provider.province.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <link href="<?php echo ADMIN_TEMPLATES_URL;?>/css/recharge.css?7" rel="stylesheet" type="text/css" id="cssfile2" />
  2. <?php defined('InShopNC') or exit('Access Invalid!'); ?>
  3. <div class="page">
  4. <div class="fixed-bar">
  5. <div class="item-title">
  6. <h3>通道</h3>
  7. <ul class="tab-base">
  8. <li><a href="index.php?act=merchant&op=provider"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  9. <li><a href="JavaScript:void(0);" class="current"><span>通道省份编辑</span></a></li>
  10. </ul>
  11. </div>
  12. </div>
  13. <div class="fixed-empty"></div>
  14. <form id="user_form" enctype="multipart/form-data" method="post">
  15. <input type="hidden" name="form_submit" value="ok"/>
  16. <input type="hidden" name="provider_id" value="<?php echo $output['provider']['provider_id']?>"/>
  17. <table class="tb-type2 table">
  18. <tbody class="mw1250 block">
  19. <tr class="noborder">
  20. <td colspan="2" class="required"><label class="validation" for="name">通道名称:</label></td>
  21. </tr>
  22. <tr class="noborder">
  23. <td class="vatop"><?php echo $output['provider']['name']?></td>
  24. </tr>
  25. <tr class="noborder">
  26. <td colspan="2"><label for="end_period">选择省份:</label></td>
  27. </tr>
  28. <tr class="noborder">
  29. <td class="w400 inblock align-center required">
  30. 中国移动
  31. </td>
  32. <td class="w400 inblock align-center required">
  33. 中国联通
  34. </td>
  35. <td class="w400 inblock align-center required">
  36. 中国电信
  37. </td>
  38. </tr>
  39. <tr class="noborder">
  40. <td class="w400 inblock">
  41. <label>
  42. 全国:
  43. <input type="checkbox" name="<?php echo mtopcard\ChinaMobileCard;?>-province" data-name="move" id="move_cb_all" value="-1"
  44. <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaMobileCard])){ echo 'checked';}?>/>
  45. </label>
  46. </td>
  47. <td class="w400 inblock">
  48. <label>
  49. 全国:
  50. <input type="checkbox" name="<?php echo mtopcard\ChinaUnicomCard;?>-province" data-name="unicom" id="unicom_cb_all" value="-1"
  51. <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaUnicomCard])){ echo 'checked';}?>/>
  52. </label>
  53. </td>
  54. <td class="w400 inblock">
  55. <label>
  56. 全国:
  57. <input type="checkbox" name="<?php echo mtopcard\ChinaTelecomCard;?>-province" data-name="tel" id="tel_cb_all" value="-1"
  58. <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaTelecomCard])){ echo 'checked';}?>/>
  59. </label>
  60. </td>
  61. </tr>
  62. <tr class="noborder">
  63. <td class="w400 inblock h200">
  64. <div class="w100pre">
  65. <?php foreach($output['province_list'] as $key => $province){ ?>
  66. <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
  67. <?php echo $province;?>
  68. <input type="checkbox" class="move_cb_box" name="<?php echo mtopcard\ChinaMobileCard;?>-province[]" data-name="move" style="vertical-align: middle;" value="<?php echo $key;?>"
  69. <?php if(in_array($key,$output['provinces'][mtopcard\ChinaMobileCard])){ echo 'checked';}?>
  70. />
  71. </label>
  72. <?php }?>
  73. </div>
  74. </td>
  75. <td class="w400 inblock h200">
  76. <div class="w100pre">
  77. <?php foreach($output['province_list'] as $key => $province){ ?>
  78. <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
  79. <?php echo $province;?>
  80. <input type="checkbox" class="unicom_cb_box" data-name="unicom" name="<?php echo mtopcard\ChinaUnicomCard;?>-province[]" style="vertical-align: middle;" value="<?php echo $key;?>"
  81. <?php if(in_array($key,$output['provinces'][mtopcard\ChinaUnicomCard])){ echo 'checked';}?>
  82. />
  83. </label>
  84. <?php }?>
  85. </div>
  86. </td>
  87. <td class="w400 inblock h200">
  88. <div class="w100pre">
  89. <?php foreach($output['province_list'] as $key => $province){ ?>
  90. <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
  91. <?php echo $province;?>
  92. <input type="checkbox" class="tel_cb_box" data-name="tel" name="<?php echo mtopcard\ChinaTelecomCard;?>-province[]" style="vertical-align: middle;" value="<?php echo $key;?>"
  93. <?php if(in_array($key,$output['provinces'][mtopcard\ChinaTelecomCard])){ echo 'checked';}?>
  94. />
  95. </label>
  96. <?php }?>
  97. </div>
  98. </td>
  99. </tr>
  100. </tbody>
  101. <tfoot>
  102. <tr class="tfoot">
  103. <td colspan="15"><a href="JavaScript:void(0);" class="btn"
  104. id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
  105. </tr>
  106. </tfoot>
  107. </table>
  108. </form>
  109. </div>
  110. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
  111. charset="utf-8"></script>
  112. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
  113. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
  114. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
  115. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
  116. <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
  117. id="cssfile2"/>
  118. <script type="text/javascript">
  119. $(function () {
  120. // 移动
  121. if($('#move_cb_all').is(":checked")) {
  122. $('.move_cb_box').each(function () {
  123. this.checked = true;
  124. $(this).attr("disabled",true);
  125. })
  126. }
  127. // 全选
  128. $('#move_cb_all').click(function() {
  129. if($(this).is(":checked")) {
  130. $('.move_cb_box').each(function () {
  131. this.checked = true;
  132. $(this).attr("disabled",true);
  133. })
  134. } else {
  135. $('.move_cb_box').each(function () {
  136. this.checked = false;
  137. $(this).attr("disabled",false);
  138. })
  139. }
  140. })
  141. $('.move_cb_box').each(function () {
  142. $(this).click(function () {
  143. // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
  144. if ($(".move_cb_box:checked").length == $(".move_cb_box").length) {
  145. $("#move_cb_all").attr("checked", "checked");
  146. $('#move_cb_all').attr("disabled",true);
  147. }else {
  148. $("#move_cb_all").removeAttr("checked");
  149. $('#move_cb_all').attr("disabled",false);
  150. };
  151. })
  152. })
  153. // 联通
  154. if($('#unicom_cb_all').is(":checked")) {
  155. $('.unicom_cb_box').each(function () {
  156. this.checked = true;
  157. $(this).attr("disabled",true);
  158. })
  159. }
  160. // 全选
  161. $('#unicom_cb_all').click(function() {
  162. if($(this).is(":checked")) {
  163. $('.unicom_cb_box').each(function () {
  164. this.checked = true;
  165. $(this).attr("disabled",true);
  166. })
  167. } else {
  168. $('.unicom_cb_box').each(function () {
  169. this.checked = false;
  170. $(this).attr("disabled",false);
  171. })
  172. }
  173. })
  174. $('.unicom_cb_box').each(function () {
  175. $(this).click(function () {
  176. // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
  177. if ($(".unicom_cb_box:checked").length == $(".unicom_cb_box").length) {
  178. $("#unicom_cb_all").attr("checked", "checked");
  179. $('#unicom_cb_all').attr("disabled",true);
  180. }else {
  181. $("#unicom_cb_all").removeAttr("checked");
  182. $('#unicom_cb_all').attr("disabled",false);
  183. };
  184. })
  185. })
  186. // 电信
  187. if($('#tel_cb_all').is(":checked")) {
  188. $('.tel_cb_box').each(function () {
  189. this.checked = true;
  190. $(this).attr("disabled",true);
  191. })
  192. }
  193. // 全选
  194. $('#tel_cb_all').click(function() {
  195. if($(this).is(":checked")) {
  196. $('.tel_cb_box').each(function () {
  197. this.checked = true;
  198. $(this).attr("disabled",true);
  199. })
  200. } else {
  201. $('.tel_cb_box').each(function () {
  202. this.checked = false;
  203. $(this).attr("disabled",false);
  204. })
  205. }
  206. })
  207. $('.tel_cb_box').each(function () {
  208. $(this).click(function () {
  209. // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
  210. if ($(".tel_cb_box:checked").length == $(".tel_cb_box").length) {
  211. $("#tel_cb_all").attr("checked", "checked");
  212. $('#tel_cb_all').attr("disabled",true);
  213. }else {
  214. $("#tel_cb_all").removeAttr("checked");
  215. $('#tel_cb_all').attr("disabled",false);
  216. };
  217. })
  218. })
  219. $("#submitBtn").click(function () {
  220. var checkMove = false;
  221. var checkUnicom = false;
  222. var checkTel = false;
  223. var checkBoxMove = $('input[data-name="move"]');
  224. var checkBoxUnicom = $('input[data-name="unicom"]');
  225. var checkBoxTel = $('input[data-name="tel"]');
  226. for (var i = 0; i < checkBoxMove.length; i++) {
  227. //如果有1个被选中时
  228. if (checkBoxMove[i].checked) {
  229. checkMove = true
  230. };
  231. };
  232. for (var i = 0; i < checkBoxUnicom.length; i++) {
  233. //如果有1个被选中时
  234. if (checkBoxUnicom[i].checked) {
  235. checkUnicom = true
  236. };
  237. };
  238. for (var i = 0; i < checkBoxTel.length; i++) {
  239. //如果有1个被选中时
  240. if (checkBoxTel[i].checked) {
  241. checkTel = true
  242. };
  243. };
  244. if (checkMove && checkUnicom && checkTel) {
  245. $("#user_form").submit();
  246. } else{
  247. layer.msg('每个类型至少选择一个')
  248. }
  249. });
  250. });
  251. </script>