123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <style>
- .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
- .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
- </style>
- <link rel="stylesheet" href="/css/paperManage.css">
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content" style="margin-top:15px;">
- <div class="select-cons">
- <form method="get" id="form1" action="<?php echo $this->createUrl("export/Pastacdemicrs");?>">
- <select id="semester" name="semester">
- <?php foreach ($sem_arr as $sem_id => $sem_name):?>
- <option value="<?php echo $sem_id;?>" <?php if($current_sem_id == $sem_id) echo "selected";?>><?php echo $sem_name;?></option>
- <?php endforeach;?>
- </select>
- <select id="grade" name="grade">
- <option value=0>请选择年级</option>
- <option value="1" <?php if($current_grade_id == 1) echo "selected";?>>高一</option>
- <option value="2" <?php if($current_grade_id == 2) echo "selected";?>>高二</option>
- <option value="3" <?php if($current_grade_id == 3) echo "selected";?>>高三</option>
- </select>
- <select id="class" name="class">
- <?php if ($class_arr):?>
- <option value=0 >请选择班级</option>
- <?php foreach ($class_arr as $class_id => $class_name): ?>
- <option value="<?php echo $class_id; ?>" <?php if($current_class_id == $class_id) echo "selected";?>><?php echo $class_name; ?></option>
- <?php endforeach; ?>
- <?php else: ?>
- <option value=0 >请选择班级</option>
- <?php endif;?>
- </select>
- <div class="test-name">
- <input type="text" placeholder="请输入考试名称" name='exam_name' class="test-name-msg" value="<?php if ($current_exam_name) echo $current_exam_name;?>">
- </div>
- <div class="search-btn">
- <input type="button" value="搜索" id="search">
- </div>
- </form>
- </div>
- <div class="hte-tables">
- <table class="history-teacher-exolaincase" cellspacing="0" cellpadding="0" >
- <thead>
- <td class="paper-title">试卷名称</td>
- <td class="paper-class">班级</td>
- <td class="paper-status">状态</td>
- <td class="paper-opt">操作</td>
- </thead>
- <?php if (!$exam_data):?>
- <tr><td colspan="4">暂无已完成阅卷的考试!</td></tr>
- <?php else:?>
- <?php foreach($exam_data as $exam_id=>$v):?>
- <tr>
- <td><?php echo $v['exam_name'];?></td>
- <td><?php echo $v['class_name'];?></td>
- <td><?php echo $v['status'];?></td>
- <td><img src="/images/download.png" alt="" class="download-img"><a onclick="downpdf(this,<?php echo "'".$exam_id."'" ?>, <?php echo "'".$v['class_id']."'"; ?>)" href="javascript:void(0);">教学宝下载</a></td>
- </tr>
- <?php endforeach;?>
- <?php endif;?>
- </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' => $pager,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$page_total.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- </div>
- </div>
- <div class="loading-pop" style="display:none;">
- <div class="loading-pop-msg">正在生成中,请稍候···</div>
- </div>
- <script type="text/javascript">
- //搜索按钮
- $("#search").click(function(){
- $("#form1").submit();
- });
- //根据学期选择
- $("#semester").change(function(){
- var gradeObj = $("#grade");
- var html = "<option value=0>请选择年级</option><option value='1'>高一</option><option value='2'>高二</option><option value='3'>高三</option></option>";
- gradeObj.empty();
- gradeObj.append(html);
- var classObj = $("#class");
- var html = "<option value=0>请选择班级</option>";
- classObj.empty();
- classObj.append(html);
- });
- // 根据年级筛选班级
- $("#grade").change(function(){
- var grade = $(this).val();
- if (!grade) {
- var classObj = $("#class");
- var html = "<option value=0>请选择班级</option>";
- classObj.empty();
- classObj.append(html);
- return;
- }
- var semester_id = $("#semester").val();
- $.post(
- '<?php echo $this->createUrl("export/getGradeClass");?>',{"grade": grade,"semester_id":semester_id},function(data){
- data = JSON.parse(data);
- if(data.success == 1){
- var classObj = $("#class");
- var html = "<option value=0>全部班级</option>";
- classObj.empty();
- $.each(data.message,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- classObj.append(html);
- }
- }
- );
- });
- // 下拉列表模拟
- $('.inp-text').click(function(){
- if ($(this).next().is(':hidden')){
- $(this).next().show();
- } else {
- $(this).next().hide();
- }
- });
- // 点下拉列表选项
- $('.select-con li').click(function(){
- $(this).closest('.select-con').hide();
- $(this).closest('.prev-class').find('.inp-text').text($(this).text());
- $(this).closest('.prev-class').find('.hid-class-msg').val($(this).attr("id"));
- });
- // 点击空白处下拉列表消失
- $(document).click(function(e){
- var targetNode = $(e.target).closest(".inp-text");
- if (targetNode.length>0){
- return;
- }else{
- $(".select-con").hide();
- }
- });
- function downpdf(self,examId, classId) {
- $(".loading-pop").show();
- $.get("<?php echo $this->createUrl("export/academicr") ?>", {examId: examId, classId: classId,'isFromPast':1}, function(data) {
- var m = JSON.parse(data);
- if (m.status == 0)
- {
- if (m.is_create == 1) { //直接获取已经生成的文件
- setTimeout(function() {
- $(".loading-pop").hide();
- }, 500);
- } else {
- $(self).parent().prev().text('已生成'); //表示文件未生成,生成一下
- $(".loading-pop").hide();
- }
- location.href="<?php echo $this->createUrl("export/down_load")?>?examId="+examId;
- } else
- {
- setTimeout(function() {
- $(".loading-pop").hide();
- }, 500);
- alert(m.error);
- }
- });
- }
- </script>
|