index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <div class="main-content-inner">
  2. <div class="breadcrumbs" id="breadcrumbs">
  3. <ul class="breadcrumb">
  4. <li>
  5. <i class="ace-icon fa fa-home home-icon"></i>
  6. <a>首页</a>
  7. </li>
  8. <!-- <li>
  9. <a>模块</a>
  10. </li> -->
  11. <li class="active">教学进度</li>
  12. </ul>
  13. </div>
  14. <div class="page-content">
  15. <div class="row">
  16. <div class="col-xs-12">
  17. <!-- PAGE CONTENT BEGINS -->
  18. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  19. <div class="row">
  20. <form method="get" action="<?php echo $this->createUrl('syllabus/index');?>">
  21. <div class="col-xs-10">
  22. <div class="dataTables_length margin-zy">
  23. <select class="form-control" name="years_id" onchange="changeYears(this.value);">
  24. <option value="">请选择年级</option>
  25. <?php if(!empty($yearsInfo)):foreach($yearsInfo as $loop):?>
  26. <option <?php if(!empty($years_id) && $years_id == $loop->years_id){echo 'selected';}?> value="<?php echo $loop->years_id;?>"><?php echo $loop->years_name;?></option>
  27. <?php endforeach;endif;?>
  28. </select>
  29. <select class="form-control" id="class_id" name="class_id" <?php if(empty($class_id)){echo 'style="display:none;"';}?>>
  30. <?php if(!empty($classInfo)):foreach($classInfo as $lp):?>
  31. <option <?php if(!empty($class_id) && $class_id == $lp->class_id){echo 'selected';}?> value="<?php echo $lp->class_id;?>"><?php echo $lp->class_name;?></option>
  32. <?php endforeach;endif;?>
  33. </select>
  34. <button class="btn btn-minier btn-primary">搜索</button>
  35. </div>
  36. </div>
  37. </form>
  38. <div class="col-xs-2">
  39. <div id="dynamic-table_filter" class="dataTables_filter">
  40. <a class="btn btn-primary btn-sm" href="<?php echo $this->createUrl('syllabus/add');?>">
  41. <i class="fa fa-plus" style="font-style: normal;"></i> 添加教学进度
  42. </a>
  43. </div>
  44. </div>
  45. </div>
  46. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  47. <thead>
  48. <tr>
  49. <th>ID</th>
  50. <th>年级</th>
  51. <th>班级</th>
  52. <th>教材</th>
  53. <th>章</th>
  54. <th>节</th>
  55. <th>创建时间</th>
  56. <th>操作</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <?php if(!empty($syllaList)):foreach($syllaList as $cl):?>
  61. <tr>
  62. <td><?php echo $cl['syllabus_id'];?></td>
  63. <td><?php echo $cl['years_name'];?></td>
  64. <td><?php echo $cl['class_name'];?></td>
  65. <td><?php echo $cl['teach_name'];?></td>
  66. <td><?php echo $cl['unit_name'];?></td>
  67. <td><?php echo $cl['sec_name'];?></td>
  68. <td><?php echo $cl['create_time'];?></td>
  69. <td>
  70. <div class="hidden-sm hidden-xs action-buttons">
  71. <a class="green" title="编辑" href="<?php echo $this->createUrl('syllabus/edit',array('sid'=>$cl['syllabus_id']));?>">
  72. <i class="ace-icon fa fa-pencil bigger-130"></i>
  73. </a>
  74. </div>
  75. </td>
  76. </tr>
  77. <?php endforeach;endif;?>
  78. </tbody>
  79. </table>
  80. <div class="row">
  81. <div class="col-xs-6">
  82. &nbsp;
  83. </div>
  84. <div class="col-xs-6">
  85. <div class="dataTables_paginate paging_simple_numbers">
  86. <?php
  87. $this->widget('CLinkPager', array(
  88. 'header' => '',
  89. 'firstPageLabel'=> '首页',
  90. 'lastPageLabel' => '末页',
  91. 'prevPageLabel' => '上一页',
  92. 'nextPageLabel' => '下一页',
  93. 'pages' => $pages,
  94. 'maxButtonCount'=> 5,
  95. ));
  96. echo '共:'.$page_total.'条';
  97. ?>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <!-- PAGE CONTENT ENDS -->
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <script type="text/javascript">
  108. // ajax获取班级
  109. function changeYears(num) {
  110. if (!num) return;
  111. $.post("<?php echo $this->createUrl('classes/ajaxclass');?>",{yid:num},function(data){
  112. var p = eval("("+data+")");
  113. if (p.flag) {
  114. var html;
  115. var cityObj = $("#class_id");
  116. cityObj.show();
  117. cityObj.empty();
  118. if (p.classList.length > 0){
  119. html = "<option value=''>请选择班级</option>";
  120. $.each(p.classList,function(i,n){
  121. html += "<option <?php if(!empty($class_id) && $class_id == "+n.class_id+"){echo 'selected';}?> value='"+n.class_id+"'>" + n.class_name + "</option>";
  122. });
  123. } else {
  124. html = "<option value=''>暂无班级</option>";
  125. }
  126. cityObj.append(html);
  127. } else {
  128. alert("获取数据失败!");
  129. }
  130. });
  131. }
  132. </script>