english_reading_time.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
  2. <link rel="stylesheet" href="/css/alert.css"/>
  3. <style>
  4. .color-red{
  5. color: red;
  6. }
  7. .en-tfb-grade-1 .date>span{
  8. margin-right: 40px;
  9. }
  10. .option-wrap{
  11. margin-top: 20px;
  12. min-width: 600px;
  13. }
  14. .option-name{
  15. display: inline-block;
  16. width: 100px;
  17. vertical-align: top;
  18. margin-top: 10px;
  19. }
  20. .option-con{
  21. display: inline-block;
  22. width: 80%;
  23. min-width: 490px;
  24. padding: 10px;
  25. border: 1px solid #ccc;
  26. }
  27. .option-con>span{
  28. display: inline-block;
  29. margin-right: 20px;
  30. margin-top:10px;
  31. line-height: 1rem;
  32. cursor: pointer;
  33. }
  34. .select-grade{
  35. width: 150px;
  36. line-height: 30px;
  37. margin-bottom: 10px;
  38. }
  39. .option-con-class label{
  40. display: inline-block;
  41. margin-right: 20px;
  42. }
  43. .active{
  44. color: #07af66;
  45. }
  46. .btn-start{
  47. display: inline-block;
  48. margin-top: 20px;
  49. margin-left: 100px;
  50. padding: 10px 30px;
  51. color: #fff;
  52. background-color: #07af66;
  53. cursor: pointer;
  54. }
  55. .en-tfb-grade-1{
  56. margin-left: 20px;
  57. }
  58. .hgc_leader-btn {
  59. display: flex;
  60. justify-content: space-between;
  61. padding: 10px 0;
  62. font-size: 14px;
  63. }
  64. .hgc_leader-btn span {
  65. display: flex;
  66. align-items: center;
  67. cursor: pointer;
  68. }
  69. .hgc_leader-btn span .icon {
  70. width: 15px;
  71. height: 15px;
  72. 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;
  73. background-size: contain;
  74. }
  75. .hgc_leader-btn span:nth-child(2) .icon {
  76. 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;
  77. background-size: contain;
  78. }
  79. .hgc_leader-btn i {
  80. font-style: normal;
  81. }
  82. .hgc_option-con label {
  83. position: relative;
  84. padding: 5px;
  85. padding-right: 30px;
  86. border: 1px solid #999;
  87. }
  88. .hgc_option-con .icon {
  89. position: absolute;
  90. top: 50%;
  91. right: 5px;
  92. transform: translateY(-50%);
  93. width: 15px;
  94. height: 15px;
  95. 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;
  96. background-size: contain;
  97. cursor: pointer;
  98. }
  99. .unclick-grey{
  100. background-color:#DCDCDC;
  101. color:#393939;
  102. }
  103. </style>
  104. <div class="main-content-inner">
  105. <!-- 导航栏开始-->
  106. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  107. <!-- 导航栏结束-->
  108. <div class="en-tfb-grade-1">
  109. <h2>外刊宝生成</h2>
  110. <p class="color-red">提示:每个班级每周允许生成一次,该模式下默认选择最新上传的外刊生成</p>
  111. <p class="date">
  112. <span>当前时间:</span>
  113. <span><?php echo $year;?>年<?php echo $month;?>月第<?php echo $week;?>周</span>
  114. <span class="btn-start fr" onclick="location='/index.php/print/englishReading3'" style="margin: -9px 200px 0px 0!important;">主题语境设置</span>
  115. <span class="btn-start fr" onclick="location='/index.php/print/englishReadingSetting'" style="margin: -9px 15px 0px 0!important;">按照教材单元设置</span>
  116. </p>
  117. <div class="option-wrap">
  118. <span class="option-name">班级:</span>
  119. <div class="option-con">
  120. <div>
  121. <select name="grade" class="select-grade">
  122. <option value="1" selected>高一</option>
  123. <option value="2">高二</option>
  124. <option value="3">高三</option>
  125. </select>
  126. </div>
  127. <div class="option-con-class" id="optionClass">
  128. </div>
  129. </div>
  130. </div>
  131. <div class="option-wrap">
  132. <span class="option-name">外刊类别:</span>
  133. <div class="option-con">
  134. <div><input type="radio" name="reading_type" value="1" checked="checked">个性外刊<span class="color-red">(班级同学语篇不完全相同,根据学生水平个性化)</span></div>
  135. <div><input type="radio" name="reading_type" value="2">共性外刊<span class="color-red">(班级同学语篇完全相同,老师可讲解)</span></div>
  136. </div>
  137. </div>
  138. <div class="option-wrap reading-level" style="display:none">
  139. <span class="option-name">外刊分级:</span>
  140. <div class="option-con">
  141. <div><input type="radio" name="reading_level" value="1" checked="checked">尖子班(优秀生)</div>
  142. <div><input type="radio" name="reading_level" value="2">培优班(中等生)</div>
  143. <div><input type="radio" name="reading_level" value="3">提高班(学困生)</div>
  144. </div>
  145. </div>
  146. <div class="option-wrap">
  147. <span class="option-name">下载方式:</span>
  148. <div class="option-con">
  149. <span><input type="radio" name="is_answer_separate" value="0" checked="checked">合并题目和答案</span>
  150. <span><input type="radio" name="is_answer_separate" value="1" >分离题目和答案</span>
  151. </div>
  152. </div>
  153. <span class="btn-start" id="confirm" active="true">开始生成</span>
  154. <span class="red class-msg" style="margin-left:20px"></span>
  155. </div>
  156. </div>
  157. <script src="/js/jquery.ajaxfileupload.js"></script>
  158. <script type="text/javascript">
  159. $(document).ready(function () {
  160. getClassByGrade(1);
  161. //增加专项
  162. function addItem(id,name) {
  163. var ele = '<label item_id="'+id+'">'+name+'<i class="icon selected-item"></i></label>';
  164. $(".special-item-box").append(ele);
  165. }
  166. function itmeNume() {
  167. $(".item-num").text($(".special-item-box>label").length);
  168. }
  169. //切换专题
  170. $(".special-name").click(function () {
  171. if($(this).hasClass("unclick-grey")){
  172. return false;
  173. }
  174. if($(this).hasClass("active")){
  175. $(this).removeClass("active");
  176. }else{
  177. $(this).addClass("active");
  178. }
  179. var num = $(".special-name.active").length;
  180. if(num >= 5){
  181. $(".special-name").each(function(){
  182. if(!$(this).hasClass("active")){
  183. $(this).addClass("unclick-grey");
  184. }
  185. });
  186. }else{
  187. $(".special-name").each(function(){
  188. if(!$(this).hasClass("active")){
  189. $(this).removeClass("unclick-grey");
  190. }
  191. });
  192. }
  193. });
  194. var optionData={
  195. edition:0,
  196. modular:0,
  197. unit:0,
  198. class:[],
  199. }
  200. // 单选按钮
  201. $("input[name='option-class']").change(function() {
  202. getsClassSelected();
  203. });
  204. function getsClassSelected() {
  205. optionData.class=[];
  206. var selectedData = $("input[name='option-class']:checked"); //获取所以选中学生
  207. for (var i = 0; i < selectedData.length; i++) {
  208. code = $(selectedData[i]).val();
  209. optionData.class.push(code);
  210. }
  211. };
  212. $('.select-grade').change(function(){
  213. var grade = $(this).val();
  214. getClassByGrade(grade);
  215. });
  216. $("body").delegate("#confirm[active='true']", "click", function() {
  217. var This = $(this);
  218. This.attr("active","false");
  219. var error = [];
  220. var selectClassIds = [];
  221. var selectedItemIds = [];
  222. var grade = parseInt($('.select-grade').val());
  223. // var textbookId = parseInt($('#optionEdition span.active').attr("code"));
  224. // var moduleId = parseInt($('#optionModular span.active').attr("code"));
  225. // var unitId = parseInt($('#optionUnit span.active').attr("code"));
  226. // var moduleName = $('#optionModular span.active').text();
  227. // var unitName = $('#optionUnit span.active').text();
  228. var type = parseInt($('input[name="reading_type"]:checked').val());
  229. var level = parseInt($('input[name="reading_level"]:checked').val());
  230. var isAnswerSeparate = $("input[name='is_answer_separate']:checked").val();
  231. $('#optionClass input:checked').each(function(k,v){
  232. if($(this).attr("status") == 0){
  233. selectClassIds.push($(this).val());
  234. }
  235. });
  236. $(".special-name.active").each(function(k,v){
  237. if($(this).attr("code")){
  238. selectedItemIds.push($(this).attr("code"));
  239. }
  240. });
  241. if(selectClassIds.length == 0){
  242. error.push("请选择班级");
  243. }
  244. // if(grade <= 0 || !grade){
  245. // error.push("请选择年级");
  246. // }
  247. // if(textbookId <= 0 || !textbookId){
  248. // error.push("请选择版本");
  249. // }
  250. // if(moduleId <= 0 || !moduleId){
  251. // error.push("请选择模块");
  252. // }
  253. // if(unitId <= 0 || !unitId){
  254. // error.push("请选择单元");
  255. // }
  256. if(error.length == 0){
  257. $.ajax({
  258. url: "<?php echo $this->createUrl('print/ajaxSaveReadingTime');?>",
  259. type: "POST",
  260. dataType: "json",
  261. data: {
  262. grade:grade,
  263. selectClassIds:selectClassIds,
  264. textbookId:0,
  265. moduleId:0,
  266. unitId:0,
  267. moduleName:'',
  268. unitName:'',
  269. type:type,
  270. level:level,
  271. isAnswerSeparate:isAnswerSeparate
  272. },
  273. success: function (data) {
  274. if(data.status == 1){
  275. layer.msg('已发送到后台,预计1小时左右生成!', {
  276. time: 2000,
  277. });
  278. setTimeout(function(){window.location.href = "<?php echo Yii::app()->createUrl('print/english_reading');?>";}, 2000);
  279. }else{
  280. layer.msg(data.error.join('</br>'));
  281. This.attr("active","true");
  282. }
  283. }
  284. });
  285. }else{
  286. This.attr("active","true");
  287. layer.msg(error.join('</br>'));
  288. }
  289. });
  290. $("body").delegate("input[name='reading_type']", "click", function() {
  291. if($(this).val() == 1){
  292. $(".reading-level").hide();
  293. }else{
  294. $(".reading-level").show();
  295. }
  296. });
  297. function getClassByGrade(grade){
  298. if(grade){
  299. $.ajax({
  300. url: "<?php echo $this->createUrl('print/ajaxGetClassesBySettingReading');?>",
  301. type: "POST",
  302. dataType: "json",
  303. data: {
  304. grade: grade,
  305. },
  306. success: function (data) {
  307. console.log(data);
  308. var html = '';
  309. if(data && data.length > 0){
  310. for(var i in data){
  311. html +='<label>';
  312. if(data[i].status == 1){
  313. html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" checked="checked" disabled="disabled" status="1">'+data[i].class_name;
  314. }else{
  315. html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" status="0">'+data[i].class_name;
  316. }
  317. html +='</label>';
  318. }
  319. }
  320. $('#optionClass').html(html);
  321. if($("#optionClass input[status=0]").length > 0){
  322. $("#confirm").attr("active","true");
  323. $(".class-msg").html("");
  324. }else{
  325. $("#confirm").attr("active","false");
  326. $(".class-msg").html("本周您已经生成过啦,下周再来看看吧~");
  327. }
  328. }
  329. });
  330. }
  331. }
  332. });
  333. </script>