123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <div class="main-content-inner">
- <div class="breadcrumbs" id="breadcrumbs">
- <ul class="breadcrumb">
- <li>
- <i class="ace-icon fa fa-home home-icon"></i>
- <a>首页</a>
- </li>
- <li>
- <a>教学管理</a>
- </li>
- <li class="active">添加教学进度</li>
- </ul>
- </div>
- <div class="page-content">
- <div class="row">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <form class="form-horizontal" action="<?php echo $this->createUrl('syllabus/add');?>" method="post" id="userInfoSubmit">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">选择年级:</label>
- <div class="col-xs-12 col-sm-9">
- <div class="clearfix">
- <select class="input-medium" onchange="changeYears(this.value);" name="years_id" id="years_id">
- <option value="">请选择年级</option>
- <?php if(!empty($yearsInfo)):foreach($yearsInfo as $loop):?>
- <option value="<?php echo $loop->years_id;?>"><?php echo $loop->years_name;?></option>
- <?php endforeach;endif;?>
- </select>
- </div>
- </div>
- <div class="col-xs-12 col-sm-9" id="classDiv" style="display:none;">
- <div class="clearfix">
- <select class="input-medium" id="class_id" name="class_id">
- </select>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">选择教材:</label>
- <div class="col-xs-12 col-sm-9">
- <div class="clearfix">
- <select class="input-medium" onchange="getMaterial(this.value);" name="tm_id" id="tm_id">
- <option value="">请选择教材</option>
- <?php if(!empty($material)):foreach($material as $mt):?>
- <option value="<?php echo $mt->tm_id;?>"><?php echo $mt->teach_name;?></option>
- <?php endforeach;endif;?>
- </select>
- </div>
- </div>
- <div class="col-xs-12 col-sm-9" id="subjectDiv" style="display:none;">
- <div class="clearfix">
- <select onchange="getUnit(this.value);" class="input-medium" id="subject_id" name="subject_id">
- </select>
- </div>
- </div>
- <div class="col-xs-12 col-sm-9" id="unitDiv" style="display:none;">
- <div class="clearfix">
- <select onchange="getSection(this.value);" class="input-medium" id="unit_id" name="unit_id">
- </select>
- </div>
- </div>
- <div class="col-xs-12 col-sm-9" id="secDiv" style="display:none;">
- <div class="clearfix">
- <select class="input-medium" id="sec_id" name="sec_id">
- </select>
- </div>
- </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 type="text/javascript">
- jQuery(function($) {
- $('#userInfoSubmit').validate({
- //debug:true,// 表单不会提交
- //errorElement: 'font', // 错误信息div
- errorClass: 'errorMessage', //错误样式
- ignore: "", //忽略提交字段
- rules: {
- years_id: {
- required: true,
- },
- class_id: {
- required: true,
- },
- tm_id: {
- required: true,
- },
-
- subject_id: {
- required: true,
- },
- unit_id: {
- required: true,
- },
- sec_id: {
- required: true,
- }
- },
- messages: {
- years_id: {
- required: "请选择年级!",
- },
- class_id: {
- required: "请选择班级!",
- },
- tm_id: {
- required: "请选择教材!",
- },
-
- subject_id: {
- required: "请选择科目!",
- },
- unit_id: {
- required: "请选择章!",
- },
- sec_id: {
- required: "请选择节!",
- }
- }
- })
- });
- // ajax获取班级
- function changeYears(num) {
- if (!num) return;
- $.post("<?php echo $this->createUrl('classes/ajaxclass');?>",{yid:num},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- $("#classDiv").show();
- var html;
- var cityObj = $("#class_id");
- cityObj.empty();
- if (p.classList.length > 0){
- html = "<option value=''>请选择班级</option>";
- $.each(p.classList,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- } else {
- html = "<option value=''>暂无班级</option>";
- }
- cityObj.append(html);
- } else {
- alert("获取数据失败!");
- }
- });
- }
-
- // 获取教材信息
- function getMaterial(id) {
- if (!id){ alert('页面错误!');return;}
- $.post("<?php echo $this->createUrl('syllabus/material');?>",{tmid:id},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- $("#subjectDiv").show();
- var html;
- var subObj = $("#subject_id");
- subObj.empty();
- if (p.subList.length > 0){
- html = "<option value=''>请选择科目</option>";
- $.each(p.subList,function(i,n){
- html += "<option value='"+n.tms_id+"'>" + n.subject_name + "</option>";
- });
- } else {
- html = "<option value=''>暂无科目</option>";
- }
- subObj.append(html);
- } else {
- alert("获取数据失败!");
- }
- });
- }
-
- // 获取章
- function getUnit(num) {
- if (!num) return;
- $.post("<?php echo $this->createUrl('syllabus/unit');?>",{unid:num},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- $("#unitDiv").show();
- var hm;
- var unitObj = $("#unit_id");
- unitObj.empty();
- if (p.unitArr.length > 0){
- hm = "<option value=''>请选择章</option>";
- $.each(p.unitArr,function(i,n){
- hm += "<option value='"+n.unit_id+"'>" + n.unit_name + "</option>";
- });
- } else {
- hm = "<option value=''>暂无章可选</option>";
- }
- unitObj.append(hm);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- // 获取节
- function getSection(num) {
- if (!num) return;
- $.post("<?php echo $this->createUrl('syllabus/section');?>",{seid:num},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- $("#secDiv").show();
- var hm;
- var secObj = $("#sec_id");
- secObj.empty();
- if (p.secList.length > 0){
- hm = "<option value=''>请选择节</option>";
- $.each(p.secList,function(i,n){
- hm += "<option value='"+n.unit_id+"'>" + n.unit_name + "</option>";
- });
- } else {
- hm = "<option value=''>暂无节可选</option>";
- }
- secObj.append(hm);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- </script>
|