123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- <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">
- <div class="col-xs-10">
- <form method="get" id="form1" action="<?php echo $this->createUrl("print/class_student_product", array("type" => $type));?>">
- <div class="dataTables_length" style="margin: 6px 0px;">
- <div class="dataTables_length">
- <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="student_name" value="<?php echo $student_name;?>"></label>
- <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
- </div>
- </div>
- <input type="hidden" name="cid" value="<?php echo $class_id;?>" />
- <input type="hidden" name="type" value="<?php echo $type;?>" />
- </form>
- </div>
- <div class="col-xs-2">
- <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px">
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
- <i style="font-style: normal;" class="fa fa-print"></i> 下载
- </a>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrintToolsJieDuan">
- <i style="font-style: normal;" class="fa fa-print"></i> 打印
- </a>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
- <?php switch($type){
- case 1:echo $semester_name."期中阶段复习个性化学习宝";break;
- case 2:echo $semester_name."期末阶段复习个性化学习宝";break;
- case 3:echo $semester_name."总复习个性化学习宝";break;
- }?>
- </div>
- </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">
- <!--<label class="pos-rel">
- <input type="checkbox" class="ace selectAll">
- <span class="lbl"></span>
- </label>-->
- <input type="checkbox" class="ace selectAll">
- </th>
- <th>个性化学习宝名称</th>
- <th>学生名称</th>
- <th>学生编号</th>
- <th>是否生成</th>
- <th>下载功能</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($student)):foreach($student as $rt):?>
- <tr>
- <td class="center">
- <?php if($rt->is_outer){ ?>
- <input type="checkbox" class="ace myselect" value="<?php echo $rt->student_id;?>" stnm="<?php echo $rt->realname;?>">
- <?php } ?>
- </td>
- <td> <?php switch($type){
- case 1:echo $class_name.$rt->realname."期中阶段复习个性化学习宝";break;
- case 2:echo $class_name.$rt->realname."期末阶段复习个性化学习宝";break;
- case 3:echo $class_name.$rt->realname."总复习个性化学习宝";break;
- case 4:echo $class_name.$rt->realname."期中阶段复习个性化学习宝";break;
- case 5:echo $class_name.$rt->realname."期末阶段复习个性化学习宝";break;
- case 6:echo $class_name.$rt->realname."总复习个性化学习宝";break;
-
- }?></td>
- <td><?php echo $rt->realname;?></td>
- <td><?php echo $rt->student_id;?></td>
- <td>
- <?php if (isset($student_products[$rt->student_id])){
- ?>
- <span class="label label-sm label-success" style="font-size:12px">已生成</span>
- <?php
- }else{
- ?>
- <span class="label label-sm label-danger" style="font-size:12px">未生成</span>
- <?php
- } ?>
- </td>
- <?php // if(YII_ENV === "development"){ ?>
- <td>
- <?php if($rt->is_outer){ ?>
- <span class="label label-sm label-success" style="font-size:12px">已开通</span>
- <?php }else{ ?>
- <span class="label label-sm label-danger" style="font-size:12px">未开通</span>
- <?php } ?>
- </td>
- <?php // } ?>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="6">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <?php if(!empty($page_count)){?>
- <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_count).'条';
- ?>
- </div>
- </div>
- </div>
- <?php }?>
- </div>
- <input type="hidden" name="classId" id="classId" value="<?php echo $class_id;?>" />
- <input type="hidden" name="type" id="type" value="<?php echo $type;?>" />
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <?php require_once "_print.php"?>
- <script type="text/javascript">
- type = "<?php echo $type;?>";
- if(type == 1){
- type = 1;
- improveName = "期中阶段复习个性化学习宝";
- }
- else if(type == 2){
- type = 2;
- improveName = "期末阶段复习个性化学习宝";
- }
- else{
- type = 3;
- improveName = "总复习个性化学习宝";
- }
- html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</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>'+
- "";
- $(function(){
- // 全选\反选
- $(".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);
- }
- });
- $("#selectPrint").click(function(){
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- layer.msg("您确定下载阶段复习学习宝吗?", {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var classId = $("#classId").val();
- var type = $("#type").val();
- if (!classId || !type) {
- 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());
- }
- }
- })
- if (result.length < 1) {
- layer.msg('未找到要下载的学生!');return false;
- }
- if(type>3){
- type=(type-3);
- }
- $.ajax({
- url: "<?php echo $this->createUrl('productdownload/download_student_product');?>",
- type: "GET",
- dataType: "json",
- data: { "classId": classId, "type": type, "studentsIds":result},
- timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
- beforeSend:function(){
- layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
- },
- error: function (jqXHR, textStatus, errorThrown) {
- if(textStatus=="timeout"){
- $.ajax({
- type:'GET',
- url: "<?php echo $this->createUrl("productdownload/addSpTask");?>",
- data: { "classId": classId, "type": type, "studentsIds":result},
- dataType: "json",
- success:function (data) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
- icon: 1,
- yes:function(){
- layer.closeAll();
- }
- });
- }
- })
- }else {
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- success: function (data){
- layer.closeAll();
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: "下载个性化学习宝",
- content: html,
- success: function(index, layerObj){
- 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 == 3){
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
- icon: 1,
- yes:function(){
- layer.closeAll();
- }
- });
- }
- else if(data.success == 0){
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- });
- })
- </script>
|