index.php 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308
  1. <script src="/js/xsgl.js" xmlns="http://www.w3.org/1999/html"></script>
  2. <style>
  3. .diy_select_list li{padding-left:0px;}
  4. .layer-zd{
  5. padding: 15px 40px;
  6. }
  7. #report-class-bulid{
  8. width: 75px;
  9. line-height: 25px;
  10. border-radius: 3px;
  11. float: right;
  12. color: #fff;
  13. background-color: #2977ff !important;
  14. border: none;
  15. outline: none;
  16. }
  17. .table-zd{
  18. margin-top:15px;
  19. width: 100%;
  20. line-height: 30px;
  21. text-align: center;
  22. }
  23. .page-zd{
  24. margin: 15px;
  25. text-align: center;
  26. }
  27. .layui-layer-title{
  28. font-size: 18px;
  29. color: #fff;
  30. background-color: #2977ff !important;
  31. }
  32. .nav-btns{
  33. margin: 10px 20px;
  34. }
  35. .nav-btns>a{
  36. display: inline-block;
  37. width: 120px;
  38. border: 1px solid #2977ff;
  39. text-align: center;
  40. line-height: 30px;
  41. }
  42. .active{
  43. color: #fff;
  44. background-color: #2977ff;
  45. }
  46. .class-add-list{
  47. position: absolute;
  48. background-color: #f9f9f9;
  49. min-width: 103px;
  50. box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  51. padding: 12px 16px;
  52. left: 0px;
  53. top: 33px;
  54. display: none;
  55. color: rgb(51, 51, 51);
  56. z-index:1000;
  57. }
  58. .class-add-list button{
  59. display: flex;
  60. }
  61. .selcet-class-type{
  62. margin-right: 12px;
  63. }
  64. </style>
  65. <script type="text/javascript">
  66. jQuery(document).ready(function(){
  67. jQuery(".delClass").click(function(){
  68. document.classId = jQuery(this).attr("classId");
  69. document.semesterId = "<?php echo $semesterId;?>";
  70. var testFlag='<?php echo Yii::app()->session['testFlag']?>';
  71. var confirm=false;
  72. $.ajax({
  73. url:'<?php echo $this->createUrl('classes/checkBeforeDelClass')?>',
  74. type:'POST',
  75. dataType:'json',
  76. data:{classId:document.classId},
  77. success:function(res){
  78. if(res.status==1){
  79. icon = 5;
  80. if(testFlag==1){ //技术支持权限
  81. if(res.data==3){
  82. //两者皆有,不可删除
  83. msg="因为以下原因操作失败:<br/><font color='red'>该班级已关联学生<br>该班级已创建过考试</font>";
  84. layer.alert(msg, {icon: icon}, function(){
  85. location.href = "<?php echo $this->createUrl("classes/index");?>";
  86. });
  87. }else if(res.data==1){
  88. //有学生,不可删除
  89. msg="因为以下原因操作失败:<br/><font color='red'>该班级已创建考试</font>";
  90. layer.alert(msg, {icon: icon}, function(){
  91. location.href = "<?php echo $this->createUrl("classes/index");?>";
  92. });
  93. }else{
  94. confirm=true;
  95. }
  96. }else{
  97. if(res.data==3){
  98. //两者皆有,不可删除
  99. msg="因为以下原因操作失败:<br/><font color='red'>该班级已关联学生<br>该班级已创建过考试</font>";
  100. layer.alert(msg, {icon: icon}, function(){
  101. location.href = "<?php echo $this->createUrl("classes/index");?>";
  102. });
  103. }else if(res.data==2){
  104. //有学生,不可删除
  105. msg="因为以下原因操作失败:<br/><font color='red'>该班级已关联学生</font>";
  106. layer.alert(msg, {icon: icon}, function(){
  107. location.href = "<?php echo $this->createUrl("classes/index");?>";
  108. });
  109. }else if(res.data==1){
  110. //有考试,隐藏
  111. $('input[name=hideClassId]').val(document.classId);
  112. $('.modal1_multi').show();
  113. }else{
  114. confirm=true;
  115. }
  116. }
  117. if(confirm){
  118. var msg = "确定删除?";
  119. //直接删除
  120. layer.msg(msg, {
  121. time: 0,
  122. btn: ['确定', '取消'],
  123. yes: function (index) {
  124. layer.close(index);
  125. jQuery.post(
  126. "<?php echo $this->createUrl("classes/delclassact");?>",
  127. {"classId": document.classId, "semesterId":document.semesterId},
  128. function(data){
  129. data = eval("("+data+")");
  130. if(data.code == "0"){
  131. msg = data.msg;
  132. icon = 6;
  133. }
  134. else{
  135. msg = "因为以下原因操作失败:<br/>"+data.msg;
  136. icon = 5;
  137. }
  138. layer.alert(msg, {icon: icon}, function(){
  139. location.href = "<?php echo $this->createUrl("classes/index?semesterId={$semesterId}");?>";
  140. });
  141. }
  142. );
  143. }
  144. })
  145. }
  146. }else{
  147. layer.msg('操作失败');
  148. }
  149. }
  150. });
  151. return false;
  152. });
  153. jQuery("#search").click(function(){
  154. //var semesterId = jQuery(this).val();
  155. var grade_id = jQuery(".diy_select1 input[name=grade_id]").val();
  156. var realname = jQuery("input[name=realname]").val();
  157. var smid = jQuery("input[name=semesters]").val();
  158. var arts_science=$("input[name=arts_science]").val();
  159. var class_type=$("input[name=class_type]").val();
  160. var subject_id=$("input[name=subject_id]").val();
  161. var show_type=$("input[name=show_type]").val();
  162. if(subject_id!=undefined){
  163. location.href = "<?php echo $this->createUrl("classes/index?grade_id=");?>"+grade_id+"&realname="+realname+"&semesterId="+smid+'&subject_id='+subject_id+'&class_type='+class_type+'&show_type='+show_type;
  164. }else{
  165. location.href = "<?php echo $this->createUrl("classes/index?grade_id=");?>"+grade_id+"&realname="+realname+"&semesterId="+smid+'&arts_science='+arts_science+'&class_type='+class_type+'&show_type='+show_type;
  166. }
  167. });
  168. });
  169. </script>
  170. <link rel="stylesheet" href="/fonts/zhuanzhang/iconfont.css" />
  171. <link rel="stylesheet" href="/css/toTransferPop.css" />
  172. <div class="main-content-inner">
  173. <!-- 导航栏开始-->
  174. <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
  175. <?php if(!isset($show_type) || !$show_type):?>
  176. <div class="nav-btns">
  177. <?php if(Yii::app()->params['section']==1){?>
  178. <a href="<?php echo $this->createUrl('classes/index')?>?class_type=1" class="<?php if($class_type==1) echo 'active' ?>" >行政班</a><a class="<?php if($class_type==2) echo 'active' ?>" href="<?php echo $this->createUrl('classes/index')?>?class_type=2">教学班</a>
  179. <?php }else{?>
  180. <a href="<?php echo $this->createUrl('classes/index')?>?class_type=1" class="<?php if($class_type==1) echo 'active' ?>" >行政班</a>
  181. <?php }?>
  182. </div>
  183. <?php endif;?>
  184. <!-- 导航栏结束-->
  185. <div class="page-content">
  186. <div class="row" style="margin:0px;">
  187. <div class="col-xs-12">
  188. <!-- PAGE CONTENT BEGINS -->
  189. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  190. <div class="row">
  191. <div class="dataTables_length margin-zy">
  192. <div class="col-xs-9" style="margin-bottom: 10px;width: 70%">
  193. <?php if($class_type==2):?>
  194. <div style="float: left;margin-top: 4px; padding-left: 5px;">
  195. 学科:
  196. </div>
  197. <div class='diy_select3' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  198. <input type='hidden' id="arts_science" name="subject_id" class='diy_select_input3' value="<?php if(empty($subject_id)){echo 0;}else{echo $subject_id;}?>"/>
  199. <div class='diy_select_txt3'><?php if(empty($subject_id)){echo '请选择学科';}else{ echo Yii::app()->params['subjectId'][$subject_id]; }?></div>
  200. <div class='diy_select_btn3'></div>
  201. <ul class='diy_select_list3'>
  202. <?php
  203. if($subjects){
  204. foreach ($subjects as $key => $val){
  205. echo '<li val="'.$key.'">'.$val.'</li>';
  206. }
  207. }
  208. ?>
  209. </ul>
  210. </div>
  211. <?php endif;?>
  212. <div style="float: left;margin-top: 4px;">
  213. 按学期筛选:
  214. </div>
  215. <div class='diy_select' style="width:215px;">
  216. <input type='hidden' class='diy_select_input' name="semesters" id="semesters" value="<?php echo $semesterId;?>"/>
  217. <div class='diy_select_txt' style="width:182px;">
  218. <?php
  219. echo empty($thisSemester['semester_name']) ? '--请选择--':$thisSemester['semester_name'];
  220. if($this->schoolManager->isCurrentSemester($semesterId)){echo "(当前学期)";}
  221. else if($this->schoolManager->isFutureSemester($semesterId)){echo "(未开始学期)";}
  222. else{echo "(已完成学期)";}
  223. ?>
  224. </div>
  225. <div class='diy_select_btn'></div>
  226. <ul class='diy_select_list'>
  227. <?php foreach($semesters as $semester){?>
  228. <li val="<?php echo $semester->semester_id;?>">
  229. <?php echo $semester->semester_name;
  230. if($this->schoolManager->isCurrentSemester($semester->semester_id)){echo "(当前学期)";}
  231. else if($this->schoolManager->isFutureSemester($semester->semester_id)){echo "(未开始学期)";}
  232. else{echo "(已完成学期)";}
  233. ?>
  234. </li>
  235. <?php }?>
  236. </ul>
  237. </div>&nbsp;
  238. <div style="float: left;margin-top: 4px; padding-left: 5px;">
  239. 年级:
  240. </div>
  241. <div class='diy_select1' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  242. <input type='hidden' id="grade_id" name="grade_id" class='diy_select_input1' value="<?php if(empty($grade_id)){echo 0;}else{echo $grade_id;}?>"/>
  243. <div class='diy_select_txt1'>
  244. <?php if(empty($grade_id)){echo '请选择年级';}else{echo Yii::app()->params['grade_list'][$grade_id]['grade_name'];}?></div>
  245. <div class='diy_select_btn1'></div>
  246. <ul class='diy_select_list1'>
  247. <li val="0" >请选择年级</li>
  248. <?php
  249. if(Yii::app()->params['grade_config']){
  250. foreach (Yii::app()->params['grade_config'] as $val){
  251. echo '<li val="'.$val['id'].'" >'.$val['grade_name'].'</li>';
  252. }
  253. }
  254. ?>
  255. </ul>
  256. </div>
  257. <?php if($class_type==1 && Yii::app()->params['section']==1):?>
  258. <div style="float: left;margin-top: 4px; padding-left: 5px;">
  259. 文理科:
  260. </div>
  261. <div class='diy_select2' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  262. <input type='hidden' id="arts_science" name="arts_science" class='diy_select_input2' value="<?php if(empty($arts_science)){echo 0;}else{echo $arts_science;}?>"/>
  263. <div class='diy_select_txt2'><?php if(empty($arts_science)){echo '不限';}else{ switch($arts_science){
  264. case 1:echo '文科';break;
  265. case 2:echo '理科';break;
  266. }}?></div>
  267. <div class='diy_select_btn2'></div>
  268. <ul class='diy_select_list2'>
  269. <li val="0" >不限</li>
  270. <li val="1">文科</li>
  271. <li val="2">理科</li>
  272. </ul>
  273. </div>
  274. <?php else:?>
  275. <input type='hidden' id="arts_science" name="arts_science" value="0"/>
  276. <?php endif;?>
  277. <input type="text" class="form-control input-sm" placeholder="请输入班级名称!" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
  278. <input type="hidden" name="class_type" value="<?php echo $class_type?>">
  279. <input type="hidden" name="show_type" value="<?php echo $show_type?>">
  280. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  281. </div>
  282. <div class="col-xs-3" style="width:30%;">
  283. <div id="dynamic-table_filter" class="dataTables_filter position_g">
  284. <?php
  285. if($this->schoolManager->isCurrentSemester($thisSemester["semester_id"]) && !$show_type ) {
  286. if ($class_type == 1) {
  287. ?>
  288. <?php if(Yii::app()->params['section']==1){?>
  289. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl("classes/settingProgress")?>" id="">
  290. <i class="fa teach-progress" style="font-style: normal;"></i> 教学进度
  291. </a>
  292. <?php }?>
  293. <a class="btn btn-success btn-sm" id="zhuanban" href="javascript:void(0)" style="<?php if(empty($_semester['semesters'])){ echo "display:none";}?>">
  294. <i class="iconfont_zhuan icon-zhuanhuan" style="font-style: normal; "></i> 班级转移
  295. </a>
  296. <a class="btn btn-success btn-sm add-class-list" href="javascript:void(0)">
  297. <div class="class-add-list">
  298. <button onclick="location='<?php echo $semesterId ? $this->createUrl("classes/add?semesterId={$semesterId}") : $this->createUrl("classes/add");?>'">单个添加</button>
  299. <button onclick="location='<?php echo $this->createUrl("classes/batchAdd");?>'">批量添加</button>
  300. </div>
  301. <i class="fa fa-plus " style="font-style: normal;"></i> 添加班级
  302. </a>
  303. <a class="btn btn-success btn-sm" href="#" id="change-class-sort">
  304. <i class="fa fa-sort-numeric-asc" style="font-style: normal;"></i> 班级排序
  305. </a>
  306. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('classes/index',array('show_type'=>1))?>" id="">
  307. <i class="fa teach-progress" style="font-style: normal;"></i> 已隐藏班级
  308. </a>
  309. <a class="btn btn-success btn-sm" href="javascript:void(0)" id="export-class">
  310. <i class="fa teach-progress fa-download" style="font-style: normal;"></i> 导出
  311. </a>
  312. <?php
  313. } else {
  314. ?>
  315. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('classes/classShift')?>" id="">
  316. <i class="fa teach-progress" style="font-style: normal;"></i> 走班学科设置
  317. </a>
  318. <a class="btn btn-success btn-sm add-class-list" href="javascript:void(0)">
  319. <div class="class-add-list">
  320. <button onclick="location='<?php echo $this->createUrl("classes/addClass");?>'">单个添加</button>
  321. <button onclick="location='<?php echo $this->createUrl("classes/batchAddClass");?>'">批量添加</button>
  322. </div>
  323. <i class="fa fa-plus " style="font-style: normal;"></i> 添加教学班
  324. </a>
  325. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('importstudent/importStudentClassified')?>">
  326. <i class="fa fa-plus " style="font-style: normal;"></i> 导入教学班学生
  327. </a>
  328. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('classes/index',array('show_type'=>1,'class_type'=>2))?>" id="">
  329. <i class="fa teach-progress" style="font-style: normal;"></i> 已隐藏班级
  330. </a>
  331. <a class="btn btn-success btn-sm" href="javascript:void(0)" id="export-class-type2">
  332. <i class="fa teach-progress fa-download" style="font-style: normal;"></i> 导出
  333. </a>
  334. <?php
  335. }
  336. }
  337. ?>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  343. <thead>
  344. <tr>
  345. <th>班级</th>
  346. <th>年级</th>
  347. <th>层级</th>
  348. <?php
  349. if($class_type==1):
  350. if(Yii::app()->params['section']==1):
  351. ?>
  352. <th>文理科</th>
  353. <?php endif;?>
  354. <th>班主任</th>
  355. <?php endif;?>
  356. <th>执教老师</th>
  357. <th>操作</th>
  358. </tr>
  359. </thead>
  360. <tbody>
  361. <?php if(!empty($yearsList)){foreach($yearsList as $cl){?>
  362. <tr>
  363. <td><?php if(isset($cl['class_name'])){echo $cl['class_name'];}?></td>
  364. <td><?php echo Yii::app()->params['grade_list'][$cl['grade']]['grade_name'];?></td>
  365. <td><?php echo $cl["level"] ? Char::numToLetter($cl['level'], 1) : "未分层";?></td>
  366. <?php if($class_type==1): ?>
  367. <?php if(Yii::app()->params['section']==1): ?>
  368. <td><?php echo $cl['arts_science']==0?'不分科':($cl['arts_science']==1?'文科':'理科')?></td>
  369. <?php endif;?>
  370. <td>
  371. <?php
  372. if(isset($cl['bzr'])){
  373. echo $cl['bzr']['teacher_name'];
  374. }
  375. ?>
  376. </td>
  377. <?php endif;?>
  378. <td><?php echo $cl['teachers'];?></td>
  379. <td>
  380. <?php if(isset($thisSemester["semester_id"]) && $model->isCurrentSemester($thisSemester["semester_id"])){?>
  381. <div class="hidden-sm hidden-xs action-buttons">
  382. <?php if($show_type){?>
  383. <span class="iconfont click-sc click-tc addbx recover" classId="<?php echo $cl['class_id'];?>" title="恢复班级">&#xe68f;</span>
  384. <?php }else{?>
  385. <?php if ($class_type == 1) {?>
  386. <!---<span style="cursor:pointer" title="编辑" class="label-sm label-primary-s label-primary-green arrowed-right" onclick="javascript:location.href='<?php echo $this->createUrl('classes/edit',array('cid'=>$cl['class_id']));?>'">
  387. 编辑
  388. </span>
  389. -->
  390. <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('classes/edit',array('cid'=>$cl['class_id']));?>'">&#xe77d;</span>
  391. <!--<a class="green" title="添加学生" href="<?php echo $this->createUrl('studentinfo/add',array('cid'=>$cl['class_id']));?>">添加学生</i></a>-->
  392. <span title="添加学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('studentinfo/add',array('cid'=>$cl['class_id']));?>'">&#xf0008;</span>
  393. <!--<a class="green" href="<?php echo $this->createUrl('classes/import',array('cid'=>$cl['class_id']));?>" title="导入学生">
  394. 导入学生</i>
  395. </a>-->
  396. <?php /*if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){*/?><!--
  397. <span title="导入学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php /*echo $this->createUrl('classes/import',array('cid'=>$cl['class_id']));*/?>'">&#xe609;</span>
  398. <?php /*}else{*/?>
  399. <span title="分班导入学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php /*echo $this->createUrl('classes/part_student',array('cid'=>$cl['class_id']));*/?>'">&#xe609;</span>
  400. --><?php /*}*/?>
  401. <!--<a class="green" title="查看学生" href="<?php echo $this->createUrl('classes/view',array('cid'=>$cl['class_id']));?>">
  402. 查看学生</i>
  403. </a>-->
  404. <span title="查看学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('classes/view',array('cid'=>$cl['class_id']));?>'">&#xe668;</span>
  405. <!--<a class="green" title="学生转班" href="<?php echo $this->createUrl('classes/copy',array('cid'=>$cl['class_id']));?>">
  406. 转班</i>
  407. </a>-->
  408. <span title="转班" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('classes/copy',array('cid'=>$cl['class_id']));?>'">&#xe68f;</span>
  409. <!--<a class="green delClass" classId="<?php echo $cl['class_id'];?>" title="删除" href="javascript:;">
  410. 删除
  411. </a>-->
  412. <?php if(Yii::app()->params['section']==1){?>
  413. <span title="下载年级报告" class="iconfont addbx click-sc" onclick="downfile('<?php echo $cl['class_id'] ?>',<?php echo $cl['report_status'];?>)" href="javascript:void(0);" reportstatus="<?php echo $cl['report_status'];?>">年</span>
  414. <?php }?>
  415. <span class="iconfont addbx click-delete delClass" classId="<?php echo $cl['class_id'];?>" title="删除">&#xe616;</span>
  416. <?php }else{?>
  417. <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('classes/editClassified',array('cid'=>$cl['class_id']));?>'">&#xe77d;</span>
  418. <span title="添加学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('studentinfo/addClassified',array('cid'=>$cl['class_id']));?>'">&#xf0008;</span>
  419. <span title="查看学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('classes/view',array('cid'=>$cl['class_id']));?>'">&#xe668;</span>
  420. <span title="转班" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('classes/copyClassified',array('cid'=>$cl['class_id']));?>'">&#xe68f;</span>
  421. <span class="iconfont addbx click-delete delClass" classId="<?php echo $cl['class_id'];?>" title="删除">&#xe616;</span>
  422. <?php }?>
  423. <?php }?>
  424. </div>
  425. <?php }else{?>
  426. <ul>
  427. <li style="list-style-type:none;">
  428. <!----<a class="green" title="查看学生" href="<?php echo $this->createUrl('classes/view',array('cid'=>$cl['class_id']));?>">查看学生</i>---->
  429. <span title="查看学生" class="iconfont addbx click-sc" onclick="javascript:location.href='<?php echo $this->createUrl('classes/view',array('cid'=>$cl['class_id']));?>'">&#xe668;</span>
  430. </a>
  431. </li>
  432. </ul>
  433. <?php }?>
  434. </td>
  435. </tr>
  436. <?php }}else{?>
  437. <tr><td colspan="10">暂无数据!</td></tr>
  438. <?php }?>
  439. </tbody>
  440. </table>
  441. <?php if(!empty($page_total)):?>
  442. <div class="row">
  443. <div class="col-xs-7">
  444. &nbsp;
  445. </div>
  446. <div class="col-xs-5">
  447. <div class="dataTables_paginate paging_simple_numbers">
  448. <?php
  449. $this->widget('CLinkPager', array(
  450. 'header' => '',
  451. 'firstPageLabel'=> '首页',
  452. 'lastPageLabel' => '末页',
  453. 'prevPageLabel' => '上一页',
  454. 'nextPageLabel' => '下一页',
  455. 'pages' => $pages,
  456. 'maxButtonCount'=> 5,
  457. ));
  458. echo '共:'.$page_total.'条';
  459. ?>
  460. </div>
  461. </div>
  462. </div>
  463. <?php endif;?>
  464. </div>
  465. <!-- PAGE CONTENT ENDS -->
  466. </div>
  467. </div>
  468. </div>
  469. </div>
  470. <div class="ttf-pop dn" id="pop-zhuan">
  471. <div class="ttf-pop-con">
  472. <div class="ttf-close-btn">×</div>
  473. <div class="ttf-toggle-tab clearfix">
  474. <div class="fl ttf-tog-menu massive-to-reansfer active " >批量转班</div>
  475. <div class="fl ttf-tog-menu single-to-reansfer" >单个转班</div>
  476. </div>
  477. <div class="ttf-tab-con clearfix">
  478. <form method="post" action="<?php echo Yii::app()->createUrl('classes/into_multi_class');?>" style="float: left;padding: 0;margin:0;height: 100%">
  479. <div class="fl ttf-tab-left">
  480. <div class="ttl-title">从下面学期转移班级</div>
  481. <div class="similar-select"><?php if(!empty($_semester['semesters'])){ echo $_semester['semesters']->semester_name;}?><input type="hidden" name="f_semester" value="<?php if(!empty($_semester['semesters'])){ echo $_semester['semesters']->semester_id;}?>"></div>
  482. <div class="ttf-warn"><img src="/images/warn-icon.png" alt="" class=""><span>注意:</span></div>
  483. <div class="ttf-warn-con">1、只能从上一个学期中转移班级;</div>
  484. <div class="ttf-warn-con">2、如果没有需要的学期/班级,请先新建</div>
  485. </div>
  486. <div class="fl ttf-tab-right">
  487. <div class="ttf-title fl">转移班级到:</div>
  488. <ul class="ttf-radio-con clearfix">
  489. <?php
  490. if(Yii::app()->params['grade_config']){
  491. $select=true;
  492. foreach (Yii::app()->params['grade_config'] as $val){
  493. if($select){
  494. $select=false;
  495. echo '<li><span class="sel-btn select"></span>'.$val['grade_name'].'</li>';
  496. }else{
  497. echo '<li><span class="sel-btn "></span>'.$val['grade_name'].'</li>';
  498. }
  499. }
  500. }
  501. ?>
  502. </ul>
  503. <?php
  504. if(Yii::app()->params['grade_config']){
  505. $class='';
  506. foreach (Yii::app()->params['grade_config'] as $val){
  507. ?>
  508. <ul class="ttf-sel-datas <?php echo $class;?>">
  509. <li class="tsd-lis clearfix">
  510. <span class="prev-class prev-class-title">
  511. 上学期班级
  512. </span>
  513. <span class="fr current-class current-class-title ellipsis">当前学期班级</span>
  514. </li>
  515. <?php if(isset($_currClass[$val['id']])){
  516. foreach($_currClass[$val['id']] as $v)
  517. {
  518. ?>
  519. <li class="tsd-lis clearfix">
  520. <span class="prev-class">
  521. <select name="one_class[<?php echo $v['class_id']?>]" class="one_class">
  522. <option value="0">选择要转移班级</option>
  523. <?php if($_fluClass)
  524. {
  525. foreach($_fluClass as $fc){
  526. ?>
  527. <option value="<?php echo $fc['class_id']?>"><?php echo $fc['class_name']?></option>
  528. <?php
  529. }
  530. }?>
  531. </select>
  532. </span>
  533. <span class="tsd-line"></span>
  534. <input type="hidden" name="one_class_id[<?php echo $v['class_id']?>]" value="<?php echo $v['class_id']?>">
  535. <span class="fr current-class ellipsis"><?php echo $v['class_name']?></span>
  536. </li>
  537. <?php }
  538. } ?>
  539. </ul>
  540. <?php
  541. $class='hide';
  542. }
  543. }
  544. ?>
  545. </div>
  546. <div class="ttf-pop-bottom clearfix">
  547. <div class="fl ttf-warn-opt">
  548. 点击<span>确定</span>修改才会被保存哦!
  549. </div>
  550. <div class="ttf-bottom-btn fr">
  551. <input type="submit" value="确定" class="ttf-bottom-sure">
  552. <!--<input type="button" value="取消" class="ttf-bottom-cancel">-->
  553. </div>
  554. </div>
  555. </form>
  556. </div>
  557. <div class="ttf-tab-con hide clearfix">
  558. <form method="post" action="<?php echo Yii::app()->createUrl('classes/into_alone_class');?>" style="float: left;padding: 0;margin:0;height: 100%">
  559. <div class="fl ttf-tab-left">
  560. <div class="ttl-title">从下面学期转移班级</div>
  561. <div class="similar-select"><?php if(!empty($_semester['semesters'])){ echo $_semester['semesters']->semester_name;}?><input type="hidden" name="f_semester" value="<?php if(!empty($_semester['semesters'])){ echo $_semester['semesters']->semester_id;}?>"></div>
  562. <div class="ttf-warn"><img src="/images/warn-icon.png" alt="" class=""><span>注意:</span></div>
  563. <div class="ttf-warn-con">1、只能从上一个学期中转移班级;</div>
  564. <div class="ttf-warn-con">2、如果没有需要的学期/班级,请先新建</div>
  565. </div>
  566. <div class="fl ttf-tab-right alone">
  567. <div class="ttf-title fl">转移班级到:</div>
  568. <ul class="ttf-radio-con alone clearfix ">
  569. <?php
  570. if(Yii::app()->params['grade_config']){
  571. $select=true;
  572. foreach (Yii::app()->params['grade_config'] as $val){
  573. if($select){
  574. $select=false;
  575. echo '<li><span class="sel-btn alone select"></span>'.$val['grade_name'].'</li>';
  576. }else{
  577. echo '<li><span class="sel-btn alone "></span>'.$val['grade_name'].'</li>';
  578. }
  579. }
  580. }
  581. ?>
  582. </ul>
  583. <?php
  584. if(Yii::app()->params['grade_config']){
  585. $class='';
  586. foreach (Yii::app()->params['grade_config'] as $val) {
  587. ?>
  588. <ul class="ttf-sel-datas <?php echo $class;?>">
  589. <li class="tsd-lis clearfix">
  590. <span class="prev-class prev-class-title">
  591. 上学期班级
  592. </span>
  593. <span class="fr current-class current-class-title ellipsis">当前学期班级</span>
  594. </li>
  595. <li class="tsd-lis clearfix">
  596. <span class="prev-class">
  597. <select name="alone_one_f_class" id="alone_two_f_class" class="aline_one_class">
  598. <option value="0">选择要转移班级</option>
  599. <?php if($_fluClass)
  600. {
  601. foreach($_fluClass as $fc){
  602. ?>
  603. <option value="<?php echo $fc['class_id']?>"><?php echo $fc['class_name']?></option>
  604. <?php
  605. }
  606. }?>
  607. </select>
  608. </span>
  609. <span class="tsd-line"></span>
  610. <span class="fr current-class ellipsis">
  611. <select name="alone_one_c_class" id="" class="">
  612. <option value="0">请选择班级</option>
  613. <?php if(isset($_currClass[$val['id']])){
  614. foreach($_currClass[$val['id']] as $v)
  615. {
  616. ?>
  617. <option value="<?php echo $v['class_id']?>"><?php echo $v['class_name']?></option>
  618. <?php }
  619. }
  620. ?>
  621. </select>
  622. </span>
  623. </li>
  624. </ul>
  625. <?php
  626. $class='hide';
  627. }
  628. }
  629. ?>
  630. </div><div class="ttf-pop-bottom clearfix">
  631. <div class="fl ttf-warn-opt">
  632. 点击<span>确定</span>修改才会被保存哦!
  633. </div>
  634. <div class="ttf-bottom-btn fr">
  635. <input type="submit" value="确定" class="ttf-bottom-sure">
  636. <!--<input type="button" value="取消" class="ttf-bottom-cancel">-->
  637. </div>
  638. </div>
  639. </form>
  640. </div>
  641. </div>
  642. </div>
  643. <div class="ttf-pop dn" id="pop-sortClass">
  644. <div class="ttf-pop-con">
  645. <div class="ttf-close-btn">×</div>
  646. <div class="ttf-toggle-tab clearfix">
  647. <div class="fl ttf-tog-menu massive-to-reansfer active">编辑班级排序</div>
  648. </div>
  649. <div class="ttf-tab-con clearfix">
  650. <div style="float: left;padding: 0;margin:0;height: 100%">
  651. <div class="fl ttf-tab-left">
  652. <div class="ttf-warn"><img src="/images/warn-icon.png" alt="" class=""><span>注意:</span></div>
  653. <div class="ttf-warn-con">1、班级排序保存后,教师端在发送打印时,选择考试班级所展示的班级顺序也会同步修改。</div>
  654. <div class="ttf-warn-con">2、目前班级的顺序是按照创建的时间,最新创建的排在最前面。</div>
  655. </div>
  656. <div class="fl ttf-tab-right">
  657. <ul class="ttf-sel-datas">
  658. <li class="tsd-lis clearfix">
  659. <span class="prev-class prev-class-title">班级</span>
  660. <span class="fr current-class current-class-title ellipsis">排序</span>
  661. </li>
  662. </ul>
  663. <ul class="ttf-sel-datas class-list">
  664. </ul>
  665. </div>
  666. <div class="ttf-pop-bottom clearfix">
  667. <div class="fl ttf-warn-opt">
  668. 点击<span>确定</span>修改才会被保存哦!
  669. </div>
  670. <div class="ttf-bottom-btn fr">
  671. <input type="button" onclick="saveClassSort()" value="确定" class="ttf-bottom-sure">
  672. <!--<input type="button" value="取消" class="ttf-bottom-cancel">-->
  673. </div>
  674. </div>
  675. </div>
  676. </div>
  677. </div>
  678. </div>
  679. <div class="ttf-pop dn" id="pop-export-class">
  680. </div>
  681. <style>
  682. .model-score input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  683. .model-score input:focus{border-color: #2977ff;box-shadow: 0 0 5px #2977ff;}
  684. .modal-btn{text-align: center;margin:10px 0;}
  685. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #2977ff;color: #fff;}
  686. .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  687. .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #2977ff;color:#fff;}
  688. .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  689. .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  690. .model-score1 input:focus{border-color: #2977ff;box-shadow: 0 0 5px #2977ff;}
  691. .modal-btn{text-align: center;margin:10px 0;}
  692. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #2977ff;color: #fff;}
  693. .model-score2 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
  694. .model-score2 input:focus{border-color: #2977ff;box-shadow: 0 0 5px #2977ff;}
  695. .modal-btn{text-align: center;margin:10px 0;}
  696. .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #2977ff;color: #fff;}
  697. .modal-btn .close3{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #fff;color: #000;border:1px solid #555;border-radius: 3px;}
  698. .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display:none ;background: rgba(0,0,0,.4)}
  699. .model-rule{width:80%;margin:15px auto;text-align: center;font-size:18px;}
  700. .modal1_multi .model-score1{width:80%;margin:10px auto;text-align: left}
  701. .modal1_multi .model-score-m{width:80%;margin:5px auto;}
  702. .modal1_multi .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  703. .modal1_multi em{color:#fff;}
  704. </style>
  705. <!-- 重置提示框 -->
  706. <div class="modal1_multi">
  707. <div class="modal-shadow"></div>
  708. <div class="modal-content">
  709. <div class="modal-title clearfix">
  710. 提示<em class="fr close3">×</em>
  711. </div>
  712. <div class="model-rule">
  713. 该班级已有考试数据,不可删除,<br>
  714. 可隐藏班级
  715. </div>
  716. <div class="model-score-m">
  717. </div>
  718. <div class="modal-btn">
  719. <a href="javascript:;" class="sumbit3">隐藏</a>
  720. <a href="javascript:;" class="close3 chameleon">关闭</a>
  721. <input type="hidden" name="hideClassId" value="0">
  722. </div>
  723. </div>
  724. </div>
  725. <script src="/js/layer/layer.js"></script>
  726. <script type="text/javascript">
  727. $(document).ready(function(){
  728. var _one_select_class = [];
  729. var _two_select_class = [];
  730. var _three_select_class = [];
  731. $("#zhuanban").click(function(){
  732. $("#pop-zhuan").removeClass("dn");
  733. });
  734. //班级排序
  735. $("#change-class-sort").click(function(){
  736. $.ajax({
  737. type:'post',
  738. url: "<?php echo $this->createUrl('classes/getClassWithSort');?>",
  739. dataType: 'json',
  740. success: function (res) {
  741. var html = ''
  742. if (res.status){
  743. for (var i=0; i<res.data.length; i++) {
  744. var item = res.data[i];
  745. html += '<li class="tsd-lis clearfix" classId="'+item.class_id+'">';
  746. html += '<span class="rev-class prev-class-title ellipsis">'+item.class_name+'</span>';
  747. html += '<span class="fr current-class">';
  748. html += '<input type="number" style="width: 50px;height: 30px;text-align: center" name="sort" value="'+item.sort+'">';
  749. html += '</span></li>';
  750. }
  751. $('.class-list').html(html);
  752. $("#pop-sortClass").removeClass("dn");
  753. }else {
  754. layer.msg("暂无班级");
  755. }
  756. }
  757. })
  758. })
  759. $(".one_class").each(function(){
  760. var _this = $(this);
  761. _this.data("last",_this.val()).change(function(){
  762. var oldVal = _this.data("last");
  763. var newVal = _this.val();
  764. var temp = 0;
  765. for(var i=0;i<$(".one_class").length;i++){
  766. if($(".one_class").eq(i).val() == newVal){
  767. if(newVal!=0){
  768. temp++;
  769. if(temp>1){
  770. _this.val(oldVal);
  771. _this.data("last",oldVal);
  772. alert("不能重复选择班级")
  773. break;
  774. }
  775. }
  776. }else{
  777. _this.data("last",_this.val());
  778. }
  779. }
  780. })
  781. })
  782. $(".aline_one_class").each(function(){
  783. var _this = $(this);
  784. _this.data("alast",_this.val()).change(function(){
  785. var oldVal = _this.data("alast");
  786. var newVal = _this.val();
  787. var temp = 0;
  788. for(var i=0;i<$(".aline_one_class").length;i++){
  789. if($(".aline_one_class").eq(i).val() == newVal){
  790. if(newVal!=0){
  791. temp++;
  792. if(temp>1){
  793. _this.val(oldVal);
  794. _this.data("alast",oldVal);
  795. alert("不能重复选择班级")
  796. break;
  797. }
  798. }
  799. }else{
  800. _this.data("alast",_this.val());
  801. }
  802. }
  803. })
  804. })
  805. //恢复班级
  806. $('.recover').click(function(){
  807. var classId=$(this).attr('classId');
  808. layer.msg('确定要恢复隐藏的班级吗', {
  809. time: 0,
  810. btn: ['确定', '取消'],
  811. yes: function (index) {
  812. layer.closeAll();
  813. $.ajax({
  814. type:'post',
  815. url: "<?php echo $this->createUrl('classes/recoverClass');?>",
  816. dataType: 'json',
  817. data:{classId:classId},
  818. success: function (res) {
  819. if (res.status){
  820. window.location.href='<?php echo $this->createUrl('classes/index')?>';
  821. }else {
  822. layer.msg("恢复失败");
  823. }
  824. }
  825. })
  826. }
  827. })
  828. });
  829. // 点击单选
  830. $("#pop-zhuan .ttf-radio-con li").click(function(){
  831. $(this).find(".sel-btn").addClass("select");
  832. $(this).siblings().find(".sel-btn").removeClass("select");
  833. $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").hide().removeClass('hide');
  834. $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").eq($(this).index()).show();
  835. });
  836. $("#pop-zhuan .ttf-radio-con.alone li").click(function(){
  837. console.log('1111');
  838. $(this).find(".sel-btn.alone").addClass("select");
  839. $(this).siblings().find(".sel-btn.alone").removeClass("select");
  840. $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").hide().removeClass('hide');
  841. $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").eq($(this).index()).show();
  842. });
  843. // 内容切换
  844. $("#pop-zhuan .ttf-tog-menu").click(function(){
  845. // console.log($(this).index());
  846. $(this).addClass("active").siblings().removeClass("active");
  847. $(".ttf-tab-con").hide();
  848. $(".ttf-tab-con").eq($(this).index()).show().removeClass("hide");
  849. });
  850. // 点击关闭
  851. $(".ttf-close-btn").click(function(){
  852. $("select").val(0);
  853. $(".ttf-pop").addClass('dn');
  854. });
  855. });
  856. function cancelPay(cid){//alert(uid);return;
  857. if (!cid) return;
  858. layer.open({
  859. type: 2,
  860. skin: 'layui-layer-lan',
  861. title: '设置用户缴费',
  862. fix: false,
  863. shadeClose: true,
  864. maxmin: true,
  865. area: ['1000px', '500px'],
  866. content: "<?php echo $this->createUrl('classes/import');?>/cid/"+cid,
  867. });
  868. }
  869. function saveClassSort() {
  870. var classSort = [];
  871. $('input[name="sort"]').each(function () {
  872. var str = $(this).parent().parent().attr('classId')+'_'+$(this).val();
  873. classSort.push(str);
  874. });
  875. if(classSort.length==0){
  876. layer.msg("排序参数错误");
  877. return false;
  878. }
  879. $.ajax({
  880. type:'post',
  881. url: "<?php echo $this->createUrl('classes/saveClassSort');?>",
  882. data: {'classSort': classSort},
  883. dataType: 'json',
  884. success: function (res) {
  885. var html = ''
  886. if (res.status){
  887. $(".ttf-pop").addClass('dn');
  888. layer.alert('修改成功',{icon:1,closeBtn:0},function () {
  889. location.reload();
  890. })
  891. }else {
  892. layer.msg("修改失败");
  893. }
  894. }
  895. })
  896. }
  897. function classesMesByGradeAndPage(grade,page){
  898. if(!grade){
  899. grade = 1;
  900. }
  901. if(!page){
  902. page = 1;
  903. }
  904. $.ajax({
  905. type:'get',
  906. url: "<?php echo $this->createUrl('classes/ajaxGetClassesByGrade');?>",
  907. data:{grade:grade,page:page},
  908. dataType: 'json',
  909. success: function (res) {
  910. var html = ''
  911. if (res.status == 1){
  912. console.log(res.data);
  913. html += "<table border=1 class='table-zd'>";
  914. html += " <tr>";
  915. html += " <td><input type='checkbox' class='select-class-all'></td>";
  916. html += " <td>班级</td>";
  917. html += " <td>人数</td>";
  918. html += " <td>状态</td>";
  919. html += " <td>生成进度</td>";
  920. html += " </tr>";
  921. for(var i = 0;i<res.data.rs.length;i++){
  922. html += " <tr>";
  923. if(res.data.rs[i]['report_status'] == 0){
  924. if(res.data.rs[i]['stu_count'] > 0 ){
  925. html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"'></td>";
  926. }else{
  927. html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"' disabled='disabled'></td>";
  928. }
  929. }else{
  930. html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"' disabled='disabled'></td>";
  931. }
  932. html += " <td>"+res.data.rs[i]['class_name']+"</td>";
  933. html += " <td>"+res.data.rs[i]['stu_count']+"</td>";
  934. if(res.data.rs[i]['report_status'] == 0){
  935. html += " <td>未生成</td>";
  936. html += " <td>0/"+res.data.rs[i]['stu_count']+"</td>";
  937. }else if(res.data.rs[i]['report_status'] == 1){
  938. html += " <td>正在生成</td>";
  939. html += " <td>0/"+res.data.rs[i]['stu_count']+"</td>";
  940. }else if(res.data.rs[i]['report_status'] == 2){
  941. html += " <td>已生成</td>";
  942. html += " <td>"+res.data.rs[i]['stu_count']+"/"+res.data.rs[i]['stu_count']+"</td>";
  943. }
  944. html += " </tr>";
  945. }
  946. html += "</table>";
  947. html += '<div class="page-zd">';
  948. html += ' <div class="dataTables_paginate paging_simple_numbers">';
  949. html += res.data.pages_index;
  950. html +='共:'+res.data.page.rowsCount+'条';
  951. html += "</div>";
  952. html += "</div>";
  953. $(".class-data").html(html);
  954. }else {
  955. console.log(11);
  956. }
  957. }
  958. })
  959. }
  960. $("#year-report").click(function () {
  961. //通过年级页码获取班级信息
  962. var html = "";
  963. html += "<div class='layer-zd'>";
  964. html += "<select class='report-grade'>";
  965. html += "<option value='1'>高一</option>";
  966. html += "<option value='2'>高二</option>";
  967. html += "<option value='3'>高三</option>";
  968. html += "</select>";
  969. html += "<button id='report-class-bulid'>生成</button>";
  970. html += "<div class='class-data'></div>";
  971. html += "<div>";
  972. html += "<div class='notice-report-1'>注:</div>";
  973. html += "<div class='notice-report-2'>1、确认哪些班级需要使用学生年度账单,然后再勾选进行生成!</div>";
  974. html += "<div class='notice-report-3'>2、点击生成后,稍后再确认是否为“已生成”状态,只有已生成的班级才可以在班级列表中下载学生年度账单</div>";
  975. html += "</div>";
  976. html += "</div>";
  977. layer.open({
  978. type: 1,
  979. title: '生成年度账单',
  980. btn: [],
  981. area: ['640px', '500px'], //宽高
  982. btnAlign: 'c',
  983. content: html,
  984. btn2: function (index, layero) {
  985. }
  986. });
  987. classesMesByGradeAndPage(1,1);
  988. // alert(1);
  989. });
  990. $("body").delegate(".report-grade","change",function(){
  991. var grade = $(this).val();
  992. if(grade){
  993. classesMesByGradeAndPage(grade,1);
  994. }
  995. })
  996. $("body").delegate(".select-class-all","click",function(){
  997. if($(this).prop("checked")){
  998. $('.select-class').each(function(i){
  999. if(!$(this).prop("disabled")){
  1000. $(this).prop("checked",true);
  1001. }
  1002. });
  1003. }else{
  1004. $('.select-class').prop("checked",false);
  1005. }
  1006. })
  1007. $("body").delegate("#report-class-bulid","click",function(){
  1008. var classIds = [];
  1009. $(".select-class:checked").each(function(){
  1010. classIds.push($(this).attr('classId'));
  1011. });
  1012. if(classIds.length>0){
  1013. var url = "<?php echo $this->createUrl("classes/yearReport") ?>";
  1014. $.post(url, {classId: classIds}, function(data) {
  1015. var m = JSON.parse(data);
  1016. console.log(m);
  1017. if (m.status == 0)
  1018. {
  1019. } else
  1020. {
  1021. setTimeout(function() {
  1022. $(".loading-pop").hide();
  1023. }, 500);
  1024. layer.msg(m.error)
  1025. }
  1026. });
  1027. $(".select-class:checked").each(function(){
  1028. $(this).prop("disabled",true);
  1029. $(this).parent().parent().find("td:eq(3)").html("正在生成");
  1030. });
  1031. }
  1032. })
  1033. $("body").delegate(".page-zd ul li a","click",function(){
  1034. var page = $(this).html();
  1035. var grade = $(".report-grade").val();
  1036. if(isNaN(page)){
  1037. var current_page = parseInt($(".page-zd ul .selected").text());
  1038. if(page == '下一页'){
  1039. classesMesByGradeAndPage(grade,(current_page + 1));
  1040. }else if(page == '上一页'){
  1041. classesMesByGradeAndPage(grade,(current_page-1));
  1042. }
  1043. }else{
  1044. classesMesByGradeAndPage(grade,page);
  1045. }
  1046. })
  1047. $('.close3').click(function(){
  1048. $('.modal1_multi').hide();
  1049. });
  1050. //隐藏班级
  1051. $('.sumbit3').click(function(){
  1052. var classId=$('input[name=hideClassId]').val();
  1053. if(classId==0 || classId==undefined || classId==''){
  1054. alert('参数错误');
  1055. }
  1056. $.ajax({
  1057. url:'<?php echo $this->createUrl('classes/hideClass')?>',
  1058. type:'POST',
  1059. dataType:'json',
  1060. data:{classId:classId},
  1061. success:function(res){
  1062. if(res.status==1){
  1063. layer.msg('班级已成功隐藏',{
  1064. icon: 1
  1065. }, function(){
  1066. location.reload();
  1067. });
  1068. }else{
  1069. layer.msg('操作失败')
  1070. }
  1071. }
  1072. });
  1073. });
  1074. $(".add-class-list").hover(function(){
  1075. $('.class-add-list').toggle();
  1076. });
  1077. // $(".class-add-list").hover(function(){
  1078. // $('.class-add-list').show();
  1079. //
  1080. // },function(){
  1081. // $('.class-add-list').hide();
  1082. //
  1083. // });
  1084. $("body").delegate(".all-select","click",function(){
  1085. if($(this).prop("checked")){
  1086. $(this).parent().find(".all-select-option").prop("checked",true);
  1087. }else{
  1088. $(this).parent().find(".all-select-option").prop("checked",false);
  1089. }
  1090. });
  1091. $("body").delegate(".all-select-option","click",function(){
  1092. if($(".all-select-option").length == $(".all-select-option:checked").length){
  1093. $(".all-select").prop("checked",true);
  1094. }else{
  1095. $(".all-select").prop("checked",false);
  1096. }
  1097. });
  1098. //导出班级数据
  1099. $("#export-class").click(function(){
  1100. var str = '<div id="hgc_editor" style="padding:20px 35px;">';
  1101. str += ' <p>请选择需要导出的字段:</p>';
  1102. str += '<input type="checkbox" name="export-class-type-all" value="0" checked="checked" class="all-select"><span class="selcet-class-type">全选</span>';
  1103. str += '<input type="checkbox" name="export-class-type[]" value="1" class="all-select-option" checked="checked"><span class="selcet-class-type">班级</span>';
  1104. str += '<input type="checkbox" name="export-class-type[]" value="2" class="all-select-option" checked="checked"><span class="selcet-class-type">年级</span>';
  1105. str += '<input type="checkbox" name="export-class-type[]" value="3" class="all-select-option" checked="checked"><span class="selcet-class-type">层级</span>';
  1106. <?php if(Yii::app()->params['section']==1):?>
  1107. str += '<input type="checkbox" name="export-class-type[]" value="4" class="all-select-option" checked="checked"><span class="selcet-class-type">文理科</span>';
  1108. <?php endif;?>
  1109. str += '<input type="checkbox" name="export-class-type[]" value="5" class="all-select-option" checked="checked"><span class="selcet-class-type">班主任</span>';
  1110. str += '<input type="checkbox" name="export-class-type[]" value="6" class="all-select-option" checked="checked"><span class="selcet-class-type">执教老师</span>';
  1111. str += '<input type="checkbox" name="export-class-type[]" value="7" class="all-select-option" checked="checked"><span class="selcet-class-type">学生人数</span>';
  1112. str += ' </div>';
  1113. layer.open({
  1114. title:'班级信息导出'
  1115. ,area:'740px'
  1116. ,type: 1
  1117. ,offset: 'auto'
  1118. ,content: str
  1119. ,btn: ['确定','取消']
  1120. ,btnAlign: 'c' //按钮居中
  1121. ,shade: 0.6 //不显示遮罩
  1122. ,yes:function(){
  1123. var semesterId = $("#semesters").val();
  1124. var grade = $("#grade_id").val();
  1125. var arts_science = $("#arts_science").val();
  1126. var class_name = $("input[name='realname']").val();
  1127. var class_type = 1;
  1128. var choose_type = [];
  1129. $(".all-select-option").each(function(){
  1130. if($(this).is(':checked')){
  1131. choose_type.push($(this).val());
  1132. }
  1133. });
  1134. if(choose_type.length > 0){
  1135. window.location.href = "<?php echo $this->createUrl("classes/exportClass");?>"+"?semesterId="+semesterId+"&grade="+grade+"&arts_science="+arts_science+"&class_name="+class_name+"&class_type=1&choose_type="+choose_type;
  1136. }
  1137. }
  1138. });
  1139. });
  1140. //导出教学班数据
  1141. $("#export-class-type2").click(function(){
  1142. var str = '<div id="hgc_editor" style="padding:20px 35px;">';
  1143. str += ' <p>请选择需要导出的字段:</p>';
  1144. str += '<input type="checkbox" name="export-class-type-all" value="0" class="all-select" checked="checked"><span class="selcet-class-type">全选</span>';
  1145. str += '<input type="checkbox" name="export-class-type[]" value="1" class="all-select-option" checked="checked"><span class="selcet-class-type">班级</span>';
  1146. str += '<input type="checkbox" name="export-class-type[]" value="2" class="all-select-option" checked="checked"><span class="selcet-class-type">年级</span>';
  1147. str += '<input type="checkbox" name="export-class-type[]" value="3" class="all-select-option" checked="checked"><span class="selcet-class-type">层级</span>';
  1148. str += '<input type="checkbox" name="export-class-type[]" value="6" class="all-select-option" checked="checked"><span class="selcet-class-type">执教老师</span>';
  1149. str += '<input type="checkbox" name="export-class-type[]" value="7" class="all-select-option" checked="checked"><span class="selcet-class-type">学生人数</span>';
  1150. str += ' </div>';
  1151. layer.open({
  1152. title:'班级信息导出'
  1153. ,area:'740px'
  1154. ,type: 1
  1155. ,offset: 'auto'
  1156. ,content: str
  1157. ,btn: ['确定','取消']
  1158. ,btnAlign: 'c' //按钮居中
  1159. ,shade: 0.6 //不显示遮罩
  1160. ,yes:function(){
  1161. var semesterId = $("#semesters").val();
  1162. var grade = $("#grade_id").val();
  1163. var arts_science = $("#arts_science").val();
  1164. var class_name = $("input[name='realname']").val();
  1165. var class_type = 2;
  1166. var choose_type = [];
  1167. $(".all-select-option").each(function(){
  1168. if($(this).is(':checked')){
  1169. choose_type.push($(this).val());
  1170. }
  1171. });
  1172. if(choose_type.length > 0){
  1173. window.location.href = "<?php echo $this->createUrl("classes/exportClass");?>"+"?semesterId="+semesterId+"&grade="+grade+"&arts_science="+arts_science+"&class_name="+class_name+"&class_type=2&choose_type="+choose_type;
  1174. }
  1175. }
  1176. });
  1177. });
  1178. function downfile(classId,status) {
  1179. $(".loading-pop").show();
  1180. if(status == 2){
  1181. var msg = '是否确定下载该班级学生的年度使用报告吗?';
  1182. layer.msg(msg, {
  1183. time: 0,
  1184. btn: ['确定', '取消'],
  1185. yes: function(index){
  1186. layer.close(index);
  1187. location.href="<?php echo $this->createUrl("classes/down_load_yearreport")?>"+"?classId="+classId;
  1188. }
  1189. });
  1190. }else{
  1191. layer.msg('账单未生成');
  1192. }
  1193. var url = "<?php echo $this->createUrl("classes/yearReport") ?>";
  1194. }
  1195. </script>