123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <link rel="stylesheet" type="text/css" href="/css/jquery.datetimepicker.css">
- <div class="main-content-inner">
- <div class="breadcrumbs" id="breadcrumbs">
- <ul class="clearfix main-content-inner-ul">
- <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学期管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php }?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学生管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php if(Yii::app()->session['coachInfo']['leader']==1){ ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("school/add");?>"' class="button button_normal button_group button_arrow" data-button="red">学校管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php } ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- </ul>
- </div>
- <div class="page-content" style="margin-top:15px;">
- <div class="row">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <form class="form-horizontal" action="<?php echo $this->createUrl('semester/edit',array('smtid'=>$info->semester_id));?>" method="post" id="semesAdd">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期名称<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type="text" id="semester_name" name="semester_name" value="<?php echo $info->semester_name;?>" class="col-xs-10 col-sm-3" />
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学年<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type="text" id="school_year" name="school_year" class="col-xs-10 col-sm-3" value="<?php echo $info->school_year;?>" />
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">开始日期<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-2">
- <div class="input-group input-group-sm">
- <input type="text" id="start_time" class="form-control hasDatepicker" name="start_time" value="<?php echo date('Y-m-d',$info->start_time)?>">
- <span class="input-group-addon">
- <i class="ace-icon fa fa-calendar"></i>
- </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">结束日期<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-2">
- <div class="input-group input-group-sm">
- <input type="text" id="end_time" class="form-control hasDatepicker" name="end_time" value="<?php echo date('Y-m-d',$info->end_time)?>">
- <span class="input-group-addon">
- <i class="ace-icon fa fa-calendar"></i>
- </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">当前学期:<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <label class="inline blue">
- <input type="radio" class="ace" name="status" value="0" <?php if($info->status==0){echo 'checked';}?> >
- <span class="lbl middle"> 否</span>
- </label>
-
- <label class="inline blue">
- <input type="radio" class="ace" name="status" value="1" <?php if($info->status==1){echo 'checked';}?>>
- <span class="lbl middle"> 是</span>
- </label>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-3 col-md-9">
- <button class="btn btn-info" type="submit" id="schoolSubmit">
- <i class="ace-icon fa fa-check bigger-110"></i>
- 提交
- </button>
- <!--
- <button class="btn" type="reset">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 重填
- </button> -->
- </div>
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script src="/js/jquery.validate.min.js"></script>
- <script src="/js/jquery.datetimepicker.js"></script>
- <script type="text/javascript">
- jQuery(function($) {
- $('#start_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
- $('#end_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
- //检测开始日期是否大于结束日期
- $.validator.addMethod("checkTime", function(value, element) {
- var startDate = $('#start_time').val();
- return new Date(Date.parse(startDate.replace(/-/g,"/"))) <= new Date(Date.parse(value.replace(/-/g,"/")));
- }, "结束日期必须大于开始日期");
- $('#semesAdd').validate({
- //debug:true,// 表单不会提交
- //errorElement: 'font', // 错误信息div
- errorClass: 'errorMessage', //错误样式
- rules: {
- semester_name: {
- required: true,
- maxlength:20,
- },
- school_year: {
- required: true,
- maxlength:8,
- digits:true
- },
- //period: {
- //required: true,
- //},
- start_time: {
- required: true,
- },
- end_time: {
- required: true,
- checkTime:true
- }
- },
- messages: {
- semester_name: {
- required: "请填写学期名称!",
- maxlength: "学期名称字符不能超过20个字符!",
- },
- school_year: {
- required: "请填写学年!",
- maxlength: "学年不能超过8个字符!",
- digits:"学年必须是数字!"
- },
- //period: {
- // required: "请填写届!",
- //},
- start_time: {
- required: "请填写开始时间!",
- },
- end_time: {
- required: "请填写结束时间!",
- }
- },
- errorPlacement: function (error, element) { // 指定错误信息显示位置
- if(element.is('input[name=start_time]') || element.is('input[name=end_time]')) {
- error.insertAfter(element.parent());
- }else{
- error.insertAfter(element.after());
- }
- },
- })
- });
- </script>
|