123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380 |
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
- <link rel="stylesheet" href="/css/alert.css"/>
- <style>
- .color-red{
- color: red;
- }
- .en-tfb-grade-1 .date>span{
- margin-right: 40px;
- }
- .option-wrap{
- margin-top: 20px;
- min-width: 600px;
- }
- .option-name{
- display: inline-block;
- width: 100px;
- vertical-align: top;
- margin-top: 10px;
- }
- .option-con{
- display: inline-block;
- width: 80%;
- min-width: 490px;
- padding: 10px;
- border: 1px solid #ccc;
- }
- .option-con>span{
- display: inline-block;
- margin-right: 20px;
- margin-top:10px;
- line-height: 1rem;
- cursor: pointer;
- }
- .select-grade{
- width: 150px;
- line-height: 30px;
- margin-bottom: 10px;
- }
- .option-con-class label{
- display: inline-block;
- margin-right: 20px;
- }
- .active{
- color: #07af66;
- }
- .btn-start{
- display: inline-block;
- margin-top: 20px;
- margin-left: 100px;
- padding: 10px 30px;
- color: #fff;
- background-color: #07af66;
- cursor: pointer;
- }
- .en-tfb-grade-1{
- margin-left: 20px;
- }
- .hgc_leader-btn {
- display: flex;
- justify-content: space-between;
- padding: 10px 0;
- font-size: 14px;
- }
- .hgc_leader-btn span {
- display: flex;
- align-items: center;
- cursor: pointer;
- }
- .hgc_leader-btn span .icon {
- width: 15px;
- height: 15px;
- background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAYAAADNX8xBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPnZS/S4JRFIZvYlDQYOBg0ODg4ODW4ugaNDT2HxRE0NA/EA0NFQUNDRENjQUN0dRQQVDgEmQ4aBQouLQVJBTZ816PpvX5o154Oufce87r57X7uU6qOReBsJV/16dzU5DHpEZ8g2MYt+3+ZCYVTKZhCKLUa1Aij1hbbzGgJ5kmzmgYstRJ4j6sWFugBiw2zqTEwijxkaUNmIBXOIX5kHOTxECx15QGpIT+sLGF6R5pklgklrXeSU0jmj8IFxAD5Q3prGS+XC/7EANxziIN+mqqM6Bf7wXebS/N2pAf6CYzaxop1yDxQKZCa5CAtB9CrWfUSU987So8YHJFPQhl6gLxBLMzNXkjGsL6BOU9VLSzLDKzTj5GridLhVhIgn72Agvn5DpsL/JnQq5etYv+ezPVE0dlNEtxBMNwC8fgxePmYEE5fTcMXPqNIPEUq3BopepN8IfdSewnMB6xXN8io0/SfcrLwHch8kVLe6ppJJHEfpr1KxlBysr/m9F/zWzcyrr+akZ/hF69dn6/AFvMtgMbWkTPEuxa+VtmloU7ct23NkNqXaMd8FfFloOlYZrmQG9H3S+96DRYAf8KZj1q7d8vtm5iIEnw//Hkumeiqrou574AaXrOncWtEY0AAAAASUVORK5CYII=') no-repeat center;
- background-size: contain;
- }
- .hgc_leader-btn span:nth-child(2) .icon {
- background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE6SURBVDhP7ZStTgNBFEZvmwpkRUUFsqJJKyoqKhBIRCWiD4CkggRPeAIEgodA8gAYEgQPgICktrJJDUkJ5dztV5id7KZDlqA4ydf7N/duZtIZK+PD7Bi9rM3WoTyHTrQsDRoHNK3QEs0iLTV4rOW7YfGNmiZKfUFupNq9UjlqFI5qZm3FGTRcY/bQlNpblgygfkW+iT3DLpR2Fj5wRbKhRGV84CkDW/gXm5RdyqYS9n3vxs/FpTCZuK8u+2sUDuQYJsj/b33Ft+hRfgc9o3OPYwoHcqZd1NHZOkP8kTvYfa/j9jyO+ZstV+F/YHVSB77LOqFfTniF+GmhQ+QvjsddNJDfQAcoe6GwxVe2tLCDuC+3ZbKvcpOh50FuHu7m3fZrPxW9TxrjV3MDhTbyl3p7f1OZM8Rf7rmZ2Sd4TZIuop129AAAAABJRU5ErkJggg==') no-repeat center;
- background-size: contain;
- }
- .hgc_leader-btn i {
- font-style: normal;
- }
- .hgc_option-con label {
- position: relative;
- padding: 5px;
- padding-right: 30px;
- border: 1px solid #999;
- }
- .hgc_option-con .icon {
- position: absolute;
- top: 50%;
- right: 5px;
- transform: translateY(-50%);
- width: 15px;
- height: 15px;
- background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE6SURBVDhP7ZStTgNBFEZvmwpkRUUFsqJJKyoqKhBIRCWiD4CkggRPeAIEgodA8gAYEgQPgICktrJJDUkJ5dztV5id7KZDlqA4ydf7N/duZtIZK+PD7Bi9rM3WoTyHTrQsDRoHNK3QEs0iLTV4rOW7YfGNmiZKfUFupNq9UjlqFI5qZm3FGTRcY/bQlNpblgygfkW+iT3DLpR2Fj5wRbKhRGV84CkDW/gXm5RdyqYS9n3vxs/FpTCZuK8u+2sUDuQYJsj/b33Ft+hRfgc9o3OPYwoHcqZd1NHZOkP8kTvYfa/j9jyO+ZstV+F/YHVSB77LOqFfTniF+GmhQ+QvjsddNJDfQAcoe6GwxVe2tLCDuC+3ZbKvcpOh50FuHu7m3fZrPxW9TxrjV3MDhTbyl3p7f1OZM8Rf7rmZ2Sd4TZIuop129AAAAABJRU5ErkJggg==') no-repeat center;
- background-size: contain;
- cursor: pointer;
- }
- .unclick-grey{
- background-color:#DCDCDC;
- color:#393939;
- }
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="en-tfb-grade-1">
- <h2>外刊宝生成</h2>
- <p class="color-red">提示:每个班级每周允许生成一次,最多选择5个主题语境</p>
- <p class="date">
- <span>当前时间:</span>
- <span><?php echo $year;?>年<?php echo $month;?>月第<?php echo $week;?>周</span>
- <span class="btn-start fr" onclick="location='/index.php/print/englishReadingTime'" style="margin: -9px 200px 0px 0!important;">时文阅读</span>
- <span class="btn-start fr" onclick="location='/index.php/print/englishReadingSetting'" style="margin: -9px 15px 0px 0!important;">按照教材单元设置</span>
- </p>
- <div class="option-wrap">
- <span class="option-name">话题:</span>
- <div class="option-con" id="optionEdition">
- <?php if(isset($theme_context) && $theme_context):?>
- <?php foreach($theme_context as $k=>$v):?>
- <span code="<?php echo $v['label_id'];?>" class="special-name"><?php echo $v['content'];?></span>
- <?php endforeach;?>
- <?php endif;?>
- </div>
- </div>
- <div class="option-wrap">
- <span class="option-name">班级:</span>
- <div class="option-con">
- <div>
- <select name="grade" class="select-grade">
- <option value="1" selected>高一</option>
- <option value="2">高二</option>
- <option value="3">高三</option>
- </select>
- </div>
- <div class="option-con-class" id="optionClass">
- </div>
- </div>
- </div>
- <div class="option-wrap">
- <span class="option-name">外刊类别:</span>
- <div class="option-con">
- <div><input type="radio" name="reading_type" value="1" checked="checked">个性外刊<span class="color-red">(班级同学语篇不完全相同,根据学生水平个性化)</span></div>
- <div><input type="radio" name="reading_type" value="2">共性外刊<span class="color-red">(班级同学语篇完全相同,老师可讲解)</span></div>
- </div>
- </div>
- <div class="option-wrap reading-level" style="display:none">
- <span class="option-name">外刊分级:</span>
- <div class="option-con">
- <div><input type="radio" name="reading_level" value="1" checked="checked">尖子班(优秀生)</div>
- <div><input type="radio" name="reading_level" value="2">培优班(中等生)</div>
- <div><input type="radio" name="reading_level" value="3">提高班(学困生)</div>
- </div>
- </div>
- <div class="option-wrap">
- <span class="option-name">下载方式:</span>
- <div class="option-con">
- <span><input type="radio" name="is_answer_separate" value="0" checked="checked">合并题目和答案</span>
- <span><input type="radio" name="is_answer_separate" value="1" >分离题目和答案</span>
- </div>
- </div>
- <span class="btn-start" id="confirm" active="true">开始生成</span>
- <span class="red class-msg" style="margin-left:20px"></span>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- getClassByGrade(1);
- //增加专项
- function addItem(id,name) {
- var ele = '<label item_id="'+id+'">'+name+'<i class="icon selected-item"></i></label>';
- $(".special-item-box").append(ele);
- }
- function itmeNume() {
- $(".item-num").text($(".special-item-box>label").length);
- }
- //切换专题
- $(".special-name").click(function () {
- if($(this).hasClass("unclick-grey")){
- return false;
- }
- if($(this).hasClass("active")){
- $(this).removeClass("active");
- }else{
- $(this).addClass("active");
- }
- var num = $(".special-name.active").length;
- if(num >= 5){
- $(".special-name").each(function(){
- if(!$(this).hasClass("active")){
- $(this).addClass("unclick-grey");
- }
- });
- }else{
- $(".special-name").each(function(){
- if(!$(this).hasClass("active")){
- $(this).removeClass("unclick-grey");
- }
- });
- }
- });
- var optionData={
- edition:0,
- modular:0,
- unit:0,
- class:[],
- }
- // 单选按钮
- $("input[name='option-class']").change(function() {
- getsClassSelected();
- });
- function getsClassSelected() {
- optionData.class=[];
- var selectedData = $("input[name='option-class']:checked"); //获取所以选中学生
- for (var i = 0; i < selectedData.length; i++) {
- code = $(selectedData[i]).val();
- optionData.class.push(code);
- }
- };
- $('.select-grade').change(function(){
- var grade = $(this).val();
- getClassByGrade(grade);
- });
- $("body").delegate("#confirm[active='true']", "click", function() {
- var This = $(this);
- This.attr("active","false");
- var error = [];
- var selectClassIds = [];
- var selectedItemIds = [];
- var grade = parseInt($('.select-grade').val());
- // var textbookId = parseInt($('#optionEdition span.active').attr("code"));
- // var moduleId = parseInt($('#optionModular span.active').attr("code"));
- // var unitId = parseInt($('#optionUnit span.active').attr("code"));
- // var moduleName = $('#optionModular span.active').text();
- // var unitName = $('#optionUnit span.active').text();
- var type = parseInt($('input[name="reading_type"]:checked').val());
- var level = parseInt($('input[name="reading_level"]:checked').val());
- var isAnswerSeparate = $("input[name='is_answer_separate']:checked").val();
- $('#optionClass input:checked').each(function(k,v){
- if($(this).attr("status") == 0){
- selectClassIds.push($(this).val());
- }
- });
- $(".special-name.active").each(function(k,v){
- if($(this).attr("code")){
- selectedItemIds.push($(this).attr("code"));
- }
- });
- if(selectedItemIds.length == 0){
- error.push("请选择话题");
- }
- if(selectClassIds.length == 0){
- error.push("请选择班级");
- }
- // if(grade <= 0 || !grade){
- // error.push("请选择年级");
- // }
- // if(textbookId <= 0 || !textbookId){
- // error.push("请选择版本");
- // }
- // if(moduleId <= 0 || !moduleId){
- // error.push("请选择模块");
- // }
- // if(unitId <= 0 || !unitId){
- // error.push("请选择单元");
- // }
- if(error.length == 0){
- $.ajax({
- url: "<?php echo $this->createUrl('print/ajaxSaveEnglishReading');?>",
- type: "POST",
- dataType: "json",
- data: {
- grade:grade,
- selectClassIds:selectClassIds,
- selectedItemIds:selectedItemIds,
- textbookId:0,
- moduleId:0,
- unitId:0,
- moduleName:'',
- unitName:'',
- type:type,
- level:level,
- isAnswerSeparate:isAnswerSeparate
- },
- success: function (data) {
- if(data.status == 1){
- layer.msg('已发送到后台,预计1小时左右生成!', {
- time: 2000,
- });
- setTimeout(function(){window.location.href = "<?php echo Yii::app()->createUrl('print/english_reading');?>";}, 2000);
- }else{
- layer.msg(data.error.join('</br>'));
- This.attr("active","true");
- }
- }
- });
- }else{
- This.attr("active","true");
- layer.msg(error.join('</br>'));
- }
- });
- $("body").delegate("input[name='reading_type']", "click", function() {
- if($(this).val() == 1){
- $(".reading-level").hide();
- }else{
- $(".reading-level").show();
- }
- });
- function getClassByGrade(grade){
- if(grade){
- $.ajax({
- url: "<?php echo $this->createUrl('print/ajaxGetClassesBySettingReading');?>",
- type: "POST",
- dataType: "json",
- data: {
- grade: grade,
- },
- success: function (data) {
- console.log(data);
- var html = '';
- if(data && data.length > 0){
- for(var i in data){
- html +='<label>';
- if(data[i].status == 1){
- html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" checked="checked" disabled="disabled" status="1">'+data[i].class_name;
- }else{
- html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" status="0">'+data[i].class_name;
- }
- html +='</label>';
- }
- }
- $('#optionClass').html(html);
- if($("#optionClass input[status=0]").length > 0){
- $("#confirm").attr("active","true");
- $(".class-msg").html("");
- }else{
- $("#confirm").attr("active","false");
- $(".class-msg").html("本周您已经生成过啦,下周再来看看吧~");
- }
- }
- });
- }
- }
- });
- </script>
|