<?php include $this->admin_tpl('meta', 'admin');?>
<title>发送消息 - YzmCMS内容管理系统</title>
</head>
<body>
<article class="page-container">
<div class="formdoby_normal"> 
	<form method="post" onsubmit="return dosub(this)">
		<ul>
			 <li><label><span class="c-red">*</span>收件人：</label>
			 	<input type="text" class="input" name="send_to" value="">
			 </li>
			 <li><label><span class="c-red">*</span>主题：</label>
			 	<input type="text" class="input" name="subject" value="">
			 </li>
			 <li><label><span class="c-red">*</span>内容：</label>
			 	<textarea class="textarea" name="content" style="width:72%"></textarea>
			 </li>
		</ul>
		<div class="footer_btn">
			<input type="hidden" name="dosubmit" value="1">
			<input class="btn btn-primary radius" type="submit" value="提 交">
			<input class="btn btn-default radius" type="button" value="取 消" onclick="yzmcms_close()">	
		</div>
	</form>
</div>
</article>
<?php include $this->admin_tpl('footer', 'admin');?>

<script type="text/javascript">
	function dosub(obj){
		 if(obj.send_to.value==''){
			 layer.msg('收件人不能为空！', {icon:2});
			 return false;
		 }
		 if(obj.subject.value==''){
			 layer.msg('主题不能为空！', {icon:2});
			 return false;
		 }
		 if(obj.content.value==''){
			 layer.msg('内容不能为空！', {icon:2});
			 return false;
		 }
        $.ajax({
            type: 'POST',
            url: '<?php echo U('add');?>', 
            data: $(obj).serialize(),
		    dataType: "json", 
            success: function (msg) {
				if(msg.status == 1){
					layer.msg(msg.message, {icon:1, time:800}, function(){
						parent.location.reload();
					});
			    }else{
					layer.msg(msg.message, {icon:2});
				}
            }
        })		 
		return false;			 
	}
</script> 

</body>
</html>