add_section.php 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
  5. <meta charset="utf-8"/>
  6. <title>校本课程平台</title>
  7. <meta name="description" content=""/>
  8. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
  9. <!-- bootstrap & fontawesome -->
  10. <link rel="stylesheet" href="/css/bootstrap.min.css"/>
  11. <link rel="stylesheet" href="/css/font-awesome/4.2.0/css/font-awesome.min.css"/>
  12. <!-- page specific plugin styles -->
  13. <!-- text fonts -->
  14. <link rel="stylesheet" href="/css/fonts/fonts.googleapis.com.css"/>
  15. <!-- ace styles -->
  16. <link rel="stylesheet" href="/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style"/>
  17. <!--[if lte IE 9]>
  18. <link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet"/>
  19. <![endif]-->
  20. <link rel="stylesheet" href="/css/style.css"/>
  21. <!--[if lte IE 9]>
  22. <link rel="stylesheet" href="assets/css/ace-ie.min.css"/>
  23. <![endif]-->
  24. <!-- inline styles related to this page -->
  25. <!-- ace settings handler -->
  26. <script src="/js/ace-extra.min.js"></script>
  27. <script src="/js/jquery-2.2.2.min.js"></script>
  28. <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->
  29. <script src="/js/layer/layer.js"></script>
  30. <!--[if lte IE 8]>
  31. <script src="assets/js/html5shiv.min.js"></script>
  32. <script src="assets/js/respond.min.js"></script>
  33. <![endif]-->
  34. <script type="text/javascript">
  35. var ratehtml = '';
  36. jQuery(document).ready(function () {
  37. //学年
  38. var usedSchoolYear=[];
  39. var schoolYearId=[],
  40. schoolYearName=[];
  41. <?php
  42. if(isset($schoolYear)){
  43. foreach ($schoolYear as $value){
  44. echo "schoolYearId.push('".$value['schoolYearId']."');";
  45. echo "schoolYearName.push('".$value['schoolYearName']."');";
  46. }
  47. }
  48. ?>
  49. $('.addScale').click(function(){
  50. var usedSchoolYear=[];
  51. var html='<tr>';
  52. //读取已选择学年
  53. var select=$('#scale').find('.school_year');
  54. if(select.length>0){
  55. for(var i=0;i<select.length;i++){
  56. usedSchoolYear.push(select.eq(i).val());
  57. }
  58. }
  59. html+='<td>';
  60. html+='<select class="school_year" name="schoolScale[]">';
  61. for(var i=0;i<schoolYearId.length;i++){
  62. if($.inArray(schoolYearId[i],usedSchoolYear)!=-1){
  63. }else{
  64. html+='<option value="'+schoolYearId[i]+'">'+schoolYearName[i]+'</option>';
  65. }
  66. }
  67. html+='</select>';
  68. html+='</td>';
  69. html+='<td><input type="text" name="highSchoolSix[]" class="customInput grade_6" /></td>';
  70. html+='<td><input type="text" name="highSchoolSeven[]" class="customInput grade_7" /></td>';
  71. html+='<td><input type="text" name="highSchoolEight[]" class="customInput grade_8" /></td>';
  72. html+='<td><input type="text" name="highSchoolNine[]" class="customInput grade_9" /></td>';
  73. html+='<td><span class="remove_tr">移除</span></td>';
  74. html+='</tr>';
  75. $('#scale').append(html);
  76. });
  77. $('#addrate').click(function(){
  78. var usedSchoolYear=[];
  79. //读取已选择学年
  80. var select=$('#rate').find('.school_year');
  81. if(select.length>0){
  82. for(var i=0;i<select.length;i++){
  83. usedSchoolYear.push(select.eq(i).val());
  84. }
  85. }
  86. console.log(usedSchoolYear);
  87. html='';
  88. for(var i=0;i<schoolYearId.length;i++){
  89. if($.inArray(schoolYearId[i],usedSchoolYear)!=-1){
  90. }else{
  91. html+='<option value="'+schoolYearId[i]+'">'+schoolYearName[i]+'</option>';
  92. }
  93. }
  94. $("#hidrate").find('.school_year').html(html);
  95. $('#rate').append($("#hidrate").html())
  96. });
  97. jQuery(window.parent.document).find("#iframe").ready(function () {
  98. jQuery(window.parent.document).find(".menuLi, .menuTop").click(function () {
  99. var url = jQuery(this).attr("url");
  100. window.parent.location.href = "xxx" + url;
  101. });
  102. window.parent.document.url = window.location.href;
  103. var main = jQuery(window.parent.document).find("#iframe");
  104. var thisheight = jQuery("body").height() + 30;
  105. main.height(thisheight);
  106. });
  107. jQuery(window.parent.document).find("#iframe").load(function () {
  108. var main = jQuery(window.parent.document).find("#iframe");
  109. var thisheight = jQuery("body").height() + 30;
  110. main.height(thisheight);
  111. });
  112. });
  113. jQuery(document).ready(function () {
  114. $('.steps-choose').click(function(){
  115. $('.steps-choose').removeClass('show');
  116. $(this).addClass('show');
  117. });
  118. $('#my_wp').click(function () {
  119. var use_wp = $("input[name=use_wp]:checked").val();
  120. var data = {
  121. use_wp: use_wp
  122. };
  123. $.post("<?php echo Yii::app()->createUrl('school/setusewp')?>", data, function (flags) {
  124. var m = JSON.parse(flags);
  125. if (m.status) {
  126. var data1 = {
  127. wp8K: parseInt(m.wp)
  128. };
  129. evaluationClient.SetPaperMode(JSON.stringify(data1));
  130. layer.msg('保存成功', {
  131. icon: 1
  132. }, function () {
  133. layer.closeAll();
  134. location.reload();
  135. });
  136. } else {
  137. layer.msg('保存失败', {
  138. icon: 5
  139. }, function () {
  140. layer.closeAll();
  141. location.reload();
  142. });
  143. }
  144. });
  145. })
  146. $('#scale').on('click','.remove_tr',function(){
  147. $(this).closest('tr').remove();
  148. })
  149. });
  150. function check() {
  151. $("#profileyear").val($("#year").html())
  152. return true;
  153. }
  154. function checknum(str, obj) {
  155. obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
  156. obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
  157. obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
  158. obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
  159. }
  160. </script>
  161. <style type="text/css">
  162. .errorMessage {
  163. color: red;
  164. margin-left: 10px;
  165. }
  166. .breadcrumb > li {
  167. padding: 3px 5px;
  168. color: #fff;
  169. background: #6fb3e0;
  170. }
  171. .breadcrumb > li > a {
  172. color: #fff !important;
  173. }
  174. .li_backgrond_color {
  175. background-color: #00CC99 !important;
  176. }
  177. .li_backgrond_color > a {
  178. color: #fff !important;
  179. }
  180. .breadcrumb > li + li:before {
  181. display: none;
  182. }
  183. .steps-choose table th {
  184. text-align: right;
  185. width: 200px;
  186. }
  187. .icon {
  188. display: inline-block;
  189. background: center/contain no-repeat;
  190. width: 25px;
  191. height: 25px;
  192. cursor: pointer;
  193. vertical-align: middle;
  194. }
  195. .icon-edit {
  196. background-image: url("/images/edit.png")
  197. }
  198. .confirmbox {
  199. background: #fff;
  200. border: 1px solid #cccccc;
  201. border-radius: 3px;
  202. padding: 40px 40px 30px;
  203. text-align: center;
  204. position: fixed;
  205. left: 50%;
  206. top: 50%;
  207. transform: translate(-50%, -50%);
  208. z-index: 99;
  209. }
  210. .confirmbox-mask {
  211. background: rgba(0, 0, 0, .7);
  212. left: 0;
  213. right: 0;
  214. top: 0;
  215. bottom: 0;
  216. z-index: 99;
  217. position: fixed;
  218. }
  219. button {
  220. border: none;
  221. background: #009965;
  222. width: 111px;
  223. height: 36px;
  224. border-radius: 3px;
  225. font-size: 14px;
  226. color: #fff;
  227. outline: none;
  228. cursor: pointer;
  229. }
  230. button.save {
  231. display: block;
  232. margin: 40px auto;
  233. }
  234. .confirmbox .confirmbox-btns {
  235. margin-top: 40px;
  236. }
  237. .icon-close{
  238. background-image: url("/images/close.png")
  239. }
  240. .class-modal {
  241. width: 700px;
  242. min-height: 400px;
  243. background: #fff;
  244. border-radius: 5px;
  245. position: absolute;
  246. top: 50%;
  247. left: 50%;
  248. transform: translate(-50%, -50%);
  249. padding: 20px;
  250. }
  251. .class-modal-head {
  252. font-size: 20px;
  253. font-weight: bold;
  254. text-align: center;
  255. }
  256. .class-modal-body {
  257. margin-top: 20px;
  258. max-height: 300px;
  259. overflow: auto;
  260. }
  261. .class-modal-body .classes {
  262. margin-bottom: 10px;
  263. }
  264. .class-modal-body .classes > div {
  265. display: inline-block;
  266. max-width: 640px;
  267. vertical-align: top;
  268. }
  269. .class-modal-body label {
  270. text-decoration: none;
  271. display: inline-block;
  272. margin: 0 5px 5px;
  273. width:140px;
  274. font-size: 14px;
  275. }
  276. .class-modal-body .classes a.active {
  277. color: #fc091b
  278. }
  279. .class-modal .class_btn{
  280. margin:10px 0;
  281. text-align: center;
  282. }
  283. .class-modal .class_btn button{
  284. margin:5px;
  285. }
  286. .class-modal .icon-close{
  287. position: absolute;
  288. right: 20px;
  289. top: 20px;
  290. }
  291. .c-red {
  292. color: #CC3300
  293. }
  294. .subject-name {
  295. display: inline-block;
  296. padding: 3px 8px;
  297. background: #ff9900;
  298. border-radius: 3px;
  299. color: #ffffff;
  300. font-size: 12px;
  301. }
  302. .steps-choose table th{
  303. text-align: left;
  304. width: auto;
  305. }
  306. .steps-choose table tr th:first-child{
  307. text-align: right;
  308. padding-right: 20px;
  309. width: 200px;
  310. }
  311. .thin_font{font-weight: normal;}
  312. .independentPd{width:800px;}
  313. .customInput{width:60px;}
  314. .hgc_tag{
  315. position: relative;
  316. display: inline-block;
  317. height: 25px;
  318. line-height:25px;
  319. padding: 0 10px;
  320. border: 1px solid #333;
  321. font-size: 14px;
  322. margin:6px 5px;
  323. }
  324. .hgc_tag .close{
  325. position: absolute;
  326. right: -5px;
  327. top: -5px;
  328. color: #fff;
  329. background: #15ae68;
  330. font-size: 12px;
  331. font-style: normal;
  332. width: 15px;
  333. height: 15px;
  334. text-align: center;
  335. line-height: 15px;
  336. border-radius: 50%;
  337. cursor: pointer;
  338. opacity: 1;
  339. }
  340. .steps-choose.show .table-hide{
  341. padding:10px 20px;
  342. }
  343. .class-modal-1 {
  344. width: 500px;
  345. min-height: 220px;
  346. background: #fff;
  347. border-radius: 5px;
  348. position: absolute;
  349. top: 50%;
  350. left: 50%;
  351. transform: translate(-50%, -50%);
  352. }
  353. .class-modal-head-1 {
  354. font-size: 14px;
  355. text-align: left;
  356. color:#fff;
  357. line-height:30px;
  358. background: #2977ff;
  359. padding-left:15px;
  360. }
  361. .class-modal-body-1{
  362. padding:15px;
  363. }
  364. .class-modal-body-1 h2,.class-modal-body-1 h3{
  365. font-size:14px;
  366. font-weight:normal;
  367. margin-top:10px;
  368. }
  369. .class-modal-body-1 h3 span{
  370. font-size:10px;
  371. color:#ccc;
  372. }
  373. .class-modal-body-1 label{
  374. display: inline-block;
  375. font-weight: normal;
  376. margin-right: 40px;
  377. height:30px;
  378. }
  379. .class-modal-1 .icon-close-1{
  380. position: absolute;
  381. right: 10px;
  382. top:5px;
  383. }
  384. .class-modal-1 .class_area{
  385. height:115px;
  386. border:1px solid #ccc;
  387. padding:5px;
  388. overflow-y: auto;
  389. margin-bottom:15px;
  390. }
  391. .class-modal-1 .checkAll{
  392. position:absolute;
  393. right:5px;
  394. top:115px;
  395. }
  396. .class-modal-1 .subsection{
  397. }
  398. .class-modal-1 .btn p{color:#000;}
  399. .class-modal-1 .btn_area{
  400. margin-top:20px;
  401. text-align: center;
  402. }
  403. .class-modal-1 .btn_area p{
  404. display: inline-block;
  405. }
  406. .class-modal-1 .btn_area button{
  407. width:80px;
  408. height:25px;
  409. margin-left:5px;
  410. }
  411. .class-modal-1 .btn_area .cancel{
  412. background: #fff;
  413. color:#000;
  414. border:1px solid #666;
  415. }
  416. .icon-close-1{
  417. background-image: url("/images/chose.png");
  418. background-size: 15px,15px;
  419. }
  420. .subject-area {
  421. font-size:16px;
  422. }
  423. input[name=stu-login-permission]{
  424. margin-left: 15px;
  425. }
  426. </style>
  427. </head>
  428. <body class="no-skin">
  429. <!-- 导航栏开始-->
  430. <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
  431. <!-- 导航栏结束-->
  432. <div class="shade"></div>
  433. <div class="main-container" id="main-container">
  434. <div class="main-content">
  435. <?php if ($schoocontact === null) { ?>
  436. <input type='hidden' name='actionsc' value='add'>
  437. <?php } else { ?>
  438. <input type='hidden' name='actionsc' value='edit'>
  439. <?php } ?>
  440. <?php if ($schoolentrancerate === null) { ?>
  441. <input type='hidden' name='actionse' value='add'>
  442. <?php } else { ?>
  443. <input type='hidden' name='actionse' value='edit'>
  444. <?php } ?>
  445. <?php if ($schoolprofile === null) { ?>
  446. <input type='hidden' name='actionsp' value='add'>
  447. <?php } else { ?>
  448. <input type='hidden' name='actionsp' value='edit'>
  449. <?php } ?>
  450. <div class="step-five steps-choose show">
  451. <h3 style="padding-left: 20px">设置8K纸张</h3>
  452. <table class="table-hide" style="margin-top: 15px;">
  453. <tbody>
  454. <tr style="line-height:40px">
  455. <th>8K纸张:&nbsp;</th>
  456. <td>
  457. <input class="ace" type="radio" <?php if ($schoolinfo->use_wp == 0) {
  458. echo ' checked="checked"';
  459. } ?> value="0" name="use_wp">8k类型(260*370)
  460. <input class="ace" type="radio" <?php if ($schoolinfo->use_wp == 1) {
  461. echo ' checked="checked"';
  462. } ?> value="1" name="use_wp">8k类型(270*390)
  463. </td>
  464. </tr>
  465. </tbody>
  466. </table>
  467. <div class="create-orders table-hide">
  468. <input type="button" id="my_wp" class="btn btn-success btn-sm" value="保存" style="width:100px">
  469. </div>
  470. </div>
  471. <div class="step-one steps-choose ">
  472. <h3 style="padding-left: 20px">基本信息</h3>
  473. <table class="table-hide" style="margin-top: 15px">
  474. <tbody>
  475. <tr style="line-height:40px">
  476. <th>学校名称:</th>
  477. <td><span><?php echo $schoolinfo['school_name'] ?></span></td>
  478. </tr>
  479. <tr style="line-height:40px">
  480. <th>学校地址:</th>
  481. <td>
  482. <span><?php echo isset($area[0]['region_name']) ? $area[0]['region_name'] : '' ?></span>-<span><?php echo isset($area[1]['region_name']) ? $area[1]['region_name'] : '' ?></span>-<span><?php echo isset($area[2]['region_name']) ? $area[2]['region_name'] : '' ?></span>-<span><?php echo $schoolinfo['address'] ?></span>
  483. </td>
  484. </tr>
  485. <tr style="line-height:40px">
  486. <th>邮编:</th>
  487. <td><span><?php echo $schoolinfo['postcode'] ?></span></td>
  488. </tr>
  489. <tr style="line-height:40px">
  490. <th>联系电话:</th>
  491. <td><span><?php echo $schoolinfo['phone'] ?></span></td>
  492. </tr>
  493. <tr style="line-height:40px">
  494. <th>类型:</th>
  495. <td><span><?php echo $schoolinfo['client'] == 1 ? "非客户学校" : "客户学校"; ?></span></td>
  496. </tr>
  497. <tr style="line-height:40px">
  498. <th>简介:</th>
  499. <td><span><?php echo $schoolinfo['intro'] ?></span></td>
  500. </tr>
  501. </tbody>
  502. </table>
  503. </div>
  504. <div class="step-one steps-choose ">
  505. <h3 style="padding-left: 20px">学段设置</h3>
  506. <table class="table-hide" style="margin-top: 15px">
  507. <tbody>
  508. <tr style="line-height:40px">
  509. <th>学段:</th>
  510. <td>
  511. <select class="gradeGroup">
  512. <?php
  513. if($gradeGroup){
  514. foreach ($gradeGroup as $item){
  515. if($item['group_id']==$schoolinfo['grade_group_id']){
  516. echo '<option value="'.$item['group_id'].'" selected>'.$item['group_name'].'</option>';
  517. }else{
  518. echo '<option value="'.$item['group_id'].'">'.$item['group_name'].'</option>';
  519. }
  520. }
  521. }
  522. ?>
  523. </select>
  524. </td>
  525. <td> <span class="red">注:下拉框内可选择学段名称模式,系统默认按三年制1设置,
  526. 仅支持修改一次,请核对选择后再点击确认按钮</span>
  527. </td>
  528. </tr>
  529. <tr style="line-height:40px">
  530. <th valign="top">学制:</th>
  531. <td>
  532. <span class="showGradeConfig"></span>
  533. </td>
  534. <td></td>
  535. </tr>
  536. <tr style="line-height:40px">
  537. <th valign="top"></th>
  538. <td>
  539. <div class="create-orders table-hide">
  540. <?php
  541. if ((isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag'] == 1)) || (isset($schoolinfo['grade_group_changed']) && $schoolinfo['grade_group_changed']==0)):
  542. ?>
  543. <input type="button" id="saveGradeSection" class="btn btn-success btn-sm" value="确认" style="width:100px">
  544. <?php endif;?>
  545. </div>
  546. </td>
  547. <td></td>
  548. </tr>
  549. </tbody>
  550. </table>
  551. </div>
  552. <?php if(Yii::app()->params['section']==1):?>
  553. <div class="step-seven steps-choose ">
  554. <h3 style="padding-left: 20px">文理科设置</h3>
  555. <table class="table-hide" style="margin-top: 15px">
  556. <tbody>
  557. <?php
  558. if(isset($grade) && $grade){
  559. $checked=array(
  560. 0=>'',
  561. 1=>''
  562. );
  563. foreach ($grade as $key=> $value){
  564. if($value['arts_science']==1){
  565. $checked[0]="checked";
  566. $checked[1]="";
  567. }elseif($value['arts_science']==2){
  568. $checked[1]="checked";
  569. $checked[0]="";
  570. }
  571. $ids_1='';
  572. $names_1='';
  573. $ids_2='';
  574. $names_2='';
  575. if(isset($arts_science[$value['id']][1]['ids']) && isset($arts_science[$value['id']][1]['names'])){
  576. $ids_1=implode(',',$arts_science[$value['id']][1]['ids']);
  577. $names_1=implode(',',$arts_science[$value['id']][1]['names']);
  578. }
  579. if(isset($arts_science[$value['id']][2]['ids']) && isset($arts_science[$value['id']][2]['names'])){
  580. $ids_2=implode(',',$arts_science[$value['id']][2]['ids']);
  581. $names_2=implode(',',$arts_science[$value['id']][2]['names']);
  582. }
  583. echo '<tr style="line-height:40px">';
  584. echo '<th>'.$value['grade_name'].'</th>';
  585. echo '<th><input class="ace changeAS grade" type="radio" id="'.$value['id'].'" name="as_'.$key.'" '.$checked[0].' value="1">不分科 <input class="ace changeAS" '.$checked[1].' id="'.$value['id'].'" name="as_'.$key.'" type="radio" value="2">文理分科</th>';
  586. echo '</tr>';
  587. if($value['arts_science']==2){
  588. echo '<tr class="ClassList_'.$value['id'].'">';
  589. }else{
  590. echo '<tr class="ClassList_'.$value['id'].'" style="display: none">';
  591. }
  592. echo '<th>文科班:</th>';
  593. echo '<th><span class="thin_font list_'.$value['id'].'_1">'.$names_1.'</span><i id="'.$value['id'].'" type="1" name="'.$value['grade_name'].'年级 文科班选择" class="icon icon-edit add_class" style="font-style: normal;color:#15ae68 "></i></th>';
  594. echo '</tr>';
  595. if($value['arts_science']==2){
  596. echo '<tr class="ClassList_'.$value['id'].'">';
  597. }else{
  598. echo '<tr class="ClassList_'.$value['id'].'" style="display: none">';
  599. }
  600. echo '<th>理科班:</th>';
  601. echo '<th><span class="thin_font list_'.$value['id'].'_2">'.$names_2.'</span><i id="'.$value['id'].'" type="2" name="'.$value['grade_name'].'年级 理科班选择" class="icon icon-edit add_class" style="font-style: normal;color:#15ae68 "></i></th>';
  602. echo '<input type="hidden" name="grade_'.$value['id'].'_1" value="'.$ids_1.'"><input type="hidden" name="grade_'.$value['id'].'_2" value="'.$ids_2.'">';
  603. echo '</tr>';
  604. }
  605. }
  606. ?>
  607. </tbody>
  608. </table>
  609. <div class="create-orders table-hide">
  610. <input type="button" id="SaveArtsAndScience" class="btn btn-success btn-sm" value="保存" style="width:100px">
  611. </div>
  612. </div>
  613. <?php endif;?>
  614. <div class="step-eight steps-choose ">
  615. <h3 style="padding-left: 20px">自定义学科设置</h3>
  616. <div class="table-hide subject-icon">
  617. <?php
  618. if(isset($extendSubjectSchool) && $extendSubjectSchool){
  619. foreach ($extendSubjectSchool as $key=> $value){
  620. echo '<span class="hgc_tag">'.$value['subject_name'];
  621. if($value['used']==0){
  622. echo '<i subject_id="'.$value['subject_id'].'" class="close">X</i>';
  623. }
  624. echo '</span>';
  625. }
  626. }else{
  627. echo '暂未添加自定义科目';
  628. }
  629. ?>
  630. </div>
  631. <div class="create-orders table-hide">
  632. <input type="button" id="selectSubjects" class="btn btn-success btn-sm" value="添加学科" style="width:100px">
  633. </div>
  634. </div>
  635. <?php if (!isset(Yii::app()->session["crmUserInfo"])) {
  636. if ($grade) { ?>
  637. <div class="step-three steps-choose">
  638. <h3 style="padding-left: 20px">设置学校准考证号&nbsp;<i class="fa fa-plus"
  639. style="font-style: normal;color:#15ae68 "></i></h3>
  640. <form action="<?php echo Yii::app()->createUrl('school/grade_insert') ?>" method="post" id="orderAdd"
  641. onsubmit="return gradecheck();">
  642. <ul class="table-hide">
  643. <?php foreach ($grade as $v) { ?>
  644. <li class="row marginNo table-hide-li pt20" style="width: 760px">
  645. <div class="textRight fl " style="width:160px;line-height: 80px;height: 80px"><span
  646. class="mt15"><?php echo $v->grade_name ?>:</span>&nbsp;
  647. </div>
  648. <div class="col-xs-9 paddingNo fl ">
  649. <div class="col-xs-9 fl lineHeight40">
  650. 准考证号位数:&nbsp;&nbsp;<input class="students-search" type="text" placeholder=""
  651. name="card_length<?php echo $v->id ?>"
  652. value='<?php echo $v->card_length ?>'
  653. style="width:50px;">&nbsp;位
  654. </div>
  655. <div class="col-xs-8 fl lineHeight40 text-left">
  656. <span style="float: left">是否开启准考证号:</span>&nbsp;&nbsp;<div
  657. class="col-sm-4 mt6 ">
  658. <span class="inline blue">
  659. <input type="radio" class="ace" name="card_status<?php echo $v->id ?>"
  660. value="1" <?php echo $v->card_status == 1 ? "checked" : '' ?>>
  661. <span> 是</span>
  662. </span>
  663. &nbsp;&nbsp;
  664. <span class="inline blue">
  665. <input type="radio" class="ace" name="card_status<?php echo $v->id ?>"
  666. value="0" <?php echo $v->card_status == 0 ? "checked" : '' ?>>
  667. <span> 否</span>
  668. </span>
  669. </div>
  670. </div>
  671. </div>
  672. </li>
  673. <?php } ?>
  674. </ul>
  675. <div class="create-orders table-hide" style="line-height: 24px;color: red">
  676. 1、修改学校准考证号位数时,同时修改学生的学校准考证号的位数,两者位数必须一致,否则无法使用。&nbsp;<br>2、如:学校准考证号设置为5位,学生的学校准考证号为“12345”<br>3、准考证号位数最好在14位内
  677. </div>
  678. <div class="create-orders table-hide">
  679. <input type="submit" name="grade_submit" id="grade_submit" class="btn btn-success btn-sm"
  680. value="保存" style="width:100px">
  681. </div>
  682. </div><?php }
  683. } ?>
  684. </form>
  685. </div>
  686. <div class="step-two steps-choose">
  687. <h3 style="padding-left: 20px">联系人</h3>
  688. <form action="<?php echo Yii::app()->createUrl('school/contact_insert') ?>" method="post" id="orderAdd"
  689. onsubmit="return check_contact();">
  690. <table class="table-hide" style="margin-top: 15px;">
  691. <tbody>
  692. <tr style="line-height:40px">
  693. <th>校长:&nbsp;</th>
  694. <td>
  695. <input class="students-search" type="text" placeholder="" name="schoolMasterName"
  696. value='<?php echo $schoocontact['schoolMasterName'] ?>' style="width:240px">
  697. </td>
  698. <th>校长联系电话:&nbsp;</th>
  699. <td>
  700. <input class="students-search" type="text" placeholder="" name="schoolMasterMobile"
  701. value='<?php echo $schoocontact['schoolMasterMobile'] ?>' style="width:240px">
  702. </td>
  703. </tr>
  704. <tr style="line-height:40px">
  705. <th>分管项目副校长:&nbsp;</th>
  706. <td>
  707. <input class="students-search" type="text" placeholder="" name="schoolMaster2Name"
  708. value='<?php echo $schoocontact['schoolMaster2Name'] ?>' style="width:240px">
  709. </td>
  710. <th>分管项目副校长联系电话:&nbsp;</th>
  711. <td>
  712. <input class="students-search" type="text" placeholder="" name="schoolMaster2Mobile"
  713. value='<?php echo $schoocontact['schoolMaster2Mobile'] ?>' style="width:240px">
  714. </td>
  715. </tr>
  716. </tbody>
  717. </table>
  718. <div class="create-orders table-hide">
  719. <input type="submit" name="my_submit" id="my_submit" class="btn btn-success btn-sm checkRepeat" value="保存"
  720. style="width:100px">
  721. </div>
  722. </form>
  723. </div>
  724. <div class="step-four steps-choose">
  725. <h3 style="padding-left: 20px">学校概况</h3>
  726. <form action="<?php echo Yii::app()->createUrl('school/profile_insert') ?>" method="post" id="orderAdd">
  727. <ul class="table-hide">
  728. <li class="row marginNo table-hide-li pt20 ">
  729. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">建校年份:</span>&nbsp;
  730. </div>
  731. <div class="fl col-xs-9 paddingNo">
  732. <div class='diy_select' style="width:238px;float: left;">
  733. <input type='hidden' class='diy_select_input' id="profileyear" name="profile[schoolBuildYear]"
  734. value="<?php echo $schoolprofile['schoolBuildYear'] ?>"/>
  735. <div class='diy_select_txt' style="width:205px;"
  736. id="year"><?php if ($schoolprofile['schoolBuildYear']) {
  737. echo $schoolprofile['schoolBuildYear'];
  738. } else {
  739. echo '选择年份';
  740. } ?></div>
  741. <div class='diy_select_btn'></div>
  742. <ul class='diy_select_list'>
  743. <?php for ($i = 1900; $i < (int)date("Y"); $i++) { ?>
  744. <li val="<?php echo $i; ?>" class=""><?php echo $i; ?></li>
  745. <?php } ?>
  746. </ul>
  747. </div>
  748. </li>
  749. <?php if(Yii::app()->params['section']!=0):?>
  750. <li class="row marginNo table-hide-li pt20">
  751. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">教材版本</span>&nbsp;
  752. </div>
  753. <div class="col-xs-9 paddingNo fl">
  754. <select name="profile[bookVersion]">
  755. <option value="1" <?php if($schoolprofile['bookVersion']==1) echo 'selected'?>>人教A版</option>
  756. <option value="2" <?php if($schoolprofile['bookVersion']==2) echo 'selected'?>>人教B版</option>
  757. <option value="3" <?php if($schoolprofile['bookVersion']==3) echo 'selected'?>>苏教版</option>
  758. <option value="4" <?php if($schoolprofile['bookVersion']==4) echo 'selected'?>>北师大版</option>
  759. <option value="5" <?php if($schoolprofile['bookVersion']==5) echo 'selected'?>>湘教版</option>
  760. </select>
  761. </div>
  762. </li>
  763. <?php endif;?>
  764. <li class="row marginNo table-hide-li pt20">
  765. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">文理科</span>&nbsp;
  766. </div>
  767. <div class="col-xs-9 paddingNo fl">
  768. <select name="profile[artsAndScience]">
  769. <option value="1" <?php if($schoolprofile['artsAndScience']==1) echo 'selected'?>>重文</option>
  770. <option value="2" <?php if($schoolprofile['artsAndScience']==2) echo 'selected'?>>重理</option>
  771. <option value="3" <?php if($schoolprofile['artsAndScience']==3) echo 'selected'?>>文理均衡</option>
  772. </select>
  773. </div>
  774. </li>
  775. <li class="row marginNo table-hide-li pt20">
  776. <div class="textRight lineHeight30 fl" style="width:160px"><span class="">学校性质:</span>&nbsp;</div>
  777. <div class="col-xs-9 paddingNo fl">
  778. <div class="col-sm-12 paddingNo mt6">
  779. <span class="inline blue mr15">
  780. <input class="ace"
  781. type="radio" <?php if ($schoolprofile['schoolNature'] == "0" || $schoolprofile['schoolNature'] == "") {
  782. echo ' checked="checked"';
  783. } ?> name="profile[schoolNature]" value="0">
  784. <span class="lbl middle">民办</span>
  785. </span>
  786. <span class="inline blue">
  787. <input class="ace"
  788. type="radio" <?php if ($schoolprofile['schoolNature'] == "1" ) {
  789. echo ' checked="checked"';
  790. } ?> name="profile[schoolNature]" value="1">
  791. <span class="lbl middle">公办</span>
  792. </span>
  793. </div>
  794. </div>
  795. </li>
  796. <li class="row marginNo table-hide-li pt20">
  797. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">学校类型:</span>&nbsp;
  798. </div>
  799. <div class="col-xs-9 paddingNo fl">
  800. <select name="profile[schoolType]">
  801. <option value="0" <?php if($schoolprofile['schoolType']==0) echo 'selected'?>>普通</option>
  802. <option value="1" <?php if($schoolprofile['schoolType']==1) echo 'selected'?>>省重点</option>
  803. <option value="2" <?php if($schoolprofile['schoolType']==2) echo 'selected'?>>市重点</option>
  804. <option value="3" <?php if($schoolprofile['schoolType']==3) echo 'selected'?>>县重点</option>
  805. </select>
  806. </div>
  807. </li>
  808. <li class="row marginNo table-hide-li pt20">
  809. <div class="textRight lineHeight30 fl" style="width:160px"><span class="">是否设少数民族:</span>&nbsp;
  810. </div>
  811. <div class="col-xs-9 paddingNo fl">
  812. <div class="col-sm-12 paddingNo mt6">
  813. <span class="inline blue mr15">
  814. <input class="ace"
  815. type="radio" <?php if ($schoolprofile['isMinority'] == "1") {
  816. echo ' checked="checked"';
  817. } ?> value="1"
  818. name="profile[isMinority]">
  819. <span class="lbl middle">是</span>
  820. </span>
  821. <span class="inline blue mr15">
  822. <input class="ace" type="radio" <?php if (!$schoolprofile['isMinority']) {
  823. echo ' checked="checked"';
  824. } ?> value="0" name="profile[isMinority]">
  825. <span class="lbl middle">否</span>
  826. </span>
  827. </div>
  828. </div>
  829. </li>
  830. <li class="row marginNo table-hide-li pt20">
  831. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">寄宿制形式:</span>&nbsp;
  832. </div>
  833. <div class="col-xs-9 paddingNo fl">
  834. <div class='diy_select' style="width:238px;float: left;">
  835. <input type='hidden' class='diy_select_input' id="type_id" name="profile[isStaying]"
  836. value="<?php echo $schoolprofile['isStaying'] ?>"/>
  837. <div class='diy_select_txt'
  838. style="width:205px;"><?php echo $schoolprofile['isStaying'] == 1 ? "寄宿制" : "非寄宿制" ?></div>
  839. <div class='diy_select_btn'></div>
  840. <ul class='diy_select_list'>
  841. <li val="0">非寄宿制</li>
  842. <li val="1">寄宿制</li>
  843. </ul>
  844. </div>
  845. </li>
  846. <li class="row marginNo table-hide-li pt20">
  847. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">升学率:</span>&nbsp;
  848. </div>
  849. <div class="col-xs-9 paddingNo fl">
  850. <div class="mt6"><a href="javascript:void(0);" id="addrate" >+添加</a></div>
  851. <div class="clearfix mt15 independentPd" id="rate">
  852. <?php
  853. if (!empty($schoolentrancerate)) {
  854. foreach ($schoolentrancerate as $k => $v) {
  855. ?>
  856. <div class="customK">
  857. <span class="inline blue mr15">
  858. <select class="school_year" name="schoolYear[]">
  859. <?php
  860. if(isset($schoolYear)){
  861. foreach ($schoolYear as $value){
  862. if(strcmp($v['schoolYearId'],$value['schoolYearId'])==0){
  863. echo '<option value="'.$value['schoolYearId'].'" selected>'.$value['schoolYearName'].'</option>';
  864. }else{
  865. echo '<option value="'.$value['schoolYearId'].'" >'.$value['schoolYearName'].'</option>';
  866. }
  867. }
  868. }
  869. ?>
  870. </select>
  871. </span>
  872. <span class="inline blue mr15">
  873. 中考录取率
  874. <input class="customInput" name="upRate[]" type="text" value="<?php echo $v['highSchoolRate'] ?>" onkeyup="checknum(this.value,this)"> %
  875. </span>
  876. <a href="javascript:;">删除</a>
  877. </div>
  878. <?php }
  879. } ?>
  880. </div>
  881. </div>
  882. </li>
  883. <li class="row marginNo table-hide-li pt20">
  884. <div class="textRight lineHeight30 fl" style="width:160px"><span class="mt15">学校规模:</span>&nbsp;
  885. </div>
  886. <div class="col-xs-9 paddingNo fl">
  887. <div class="mt6"><a href="javascript:void(0);" class="addScale">+添加</a></div>
  888. <table id="scale" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" >
  889. <tr>
  890. <th>学年</th>
  891. <th>六年级规模</th>
  892. <th>七年级规模</th>
  893. <th>八年级规模</th>
  894. <th>九年级规模</th>
  895. </tr>
  896. <?php
  897. if($scale){
  898. foreach ($scale as $val){
  899. ?>
  900. <tr>
  901. <td>
  902. <select class="school_year" name="schoolScale[]">
  903. <?php
  904. if(isset($schoolYear)){
  905. foreach ($schoolYear as $value){
  906. if(strcmp($val['schoolYearId'],$value['schoolYearId'])==0){
  907. echo '<option value="'.$value['schoolYearId'].'" selected>'.$value['schoolYearName'].'</option>';
  908. }else{
  909. echo '<option value="'.$value['schoolYearId'].'" >'.$value['schoolYearName'].'</option>';
  910. }
  911. }
  912. }
  913. ?>
  914. </select>
  915. </td>
  916. <td><input type="text" name="highSchoolSix[]" value="<?php echo $val['highSchoolSix']?>"></td>
  917. <td><input type="text" name="highSchoolSeven[]" value="<?php echo $val['highSchoolSeven']?>"></td>
  918. <td><input type="text" name="highSchoolEight[]" value="<?php echo $val['highSchoolEight']?>"></td>
  919. <td><input type="text" name="highSchoolNine[]" value="<?php echo $val['highSchoolNine']?>"></td>
  920. </tr>
  921. <?php
  922. }
  923. }
  924. ?>
  925. </table>
  926. </div>
  927. </li>
  928. </ul>
  929. <div class="create-orders table-hide">
  930. <input type="submit" name="my_submit" id="my_submit" class="btn btn-success btn-sm" value="保存"
  931. style="width:100px">
  932. </div>
  933. </form>
  934. <div id="hidrate" style="display:none">
  935. <div class="customK">
  936. <span class="inline blue mr15">
  937. <select class="school_year" name="schoolYear[]">
  938. <?php
  939. if(isset($schoolYear)){
  940. foreach ($schoolYear as $value){
  941. echo '<option value="'.$value['schoolYearId'].'" >'.$value['schoolYearName'].'</option>';
  942. }
  943. }
  944. ?>
  945. </select>
  946. </span>
  947. <span class="inline blue mr15">
  948. 中考录取率
  949. <input class="customInput" name="upRate[]" type="text" value="" onkeyup="checknum(this.value,this)"> %
  950. </span>
  951. <a href="javascript:;">删除</a>
  952. </div>
  953. </div>
  954. </div>
  955. <div class="step-six steps-choose">
  956. <h3 style="padding-left: 20px">安全与隐私</h3>
  957. <table class="table-hide" style="margin-top: 15px;margin-left: 15px;">
  958. <tbody>
  959. <tr style="line-height: 40px;">
  960. <th style="width: 280px;">校内试卷是否公开于“本省推荐试卷”:</th>
  961. <td>
  962. <select class="customSelect" style="width: 100px;" id="is_private" name="is_private">
  963. <option value="0" <?php if (!$is_private) echo 'selected'?> >公开</option>
  964. <option value="1" <?php if ($is_private) echo 'selected'?>>不公开</option>
  965. </select>
  966. </td>
  967. </tr>
  968. </tbody>
  969. </table>
  970. <div class="table-hide" style="margin-top: 20px;padding-left: 55px;">
  971. <input type="button" name="submit_private" onclick="saveSchoolPrivate()" class="btn btn-success btn-sm" value="保存"
  972. style="width:100px;">
  973. </div>
  974. </div>
  975. <div class="step-nine steps-choose">
  976. <h3 style="padding-left: 20px;">学生平板登录设备权限</h3>
  977. <div class="table-hide">
  978. <div>一个设备登录多个账号<input type="radio" name="stu-login-permission" value="0" <?php echo !$login_permission?"checked='checked'":'';?>></div>
  979. <div style="color:red">注:常用,设备退出登录后可登录多个账号</div>
  980. </br>
  981. <div>一个设备只能登录一个账号<input type="radio" name="stu-login-permission" value="1" <?php echo $login_permission?"checked='checked'":''?>></div>
  982. <div style="color:red">注:课堂平板学习防学生作弊,只能在一个设备上面登录一个账号。<br>修改登录设备:【学生管理】-【学生设置】-【学生端登录ID重置】</div>
  983. </div>
  984. </div>
  985. </div>
  986. <div class="ttd dn">
  987. <div class="s-state clearfix posirela">
  988. <div class="hint_size clearfix">
  989. <span class="fl ml15">错误信息</span>
  990. </div>
  991. <div class="mistake_character">
  992. <p class="ml15" id="err_msg"></p>
  993. <div class="clearfix" style="width:180px;margin:0px auto;text-align:center">
  994. <p class="mt20">
  995. <button class="roger shut">确定</button>
  996. </p>
  997. </div>
  998. </div>
  999. </div>
  1000. </div>
  1001. <!-- /.main-content -->
  1002. <!-- /.main-container -->
  1003. <div class="confirmbox-mask" style="display: none" id="classModal">
  1004. <div class="class-modal">
  1005. </div>
  1006. </div>
  1007. <div class="confirmbox-mask" style="display: none" id="classModal-1">
  1008. <form name="table_set">
  1009. <div class="class-modal-1">
  1010. <i class="icon icon-close-1"></i><div class="class-modal-head-1">添加学科</div>
  1011. <div class="class-modal-body-1">
  1012. <div class="subject-area">
  1013. </div>
  1014. <p align="center" class="red notice">&nbsp;</p>
  1015. <div class="btn_area">
  1016. <button class="cancel icon-close-subject">取消</button>
  1017. <button class="select_subject">确定</button>
  1018. </div>
  1019. </div>
  1020. </div>
  1021. </form>
  1022. </div>
  1023. <!-- basic scripts -->
  1024. <!--[if !IE]> -->
  1025. <!--<script src="/js/jquery.2.1.1.min.js"></script>-->
  1026. <!-- <![endif]-->
  1027. <!--[if IE]>
  1028. <script src="assets/js/jquery.1.11.1.min.js"></script>
  1029. <![endif]-->
  1030. <!--[if !IE]> -->
  1031. <script type="text/javascript">
  1032. window.jQuery || document.write("<script src='/js/jquery.min.js'>" + "<" + "/script>");
  1033. </script>
  1034. <!-- <![endif]-->
  1035. <!--[if IE]>
  1036. <script type="text/javascript">
  1037. window.jQuery || document.write("<script src='assets/js/jquery1x.min.js'>" + "<" + "/script>");
  1038. </script>
  1039. <![endif]-->
  1040. <script type="text/javascript">
  1041. if ('ontouchstart' in document.documentElement) document.write("<script src='/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
  1042. </script>
  1043. <script src="/js/bootstrap.min.js"></script>
  1044. <!-- page specific plugin scripts -->
  1045. <!-- ace scripts -->
  1046. <script src="/js/ace-elements.min.js"></script>
  1047. <script src="/js/ace.min.js"></script>
  1048. <!-- 学校管理 js -->
  1049. <script src="/js/school.management.js"></script>
  1050. <script src="/js/xsgl.js"></script>
  1051. <!-- inline scripts related to this page -->
  1052. <script>
  1053. function check() {
  1054. var card_length = parseInt($("input[name=card_length]").val());
  1055. var regMobile = /[0-9]$/;
  1056. if (!regMobile.test(card_length)) {
  1057. layer.msg('非法数据!');
  1058. return false;
  1059. }
  1060. if (4 > card_length || card_length > 14) {
  1061. layer.msg('不在范围!只能取4--14位');
  1062. return false;
  1063. }
  1064. if (4 <= card_length && card_length <= 14) {
  1065. return true;
  1066. } else {
  1067. layer.msg('非法数据!');
  1068. return false;
  1069. }
  1070. }
  1071. function saveSchoolPrivate() {
  1072. var is_private = $('#is_private').val();
  1073. $.ajax({
  1074. type: 'post',
  1075. data: {'is_private': is_private},
  1076. url: "<?php echo Yii::app()->createUrl('school/saveSchoolPrivate') ;?>",
  1077. dataType: 'json',
  1078. success: function (res) {
  1079. if (res.status){
  1080. layer.alert("保存成功", {icon:1})
  1081. } else{
  1082. layer.msg("保存失败");
  1083. }
  1084. },
  1085. error: function () {
  1086. layer.msg("保存异常");
  1087. }
  1088. })
  1089. }
  1090. function gradecheck() {
  1091. var card_length1 = parseInt($("input[name=card_length1]").val());
  1092. var card_length2 = parseInt($("input[name=card_length2]").val());
  1093. var card_length3 = parseInt($("input[name=card_length3]").val());
  1094. var card_status1 = parseInt($("input[name=card_status1]:checked").val());
  1095. var card_status2 = parseInt($("input[name=card_status2]:checked").val());
  1096. var card_status3 = parseInt($("input[name=card_status3]:checked").val());
  1097. if (!card_check(card_length1, '高一', card_status1)) {
  1098. return false;
  1099. }
  1100. if (!card_check(card_length2, '高二', card_status2)) {
  1101. return false;
  1102. }
  1103. if (!card_check(card_length3, '高三', card_status3)) {
  1104. return false;
  1105. }
  1106. return true;
  1107. }
  1108. function check_contact() {
  1109. var president_tel = $("input[name=schoolMasterMobile]").val();
  1110. var regMobile = /[0-9]$/;
  1111. if (president_tel!='' && !regMobile.test(president_tel)) {
  1112. layer.msg('手机号只能为数字!');
  1113. return false;
  1114. }
  1115. <?php if(Yii::app()->params['section']==1){?>
  1116. var core_tel = $("input[name=schoolMaster2Mobile]").val();
  1117. var grade1HeadMobile = $("input[name=grade1HeadMobile]").val();
  1118. var grade2HeadMobile = $("input[name=grade2HeadMobile]").val();
  1119. var grade3HeadMobile = $("input[name=grade3HeadMobile]").val();
  1120. if ((core_tel!='' && !regMobile.test(core_tel)) || (grade1HeadMobile!='' && !regMobile.test(grade1HeadMobile)) || (grade2HeadMobile!='' && !regMobile.test(grade2HeadMobile)) || (grade3HeadMobile!='' && !regMobile.test(grade3HeadMobile))) {
  1121. layer.msg('手机号只能为数字!');
  1122. return false;
  1123. }
  1124. <?php }?>
  1125. return true;
  1126. }
  1127. function card_check(card_length, msg, status) {
  1128. if (status == 1) {
  1129. var regMobile = /[0-9]$/;
  1130. if (!regMobile.test(card_length)) {
  1131. layer.msg(msg + ': ' + '非法数据!');
  1132. return false;
  1133. }
  1134. if (4 > card_length || card_length > 14) {
  1135. layer.msg(msg + ': ' + '不在范围!只能取4--14位');
  1136. return false;
  1137. }
  1138. if (4 <= card_length && card_length <= 14) {
  1139. return true;
  1140. } else {
  1141. layer.msg(msg + ': ' + '非法数据!');
  1142. return false;
  1143. }
  1144. } else {
  1145. return true;
  1146. }
  1147. }
  1148. function edit_login(setting_status){
  1149. $.ajax({
  1150. url:'<?php echo $this->createUrl('school/ajaxSettingLoginpermission')?>',
  1151. type:'POST',
  1152. dataType:'json',
  1153. data:{'setting_status':setting_status},
  1154. success:function(res){
  1155. if(res.status==1){
  1156. layer.msg('修改成功');
  1157. }else{
  1158. if(res.msg!=undefined){
  1159. layer.msg(res.msg);
  1160. }else{
  1161. layer.msg('修改失败');
  1162. }
  1163. }
  1164. },
  1165. error:function(){
  1166. layer.msg('系统错误');
  1167. }
  1168. });
  1169. }
  1170. $("body").delegate(".customK a", "click", function () {
  1171. if ($(this).closest(".independentPd").find(".customK").length > 1) {
  1172. $(this).closest(".customK").remove();
  1173. } else {
  1174. layer.msg('最后一条不允许删除!');
  1175. }
  1176. }).on('click','.icon-close',function(){
  1177. classModal.style.display = 'none';
  1178. }).on('click','.cancel',function () {
  1179. classModal.style.display = 'none';
  1180. }).on('click','.select_class',function () {
  1181. $input=$(this).closest('.class-modal').find('.class-modal-body input');
  1182. $grade_id=$('input[name=grade_id]').val();
  1183. $type=$('input[name=type]').val();
  1184. if($type==1){
  1185. var anotherClassId=$('input[name=grade_'+$grade_id+'_2]');
  1186. var anotherClassName=$('.list_'+$grade_id+'_2');
  1187. }else{
  1188. var anotherClassId=$('input[name=grade_'+$grade_id+'_1]');
  1189. var anotherClassName=$('.list_'+$grade_id+'_1');
  1190. }
  1191. //var anotherClassStr=anotherClassId.val();
  1192. // var anotherClassNameStr=anotherClassName.html();
  1193. anotherClassStr='';
  1194. anotherClassNameStr='';
  1195. var class_ids='',class_names='';
  1196. for(var i=0;i<$input.length;i++){
  1197. if($input.eq(i).is(":checked")){
  1198. if(class_ids==''){
  1199. class_ids=$input.eq(i).val();
  1200. }else{
  1201. class_ids=class_ids+','+$input.eq(i).val();
  1202. }
  1203. if(class_names==''){
  1204. class_names=$input.eq(i).attr('name');
  1205. }else{
  1206. class_names=class_names+','+$input.eq(i).attr('name');
  1207. }
  1208. }else{
  1209. if(anotherClassStr==''){
  1210. anotherClassStr=$input.eq(i).val();
  1211. }else{
  1212. anotherClassStr=anotherClassStr+','+$input.eq(i).val();
  1213. }
  1214. if(anotherClassNameStr==''){
  1215. anotherClassNameStr=$input.eq(i).attr('name');
  1216. }else{
  1217. anotherClassNameStr=anotherClassNameStr+','+$input.eq(i).attr('name');
  1218. }
  1219. }
  1220. }
  1221. $('.list_'+$grade_id+'_'+$type).html(class_names);
  1222. $('input[name=grade_'+$grade_id+'_'+$type+']').val(class_ids);
  1223. anotherClassId.val(anotherClassStr);
  1224. anotherClassName.html(anotherClassNameStr);
  1225. classModal.style.display = 'none';
  1226. }).on("click",'.select_subject',function(){
  1227. $(this).attr('disabled',true);
  1228. var subjects=[];
  1229. for(var i=0;i<$("input[name='extend_subject']").length;i++){
  1230. if($("input[name='extend_subject']").eq(i).is(":checked")){
  1231. subjects.push($("input[name='extend_subject']").eq(i).val());
  1232. }
  1233. }
  1234. console.log(subjects);
  1235. if(subjects.length>0){
  1236. $.ajax({
  1237. url:'<?php echo $this->createUrl('school/saveExtendSubjects')?>',
  1238. type:'POST',
  1239. dataType:'json',
  1240. data:{subjects:subjects},
  1241. success:function (res) {
  1242. if(res.status==1){
  1243. layer.msg('添加成功');
  1244. window.location.reload();
  1245. }
  1246. }
  1247. });
  1248. }else{
  1249. $('.notice').html('请选择科目');
  1250. $('.select_subject').attr('disabled',false);
  1251. return false;
  1252. }
  1253. })
  1254. $('.changeAS').click(function () {
  1255. value=$(this).val();
  1256. grade_id=$(this).attr('id');
  1257. if(value==1){
  1258. $('.ClassList_'+grade_id).hide();
  1259. }else if(value==2){
  1260. $('.ClassList_'+grade_id).show();
  1261. }
  1262. });
  1263. $('.add_class').click(function(){
  1264. grade_id=$(this).attr('id');
  1265. title=$(this).attr('name');
  1266. type=$(this).attr('type');
  1267. index=layer.msg('加载班级。。。。。。');
  1268. var selected_class_id=$('input[name=grade_'+grade_id+'_'+type+']').val();
  1269. $.ajax({
  1270. url:'<?php echo $this->createUrl('school/getclass')?>',
  1271. type:'POST',
  1272. dataType:'json',
  1273. data:{'grade_id':grade_id,'title':title,'type':type,'selected_class_id':selected_class_id},
  1274. success:function(res){
  1275. layer.close(index);
  1276. if(res.status==1){
  1277. $('.class-modal').html(res.html);
  1278. classModal.style.display = 'block';
  1279. }
  1280. }
  1281. });
  1282. });
  1283. $('#selectSubjects').click(function(){
  1284. index=layer.msg('加载学科。。。。。。');
  1285. $.ajax({
  1286. url:'<?php echo $this->createUrl('school/getExtendSubjects')?>',
  1287. type:'POST',
  1288. dataType:'json',
  1289. success:function(res){
  1290. layer.close(index);
  1291. if(res.status==1){
  1292. $('.subject-area').html(res.data);
  1293. $('#classModal-1').show();
  1294. $('.select_subject').attr('disabled',false);
  1295. }
  1296. }
  1297. });
  1298. });
  1299. $('#SaveArtsAndScience').click(function(){
  1300. var grade=$('.grade');
  1301. var class_data=new Array();
  1302. for(var i=0;i<3;i++){
  1303. selectType=$('input[name=as_'+i+']:checked').val();
  1304. grade_id=$('input[name=as_'+i+']:checked').attr('id');
  1305. if(selectType==1){
  1306. class_data[grade_id]='close';
  1307. }else{
  1308. class_data[grade_id]=[];
  1309. if($('input[name=grade_'+grade_id+'_1]').val()!=''){
  1310. class_data[grade_id][1]=$('input[name=grade_'+grade_id+'_1]').val().split(',');
  1311. }else{
  1312. class_data[grade_id][1]='';
  1313. }
  1314. if($('input[name=grade_'+grade_id+'_2]').val()!=''){
  1315. class_data[grade_id][2]=$('input[name=grade_'+grade_id+'_2]').val().split(',');
  1316. }else{
  1317. class_data[grade_id][2]='';
  1318. }
  1319. if(class_data[grade_id][1].length==0 && class_data[grade_id][2].length==0){
  1320. index=layer.msg('请选择班级');
  1321. return false;
  1322. }
  1323. console.log(class_data[grade_id]);
  1324. }
  1325. }
  1326. index=layer.msg('保存中,请稍候。。。。。。');
  1327. $.ajax({
  1328. url:'<?php echo $this->createUrl('school/saveartsandscience')?>',
  1329. type:'POST',
  1330. dataType:'json',
  1331. data:{'class_data':class_data},
  1332. success:function(res){
  1333. layer.close(index);
  1334. if(res.status==1){
  1335. for(var i in class_data){
  1336. if(class_data[i]=='close'){
  1337. $('input[name=grade_'+i+'_1]').val('');
  1338. $('input[name=grade_'+i+'_2]').val('');
  1339. $('.list_'+i+'_1').html('');
  1340. $('.list_'+i+'_2').html('');
  1341. }
  1342. }
  1343. layer.msg('保存成功');
  1344. }else{
  1345. layer.msg('保存失败');
  1346. }
  1347. }
  1348. });
  1349. });
  1350. //删除自定义学科
  1351. $('.close').click(function(){
  1352. var subjectId=$(this).attr('subject_id');
  1353. obj=$(this).closest('.hgc_tag');
  1354. $.ajax({
  1355. url:'<?php echo $this->createUrl('school/delExtendSubject')?>',
  1356. type:'POST',
  1357. dataType:'json',
  1358. data:{'subjectId':subjectId},
  1359. success:function(res){
  1360. if(res.status==1){
  1361. obj.remove();
  1362. layer.msg('删除成功');
  1363. }else{
  1364. if(res.msg!=undefined){
  1365. layer.msg(res.msg);
  1366. }else{
  1367. layer.msg('删除失败');
  1368. }
  1369. }
  1370. }
  1371. });
  1372. });
  1373. $('.icon-close-1,.icon-close-subject').click(function(){
  1374. $('#classModal-1').hide();
  1375. return false;
  1376. });
  1377. $('.checkRepeat').click(function(){
  1378. $(this).attr('disabled',true);
  1379. $(this).closest('form').submit();
  1380. });
  1381. $('input[name="stu-login-permission"]').change(function(){
  1382. var setting_status = $(this).val();
  1383. if(setting_status != 1){
  1384. layer.confirm("确定切换吗?切换会清空所有已经绑定的信息", {
  1385. time: 0,
  1386. btn: ['确定', '取消'],
  1387. yes: function(index){
  1388. layer.close(index);
  1389. edit_login(setting_status);
  1390. },
  1391. cancel:function(){
  1392. $('input[name="stu-login-permission"]').prop("checked",false);
  1393. $('input[name="stu-login-permission"][value="1"]').prop("checked",true);
  1394. }
  1395. });
  1396. }else{
  1397. edit_login(setting_status);
  1398. }
  1399. });
  1400. var gradeConfig=[];
  1401. <?php
  1402. if($gradeConfig){
  1403. foreach ($gradeConfig as $group => $val){
  1404. echo 'gradeConfig['.$group.']=[];';
  1405. foreach ($val as $gradeId =>$name){
  1406. echo 'gradeConfig['.$group.']['.$gradeId.']="'.$name.'";';
  1407. }
  1408. }
  1409. }
  1410. ?>
  1411. $('.gradeGroup').change(function(){
  1412. showGradeConfig($(this).val());
  1413. });
  1414. var nowGroupId='<?php echo $schoolinfo['grade_group_id']?>';
  1415. showGradeConfig(nowGroupId);
  1416. function showGradeConfig(group){
  1417. html='';
  1418. console.log(group);
  1419. if(gradeConfig[group]!=undefined){
  1420. $.each(gradeConfig[group],function(k,v){
  1421. if(v!=undefined){
  1422. html+=(v+'<br>');
  1423. }
  1424. })
  1425. $('.showGradeConfig').html(html);
  1426. }
  1427. }
  1428. $('#saveGradeSection').click(function(){
  1429. console.log($('.gradeGroup').val());
  1430. var groupId=$('.gradeGroup').val();
  1431. var groupName=$('.gradeGroup').find("option:selected").text();
  1432. console.log(groupName);
  1433. if(groupId){
  1434. indexmsg=layer.confirm('确定学段按“'+groupName+'”模式进行设置吗?设置后不可再修改', {
  1435. btn: ['确定', '取消'] //按钮
  1436. }, function () {
  1437. layer.close(indexmsg);
  1438. layer.msg('更新中请稍候。。。。。。',{time:0});
  1439. $.ajax({
  1440. url:'<?php echo $this->createUrl('school/saveSection')?>',
  1441. type:'POST',
  1442. dataType:'json',
  1443. data:{gradeGroup:groupId},
  1444. success:function(res){
  1445. if(res.status==1){
  1446. layer.msg('设置成功');
  1447. }else{
  1448. if(res.msg!=undefined){
  1449. layer.msg(res.msg);
  1450. }else{
  1451. layer.msg('设置失败');
  1452. }
  1453. }
  1454. }
  1455. });
  1456. })
  1457. }
  1458. });
  1459. </script>
  1460. </body>
  1461. </html>