<?php
require_once("../check.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>公告发布</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="/editor/themes/default/default.css" />
<script src="../js/jquery-1.11.1.min.js"></script>
<script charset="utf-8" src="../../editor/kindeditor.js"></script>
<script charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
<script>
        KindEditor.ready(function(K) {
                window.editor = K.create('#editor_id',{
                    pasteType:1,
                    resizeType:0,
                    width:'740px',
                    height:'450px'
                });
        });
</script>
<body>
<style>
body{
    margin:0;
    padding:0;
    text-align:left;
}
#table{
    margin-top:5px;
    width:auto;
    max-width:1000px;
    min-height:30px;
    height:auto;
    display: table;
    line-height:30px;
    text-align:left;
    color: #5F5F5F;
}
#table label{
    clear:none;
    height:30px;
    line-height:30px;
    float:left;
    width:150px;
    text-align:right;
    color: #5F5F5F;
    font-size:16px;
    margin-right:5px;
}

#table input.text{
    border:1px solid #D8D8D8;
    border-radius:3px;
    line-height:30px;
    height:30px;
    float:left;
    font-size:14px; 
    color: #5F5F5F;
    width:740px;  
}
#table input.xtext{
    border:1px solid #D8D8D8;
    border-radius:3px;
    line-height:30px;
    height:30px;
    float:left;
    font-size:14px; 
    color: #5F5F5F;
    width:100px;
}


#table input.form{
    margin-top:10px;
    margin-left:155px;
    height:35px;
    line-height:35px;
    width:150px;
    float:left;
    color: #FFFFFF;
    font-size:16px; 
    background-color:#08246B;
    border:1px solid #08246B;
    border-radius:5px;
    box-shadow:0px 0px 5px 5px #C2C2C2;   
}
#table select{

    color: #5F5F5F;
    font-size:14px;
    border:1px solid #D8D8D8;
    width: 100px;
}

#loading{
    z-index: 800;
    display:none;
    margin:0;
    padding:0;
    position: fixed;
    width:190px;
    height:14px;
    top:220px;
    left:410px;
}
</style>
<script>
$(function(){

    $(document).ajaxStart(function(){
    $("#loading").show();
    });
    
    $(document).ajaxStop(function(){
    setTimeout(function(){
    $("#loading").hide();
    },1000);
    
    });
    

    

    
   $("#form").click(function(){
    var title = $("#title").val();
    editor.sync();
    var content = $('#editor_id').val();

    if((title==false) || (editor==false) || (content==false)){
        alert('请输入必填项!\n\n必填项包含:内容标题、主要内容!');
        return false;
    }
    $.post("../core/notice.php",{
        title:title,
        content:content,
    },function(fabuok,fabuzt){
        if(fabuok=="ok"){
              setTimeout(function(){
              alert('保存成功!');
              location.href='notice.php';
              return false;
                },1300);
            
        }else{
            alert('保存出错!');
            return false;
        }
    });
    
   });

});
</script>
<link rel="stylesheet" href="../../edirot/themes/default/default.css" />
<div id="table">
<label>内容标题:</label><input type="text" id="title" class="text" />
</div>

<div id="table">
<div style="float: left;"><label>主要内容:</label></div>
<div style="float: left;"><textarea id="editor_id" name="content"></textarea></div>
</div>


<div id="table">
<input class="form" id="form" type="button" value="保存" />
</div>
<div id="loading"><img src="../images/png/dunling_loading.gif" /></div>
</body>