index.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <script type="text/javascript">
  2. jQuery(document).ready(function(){
  3. jQuery(".delTeacher").click(function(){
  4. document.teacherId = jQuery(this).attr("teacherId");
  5. layer.msg('确定删除?', {
  6. time: 0,
  7. btn: ['确定', '取消'],
  8. yes: function(index){
  9. layer.close(index);
  10. jQuery.post(
  11. "<?php echo $this->createUrl("teacher/delteacheract");?>",
  12. {"teacherId": document.teacherId},
  13. function(data){
  14. data = eval("("+data+")");
  15. if(data.code == "0"){
  16. msg = data.msg;
  17. icon = 6;
  18. }
  19. else{
  20. msg = "因为以下原因操作失败:<br/>"+data.msg;
  21. icon = 5;
  22. }
  23. layer.alert(msg, {icon: icon}, function(){
  24. location.href = "<?php echo $this->createUrl("teacher/index");?>";
  25. });
  26. }
  27. );
  28. }
  29. });
  30. });
  31. $(".teacher-export-msg").click(function(){
  32. var subject_id = $("#subject_id").val();
  33. var realname = $("input[name='realname']").val();
  34. var class_id = $("#class_id").val();
  35. window.location.href = "<?php echo $this->createUrl("teacher/batchImport");?>"+"?subject_id="+subject_id+"&class_id="+class_id+"&realname="+realname;
  36. });
  37. });
  38. </script>
  39. <script src="/js/xsgl.js"></script>
  40. <style>
  41. ul .page a ,ul .selected a{
  42. border:1px solid #619aff !important;
  43. color: #619aff !important;
  44. }
  45. ul.yiiPager .selected a {
  46. background: #619aff !important;
  47. }
  48. .click_gray{
  49. background-color: #999;
  50. border:1px solid #999;
  51. }
  52. </style>
  53. <div class="main-content-inner">
  54. <!----<div class="breadcrumbs" id="breadcrumbs">
  55. <ul class="breadcrumb">
  56. <li>
  57. <a href="<?php echo $this->createUrl("semester/index");?>">学期管理</a>
  58. </li>
  59. <li class="li_backgrond_color">
  60. <a href="<?php echo $this->createUrl("teacher/index");?>">教师管理</a>
  61. </li>
  62. <li>
  63. <a href="<?php echo $this->createUrl("classes/index");?>">班级管理</a>
  64. </li>
  65. <li>
  66. <a href="<?php echo $this->createUrl("studentinfo/index");?>">学生管理</a>
  67. </li>
  68. </ul>
  69. </div>--->
  70. <!-- 导航栏开始-->
  71. <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
  72. <!-- 导航栏结束-->
  73. <div class="page-content">
  74. <div class="row" style="margin:0px">
  75. <div class="col-xs-12">
  76. <!-- PAGE CONTENT BEGINS -->
  77. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  78. <div class="row">
  79. <form method="get" action="<?php echo $this->createUrl('teacher/index');?>" style="padding-left: 0px">
  80. <div class="col-xs-9">
  81. <div class="dataTables_length margin-zy">
  82. <div style="float: left;margin-top: 4px; padding-left: 5px;">
  83. 学科:
  84. </div>
  85. <div class='diy_select1' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  86. <input type='hidden' id="subject_id" name="subject_id" class='diy_select_input1' value="<?php echo $subject_id?>"/>
  87. <div class='diy_select_txt1'><?php if(empty($subject_id)){echo "选择学科";}else{echo Yii::app()->params['subjectId'][$subject_id];}?></div>
  88. <div class='diy_select_btn1'></div>
  89. <ul class='diy_select_list1'>
  90. <li val="0" >选择学科</li>
  91. <?php
  92. foreach ($subjectslist as $key => $val){
  93. echo '<li val="'.$key.'">'.$val.'</li>';
  94. }
  95. ?>
  96. </ul>
  97. </div>
  98. <div style="float: left;margin-top: 4px;">
  99. 班级:
  100. </div>
  101. <div class='diy_select' style="width:131px;">
  102. <input type='hidden' class='diy_select_input' name="class_id" id="class_id" value="<?php echo $class_id?>"/>
  103. <div class='diy_select_txt' >
  104. <?php if($class_data && isset($class_data[$class_id])){echo $class_data[$class_id];}else{
  105. echo '--请选择--';
  106. }?>
  107. </div>
  108. <div class='diy_select_btn'></div>
  109. <ul class='diy_select_list'>
  110. <li val="0">--请选择--</li>
  111. <?php foreach ($class_data as $k=>$v){?>
  112. <li val="<?php echo $k?>"><?php echo $v?></li>
  113. <?php }?>
  114. </ul>
  115. </div>&nbsp;
  116. <input type="text" class="form-control input-sm" placeholder="请输入教师姓名/账号!" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
  117. <!--<button class="btn btn-minier btn-primary">搜索</button>-->
  118. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  119. </div>
  120. </div>
  121. </form>
  122. <div id="dynamic-table_filter" class="dataTables_filter" style="margin-right: 10px;">
  123. <a class="btn label-primary-green btn-sm teacher-export-msg" style="float:right;margin:6px 0px;" href="javascript:void(0)">
  124. <i class="fa fa-download" style="font-style: normal;"></i> 导出
  125. </a>
  126. </div>
  127. <div id="dynamic-table_filter" class="dataTables_filter" style="margin-right: 10px;">
  128. <a class="btn label-primary-green btn-sm" style="float:right;margin:6px 0px;" href="<?php echo $this->createUrl('teacher/add');?>">
  129. <i class="fa fa-plus" style="font-style: normal;"></i> 添加教师
  130. </a>
  131. </div>
  132. <div id="dynamic-table_filter" class="dataTables_filter" style="margin-right: 10px;">
  133. <a class="btn label-primary-green btn-sm" style="float:right;margin:6px 0px;" href="<?php echo $this->createUrl('teacher/excelinfo');?>">
  134. <i class="fa fa-plus" style="font-style: normal;"></i> 批量导入教师
  135. </a>
  136. </div>
  137. <?php if(isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag']==1)){ ?>
  138. <div id="dynamic-table_filter" class="dataTables_filter" style="margin-right: 10px;">
  139. <a class="btn label-primary-green btn-sm" style="float:right;margin:6px 0px;" href="<?php echo $this->createUrl('teacher/change');?>">
  140. <i class="fa fa-plus" style="font-style: normal;"></i> 教师账号去重
  141. </a>
  142. </div>
  143. <?php } ?>
  144. </div>
  145. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  146. <thead>
  147. <tr>
  148. <th style="width:80px;">教师姓名</th>
  149. <th>登录账号</th>
  150. <th>执教班级</th>
  151. <!--<th>邮箱</th>-->
  152. <th style="width:50px;">性别</th>
  153. <th>学科组</th>
  154. <th>岗位</th>
  155. <th>职称</th>
  156. <th>创建时间</th>
  157. <th>可用</th>
  158. <th>操作</th>
  159. </tr>
  160. </thead>
  161. <tbody>
  162. <?php if(!empty($teachArray)):foreach($teachArray as $ta):?>
  163. <tr>
  164. <td style="width:80px;"><?php echo $ta['teacher_name'];?></td>
  165. <td><?php echo $ta['businessphone'] ? $ta['businessphone'] : "暂无";?></td>
  166. <td style="width: 40%"><?php echo $ta['class_name'];?></td>
  167. <!--<td><?php echo $ta['teacher_email'];?></td>-->
  168. <td style="text-align:center;line-height:;"><?php if($ta['teacher_sex'] == 1){echo '女';}else{echo '男';}?></td>
  169. <td><?php echo isset($subjectslist[$ta['subjects']])?$subjectslist[$ta['subjects']]:'';?></td>
  170. <td><?php echo isset($postlist[$ta['posts']])?$postlist[$ta['posts']]:'';?></td>
  171. <td><?php echo $titlelist[$ta['title']];?></td>
  172. <td><?php echo date('Y-m-d H:i:s',$ta['add_time']);?></td>
  173. <td class="hidden-480">
  174. <?php if($ta['status'] == 0 && $ta['businessphone']):?>
  175. <span class="label label-sm label-success">是</span>
  176. <?php else:?>
  177. <span class="label label-sm label-warning">否</span>
  178. <?php endif;?>
  179. </td>
  180. <td style="width:100px;">
  181. <div class="hidden-sm hidden-xs action-buttons">
  182. <?php if($ta['posts']==5):?>
  183. <span class="iconfont addbx click_gray" title="编辑">&#xe77d;</span>
  184. <span class="iconfont addbx click_gray" title="删除" teacherId="<?php echo $ta['teacher_id'];?>">&#xe616;</span
  185. <?php else:?>
  186. <?php if($ta['businessphone']):?>
  187. <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('teacher/edit',array('thid'=>$ta['teacher_id']));?>'">&#xe77d;</span>
  188. <?php endif;?>
  189. <span class="iconfont addbx click-delete delTeacher" title="删除" teacherId="<?php echo $ta['teacher_id'];?>">&#xe616;</span
  190. <?php endif;?>
  191. </div>
  192. </td>
  193. </tr>
  194. <?php endforeach;else:?>
  195. <tr><td colspan="10">暂无数据!</td></tr>
  196. <?php endif;?>
  197. </tbody>
  198. </table>
  199. <?php if(!empty($page_total)):?>
  200. <div class="row">
  201. <div class="col-xs-7">
  202. &nbsp;
  203. </div>
  204. <div class="col-xs-5">
  205. <div class="dataTables_paginate paging_simple_numbers">
  206. <?php
  207. $this->widget('CLinkPager', array(
  208. 'header' => '',
  209. 'firstPageLabel'=> '首页',
  210. 'lastPageLabel' => '末页',
  211. 'prevPageLabel' => '上一页',
  212. 'nextPageLabel' => '下一页',
  213. 'pages' => $pages,
  214. 'maxButtonCount'=> 5,
  215. ));
  216. echo '共:'.$page_total.'条';
  217. ?>
  218. </div>
  219. </div>
  220. </div>
  221. <?php endif;?>
  222. </div>
  223. <!-- PAGE CONTENT ENDS -->
  224. </div>
  225. </div>
  226. </div>
  227. </div>