
<html>
<head>
<title>私塾家</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link href="/static/sys/css/main.css" rel="stylesheet"/>
<link href="/static/sys/css/select.css" rel="stylesheet"/>
<style>
	.tablelink{margin-right:10px;}
	td img{  
                cursor: pointer;  
                transition: all 0.6s;  
    }  
   td img:hover{  
                transform: scale(2.5);  
    } 
</style>

 
<script src="/static/js/jquery-2.2.4.min.js"></script>
<script src="/static/js/layer/layer.js"></script>

<script src="/static/js/city/city.json.js"></script>
<script src="/static/js/city/citySetMe_V.js"></script>
<script src="/static/js/city/Popt.js"></script>

</head>
 <style type="text/css">
   body{min-width:180px;}
       .select1{
   		    width:100%;
		    height: 32px;
		    line-height: 32px;
		    border-top: solid 1px #a7b5bc;
		    border-left: solid 1px #a7b5bc;
		    border-right: solid 1px #ced9df;
		    border-bottom: solid 1px #ced9df;
		    opacity:1;
	        margin-bottom: 10px;
    	}
    	.btn{
    	  width: 100px;
    	}
     label.control-label-error {color: Red;}	
     
._citys {     background-color: whitesmoke;width: 450px; display: inline-block; border: 2px solid #eee; padding: 5px; position: relative; }
._citys span { color: #05920a; height: 15px; width: 15px; line-height: 15px; text-align: center; border-radius: 3px; position: absolute; right: 10px; top: 10px; border: 1px solid #05920a; cursor: pointer; }
._citys0 { width: 95%; height: 34px; line-height: 34px; display: inline-block; border-bottom: 2px solid #05920a; padding: 0px 5px; font-size:14px; font-weight:bold; margin-left:6px; }
._citys0 li { display: inline-block; line-height: 34px; font-size: 15px; color: #888; width: 80px; text-align: center; cursor: pointer; }
._citys1 { width: 100%; display: inline-block; padding: 10px 0; }
._citys1 a { width: 83px; height: 35px; display: inline-block; background-color: #f5f5f5; color: #666; margin-left: 6px; margin-top: 3px; line-height: 35px; text-align: center; cursor: pointer; font-size: 12px; border-radius: 5px; overflow: hidden; }
._citys1 a:hover { color: #fff; background-color: #05920a; }
.AreaS { background-color: #05920a !important; color: #fff !important; }
     
     
     
    </style>
<body>
<div class="formbody">
		<ul class="forminfo">
			<li style="margin-bottom: 20px">
				<label>老师姓名：<b>*</b></label>
				<input type="text" id="teacher_name" class="dfinput fl" name="teacher_name" style="float: left;" value=""/>
			</li>
			<li style="margin-bottom: 20px">
				<label>老师电话：<b>*</b></label>
				<input type="text" id="teacher_phone" class="dfinput fl" name="teacher_phone"  style="float: left;" value=""/>
			</li>
			<li>
				<label>老师科目：<b>*</b></label>
				<div class="vocation" style="margin-right: 5px; width: 345px">
					<select name="subject" id="subject" class="select1" > 
						<option  value="" >请选择</option>
						<option  value="语文" >语文</option>
						<option  value="数学" >数学</option>
						<option  value="英语" >英语</option>
					</select>
				</div>
			</li>
			
			<li>
				<label>&nbsp;</label>
				<button type="submit" onclick="save();" class="btn">提交</button>
				<button type="button" class="btn" onclick="closeWin();">取消</button>
			</li>
		</ul>
		<br/><br/><br/>
</div>
</body>
<script type="text/javascript">
function save(){
	
	if( $("#teacher_name").val()==''){
		parent.layer.msg("老师姓名不能为空",{icon:11});
		return ;
	}
	if( $("#teacher_phone").val()==''){
		parent.layer.msg("老师电话不能为空",{icon:11});
		return ;
	}
	if( $("#subject").val()==''){
		parent.layer.msg("老师科目不能为空",{icon:11});
		return ;
	}
	var params ={
        'teacherName' : $("#teacher_name").val(),
        'teacherPhone' : $("#teacher_phone").val(),
        'subject' : $("#subject").val()
    };
	
	parent.layer.confirm("您确定要保存老师信息?", {
		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
	}, function(){
		var url="[[${sysUrl}]]/sys/imuser/teacher/data/add/[[${classId}]]";
		
		$.post(url,params,function(data){
			if(data.meta.success){
				parent.layer.msg("保存成功",{icon:1});
				parent.location.reload();
				parent.layer.close(parent.layer.getFrameIndex(window.name));
			}else{
				parent.layer.msg(data.meta.message,{icon:11});
			}
		});
	});
}


function closeWin(){
	parent.location.reload();
	parent.layer.close(parent.layer.getFrameIndex(window.name));
}


</script>
</html>