provider.group.set.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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">
  28. 全选
  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"><?php echo $provider['name'];?></td>
  40. <td class="w50 align-center">
  41. <input type="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. // 表格hover时背景
  82. $('.trFlex').each(function () {
  83. let color = $(this).attr('data-color')
  84. if (color == 4 || color == 1) {
  85. $(this).css('background', '#f1dde6')
  86. } else if (color == 5 || color == 2) {
  87. $(this).css('background', '#c8c6f3')
  88. } else if (color == 6) {
  89. $(this).css('background', '#f2f3c6')
  90. } else {
  91. $(this).css('background', '#fff')
  92. }
  93. $(this).hover(function () {
  94. $(this)[0].style.backgroundColor = '#cbe9f3'
  95. },function() {
  96. if (color == 4 || color == 1) {
  97. $(this).css('background', '#f1dde6')
  98. } else if (color == 5 || color == 2) {
  99. $(this).css('background', '#c8c6f3')
  100. } else if (color == 6) {
  101. $(this).css('background', '#f2f3c6')
  102. } else {
  103. $(this).css('background', '#fff')
  104. }
  105. })
  106. })
  107. // 清空
  108. $('#emptyBtn').click(function () {
  109. $('input[type="checkbox"]').each(function () {
  110. if ($(this).is(":checked")) {
  111. $(this).attr("checked",false)
  112. }
  113. })
  114. })
  115. //全选td
  116. $('.td_readonly').each(function () {
  117. let isReadonly = $(this).attr('data-readonly')
  118. if (isReadonly == 1) {
  119. $(this).children().attr('disabled', true)
  120. }
  121. })
  122. // 全选
  123. $('.checkAll').click(function () {
  124. let hang = $(this).parent().parent().prevAll().length + 1
  125. if ($(this).is(':checked')) {
  126. $('.td_readonly').each(function () {
  127. let isReadonly = $(this).attr('data-readonly')
  128. if (isReadonly == 0) {
  129. let inputH = $(this).parent().prevAll().length + 1
  130. if (hang == inputH) {
  131. $(this).children().attr("checked",true)
  132. }
  133. }
  134. })
  135. } else {
  136. $('.td_readonly').each(function () {
  137. let isReadonly = $(this).attr('data-readonly')
  138. if (isReadonly == 0) {
  139. let inputH = $(this).parent().prevAll().length + 1
  140. if (hang == inputH) {
  141. $(this).children().attr("checked",false)
  142. }
  143. }
  144. })
  145. }
  146. })
  147. });
  148. </script>