123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589 |
- <script type="text/javascript">
- function in_array(search, array){
- for(var i in array){
- if(array[i]==search){
- return true;
- }
- }
- return false;
- }
- testFlag = "<?php echo $this->testFlag;?>";
- customTplsIds = new Array();
- var i = 0;
- <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
- customTplsIds[i] = "<?php echo $tplId;?>";
- i++;
- <?php }?>
- jQuery(document).ready(function(){
- // 根据年级筛选班级
- jQuery("#grade").change(function(){
- var grade = $(this).val();
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
- data = JSON.parse(data);
- if(data.success == 1){
- var classObj = $("#class");
- var html = "<option value=''>全部班级</option>";
- classObj.empty();
- $.each(data.message,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- classObj.append(html);
- }
- }
- );
- });
- });
- </script>
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- }
- .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-lis{
- line-height: 30px;
- cursor: pointer;
- }
- .sc-lis span{
- position: relative;
- }
- .sc-lis .points{
- top: 2px;
- right: -16px;
- }
- .click-sc:focus {
- color: #fff;
- }
- .click-sc:hover {
- color: #fff;
- }
- .create-third{
- position: absolute;
- right: 6px;
- top: 10px;
- }
- .tab-con-btn{
- height: 31px;
- width: 210px;
- background: #F2F2F2;
- border: 1px solid #2977ff;
- border-radius: 15px;
- display: inline-block;
- text-align: center;
- }
- .tab_btn{
- display: inline-block;
- width:100px;
- padding: 0;
- border: 0;
- margin:0;
- outline:none;
- background: #F2F2F2;
- border-radius: inherit;
- }
- .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;
- }
- .has-sel-1{
- background: #2977ff;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-right-radius: 15px;
- border-bottom-right-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .icon {
- display: inline-block;
- background: center/contain no-repeat;
- width: 25px;
- height: 25px;
- cursor: pointer;
- vertical-align: middle;
- }
- .icon-edit {
- background-image: url("/images/edit.png")
- }
- .table-hover>tbody>tr:hover {
- background-color: #E6F1EC
- }
- </style>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <link rel="stylesheet" href="/fonts/shangchuan/iconfont.css" />
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <form method="get" id="form1" action="<?php echo $this->createUrl("third/index");?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy">
- <div class="tab-con-btn">
- <?php
- if(isset($list_type) && $list_type==1):
- ?>
- <button class="tab_btn " >阅卷试卷</button>
- <button class="tab_btn has-sel-1" >导入成绩试卷</button>
- <?php
- else:
- ?>
- <button class="tab_btn has-sel" >阅卷试卷</button>
- <button class="tab_btn " >导入成绩试卷</button>
- <?php
- endif;
- ?>
- </div>
- <input type="hidden" name="list_type" value="<?php if(isset($list_type)){echo $list_type;}else{echo 0;}?>" />
- <input type="hidden" name="type" value="<?php echo $printType;?>" />
- <input type="checkbox" name="display" style="margin: -1px 2px 0 0;display:inline-block;vertical-align: middle;width:15px;height:15px;" value="1" <?php if($display === '1') echo "checked";?>>显示隐藏试卷
- <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </div>
- </div>
- </form>
- <button class="label-primary-s bth-s create-third" data-button="red">创建试卷</button>
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
- <thead>
- <tr>
- <th>名称</th>
- <th>创建日期</th>
- <th>考试日期</th>
- <th>题量</th>
- <th>满分</th>
- <th>考试班级</th>
- <th>上传进度</th>
- <th>状态</th>
- <th >操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):foreach($printList as $cl):?>
- <tr>
- <td style="max-width:260px">
- <?php
- if($cl['is_new']==0)
- {
- echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
- }
- echo $cl['exam_name'];
- ?>
- <!-- <a href="<?php /*echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id']))*/?>"><?php /*echo $cl['print_name'];*/?></a>-->
- </td>
- <td><?php if(!empty($cl['create_time'])){ echo date('Y-m-d',$cl['create_time']);}?></td>
- <td><?php if(!empty($cl['examDate'])){ echo date('Y-m-d',$cl['examDate']);}?></td>
- <td><?php if(!empty($cl['totals'])){ echo $cl['totals'];}?></td>
- <td><?php if(!empty($cl['total_score'])){ echo $cl['total_score'];}?></td>
- <td><?php if(!empty($cl['class_count'])){ echo $cl['class_count'];}?></td>
- <td><?php if(!empty($cl['upload_count'])){ echo $cl['upload_count'];}?></td>
- <td><?php if(!empty($cl['upload_status'])){ echo $cl['upload_status'];}?></td>
- <td style="width:265px;">
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('third/exam_list',array('exam_group_id'=>$cl['exam_group_id'],'branch'=>$cl['branch'],'grade'=>$class_grade[$cl['class_id']],'upload_status'=>$cl['upload_status']));?>'"></span>
- <span class="iconfont click-sc addbx score-import" rel="<?php echo $cl['exam_group_id'] ?>" aria-hidden="true" title="上传成绩" onclick=""></span>
- <?php
- if($cl['upload_status']!='已上传成绩'):
- ?>
- <i class="icon icon-edit" rel="<?php echo $cl['exam_group_id'] ?>" title="编辑"></i>
- <?php endif;?>
- <?php if($cl['is_display'] == 1):?>
- <span class="iconfont click-sc click-tc addbx" aria-hidden="true" title="恢复试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',0)"></span>
- <?php else:?>
- <span class="iconfont click-sc click-delete addbx" aria-hidden="true" title="隐藏试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',1)"></span>
- <?php endif;?>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="10">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-6">
-
- </div>
- <div class="col-xs-6">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- 'firstPageLabel'=> '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$page_total.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!--上传模板弹窗-->
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- /*var str = '<div class="points"></div>';
- $(".sc-lis").each(function(){
- if($(this).find(".points").length>0){
- $(".sel-opt").append(str);
- }
- });*/
- $('.score-import').click(function(){
- $egid=$(this).attr('rel');
- $(location).attr('href',"<?php echo Yii::app()->createUrl('third/import')?>?examgroupid="+$egid);
- });
- $('.icon-edit').click(function(){
- $egid=$(this).attr('rel');
- $(location).attr('href',"<?php echo Yii::app()->createUrl('third/editthirdunderline')?>?examgroupid="+$egid);
- });
- $(".sel-opt,.sel-cons").mouseover(function(){
- $(".sel-cons").show();
- }).mouseout(function(){
- $(".sel-cons").hide();
- });
- $(".sc-lis").click(function(){
- var data = {
- subjectId : $(this).attr('val')
- };
- $.post("<?php echo Yii::app()->createUrl('third/setSubjectId')?>",data,function(flags){
- if(flags)
- {
- location.reload();
- }else
- {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- $(".ruanyun").click(function(){
- var exam_id = $(this).attr('exam_id');
- layer.msg("确定发送吗?学生是否全部上传成绩", {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
- type: "POST",
- dataType: "json",
- data:{ examId: exam_id
- },
- success: function (data){
- if(data.status == 1){
- layer.msg('发送成功',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else if(data.status == 2){
- layer.msg('发送失败,未上传成绩',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('发送失败',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- });
- $(".create_sheet").click(function(){
- var exam_group_id = $(this).attr("exam_group_id");
- var sheet_id = $(this).attr("sheet_id");
-
- if(exam_group_id>0){
- $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
- $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- layer.msg('已上传成绩,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==3)
- {
- layer.msg('已发送标注,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==0)
- {
- evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
- }
- });
- }
- });
- $(".create_sheet_subject").click(function(){
- var exam_group_id = $(this).attr("exam_group_id");
- var sheet_id = $(this).attr("sheet_id");
- if(exam_group_id>0){
- $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
- $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status==1)
- {
- layer.msg('已上传成绩,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==3)
- {
- layer.msg('已发送标注,无法修改!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==2)
- {
- layer.msg('非法考试!',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- if(m.status==0)
- {
- evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
- }
- });
- }
- });
- //打印
- $(".print_sheet").click(function(){
- var exam_group_id = $(this).attr('exam_group_id');
- if(!exam_group_id)
- {
- layer.msg('非法考试!');
- return false;
- }
- $.post("<?php echo Yii::app()->createUrl('third/print_paper')?>",{exam_group_id:exam_group_id},function(rs){
- var m = JSON.parse(rs);
- if(m.status)
- {
- evaluationClient.CreateDiSanFang(m.result);
- }
- });
- });
- $('.tab_btn').click(function(){
- $('input[name="list_type"]').val($(this).index());
- });
- $('.create-third').click(function(){
- var href='';
- <?php
- if(isset($list_type) && $list_type==1){
- echo "href='".$this->createUrl("third/thirdview_under_line")."';";
- } else{
- if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(3,6))){
- echo "href='".$this->createUrl("third/thirdview")."';";
- }else{
- echo "href='".$this->createUrl("third/thirdview_duo")."';";
- }
- }
- ?>
- window.location=href;
- });
- });
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- // 隐藏试卷
- function oprateExam(examGroupId,flag){
- if (examGroupId) {
- layer.msg('未找到周周练id',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- var msg = '您确定要隐藏该试卷吗?';
- if (flag == 0) {
- msg = '您确定要恢复该试卷吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- location.reload();
- } else {
- layer.msg(obj.message,{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- // layer.msg(obj.message);
- }
- });
- }
- });
- }
- </script>
|