provider.group.set.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <link href="<?php echo ADMIN_TEMPLATES_URL;?>/css/recharge.css?<?php echo rand(1,10);?>" 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=provider_group&op=index"><span><?php echo $lang['nc_manage'] ?></span></a></li>
  9. <li><a href="index.php?act=provider_group&op=add"><span><?php echo $lang['nc_new'] ?></span></a></li>
  10. <li><a href="JavaScript:void(0);" class="current"><span>通道组通道分配</span></a></li>
  11. </ul>
  12. </div>
  13. </div>
  14. <div class="fixed-empty"></div>
  15. <form method="post" id="merchant_name_form">
  16. <input type="hidden" name="form_submit" value="ok"/>
  17. <input type="hidden" name="group_id" value="<?php echo $_GET['group_id']?>">
  18. <input type="hidden" name="type" value="<?php echo $_GET['type'];?>">
  19. <input type="hidden" name="quality" value="<?php echo $_GET['quality']?>">
  20. <input type="hidden" name="is_only" value="<?php echo $output['is_only']?>">
  21. <table class=" tb-type2">
  22. <thead style="position: fixed;background-color: #fff;">
  23. <tr class="thead">
  24. <th class="w180">
  25. <a href="JavaScript:void(0);" class="btn" id="emptyBtn"><span>清空</span></a>
  26. </th>
  27. <th class="w57 align-center" id="selectAll">
  28. <input type="checkbox" name="chbox" value="">
  29. </th>
  30. <?php foreach ($output['amounts'] as $amount){?>
  31. <th class="w57 align-center"><?php echo $amount;?></th>
  32. <?php }?>
  33. </tr>
  34. </thead>
  35. <tbody style="display: block;padding-top: 47px;">
  36. <?php if(!empty($output['providers'])){?>
  37. <?php foreach ($output['providers'] as $provider){?>
  38. <tr class="trFlex" data-color="<?php echo $provider['card_type'];?>">
  39. <td class="w180"><span data-color="<?php echo $provider['opened']?>" class="textColor"><?php echo $provider['name'];?></span></td>
  40. <td class="w50 align-center">
  41. <input type="checkbox" data-check="<?php echo $provider['opened']?>" name="checkbox" class="w50 checkAll">
  42. </td>
  43. <?php foreach ($output['amounts'] as $amount){?>
  44. <?php if(is_array($output['QPTA']["{$provider['provider_name']}-{$provider['card_type']}-{$amount}"]) && array_key_exists("{$provider['provider_name']}-{$provider['card_type']}-{$amount}", $output['QPTA'])){?>
  45. <td class="w50 align-center td_readonly" data-readonly = '0'>
  46. <?php }else{?>
  47. <td class="w50 align-center td_readonly" data-readonly = '1'>
  48. <?php }?>
  49. <input type="checkbox" class="w50 input" name="info[]" style="vertical-align: middle;"
  50. value="<?php echo "{$_GET['quality']}-{$provider['provider_name']}-{$provider['card_type']}-{$amount}-{$provider['provider_id']}";?>"
  51. <?php if(in_array("{$_GET['quality']}-{$provider['provider_name']}-{$provider['card_type']}-{$amount}-{$provider['provider_id']}", $output['sel_data'])){ echo 'checked';}?>
  52. />
  53. </td>
  54. <?php }?>
  55. </tr>
  56. <?php }?>
  57. <?php }else{?>
  58. <tr class="no_data">
  59. <td colspan="8"><?php echo $lang['nc_no_record']; ?></td>
  60. </tr>
  61. <?php }?>
  62. </tbody>
  63. <tfoot>
  64. <tr class="tfoot">
  65. <td colspan="15">
  66. <?php if(!empty($output['providers'])){?>
  67. <a href="JavaScript:void(0);" class="btn" id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a>
  68. <?php }?>
  69. </td>
  70. </tr>
  71. </tfoot>
  72. </table>
  73. </form>
  74. </div>
  75. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
  76. <script>
  77. $(function () {
  78. $('#submitBtn').click(function () {
  79. $("#merchant_name_form").submit();
  80. });
  81. $('.textColor').each(function () {
  82. let color = $(this).attr('data-color')
  83. if (color == '1') {
  84. $(this).css('color', 'green')
  85. } else {
  86. $(this).css('color', 'red')
  87. }
  88. })
  89. // 表格hover时背景
  90. $('.trFlex').each(function () {
  91. let color = $(this).attr('data-color')
  92. if (color == 4 || color == 1) {
  93. $(this).css('background', '#f1dde6')
  94. } else if (color == 5 || color == 2) {
  95. $(this).css('background', '#c8c6f3')
  96. } else if (color == 6) {
  97. $(this).css('background', '#f2f3c6')
  98. } else {
  99. $(this).css('background', '#fff')
  100. }
  101. $(this).hover(function () {
  102. $(this)[0].style.backgroundColor = '#cbe9f3'
  103. },function() {
  104. if (color == 4 || color == 1) {
  105. $(this).css('background', '#f1dde6')
  106. } else if (color == 5 || color == 2) {
  107. $(this).css('background', '#c8c6f3')
  108. } else if (color == 6) {
  109. $(this).css('background', '#f2f3c6')
  110. } else {
  111. $(this).css('background', '#fff')
  112. }
  113. })
  114. })
  115. // 清空
  116. $('#emptyBtn').click(function () {
  117. $('input[type="checkbox"]').each(function () {
  118. if ($(this).is(":checked")) {
  119. $(this).attr("checked",false)
  120. }
  121. })
  122. })
  123. //全选td
  124. $('.td_readonly').each(function () {
  125. let isReadonly = $(this).attr('data-readonly')
  126. if (isReadonly == 1) {
  127. $(this).children().attr('disabled', true)
  128. }
  129. })
  130. // 全选
  131. $('.checkAll').click(function () {
  132. let hang = $(this).parent().parent().prevAll().length + 1
  133. console.log(hang);
  134. if ($(this).is(':checked')) {
  135. $('.td_readonly').each(function () {
  136. let isReadonly = $(this).attr('data-readonly')
  137. if (isReadonly == 0) {
  138. let inputH = $(this).parent().prevAll().length + 1
  139. if (hang == inputH) {
  140. $(this).children().attr("checked",true)
  141. }
  142. }
  143. })
  144. } else {
  145. $('.td_readonly').each(function () {
  146. let isReadonly = $(this).attr('data-readonly')
  147. if (isReadonly == 0) {
  148. let inputH = $(this).parent().prevAll().length + 1
  149. if (hang == inputH) {
  150. $(this).children().attr("checked",false)
  151. }
  152. }
  153. })
  154. }
  155. })
  156. // 一键全部选择
  157. $('#selectAll').click(function() {
  158. let hang = $(this).parent().parent().prevAll().length + 1
  159. console.log(hang);
  160. if ($("input[name='chbox']").is(':checked')) {
  161. $("input[name='checkbox']").each(function() {
  162. let checkall = $(this).attr('data-check')
  163. if(checkall == '1') {
  164. this.checked = true;
  165. }
  166. if ($(this).is(':checked')) {
  167. $('.td_readonly').each(function () {
  168. let isReadonly = $(this).attr('data-readonly')
  169. if (isReadonly == 0) {
  170. if (hang == 1) {
  171. $(this).children().attr("checked",true)
  172. }
  173. }
  174. })
  175. }
  176. })
  177. } else {
  178. $("input[name='checkbox']").each(function() {
  179. this.checked = false;
  180. $('.td_readonly').each(function () {
  181. let isReadonly = $(this).attr('data-readonly')
  182. if (isReadonly == 0) {
  183. if (hang == 1) {
  184. $(this).children().attr("checked",false)
  185. }
  186. }
  187. })
  188. })
  189. }
  190. })
  191. });
  192. </script>