view_navigation.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <style>
  2. /*切换选择*/
  3. .tab-con{
  4. position: relative;
  5. height: 30px;
  6. width: 200px;
  7. background: #F2F2F2;
  8. border: 1px solid #0155fe;
  9. border-radius: 15px;
  10. }
  11. .has-sel{
  12. background: #0155fe;
  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: #0155fe;
  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 #0155fe;
  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 #0155fe;
  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. $basicSubject=$this->basicSubject;
  113. unset($basicSubject[18]);
  114. unset($basicSubject[19]);
  115. $subjectNameArr = array(
  116. 3 => '数学',
  117. 8 => '英语',
  118. 9 => '语文',
  119. 12 => '物理',
  120. 13 => '化学',
  121. 14 => '生物',
  122. 15 => '政治',
  123. 16 => '历史',
  124. 17 => '地理',
  125. 18 => '理综',
  126. 19 => '文综',
  127. );
  128. $subjectNameArr=Yii::app()->params['subjectId'];
  129. unset($subjectNameArr[20]);
  130. unset($subjectNameArr[6]);
  131. unset($subjectNameArr[51]);
  132. $_num='';
  133. $use_version = '';
  134. if(isset(Yii::app()->session['coachInfo']->use_version))
  135. {
  136. $use_version = Yii::app()->session['coachInfo']->use_version;
  137. }else
  138. {
  139. $use_version = Yii::app()->session['coachInfo']['use_version'];
  140. }
  141. if(!$use_version)
  142. {
  143. $use_version = 100;
  144. }
  145. $version_number = implode('',explode('.',$use_version));
  146. if(strlen($version_number)<7)
  147. {
  148. for($i=0;$i<7-strlen($version_number);$i++)
  149. {
  150. $_num.='0';
  151. }
  152. }
  153. $version_number=(int)$version_number.$_num;
  154. $menuList=array(
  155. //打印试卷
  156. 'print'=>array('print/index','print/class_exam','print/change','print/changescan','print/modifythirdexam','print/gettaskdetail'),
  157. //校本作业
  158. 'homework'=>array('homework/index','homework/exam_list','homework/change'),
  159. //导入成绩
  160. 'record'=>array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent','record/check_excel','record/handle_repeat','record/importStudentExcel','record/checkimgexcel','record/check_img_field_first','record/check_img_student_name','record/matchingimg','record/handle_repeat_img','record/handle_existent_img','record/bindingImg','record/change_value_img','record/handle_existent_img','record/update_images','record/change_check_img'),
  161. //第三方
  162. 'third'=>array('third/index','third/assist','third/exam_list','third/change','third/thirdview','third/import','third/modifythirdexam','third/thirdview_under_line','third/editthirdunderline','third/gettaskdetail','third/thirdcardsecond','third/thirdview_section','third/thirdview_duo','third/thirdview_section'),
  163. //统考
  164. 'cylet'=>array('cylet/index','cylet/edit'),
  165. //还原考试
  166. 'restore'=>array('print/restore'),
  167. //用户成绩推送设置
  168. 'zhiliao'=>array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist','zhiliao/upload','zhiliao/importstore','zhiliao/check_excel','zhiliao/handle_repeat','zhiliao/handle_existent','zhiliao/reportsetting','zhiliao/unpaidusersetting'),
  169. );
  170. $subjectHomePage=array();
  171. //新版本菜单
  172. if(Yii::app()->params['section']==0){
  173. $subjectHomePage[$sub_id]='third/index';
  174. $meauArr = array(
  175. array(
  176. 'name' => '第三方试卷',
  177. 'url' => $this->createUrl("third/index"),
  178. 'button_active' => inArray($urlInfo,$menuList['third']),
  179. 'is_show' => true,
  180. 'all_nav'=>$menuList['third']
  181. ),
  182. array(
  183. 'name' => '导入成绩',
  184. 'url' => $this->createUrl("record/importscore"),
  185. 'button_active' => inArray($urlInfo,$menuList['record']),
  186. 'is_show' => true,
  187. 'all_nav'=>$menuList['record']
  188. ),
  189. array(
  190. 'name' => '全学科统考',
  191. 'url' => $this->createUrl("cylet/index"),
  192. 'button_active' => inArray($urlInfo,$menuList['cylet']),
  193. 'is_show' => true,
  194. 'all_nav'=>$menuList['cylet']
  195. ),
  196. array(
  197. 'name' => '还原考试',
  198. 'url' => $this->createUrl("print/restore"),
  199. 'button_active' => inArray($urlInfo,$menuList['restore']),
  200. 'is_show' => $testFlag == 1 ,
  201. 'all_nav'=>$menuList['restore']
  202. ),
  203. );
  204. }elseif(Yii::app()->params['section']==3){
  205. //中职
  206. $subjectHomePage[$sub_id]='print/index';
  207. $meauArr = array(
  208. array(
  209. 'name' => '打印试卷',
  210. 'url' => $this->createUrl("print/index"),
  211. 'button_active' => inArray($urlInfo,$menuList['print']),
  212. 'is_show' => true,
  213. 'all_nav'=>$menuList['print']
  214. ),
  215. array(
  216. 'name' => '第三方试卷',
  217. 'url' => $this->createUrl("third/index"),
  218. 'button_active' => inArray($urlInfo,$menuList['third']),
  219. 'is_show' => true,
  220. 'all_nav'=>$menuList['third']
  221. ),
  222. array(
  223. 'name' => '导入成绩',
  224. 'url' => $this->createUrl("record/importscore"),
  225. 'button_active' => inArray($urlInfo,$menuList['record']),
  226. 'is_show' => true,
  227. 'all_nav'=>$menuList['record']
  228. ),
  229. array(
  230. 'name' => '全学科统考',
  231. 'url' => $this->createUrl("cylet/index"),
  232. 'button_active' => inArray($urlInfo,$menuList['cylet']),
  233. 'is_show' => true,
  234. 'all_nav'=>$menuList['cylet']
  235. ),
  236. array(
  237. 'name' => '还原考试',
  238. 'url' => $this->createUrl("print/restore"),
  239. 'button_active' => inArray($urlInfo,$menuList['restore']),
  240. 'is_show' => $testFlag == 1 ,
  241. 'all_nav'=>$menuList['restore']
  242. ),
  243. );
  244. }elseif (in_array($sub_id, Yii::app()->params['mathSubjectId'])) {
  245. $subjectHomePage[$sub_id]='print/index';
  246. $meauArr = array(
  247. array(
  248. 'name' => '打印试卷',
  249. 'url' => $this->createUrl("print/index"),
  250. 'button_active' => inArray($urlInfo,$menuList['print']),
  251. 'is_show' => true,
  252. 'all_nav'=>$menuList['print']
  253. ),
  254. array(
  255. 'name' => '第三方试卷',
  256. 'url' => $this->createUrl("third/index"),
  257. 'button_active' => inArray($urlInfo,$menuList['third']),
  258. 'is_show' => true,
  259. 'all_nav'=>$menuList['third']
  260. ),
  261. array(
  262. 'name' => '校本作业',
  263. 'url' => $this->createUrl("homework/index"),
  264. 'button_active' => inArray($urlInfo,$menuList['homework']),
  265. 'is_show' => true,
  266. 'all_nav'=>$menuList['homework']
  267. ),
  268. array(
  269. 'name' => '导入成绩',
  270. 'url' => $this->createUrl("record/importscore"),
  271. 'button_active' => inArray($urlInfo,$menuList['record']),
  272. 'is_show' => true,
  273. 'all_nav'=>$menuList['record']
  274. ),
  275. array(
  276. 'name' => '全学科统考',
  277. 'url' => $this->createUrl("cylet/index"),
  278. 'button_active' => inArray($urlInfo,$menuList['cylet']),
  279. 'is_show' => true,
  280. 'all_nav'=>$menuList['cylet']
  281. ),
  282. // array(
  283. // 'name' => '用户成绩推送设置',
  284. // 'url' => $this->createUrl("zhiliao/index"),
  285. // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
  286. // 'is_show' => true,
  287. // 'all_nav'=>$menuList['zhiliao']
  288. // ),
  289. array(
  290. 'name' => '还原考试',
  291. 'url' => $this->createUrl("print/restore"),
  292. 'button_active' => inArray($urlInfo,array('print/restore')),
  293. 'is_show' => $testFlag == 1,
  294. 'all_nav'=>$menuList['restore']
  295. ),
  296. );
  297. }elseif(in_array($sub_id,array(8,12,13))){
  298. $subjectHomePage[$sub_id]='print/index';
  299. $meauArr = array(
  300. array(
  301. 'name' => '打印试卷',
  302. 'url' => $this->createUrl("print/index"),
  303. 'button_active' => inArray($urlInfo,$menuList['print']),
  304. 'is_show' => true,
  305. 'all_nav'=>$menuList['print']
  306. ),
  307. array(
  308. 'name' => '第三方试卷',
  309. 'url' => $this->createUrl("third/index"),
  310. 'button_active' => inArray($urlInfo,$menuList['third']),
  311. 'is_show' => true,
  312. 'all_nav'=>$menuList['third']
  313. ),
  314. array(
  315. 'name' => '校本作业',
  316. 'url' => $this->createUrl("homework/index"),
  317. 'button_active' => inArray($urlInfo,$menuList['homework']),
  318. 'is_show' => true,
  319. 'all_nav'=>$menuList['homework']
  320. ),
  321. array(
  322. 'name' => '导入成绩',
  323. 'url' => $this->createUrl("record/importscore"),
  324. 'button_active' => inArray($urlInfo,$menuList['record']),
  325. 'is_show' => true,
  326. 'all_nav'=>$menuList['record']
  327. ),
  328. array(
  329. 'name' => '全学科统考',
  330. 'url' => $this->createUrl("cylet/index"),
  331. 'button_active' => inArray($urlInfo,$menuList['cylet']),
  332. 'is_show' => true,
  333. 'all_nav'=>$menuList['cylet']
  334. ),
  335. // array(
  336. // 'name' => '用户成绩推送设置',
  337. // 'url' => $this->createUrl("zhiliao/index"),
  338. // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
  339. // 'is_show' => true,
  340. // 'all_nav'=>$menuList['zhiliao']
  341. // ),
  342. );
  343. if( Yii::app()->params['section']==0){
  344. //初中学段
  345. unset($meauArr[0]);
  346. }
  347. }else{
  348. $subjectHomePage[$sub_id]='print/index';
  349. $meauArr = array(
  350. array(
  351. 'name' => '打印试卷',
  352. 'url' => $this->createUrl("print/index"),
  353. 'button_active' => inArray($urlInfo,$menuList['print']),
  354. 'is_show' => true,
  355. 'all_nav'=>$menuList['print']
  356. ),
  357. array(
  358. 'name' => '第三方试卷',
  359. 'url' => $this->createUrl("third/index"),
  360. 'button_active' => inArray($urlInfo,$menuList['third']),
  361. 'is_show' => true,
  362. 'all_nav'=>$menuList['third']
  363. ),
  364. array(
  365. 'name' => '校本作业',
  366. 'url' => $this->createUrl("homework/index"),
  367. 'button_active' => inArray($urlInfo,$menuList['homework']),
  368. 'is_show' => true,
  369. 'all_nav'=>$menuList['homework']
  370. ),
  371. array(
  372. 'name' => '导入成绩',
  373. 'url' => $this->createUrl("record/importscore"),
  374. 'button_active' => inArray($urlInfo,$menuList['record']),
  375. 'is_show' => true,
  376. 'all_nav'=>$menuList['record']
  377. ),
  378. array(
  379. 'name' => '全学科统考',
  380. 'url' => $this->createUrl("cylet/index"),
  381. 'button_active' => inArray($urlInfo,$menuList['cylet']),
  382. 'is_show' => true,
  383. 'all_nav'=>$menuList['cylet']
  384. ),
  385. // array(
  386. // 'name' => '用户成绩推送设置',
  387. // 'url' => $this->createUrl("zhiliao/index"),
  388. // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
  389. // 'is_show' => true,
  390. // 'all_nav'=>$menuList['zhiliao']
  391. // ),
  392. );
  393. }
  394. $allNavUrl=array();
  395. foreach ($meauArr as $value){
  396. $allNavUrl=array_merge($allNavUrl,$value['all_nav']);
  397. }
  398. if(!inArray($urlInfo,$allNavUrl)){
  399. return $this->redirect(array($subjectHomePage[$sub_id]));
  400. }
  401. $subjectNameArr=Yii::app()->params['subjectId'];
  402. unset($subjectNameArr[20]);
  403. unset($subjectNameArr[6]);
  404. unset($subjectNameArr[51]);
  405. ?>
  406. <ul class="clearfix main-content-inner-ul">
  407. <?php foreach ($meauArr as $meau):?>
  408. <?php if(!$meau['is_show']) continue;?>
  409. <li class="pull-left">
  410. <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>
  411. <img src="/images/line.jpg" style="height:45px;" />
  412. </li>
  413. <?php endforeach;?>
  414. <li class="pull-right">
  415. <div class="tabs clearfix">
  416. <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==0){echo 'active';}}else{echo 'active';}?><!--" id="_third_shijuan">全学科</a>-->
  417. <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==1){echo 'active';}}?><!--" id="_baogao">导出报告</a>-->
  418. <div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
  419. <div class="has-sel fl"><?php echo isset(Yii::app()->params["subjectId"][$sub_id])?Yii::app()->params["subjectId"][$sub_id]:'数学'?></div>
  420. <div class="sel-opt fl">
  421. 切换学科
  422. <?php if($subject){?>
  423. <!-- <div class="points"></div>-->
  424. <?php }?>
  425. </div>
  426. <div class="sel-cons" style="z-index:6;background-color: #fff;height:500px;overflow: auto">
  427. <?php foreach ($subjectNameArr as $_subId => $_subName):?>
  428. <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>
  429. <?php endforeach;?>
  430. </div>
  431. </div>
  432. </div>
  433. </li>
  434. </ul>
  435. <script type="text/javascript">
  436. $(document).ready(function() {
  437. $(".sel-opt,.sel-cons").mouseover(function () {
  438. $(".sel-cons").show();
  439. }).mouseout(function () {
  440. $(".sel-cons").hide();
  441. });
  442. $(".sc-lis2").click(function () {
  443. var sub_id = parseInt($(this).attr('val'));
  444. var data = {
  445. subjectId: sub_id
  446. };
  447. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
  448. if (flags) {
  449. console.log(sub_id);
  450. //location.reload(); }elseif(in_array($sub_id,array(8,9,12,13,14,15,16,17))){
  451. // var url = "<?php echo $this->createUrl("print/index");?>";
  452. var sArr=[3,6,51,8,12,13];
  453. if($.inArray(sub_id,sArr)!=-1){
  454. var url = "<?php echo $this->createUrl("print/index");?>";
  455. }else{
  456. var url = "<?php echo $this->createUrl("third/index");?>";
  457. }
  458. location.href = url;
  459. } else {
  460. alert('网络异常');
  461. }
  462. });
  463. $('.has-sel').text($(this).text());
  464. $(".sel-cons").hide();
  465. });
  466. });
  467. </script>