setting_mainly.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
  2. <link rel="stylesheet" href="/css/alert.css"/>
  3. <style>
  4. .mrv-3{
  5. margin: 10px 20px;
  6. }
  7. .nav-btns>a{
  8. display: inline-block;
  9. width: 120px;
  10. border: 1px solid #40c180;
  11. text-align: center;
  12. line-height: 30px;
  13. }
  14. .active{
  15. color: #fff;
  16. background-color: #40c180;
  17. }
  18. </style>
  19. <div class="main-content-inner">
  20. <!-- 导航栏开始-->
  21. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  22. <!-- 导航栏结束-->
  23. <div class="mrv-3">
  24. <!-- <div class="nav-btns">
  25. <a href="<?php // echo $this->createUrl("print/sub_index/type/third_isp");?>">课后指导</a><a href="<?php // echo $this->createUrl("print/mrv");?>">晨读词汇</a>
  26. </div>-->
  27. <h2>阶段复习</h2>
  28. <div>每月最后一周
  29. <select name="select-month" class="select-month">
  30. <option value="1"<?php echo $chooseMonth == 1?" selected=selected":'';?>>周一</option>
  31. <option value="2"<?php echo $chooseMonth == 2?" selected=selected":'';?>>周二</option>
  32. <option value="3"<?php echo $chooseMonth == 3?" selected=selected":'';?>>周三</option>
  33. <option value="4"<?php echo $chooseMonth == 4?" selected=selected":'';?>>周四</option>
  34. <option value="5"<?php echo $chooseMonth == 5?" selected=selected":'';?>>周五</option>
  35. <option value="6"<?php echo $chooseMonth == 6?" selected=selected":'';?>>周六</option>
  36. <option value="7"<?php echo $chooseMonth == 7?" selected=selected":'';?>>周日</option>
  37. </select>
  38. 自动生成
  39. </div>
  40. <div><button id="save-setting" style="margin-top: 10px;" active="true">保存设置</button><span style="color: red">(注意:学生至少需要参加1次考试,否则无法生成)</span></div>
  41. </div>
  42. </div>
  43. <script src="/js/jquery.ajaxfileupload.js"></script>
  44. <script type="text/javascript">
  45. $(document).ready(function () {
  46. $('#save-setting[active="true"]').on('click',function(event){
  47. var This = $(this);
  48. This.attr('active','false');
  49. var week = $('.select-month').val();
  50. if(week){
  51. $.ajax({
  52. url: "<?php echo $this->createUrl('print/ajaxSaveEnglishMonthMainly');?>",
  53. type: "POST",
  54. dataType: "json",
  55. data: {
  56. week:week
  57. },
  58. success: function (data) {
  59. if(data.status == 1){
  60. layer.msg('设置成功', {
  61. time: 2000,
  62. });
  63. setTimeout(function(){window.location.href = "<?php echo Yii::app()->createUrl('print/mainly_revision');?>";}, 2000);
  64. }else{
  65. layer.msg(data.error.join('</br>'));
  66. This.attr("active","true");
  67. }
  68. }
  69. });
  70. }else{
  71. This.attr('active','true');
  72. }
  73. });
  74. });
  75. </script>