index.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <script src="/js/xsgl.js"></script>
  2. <script>
  3. function endDates() {
  4. //将结束日期的事件改成 false 即可
  5. }
  6. $(function(){
  7. // $(".ttd").fadeIn();
  8. var start = {
  9. dateCell: '#start_time',
  10. format: 'YYYY-MM-DD hh:mm:ss',
  11. minDate: '2014-06-16 23:59:59', //设定最小日期为当前日期
  12. // isinitVal:true,
  13. maxDate: jeDate.now(0), //最大日期
  14. isTime: true,
  15. choosefun: function(obj){
  16. end.minDate = obj.toString(); //开始日选好后,重置结束日的最小日期
  17. end.trigger = true;
  18. jeDate(end);
  19. }
  20. };
  21. var end = {
  22. dateCell: '#end_time',
  23. format: 'YYYY-MM-DD hh:mm:ss',
  24. // minDate: jeDate.now(0), //设定最小日期为当前日期
  25. maxDate: '2099-06-16 23:59:59', //最大日期
  26. choosefun: function(datas){
  27. start.maxDate = datas; //将结束日的初始值设定为开始日的最大日期
  28. }
  29. };
  30. jeDate(start);
  31. jeDate(end);
  32. //全选
  33. $(".selectAll").click(function(){
  34. if ($(this).prop("checked")) {
  35. $(".myselect").prop("checked",true);
  36. } else {
  37. $(".myselect").prop("checked",false);
  38. }
  39. });
  40. //删除
  41. $("#del").click(function(){
  42. // 判断是否有选中
  43. var n_id;
  44. layer.msg('确定删除选中的记录吗?', {
  45. time: 0,
  46. btn: ['确定', '取消'],
  47. yes: function(index){
  48. layer.close(index);
  49. if (!$("input[class='ace myselect']").is(':checked'))
  50. {
  51. layer.msg('请至少一个记录!');return false;
  52. }
  53. jQuery("input[class='ace myselect']").each(function()
  54. {
  55. if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
  56. {
  57. n_id += ","+jQuery(this).val();
  58. }
  59. });
  60. if(n_id)
  61. {
  62. n_id = n_id.replace("undefined,",'');
  63. }
  64. var data={n_id:n_id};
  65. $.post("<?php echo Yii::app()->createUrl('notification/del') ?>", data, function(flags) {
  66. var m = JSON.parse(flags);
  67. if(m.status)
  68. {
  69. location.reload();
  70. }else
  71. {
  72. layer.msg('删除失败');
  73. }
  74. });
  75. }
  76. });
  77. });
  78. $("#btnClose").click(function(){
  79. $(this).parents(".ttd").fadeOut();
  80. location.reload();
  81. });
  82. $(".info").click(function () {
  83. var data={
  84. exam_group_id:$(this).attr('exam_group_id'),
  85. n_id: $(this).attr('n_id'),
  86. mode: $(this).attr('mode')
  87. };
  88. $.post("<?php echo Yii::app()->createUrl('notification/ajax_exam_info') ?>", data, function(flags) {
  89. var m = JSON.parse(flags);
  90. if(m)
  91. {
  92. if(m.mode==2){
  93. $('.title').html('您有新的预警需要注意');
  94. $('#exam_name').html('预警名称:'+m.title);
  95. if(m.alarm_level==0){
  96. $('#teacher_name').html('预警级别:红色预警');
  97. }
  98. if(m.alarm_level==1){
  99. $('#teacher_name').html('预警级别:黄色预警');
  100. }
  101. if(m.alarm_level==2){
  102. $('#teacher_name').html('预警级别:绿色预警');
  103. }
  104. $('#exam_class').html('预警学校:'+m.school_name);
  105. $('#mark_type').html('预警详情:无');
  106. if(m.alarm_description){
  107. $('#mark_type').html('预警详情:'+m.alarm_description);
  108. }
  109. $('#exam_time').html('预警时间:'+m.create_time);
  110. $('#complete').html('');
  111. $(".ttd").fadeIn();
  112. }else{
  113. $('#exam_name').html('试卷名称:'+m.exam_name);
  114. if(m.mark_type==3)
  115. {
  116. if(m.subject_id !=3 && m.subject_id !=6 && m.subject_id!=51){
  117. $('#teacher_name').html('主阅卷老师:'+m.teacher_name);
  118. }else{
  119. $('#teacher_name').html('出卷老师:'+m.teacher_name);
  120. }
  121. $('#mark_type').html('阅卷方式:班级混合阅卷');
  122. $('#complete').html('所有老师已完成阅卷,请及时处理!');
  123. }
  124. if(m.mark_type==4)
  125. {
  126. $('#teacher_name').html('阅卷老师:'+m.teacher_name);
  127. $('#mark_type').html('阅卷方式:班级单独阅卷');
  128. $('#complete').html('老师已完成阅卷,请及时处理!');
  129. }
  130. $('#exam_class').html('考试班级:'+m.class_name);
  131. $('#exam_time').html('考试时间:'+m.exam_time);
  132. $(".ttd").fadeIn();
  133. }
  134. evaluationClient.SetNotification(m.count);
  135. }else
  136. {
  137. layer.msg('数据有误');
  138. }
  139. });
  140. });
  141. });
  142. </script>
  143. <script type="text/javascript" src="/js/times/jedate.js"></script>
  144. <style>
  145. a{color: #ffffff}
  146. a:hover a:active{color: #ffffff}
  147. *{padding:0px;margin:0px;font-family:微软雅黑}
  148. ul,li,ol{list-style-type:none;}
  149. .clearfix:after{clear:both;overflow:hidden;content:"";display:block;}
  150. input ,button{outline:none;}
  151. .position-r{position:relative}
  152. .fl{float:left;}
  153. .fr{float:right;}
  154. .mt5{margin-top:5px;}
  155. .mt10{margin-top:10px;}
  156. .mt20{margin-top:20px;}
  157. .ml15{margin-left:15px;}
  158. .mr15{margin-right:15px;}
  159. .font_bold{font-weight:bold;}
  160. .choseImg{cursor:pointer;}
  161. .ttd{background:url(/images/back-d.png) center repeat;width:100%;height:100%;position:fixed;top:0px;z-index:999}
  162. .s-state{width:380px;background:#fff;margin:12% auto 0 auto;}
  163. .hint_size{height:45px;width:90%;color:#333;line-height:45px;margin:0px auto;border-bottom:1px solid #ccc;}
  164. .mistake_character{text-align:left;color:#606060;font-size:14px;padding:0px 0px 28px 0px;width:90%;margin:0px auto;}
  165. .roger{width:100px;height:35px;border:1px solid #2977ff;background:#2977ff;color:#fff;font-size:16px;cursor:pointer;}
  166. .rogergb{background:#ccc;border:1px solid #ccc;}
  167. .allTeacher{width:164px;height:30px;border:1px solid #ccc;border-radius:6px;margin-top:10px;}
  168. button.wordBtn{background:#2977ff;color:#fff;width:120px;height:30px;border:1px solid #2977ff;cursor:pointer;border-radius:4px;margin-left: 15px;}
  169. </style>
  170. <div class="main-content-inner">
  171. <div class="page-content">
  172. <div class="row" style="margin:0px;">
  173. <div class="col-xs-12">
  174. <!-- PAGE CONTENT BEGINS -->
  175. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  176. <div class="col-xs-7">
  177. <form method="get" id="form1" action="<?php echo $this->createUrl("notification/index");?>">
  178. <div class="col-xs-12 fl">
  179. <div class="dataTables_length margin-zy">
  180. 开始时间: <input type="text" id="start_time" class="form-control input-sm" placeholder="开始时间" name="start_time" value="<?php echo $start_time?>" readonly ">
  181. 结束时间: <input type="text" id="end_time" class="form-control input-sm" placeholder="结束时间" name="end_time" value="<?php echo $end_time?>" readonly ">
  182. 通知类型:<select class="form-control" id="mode" name="mode" style="width: 100px;">
  183. <option value="0" >全部类型</option>
  184. <option value="-1" <?php if($mode<0){echo 'selected';}?> >通知类型</option>
  185. <option value="2" <?php if($mode>0){echo 'selected';}?>>预警类型</option>
  186. </select>
  187. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  188. </div>
  189. </div>
  190. </form>
  191. </div>
  192. <div class="col-xs-3 fl" style="margin: 10px"> <button class="label-primary-s bth-s" id="del" style="padding:4px 12px;">选中删除</button></div>
  193. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  194. <thead>
  195. <tr>
  196. <th><input type="checkbox" class="ace selectAll"></th>
  197. <th>序号</th>
  198. <th>时间</th>
  199. <th>标题</th>
  200. <th>状态</th>
  201. <th>类型</th>
  202. <th>操作</th>
  203. </tr>
  204. </thead>
  205. <tbody>
  206. <?php
  207. if(isset($list) && !empty($list)){
  208. foreach ($list as $k=>$v){
  209. ?>
  210. <tr>
  211. <td><input type="checkbox" class="ace myselect" value="<?php echo $v->id?>"></td>
  212. <td><?php echo ($_page*10)-(10-$k-1)?></td>
  213. <td><?php echo date('Y-m-d H:i:s',$v->create_time)?></td>
  214. <td><?php echo $v->title?></td>
  215. <td><?php if($v->status){echo '已读';}else{echo '未读';}?></td>
  216. <td><?php if($v->mode==0){echo '通知';}else{echo "预警类";}?></td>
  217. <td><button class="label-primary-s bth-s info" mode="<?php echo $v->mode?>" exam_group_id = "<?php echo $v->exam_group_id?>" n_id="<?php echo $v->id?>" style="padding:4px 12px;">详情</button></td>
  218. </tr>
  219. <?php
  220. }}else{?>
  221. <tr><td colspan="7">暂无数据!</td></tr>
  222. <?php }?>
  223. </tbody>
  224. </table>
  225. <?php if(isset($page)&&!empty($page)):?>
  226. <div class="row">
  227. <div class="col-xs-7">
  228. <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
  229. </div>
  230. <div class="col-xs-5">
  231. <div class="dataTables_paginate paging_simple_numbers">
  232. <?php
  233. $this->widget('CLinkPager', array(
  234. 'header' => '',
  235. //'selectedPageCssClass' => 'active2', //当前页的class
  236. //'hiddenPageCssClass' => 'disabled2', //禁用页的class
  237. 'firstPageLabel' => '首页',
  238. 'lastPageLabel' => '末页',
  239. 'prevPageLabel' => '上一页',
  240. 'nextPageLabel' => '下一页',
  241. 'pages' => $page,
  242. 'maxButtonCount'=> 5,
  243. ));
  244. ?><?php echo '共:'.$page_total.'条';?>
  245. </div>
  246. </div>
  247. </div>
  248. <?php endif;?>
  249. </div>
  250. <!-- PAGE CONTENT ENDS -->
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="ttd" style="display: none;">
  256. <div class="s-state clearfix posirela">
  257. <div class="hint_size clearfix">
  258. <span class="fl ml15 title" >系统通知</span>
  259. </div>
  260. <div class="mistake_character clearfix" style="padding-top: 10px; padding-bottom: 0;">
  261. <label class="ml15 fl" style="line-height:37px" id="exam_name">试卷名称:</label>
  262. </div>
  263. <div class="mistake_character clearfix" style="padding-top: 0; padding-bottom: 0px;">
  264. <label class="ml15 fl" style="line-height:37px" id="teacher_name">主阅卷老师:</label>
  265. </div>
  266. <div class="mistake_character clearfix" style="padding-top: 0; padding-bottom: 10px;">
  267. <label class="ml15 fl" style="line-height:37px" id="exam_class">考试班级:</label>
  268. </div>
  269. <div class="mistake_character clearfix" style="padding-top: 0; padding-bottom: 10px;">
  270. <label class="ml15 fl" style="line-height:37px" id="mark_type">阅卷方式:</label>
  271. </div>
  272. <div class="mistake_character clearfix" style="padding-top: 0; padding-bottom: 10px;">
  273. <label class="ml15 fl" style="line-height:37px" id="exam_time">考试时间:</label>
  274. </div>
  275. <div class="mistake_character clearfix" style="padding-top: 0; padding-bottom: 10px;">
  276. <label class="ml15 fl" style="line-height:37px" id="complete">所有老师已完成阅卷,请及时处理!</label>
  277. </div>
  278. <div class="mistake_character clearfix">
  279. <div class="clearfix" style="width:300px;margin:0px auto;">
  280. <p class="fl"><button class="roger shut" id="btnClose">确定</button></p>
  281. </div>
  282. </div>
  283. </div>
  284. </div>