123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #0155fe;
- border-radius: 15px;
- }
- .has-sel{
- background: #0155fe;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .sel-opt{
- width: 50%;
- position: relative;
- color: #0155fe;
- line-height: 30px;
- text-indent: 6px;
- cursor: pointer;
- }
- .sel-opt:after{
- content: '';
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-top: 8px solid #0155fe;
- position: absolute;
- right: 12px;
- top: 12px;
- }
- // .sel-opt select{
- // width: 100%;
- // height: 30px;
- // background: #F2F2F2;
- // color: #01B677;
- // text-indent: 6px;
- // font-size: inherit;
- // border-top-right-radius: 15px;
- // border-bottom-right-radius: 15px;
- // cursor: pointer;
- // }
- // .sel-opt select option{
- // position: relative;
- // }
- .points{
- position: absolute;
- top: -2px;
- right: 0;
- width: 10px;
- height: 10px;
- background: #F01516;
- border-radius: 50%;
- }
- .sel-cons{
- border: 1px solid #0155fe;
- width: 50%;
- position: absolute;
- right: 0;
- top: 30px;
- text-indent: 10px;
- display: none;
- }
- .sc-lis2{
- line-height: 30px;
- cursor: pointer;
- }
- .sc-lis2 span{
- position: relative;
- }
- .sc-lis2 .points{
- top: 2px;
- right: -16px;
- }
- .subject-change{
- margin:8px 11px 0 0;display: block
- }
- .subject-change-no{
- margin:8px 11px 0 0;display: none
- }
- </style>
- <?php
- $sub_id = isset(Yii::app()->session['session_subject_id']) ? Yii::app()->session['session_subject_id']:0;
- $duo_sub_id = isset(Yii::app()->session['session_duoxueke_subject_id']) ? Yii::app()->session['session_duoxueke_subject_id']:0;
- $testFlag = isset(Yii::app()->session['testFlag'])?Yii::app()->session['testFlag']:0;
- $printType = isset($printType)?$printType:'';
- $subject = isset($subject)?$subject:array();
- $urlInfoAll = Yii::app()->request->getPathInfo();
- $urlInfo = '';
- if($urlInfoAll){
- $urlInfoArr = explode('/',$urlInfoAll);
- if(isset($urlInfoArr[0]) && isset($urlInfoArr[1])){
- $urlInfo = strtolower($urlInfoArr[0]).'/'.strtolower($urlInfoArr[1]);
- }
- $urlType = '';
- foreach ($urlInfoArr as $_url_k => $_url_v) {
- if ($_url_v == 'type' && isset($urlInfoArr[$_url_k + 1])) {
- $urlType = $urlInfoArr[$_url_k + 1];
- }
- }
- if(count($urlInfoArr) > 4){
- $urlInfoArr = array_slice($urlInfoArr,0,4);
- }
- $urlInfoAll = implode('/',$urlInfoArr);
- }
- $basicSubject=$this->basicSubject;
- unset($basicSubject[18]);
- unset($basicSubject[19]);
- $subjectNameArr = array(
- 3 => '数学',
- 8 => '英语',
- 9 => '语文',
- 12 => '物理',
- 13 => '化学',
- 14 => '生物',
- 15 => '政治',
- 16 => '历史',
- 17 => '地理',
- 18 => '理综',
- 19 => '文综',
- );
- $subjectNameArr=Yii::app()->params['subjectId'];
- unset($subjectNameArr[20]);
- unset($subjectNameArr[6]);
- unset($subjectNameArr[51]);
- $_num='';
- $use_version = '';
- if(isset(Yii::app()->session['coachInfo']->use_version))
- {
- $use_version = Yii::app()->session['coachInfo']->use_version;
- }else
- {
- $use_version = Yii::app()->session['coachInfo']['use_version'];
- }
- if(!$use_version)
- {
- $use_version = 100;
- }
- $version_number = implode('',explode('.',$use_version));
- if(strlen($version_number)<7)
- {
- for($i=0;$i<7-strlen($version_number);$i++)
- {
- $_num.='0';
- }
- }
- $version_number=(int)$version_number.$_num;
- $menuList=array(
- //打印试卷
- 'print'=>array('print/index','print/class_exam','print/change','print/changescan','print/modifythirdexam','print/gettaskdetail'),
- //校本作业
- 'homework'=>array('homework/index','homework/exam_list','homework/change'),
- //导入成绩
- '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'),
- //第三方
- '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'),
- //统考
- 'cylet'=>array('cylet/index','cylet/edit'),
- //还原考试
- 'restore'=>array('print/restore'),
- //用户成绩推送设置
- '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'),
- );
- $subjectHomePage=array();
- //新版本菜单
- if(Yii::app()->params['section']==0){
- $subjectHomePage[$sub_id]='third/index';
- $meauArr = array(
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,$menuList['third']),
- 'is_show' => true,
- 'all_nav'=>$menuList['third']
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,$menuList['record']),
- 'is_show' => true,
- 'all_nav'=>$menuList['record']
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,$menuList['cylet']),
- 'is_show' => true,
- 'all_nav'=>$menuList['cylet']
- ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,$menuList['restore']),
- 'is_show' => $testFlag == 1 ,
- 'all_nav'=>$menuList['restore']
- ),
- );
- }elseif(Yii::app()->params['section']==3){
- //中职
- $subjectHomePage[$sub_id]='print/index';
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,$menuList['print']),
- 'is_show' => true,
- 'all_nav'=>$menuList['print']
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,$menuList['third']),
- 'is_show' => true,
- 'all_nav'=>$menuList['third']
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,$menuList['record']),
- 'is_show' => true,
- 'all_nav'=>$menuList['record']
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,$menuList['cylet']),
- 'is_show' => true,
- 'all_nav'=>$menuList['cylet']
- ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,$menuList['restore']),
- 'is_show' => $testFlag == 1 ,
- 'all_nav'=>$menuList['restore']
- ),
- );
- }elseif (in_array($sub_id, Yii::app()->params['mathSubjectId'])) {
- $subjectHomePage[$sub_id]='print/index';
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,$menuList['print']),
- 'is_show' => true,
- 'all_nav'=>$menuList['print']
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,$menuList['third']),
- 'is_show' => true,
- 'all_nav'=>$menuList['third']
- ),
- array(
- 'name' => '校本作业',
- 'url' => $this->createUrl("homework/index"),
- 'button_active' => inArray($urlInfo,$menuList['homework']),
- 'is_show' => true,
- 'all_nav'=>$menuList['homework']
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,$menuList['record']),
- 'is_show' => true,
- 'all_nav'=>$menuList['record']
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,$menuList['cylet']),
- 'is_show' => true,
- 'all_nav'=>$menuList['cylet']
- ),
- // array(
- // 'name' => '用户成绩推送设置',
- // 'url' => $this->createUrl("zhiliao/index"),
- // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
- // 'is_show' => true,
- // 'all_nav'=>$menuList['zhiliao']
- // ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,array('print/restore')),
- 'is_show' => $testFlag == 1,
- 'all_nav'=>$menuList['restore']
- ),
- );
- }elseif(in_array($sub_id,array(8,12,13))){
- $subjectHomePage[$sub_id]='print/index';
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,$menuList['print']),
- 'is_show' => true,
- 'all_nav'=>$menuList['print']
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,$menuList['third']),
- 'is_show' => true,
- 'all_nav'=>$menuList['third']
- ),
- array(
- 'name' => '校本作业',
- 'url' => $this->createUrl("homework/index"),
- 'button_active' => inArray($urlInfo,$menuList['homework']),
- 'is_show' => true,
- 'all_nav'=>$menuList['homework']
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,$menuList['record']),
- 'is_show' => true,
- 'all_nav'=>$menuList['record']
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,$menuList['cylet']),
- 'is_show' => true,
- 'all_nav'=>$menuList['cylet']
- ),
- // array(
- // 'name' => '用户成绩推送设置',
- // 'url' => $this->createUrl("zhiliao/index"),
- // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
- // 'is_show' => true,
- // 'all_nav'=>$menuList['zhiliao']
- // ),
- );
- if( Yii::app()->params['section']==0){
- //初中学段
- unset($meauArr[0]);
- }
- }else{
- $subjectHomePage[$sub_id]='print/index';
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,$menuList['print']),
- 'is_show' => true,
- 'all_nav'=>$menuList['print']
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,$menuList['third']),
- 'is_show' => true,
- 'all_nav'=>$menuList['third']
- ),
- array(
- 'name' => '校本作业',
- 'url' => $this->createUrl("homework/index"),
- 'button_active' => inArray($urlInfo,$menuList['homework']),
- 'is_show' => true,
- 'all_nav'=>$menuList['homework']
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,$menuList['record']),
- 'is_show' => true,
- 'all_nav'=>$menuList['record']
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,$menuList['cylet']),
- 'is_show' => true,
- 'all_nav'=>$menuList['cylet']
- ),
- // array(
- // 'name' => '用户成绩推送设置',
- // 'url' => $this->createUrl("zhiliao/index"),
- // 'button_active' => inArray($urlInfo,$menuList['zhiliao']),
- // 'is_show' => true,
- // 'all_nav'=>$menuList['zhiliao']
- // ),
- );
- }
- $allNavUrl=array();
- foreach ($meauArr as $value){
- $allNavUrl=array_merge($allNavUrl,$value['all_nav']);
- }
- if(!inArray($urlInfo,$allNavUrl)){
- return $this->redirect(array($subjectHomePage[$sub_id]));
- }
- $subjectNameArr=Yii::app()->params['subjectId'];
- unset($subjectNameArr[20]);
- unset($subjectNameArr[6]);
- unset($subjectNameArr[51]);
- ?>
- <ul class="clearfix main-content-inner-ul">
- <?php foreach ($meauArr as $meau):?>
- <?php if(!$meau['is_show']) continue;?>
- <li class="pull-left">
- <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>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php endforeach;?>
- <li class="pull-right">
- <div class="tabs clearfix">
- <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==0){echo 'active';}}else{echo 'active';}?><!--" id="_third_shijuan">全学科</a>-->
- <!-- <a href="javascript:;" class="fl --><?php //if(isset($_GET['_tab'])){if($_GET['_tab'] ==1){echo 'active';}}?><!--" id="_baogao">导出报告</a>-->
- <div class="tab-con clearfix pull-right" style="margin:8px 11px 0 0">
- <div class="has-sel fl"><?php echo isset(Yii::app()->params["subjectId"][$sub_id])?Yii::app()->params["subjectId"][$sub_id]:'数学'?></div>
- <div class="sel-opt fl">
- 切换学科
- <?php if($subject){?>
- <!-- <div class="points"></div>-->
- <?php }?>
- </div>
- <div class="sel-cons" style="z-index:6;background-color: #fff;height:500px;overflow: auto">
- <?php foreach ($subjectNameArr as $_subId => $_subName):?>
- <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>
- <?php endforeach;?>
- </div>
- </div>
- </div>
- </li>
- </ul>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".sel-opt,.sel-cons").mouseover(function () {
- $(".sel-cons").show();
- }).mouseout(function () {
- $(".sel-cons").hide();
- });
- $(".sc-lis2").click(function () {
- var sub_id = parseInt($(this).attr('val'));
- var data = {
- subjectId: sub_id
- };
- $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
- if (flags) {
- console.log(sub_id);
- //location.reload(); }elseif(in_array($sub_id,array(8,9,12,13,14,15,16,17))){
- // var url = "<?php echo $this->createUrl("print/index");?>";
- var sArr=[3,6,51,8,12,13];
- if($.inArray(sub_id,sArr)!=-1){
- var url = "<?php echo $this->createUrl("print/index");?>";
- }else{
- var url = "<?php echo $this->createUrl("third/index");?>";
- }
- location.href = url;
- } else {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- });
- </script>
|