123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("#class").change(function(){
- var classId = jQuery(this).val();
- location.href = "<?php echo $this->createUrl("vacationhomework/classes?classId=");?>"+classId;
- });
- });
- </script>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("print/index",array('type'=>'wp'));?>"' class="button button_normal button_group button_arrow <?php if($printType == 'wp'){echo 'button_active';}?>" data-button="red">打印试卷</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <!--<button onclick='' class="button button_normal button_group button_arrow <?php if($printType == 'wtb'){echo 'button_active';}?>" data-button="red">下载错题本</button>-->
- <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow <?php if($printType == 'wtb'){echo 'button_active';}?>" data-button="red">下载错题本</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <!--<button onclick='ccc()' class="button button_normal button_group button_arrow <?php if($printType == 'isp'){echo 'button_active';}?>" data-button="red">下载提分方案</button>-->
- <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'isp'));?>"' class="button button_normal button_group button_arrow <?php if($printType == 'isp'){echo 'button_active';}?>" data-button="red">下载提分方案</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow <?php if($printType == ''){echo 'button_active';}?>" data-button="red">导出报告</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("vacationhomework/classes");?>"' class="button button_normal button_group button_arrow <?php if($printType == 'vh'){echo 'button_active';}?>" data-button="red">下载暑假作业</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
- </li>
- </ul>
- <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("print/index");?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy">
- <input type="hidden" name="type" value="<?php echo $printType;?>" />
- <select class="form-control" id="class" name="classId">
- <option value="">全部班级</option>
- <?php foreach($classes as $class){?>
- <option <?php if($classId == $class["class_id"]) echo "selected";?> value="<?php echo $class["class_id"];?>"><?php echo $class["class_name"];?></option>
- <?php }?>
- </select>
- </div>
- </div>
- </form>
-
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <th>名称</th>
- <th>班级</th>
- <th>生成时间</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($rs)):foreach($rs as $cl):?>
- <tr>
- <td><?php echo "{$cl['class_name']} {$cl['semester_name']} 暑假作业";?></td>
- <td><?php echo $cl['class_name'];?></td>
- <td><?php if(!empty($cl['generate_time'])){ echo date('Y-m-d H:i',$cl['generate_time']);}?></td>
- <td>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载暑假作业" onclick="javascript:location.href='<?php echo $this->createUrl('vacationhomework/students?classId=').$cl['class_id'];?>'"></span>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="5">暂无数据!</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' => $pager,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$pager->rowsCount.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
-
- <!--上传模板弹窗-->
-
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
-
- // 确认上传成绩
- function uploadConfirm(classId, examId) {
- //if (confirm('您确定已上传成绩了吗?')) {
- layer.msg('您确定已上传成绩了吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
- type: "POST",
- data: {
- classId: classId,
- examId: examId
- },
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('确认中...', {icon: 16,time: 20000});
- },
- dataType: "JSON",
- success: function(data) {
- if (data.status == 1) {
- var index = layer.msg();
- layer.close(index);
-
- layer.msg('确认成功!');
- location.reload();
- } else {
- alert(data.error);
- }
- },
- complete:function(){
- var index = layer.msg();
- layer.close(index);
- },
- error:function(){
- var index = layer.msg();
- layer.close(index);
- }
- });
- }
- });
-
-
- //}
- }
- // 打印错题本
- function printBook(cid,eid,type){
- if (!cid || !eid || !type) {
- layer.msg("打印参数有误");return;
- }
-
- var message = '';
- var objUrl = '';
- if (type == 1) {
- message = "您确定要下载该班级错题本嘛!";
- objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
- } else{
- message = "您确定要下载该班级提分方案嘛!";
- objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
- }
-
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
-
- layer.msg("下载中请稍后...");
-
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
-
- location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
- }
- });
- }
-
- // 上传试卷模板
- function uploadTemplate(eid,name){
- if (!eid) {
- layer.msg('操作失败!');
- return false;
- }
- $.post("<?php echo $this->createUrl('print/verifyTpl');?>",{eid:eid},function(data){
- var obj = JSON.parse(data);
- var html ='<div class="layer_notice" style="padding:5px;">';
- html +='<table class="table table-striped table-bordered table-hover ">';
- html +='<thead class="thin-border-bottom">';
- html +='<tr>';
- html +='<th>试卷名称</th>';
- html +='<th>是否上传</th>';
- html +='<th>操作</th>';
- html +='</tr>';
- html +='</thead>';
- html +='<tbody class="content_tbody">';
- if (obj.success == 1) {
- html +='<td>'+name+'</td><td><span style="color:red;">已上传</span></td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
- } else {
- html +='<td>'+name+'</td><td id="alreadUpload">未上传</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
- }
- html +='</tbody>';
- html +='</table>';
- html +='<span style="width:582px;display:inline-block;text-align:center;">';
- html +='<button class="btn btn-success btn-sm" onclick="uploadWord()"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
- html +='</span>';
- html +='<input type="hidden" id="mpEid" value="'+eid+'">';
- html +='</div>';
- layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ['600px', '300px'], //宽高
- content: html
- });
- });
- }
-
- function uploadWord(paramEid) {
- var paramEid = $('#mpEid').val();
- if (!paramEid) {
- layer.msg('没找到周周练ID!');
- return false;
- }
- var obj_file = $("#word_file").val();
- if (!obj_file) {
- layer.msg('请选择上传文件');
- return false;
- }
-
- var extStart = obj_file.lastIndexOf('.');
- var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
- if (extName != ".dotx") {
- layer.msg('模板格式有误,请上传dotx格式word!');
- return false;
- }
- $.ajaxFileUpload({
- url: "<?php echo $this->createUrl('print/uploadTpl');?>", //用于文件上传的服务器端请求地址
- secureuri: false, //是否需要安全协议,一般设置为false
- fileElementId: 'word_file', //文件上传域的ID
- dataType: 'text', //返回值类型 一般设置为json
- data:{"eid":paramEid},
- success: function (data, status){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- });
- $("#alreadUpload").html('<span style="color:red;">已上传</span>');
-
- } else {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 1,
- }, function(){
- layer.closeAll();
- });
- }
- });
- return false;
- }
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
-
- function print(cid,eid,tid,fg){
- if (!cid || !eid) return false;
- var msg = '';
- if (tid == 0) {
- if (fg == 1) {
- msg = '打印答题卡';
- } else {
- msg = '您确定要打印该试卷嘛?';
- }
- } else if (tid == 1) {
- msg = '您确定要打印该错题本嘛?';
- } else if (tid == 2) {
- msg = '您确定要打印该提分册嘛?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- ajaxPrint(cid, eid, tid);
- }
- });
- }
-
- function ajaxPrint(cid, eid, tid) {
- $.ajax({
- url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
- type:"post",
- data:{cid:cid,eid:eid,tid:tid},
- dataType: "json",
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('打印中', {icon: 16,time: 20000});
- },
- success:function(obj){
- var index = layer.msg();
- layer.close(index);
-
- if (obj.success == 1) {
- if (tid == 0) {//console.log(JSON.stringify(obj.message));
- evaluationClient.printPaper(JSON.stringify(obj.message));
- //alert('提交打印试卷成功!');
- } else if (tid == 1) {
- evaluationClient.printCTB(JSON.stringify(obj.message));
- //alert('提交打印错题本成功!');
- } else if (tid == 2) {
- evaluationClient.printTFFA(JSON.stringify(obj.message));
- //alert('提交打印提分册成功!');
- } else {
- layer.msg('操作错误!');
- }
- location.reload();
- } else {//alert(obj.message);
- layer.msg(obj.message);
- }
- },
- complete:function(){
- //layer.msg('打印失败!');
- //var index = layer.msg();
- //layer.close(index);
- },
- error:function(){
- //var index = layer.msg();
- //layer.close(index);
- }
- });
- }
-
- // 生成试卷模板
- function createTemplate (eid,flag){
- if (!eid) {
- layer.msg('未找到周周练id');
- }
- var msg = '';
- if (flag == 2) {
- msg = '您确定要下载试卷嘛?';
- } else {
- msg = '您确定要生成模板嘛?';
- }
-
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl('print/createtempelate');?>',{eid:eid},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- if (flag == 2) {
- evaluationClient.CreatePaperTiGan(JSON.stringify(obj.object));
- } else {
- evaluationClient.createPaper(JSON.stringify(obj.object));
- }
- } else {
- layer.msg(obj.message);
- }
- });
- }
- });
- }
- </script>
|