123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- }
- .has-sel{
- background: #01B677;
- 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: #01B677;
- 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 #01B677;
- 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 #01B677;
- 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);
- }
- $subjectNameArr = array(
- 3 => '数学',
- 8 => '英语',
- 9 => '语文',
- 12 => '物理',
- 13 => '化学',
- 14 => '生物',
- 15 => '政治',
- 16 => '历史',
- 17 => '地理',
- 18 => '理综',
- 19 => '文综',
- );
- if (in_array($sub_id, Yii::app()->params['mathSubjectId'])) {
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
- 'is_show' => true,
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,array('third/index','third/assist','third/exam_list','third/change','third/thirdview','third/import')),
- 'is_show' => true,
- ),
- array(
- 'name' => '上传试卷',
- 'url' => $this->createUrl("upload/index"),
- 'button_active' => inArray($urlInfo,array('upload/index')),
- 'is_show' => true,
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
- 'is_show' => true,
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
- 'is_show' => true,
- ),
- array(
- 'name' => '联评考试',
- 'url' => $this->createUrl("print/united"),
- 'button_active' => inArray($urlInfo,array('print/united','print/class_exam_united','print/unitedtask')),
- 'is_show' => in_array($sub_id, Yii::app()->params['mathSubjectId'])?true:false,
- ),
- array(
- 'name' => '用户成绩推送设置',
- 'url' => $this->createUrl("zhiliao/index"),
- 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
- 'is_show' => true,
- ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,array('print/restore')),
- 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
- ),
- );
- }elseif($sub_id == 8){
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
- 'is_show' => true,
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,array('third/index','third/exam_list','third/change','third/assist','third/thirdview_under_line','third/editthirdunderLine','third/thirdview_duo')),
- 'is_show' => true,
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
- 'is_show' => true,
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
- 'is_show' => true,
- ),
- array(
- 'name' => '用户成绩推送设置',
- 'url' => $this->createUrl("zhiliao/index"),
- 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
- 'is_show' => true,
- ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,array('print/restore')),
- 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
- ),
- );
- }else{
- $meauArr = array(
- array(
- 'name' => '打印试卷',
- 'url' => $this->createUrl("print/index"),
- 'button_active' => inArray($urlInfo,array('print/index','print/class_exam','print/change','print/changescan')),
- 'is_show' => true,
- ),
- array(
- 'name' => '第三方试卷',
- 'url' => $this->createUrl("third/index"),
- 'button_active' => inArray($urlInfo,array('third/index','third/exam_list','third/change','third/assist','third/thirdview_under_line','third/editThirdUnderLine','third/thirdview_duo')),
- 'is_show' => true,
- ),
- array(
- 'name' => '导入成绩',
- 'url' => $this->createUrl("record/importscore"),
- 'button_active' => inArray($urlInfo,array('record/importscore','record/check','record/handle','record/handle_card','record/handle_existent')),
- 'is_show' => true,
- ),
- array(
- 'name' => '全学科统考',
- 'url' => $this->createUrl("cylet/index"),
- 'button_active' => inArray($urlInfo,array('cylet/index','cylet/edit')),
- 'is_show' => true,
- ),
- array(
- 'name' => '用户成绩推送设置',
- 'url' => $this->createUrl("zhiliao/index"),
- 'button_active' => inArray($urlInfo,array('zhiliao/index','zhiliao/exam_list','zhiliao/edit','zhiliao/upload','zhiliao/change','zhiliao/blacklist')),
- 'is_show' => true,
- ),
- array(
- 'name' => '还原考试',
- 'url' => $this->createUrl("print/restore"),
- 'button_active' => inArray($urlInfo,array('print/restore')),
- 'is_show' => $testFlag == 1 && !inArray($urlInfo,array('print/change','print/sub_index','export/index','upload/index')),
- ),
- );
- }
- ?>
- <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;">
- <?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 = $(this).attr('val');
- var data = {
- subjectId: sub_id
- };
- $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
- if (flags) {
- // location.reload();
- if (sub_id == 3 || sub_id == 6 || sub_id == 51 || sub_id == 8) {
- 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>
|