123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684 |
- <style>
- .nav-btns{
- margin: 10px 20px;
- }
- .nav-btns>a{
- display: inline-block;
- width: 120px;
- border: 1px solid #40c180;
- text-align: center;
- line-height: 30px;
- }
- .active{
- color: #fff;
- background-color: #40c180;
-
- }
- .btn-garder{
- margin-right: 10px;
- display: inline-block;
- width: 100px;
- border: none;
- text-align: center;
- line-height: 30px;
- color: #fff;
- background-color: #40c180;
- }
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- .btn_area button {
- border: none;
- background: #009965;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- .btn_area button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal-body .classes {
- margin-bottom: 10px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 20px;
- }
- .class-modal-1 {
- width: auto;
- background: #fff;
- border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head-1 {
- font-size: 14px;
- text-align: left;
- color:#fff;
- line-height:30px;
- background: #2977ff;
- padding-left:15px;
- }
- .class-modal-body-1{
- padding:15px;
- }
- .class-modal-body-1 h2,.class-modal-body-1 h3{
- font-size:14px;
- font-weight:normal;
- margin-top:10px;
- }
- .class-modal-body-1 h3 span{
- font-size:10px;
- color:#ccc;
- }
- .class-modal-body-1 label{
- display: inline-block;
- font-weight: normal;
- margin-right: 15px;
- height:30px;
- position: relative;
- }
- .class-modal-1 .icon-close-1{
- position: absolute;
- right: 10px;
- top:5px;
- }
- .class-modal-1 .class_area{
- height:115px;
- border:1px solid #ccc;
- padding:5px;
- overflow-y: auto;
- margin-bottom:15px;
- }
- .class-modal-1 .checkAll{
- position:absolute;
- right:5px;
- top:115px;
- }
- .class-modal-1 .subsection{
- }
- .class-modal-1 .btn p{color:#000;}
- .class-modal-1 .btn_area{
- padding: 10px;
- border-top: 1px solid #aab6aa;
- margin-top:10px;
- }
- .class-modal-1 .btn_area p{
- display: inline-block;
- }
- .class-modal-1 .btn_area button{
- margin-left:5px;
- }
- .class-modal-1 .btn_area .cancel{
- background: #fff;
- color:#000;
- border:1px solid #666;
- }
- .c-red-1 {
- color: #CC3300;
- font-size:10px;
- display: inline-block;
- position:absolute;
- left:15px;
- top:18px;
- }
- .vtm{vertical-align: middle;}
- .pointer{cursor: pointer;}
- .dib{display: inline-block;}
- .pdp-con .pop-opt-con{border-top: 1px solid #ddd;padding-top: 20px;}
- .tit-sub-intro{color: #666;}
- .tit-sub-intro span{font-size: 12px;}
- .subsection{width: 44px;height: 24px;border: 1px solid #ddd;text-align: center;font-size: 12px;}
- .reduce-btn,.add-btn{width: 16px;height: 16px;line-height: 16px;text-align: center;color: #16AE68;border: 1px solid #16AE68;border-radius: 3px;font-size: 16px;font-weight: bold;margin-right: 6px;}
- .reduce-btn.forbidden,.add-btn.forbidden{color: #bbb;border: 1px solid #bbb;cursor: no-drop;}
- .tab-con-btn {
- height: 31px;
- width: 210px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- display: inline-block;
- text-align: center;
- }
- .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;
- }
- .tab_btn {
- display: inline-block;
- width: 100px;
- padding: 0;
- border: 0;
- outline: none;
- margin: 0;
- background: #F2F2F2;
- border-radius: inherit;
- cursor: pointer;
- }
- </style>
- <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>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_production_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("export/holiday_teacher_index");?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy clearfix">
- <div class="tab-con-btn">
- <span class="tab_btn" onclick="location.href='<?php echo $this->createUrl('export/holiday_index');?>'">学生产品</span>
- <span class="tab_btn has-sel">教师产品</span>
- </div>
- <select class="form-control" id="semesterId" name="semesterId">
- <?php foreach($semsters as $semster){?>
- <option <?php if((string)$semsterId === (string)$semster["semester_id"]) echo "selected=selected";?> value="<?php echo $semster["semester_id"];?>"><?php echo $semster["semester_name"];?></option>
- <?php }?>
- </select>
- <input type="text" placeholder="请输入教师姓名" name="teacher_name" value="<?php echo isset($teacher_name)?$teacher_name:'';?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- <span style="font-size:13px;padding-left:2px;color:red;">
- 提示:数据更新要第2天下载,请提前一天更新。报告生成保存7天,7天后请重新下载
- </span>
- <span class="fr ">
-
- <?php // if(isset($is_all_pdf) && $is_all_pdf):?>
- <span style="color:red">
- <?php // if(isset($create_time) && $create_time):?>
- <?php // echo date("m月d日",$create_time+86400).'已更新';?>
- <?php // endif;?>
- </span>
- <?php // else:?>
- <span style="color:red">
- <?php // if(isset($create_time) && $create_time):?>
- <?php // echo date("m月d日",$create_time).'已重置,更新报告需1-2天,正在更新';?>
- <?php // endif;?>
- </span>
- <?php // endif;?>
- <a id="batchUpdate" href="javascript:void(0);" class="btn-garder">批量更新</a>
- <a id="batchPrint" href="javascript:void(0);" class="btn-garder">批量下载</a>
-
- </span>
- </div>
- </div>
- </form>
-
- </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 class="center">
- <input type="checkbox" class="ace selectAll" />
- </th>
- <th>生成日期</th>
- <th>教师姓名</th>
- <th>登陆账号</th>
- <th>执教班级</th>
- <th>报告生成数</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):foreach($printList as $cl):?>
- <?php if(!$cl['teacher_id']){continue;}?>
- <tr>
- <td>
- <?php if(Yii::app()->cache->getValue("cloud_print_holiday_report_".$cl['report_id']) != 1){?>
- <input type="checkbox" class="ace myselect" value="<?php echo $cl['report_id'];?>">
- <?php }?>
- </td>
- <td><?php echo isset($cl['build_time'])?$cl['build_time']:"";?></td>
- <td><?php echo isset($cl['teacher_name'])?$cl['teacher_name']:'';?></td>
- <td><?php echo isset($cl['phone_number'])?$cl['phone_number']:'';?></td>
- <td style="width:1000px"><?php echo isset($cl['class_name'])?$cl['class_name']:'';?></td>
- <td><?php echo isset($cl['pdf_count'])?$cl['pdf_count']:'';?></td>
- <td style="width:265px;">
- <!-- 发送云印任务 -->
- <span style=" display: inline-block;
- width: 28px;
- height: 28px;
- vertical-align: -1px;
- padding: 2px;" class="iconfont click-sc addbx" aria-hidden="true" title="更新pdf" onclick="resetReport('<?php echo (string)$cl['report_id'];?>','<?php echo (string)$cl['teacher_id'];?>','<?php echo (string)$cl['semester_id'];?>')"><img src="/images/report-reset.png" style="width: 65%;
- height: auto;"/></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="下载假期报告" onclick="printWeek('<?php echo (string)$cl['report_id'];?>')"></span>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="8">暂无数据!</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">
- <select class="form-control" id="limit" name="limit">
- <option value="10" <?php if($limit == 10) echo "selected";?> data-url="<?php echo $this->createUrl("export/holiday_teacher_index",array('limit'=>10));?>">10</option>
- </select>
- <?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(){
- });
- $('#limit').change(function () {
- window.location.href = $("#limit option:selected").attr('data-url');
- });
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- function printWeek(reportId){
- if (!reportId) {
- layer.msg("打印参数有误");return;
- }
- var message = "您确定要下载该教师版假期报告吗?";
- var objUrl = '';
- html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接下载好题本。</div>'+
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
- '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
- '</div>'+
- '</div>'+
- "";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
- startTime = (new Date()).getTime();
- showTip = true;
- tipShowed = false;
- toPromptTime = 3000;
- window.interval = setInterval(function(){
- execTime = (new Date()).getTime() - startTime;
- if(execTime > toPromptTime && showTip && !tipShowed){
- msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
- tipShowed = true;
- }
- }, 1000);
- jQuery.get(
- "<?php echo $this->createUrl("productdownteacher/getTeacherHolidayFile");?>",
- {"reportId": reportId},
- function(data){
- data = JSON.parse(data);
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: "下载教师版假期报告",
- content: html,
- success: function(index, layerObj){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.limitinfo, {"time": 3000});
- clearInterval(window.interval);
- layer.close(msgIndex);
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
- jQuery("#confirm, #cancel").on("click", function(){
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function(){
- jQuery("#url").select();
- });
- },
- end: function(){
- }
- });
- }
- else if(data.success == 0){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.message, {"time": 3000});
- }
- }
- );
- }
- });
- }
- // 全选\反选
- $(".selectAll").click(function(){
- if ($(this).prop("checked")) {
- var s_obj = $(".myselect");
- var s_len = s_obj.length;
- for (var i=0;i<s_len;i++) {
- if (!s_obj[i].disabled) {
- s_obj[i].checked=true;
- }
- }
- } else {
- $(".myselect").prop("checked",false);
- }
- });
-
- //批量下载
- $("#batchPrint").click(function(){
- var message = "您确定要批量下载教师版假期报告吗?";
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var result = [];
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- result.push($(this).val());
- }
- }
- });
- var reportId = "";
- for(i=0;i<result.length;i++)
- {
- reportId += result[i] + ",";
- }
- html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接下载教师版假期报告。</div>'+
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
- '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
- '</div>'+
- '</div>'+
- "";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
- startTime = (new Date()).getTime();
- showTip = true;
- tipShowed = false;
- toPromptTime = 3000;
- window.interval = setInterval(function(){
- execTime = (new Date()).getTime() - startTime;
- if(execTime > toPromptTime && showTip && !tipShowed){
- msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
- tipShowed = true;
- }
- }, 1000);
- jQuery.get(
- "<?php echo $this->createUrl("productdownteacher/getTeacherHolidayFile");?>",
- {"reportId": reportId},
- function(data){
- data = JSON.parse(data);
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: "下载教师版假期报告",
- content: html,
- success: function(index, layerObj){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.limitinfo, {"time": 3000});
- clearInterval(window.interval);
- layer.close(msgIndex);
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
- jQuery("#confirm, #cancel").on("click", function(){
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function(){
- jQuery("#url").select();
- });
- },
- end: function(){
- }
- });
- }
- else if(data.success == 0){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.message, {"time": 3000});
- }
- }
- );
- }
- });
- });
- //批量重置
- $("#batchUpdate").click(function(){
- var semester_id = $("select[name='semesterId']").val();
- if(semester_id){
- layer.msg('确定要重置该学期的所有数据吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("export/ajaxBatchResetHolidayTeacher");?>",
- dataType: "json",
- //contentType: "application/json",
- data: {semster_id:semester_id},
- beforeSend:function(){
- // layer.load(1, {
- // shade: [0.1,'#fff'] //0.1透明度的白色背景
- // });
- },
- success:function(data) {
- if (data.status == 1) {
- window.location.reload();
- } else if (data.status == 0) {
- layer.msg(data.result);
- }
- }
- });
- }
- });
- }else{
- layer.msg("请选择学期");
- }
- });
-
- //重置假期报告
- function resetReport(reportId,teacherId,semsterId){
- layer.msg('确定要重置该老师的数据吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("export/ajaxResetHolidayTeacherReport");?>",
- dataType: "json",
- //contentType: "application/json",
- data: {teacher_id:teacherId,report_id:reportId,semster_id:semsterId},
- beforeSend:function(){
- // layer.load(1, {
- // shade: [0.1,'#fff'] //0.1透明度的白色背景
- // });
- },
- success:function(data) {
- if (data.status == 1) {
- window.location.reload();
- } else if (data.status == 0) {
- layer.msg(data.result);
- }
- }
- });
- }
- });
- }
-
- //重置假期报告确认
-
-
- </script>
|