new_view_navigation.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <style>
  2. /*切换选择*/
  3. .tab-con{
  4. position: relative;
  5. height: 30px;
  6. width: 200px;
  7. background: #F2F2F2;
  8. border: 1px solid #01B677;
  9. border-radius: 15px;
  10. }
  11. .has-sel{
  12. background: #01B677;
  13. color: #fff;
  14. width: 50%;
  15. height: 30px;
  16. border-top-left-radius: 15px;
  17. border-bottom-left-radius: 15px;
  18. text-align: center;
  19. line-height: 30px;
  20. }
  21. .sel-opt{
  22. width: 50%;
  23. position: relative;
  24. color: #01B677;
  25. line-height: 30px;
  26. text-indent: 6px;
  27. cursor: pointer;
  28. }
  29. .sel-opt:after{
  30. content: '';
  31. border-left: 6px solid transparent;
  32. border-right: 6px solid transparent;
  33. border-top: 8px solid #01B677;
  34. position: absolute;
  35. right: 12px;
  36. top: 12px;
  37. }
  38. // .sel-opt select{
  39. // width: 100%;
  40. // height: 30px;
  41. // background: #F2F2F2;
  42. // color: #01B677;
  43. // text-indent: 6px;
  44. // font-size: inherit;
  45. // border-top-right-radius: 15px;
  46. // border-bottom-right-radius: 15px;
  47. // cursor: pointer;
  48. // }
  49. // .sel-opt select option{
  50. // position: relative;
  51. // }
  52. .points{
  53. position: absolute;
  54. top: -2px;
  55. right: 0;
  56. width: 10px;
  57. height: 10px;
  58. background: #F01516;
  59. border-radius: 50%;
  60. }
  61. .sel-cons{
  62. border: 1px solid #01B677;
  63. width: 50%;
  64. position: absolute;
  65. right: 0;
  66. top: 30px;
  67. text-indent: 10px;
  68. display: none;
  69. }
  70. .sc-lis2{
  71. line-height: 30px;
  72. cursor: pointer;
  73. }
  74. .sc-lis2 span{
  75. position: relative;
  76. }
  77. .sc-lis2 .points{
  78. top: 2px;
  79. right: -16px;
  80. }
  81. .subject-change{
  82. margin:8px 11px 0 0;display: block
  83. }
  84. .subject-change-no{
  85. margin:8px 11px 0 0;display: none
  86. }
  87. </style>
  88. <?php
  89. $sub_id = isset(Yii::app()->session['session_subject_id']) ? Yii::app()->session['session_subject_id']:0;
  90. $duo_sub_id = isset(Yii::app()->session['session_duoxueke_subject_id']) ? Yii::app()->session['session_duoxueke_subject_id']:0;
  91. $testFlag = isset(Yii::app()->session['testFlag'])?Yii::app()->session['testFlag']:0;
  92. $printType = isset($printType)?$printType:'';
  93. $subject = isset($subject)?$subject:array();
  94. $urlInfoAll = Yii::app()->request->getPathInfo();
  95. $urlInfo = '';
  96. if($urlInfoAll){
  97. $urlInfoArr = explode('/',$urlInfoAll);
  98. if(isset($urlInfoArr[0]) && isset($urlInfoArr[1])){
  99. $urlInfo = strtolower($urlInfoArr[0]).'/'.strtolower($urlInfoArr[1]);
  100. }
  101. $urlType = '';
  102. foreach ($urlInfoArr as $_url_k => $_url_v) {
  103. if ($_url_v == 'type' && isset($urlInfoArr[$_url_k + 1])) {
  104. $urlType = $urlInfoArr[$_url_k + 1];
  105. }
  106. }
  107. if(count($urlInfoArr) > 4){
  108. $urlInfoArr = array_slice($urlInfoArr,0,4);
  109. }
  110. $urlInfoAll = implode('/',$urlInfoArr);
  111. }
  112. $subjectNameArr = array(
  113. 3 => '数学',
  114. 8 => '英语',
  115. 9 => '语文',
  116. 12 => '物理',
  117. 13 => '化学',
  118. 14 => '生物',
  119. 15 => '政治',
  120. 16 => '历史',
  121. 17 => '地理',
  122. 18 => '理综',
  123. 19 => '文综',
  124. );
  125. if (in_array($sub_id, Yii::app()->params['mathSubjectId'])) {
  126. $meauArr = array(
  127. array(
  128. 'name' => '打印试卷',
  129. 'url' => $this->createUrl("print/index"),
  130. 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
  131. 'is_show' => true,
  132. ),
  133. array(
  134. 'name' => '第三方试卷',
  135. 'url' => $this->createUrl("third/index"),
  136. 'button_active' => inArray($urlInfo,array('third/index','third/assist','third/exam_list','third/change','third/thirdview','third/import')),
  137. 'is_show' => true,
  138. ),
  139. array(
  140. 'name' => '上传试卷',
  141. 'url' => $this->createUrl("upload/index"),
  142. 'button_active' => inArray($urlInfo,array('upload/index')),
  143. 'is_show' => true,
  144. ),
  145. array(
  146. 'name' => '导入成绩',
  147. 'url' => $this->createUrl("record/importscore"),
  148. 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
  149. 'is_show' => true,
  150. ),
  151. array(
  152. 'name' => '全学科统考',
  153. 'url' => $this->createUrl("cylet/index"),
  154. 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
  155. 'is_show' => true,
  156. ),
  157. array(
  158. 'name' => '联评考试',
  159. 'url' => $this->createUrl("print/united"),
  160. 'button_active' => inArray($urlInfo,array('print/united','print/class_exam_united','print/unitedtask')),
  161. 'is_show' => in_array($sub_id, Yii::app()->params['mathSubjectId'])?true:false,
  162. ),
  163. array(
  164. 'name' => '用户成绩推送设置',
  165. 'url' => $this->createUrl("zhiliao/index"),
  166. 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
  167. 'is_show' => true,
  168. ),
  169. array(
  170. 'name' => '还原考试',
  171. 'url' => $this->createUrl("print/restore"),
  172. 'button_active' => inArray($urlInfo,array('print/restore')),
  173. 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
  174. ),
  175. );
  176. }elseif($sub_id == 8){
  177. $meauArr = array(
  178. array(
  179. 'name' => '打印试卷',
  180. 'url' => $this->createUrl("print/index"),
  181. 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
  182. 'is_show' => true,
  183. ),
  184. array(
  185. 'name' => '第三方试卷',
  186. 'url' => $this->createUrl("third/index"),
  187. 'button_active' => inArray($urlInfo,array('third/index','third/exam_list','third/change','third/assist','third/thirdview_under_line','third/editthirdunderLine','third/thirdview_duo')),
  188. 'is_show' => true,
  189. ),
  190. array(
  191. 'name' => '导入成绩',
  192. 'url' => $this->createUrl("record/importscore"),
  193. 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
  194. 'is_show' => true,
  195. ),
  196. array(
  197. 'name' => '全学科统考',
  198. 'url' => $this->createUrl("cylet/index"),
  199. 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
  200. 'is_show' => true,
  201. ),
  202. array(
  203. 'name' => '用户成绩推送设置',
  204. 'url' => $this->createUrl("zhiliao/index"),
  205. 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
  206. 'is_show' => true,
  207. ),
  208. array(
  209. 'name' => '还原考试',
  210. 'url' => $this->createUrl("print/restore"),
  211. 'button_active' => inArray($urlInfo,array('print/restore')),
  212. 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
  213. ),
  214. );
  215. }else{
  216. $meauArr = array(
  217. array(
  218. 'name' => '打印试卷',
  219. 'url' => $this->createUrl("print/index"),
  220. 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
  221. 'is_show' => true,
  222. ),
  223. array(
  224. 'name' => '第三方试卷',
  225. 'url' => $this->createUrl("third/index"),
  226. 'button_active' => inArray($urlInfo,array('third/index','third/exam_list','third/change','third/assist','third/thirdview_under_line','third/editThirdUnderLine','third/thirdview_duo')),
  227. 'is_show' => true,
  228. ),
  229. array(
  230. 'name' => '导入成绩',
  231. 'url' => $this->createUrl("record/importscore"),
  232. 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
  233. 'is_show' => true,
  234. ),
  235. array(
  236. 'name' => '全学科统考',
  237. 'url' => $this->createUrl("cylet/index"),
  238. 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
  239. 'is_show' => true,
  240. ),
  241. array(
  242. 'name' => '用户成绩推送设置',
  243. 'url' => $this->createUrl("zhiliao/index"),
  244. 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
  245. 'is_show' => true,
  246. ),
  247. array(
  248. 'name' => '还原考试',
  249. 'url' => $this->createUrl("print/restore"),
  250. 'button_active' => inArray($urlInfo,array('print/restore')),
  251. 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
  252. ),
  253. );
  254. }
  255. ?>
  256. <ul class="clearfix main-content-inner-ul">
  257. <?php foreach ($meauArr as $meau):?>
  258. <?php if(!$meau['is_show']) continue;?>
  259. <li class="pull-left">
  260. <button onclick='location.href="<?php echo $meau['url'];?>"' class="button button_normal button_group button_arrow <?php echo $meau['button_active']?'button_active':'';?>" data-button="red"><?php echo $meau['name'];?></button>
  261. <img src="/images/line.jpg" style="height:45px;" />
  262. </li>
  263. <?php endforeach;?>
  264. <li class="pull-right">
  265. <div class="tabs clearfix">
  266. <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==0){echo 'active';}}else{echo 'active';}?><!--" id="_third_shijuan">全学科</a>-->
  267. <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==1){echo 'active';}}?><!--" id="_baogao">导出报告</a>-->
  268. <div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
  269. <div class="has-sel fl"><?php echo isset(Yii::app()->params["subjectId"][$sub_id])?Yii::app()->params["subjectId"][$sub_id]:'数学'?></div>
  270. <div class="sel-opt fl">
  271. 切换学科
  272. <?php if($subject){?>
  273. <!-- <div class="points"></div>-->
  274. <?php }?>
  275. </div>
  276. <div class="sel-cons" style="z-index:6;background-color: #fff;">
  277. <?php foreach ($subjectNameArr as $_subId => $_subName):?>
  278. <div class="sc-lis2" val="<?php echo $_subId;?>"><span><?php echo $_subName;?><?php if($subject && isset($subject[$_subId]) && !empty($subject[$_subId])){?><!-- <div class="points"></div> --><?php }?></span></div>
  279. <?php endforeach;?>
  280. </div>
  281. </div>
  282. </div>
  283. </li>
  284. </ul>
  285. <script type="text/javascript">
  286. $(document).ready(function() {
  287. $(".sel-opt,.sel-cons").mouseover(function () {
  288. $(".sel-cons").show();
  289. }).mouseout(function () {
  290. $(".sel-cons").hide();
  291. });
  292. $(".sc-lis2").click(function () {
  293. var sub_id = $(this).attr('val');
  294. var data = {
  295. subjectId: sub_id
  296. };
  297. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
  298. if (flags) {
  299. // location.reload();
  300. if (sub_id == 3 || sub_id == 6 || sub_id == 51 || sub_id == 8) {
  301. var url = "<?php echo $this->createUrl("print/index");?>";
  302. }else{
  303. var url = "<?php echo $this->createUrl("third/index");?>";
  304. }
  305. location.href = url;
  306. } else {
  307. alert('网络异常');
  308. }
  309. });
  310. $('.has-sel').text($(this).text());
  311. $(".sel-cons").hide();
  312. });
  313. });
  314. </script>