admin_credit.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php if(!defined('UC_ROOT')) exit('Access Denied');?>
  2. <?php include $this->gettpl('header');?>
  3. <script src="js/common.js" type="text/javascript"></script>
  4. <div class="container">
  5. <div class="note">
  6. <p class="i">点击“同步应用的积分设置”可以获取应用的积分设置,并且把当前设置结果通知给应用</p>
  7. </div>
  8. <?php if($status) { ?>
  9. <div class="<?php if($status > 0) { ?>correctmsg<?php } else { ?>errormsg<?php } ?>"><p><?php if($status == 1) { ?>成功更新积分兑换方案。<?php } elseif($status == -1) { ?>兑换前后应用相同,请重新设置。<?php } ?></p></div>
  10. <?php } ?>
  11. <div class="hastabmenu">
  12. <ul class="tabmenu">
  13. <li class="tabcurrent"><a href="#" class="tabcurrent">更新积分兑换方案</a></li>
  14. </ul>
  15. <div class="tabcontentcur">
  16. <form id="creditform" action="admin.php?m=credit&a=ls&addexchange=yes" method="post">
  17. <input type="hidden" name="formhash" value="<?php echo FORMHASH;?>">
  18. <table class="dbtb">
  19. <tr>
  20. <td class="tbtitle">兑换方向:</td>
  21. <td>
  22. <select onchange="switchcredit('src', this.value)" name="appsrc">
  23. <option>请选择</option><?php echo $appselect;?>
  24. </select><span id="src"></span>
  25. &nbsp;&gt;&nbsp;
  26. <select onchange="switchcredit('desc', this.value)" name="appdesc">
  27. <option>请选择</option><?php echo $appselect;?>
  28. </select><span id="desc"></span>
  29. </td>
  30. </tr>
  31. <tr>
  32. <td class="tbtitle">兑换比率:</td>
  33. <td>
  34. <input name="ratiosrc" size="3" value="<?php echo $ratiosrc;?>" class="txt" style="margin-right:0" />
  35. &nbsp;:&nbsp;
  36. <input name="ratiodesc" size="3" value="<?php echo $ratiodesc;?>" class="txt" />
  37. </td>
  38. </tr>
  39. <tr>
  40. <td></td>
  41. <td>
  42. <input type="submit" value="提 交" class="btn" /> &nbsp;
  43. <input type="button" value="同步应用的积分设置" class="btn" onclick="location.href='admin.php?m=credit&a=sync&sid=<?php echo $sid;?>'" />
  44. </td>
  45. </tr>
  46. </table>
  47. <div style="display: none">
  48. <script type="text/javascript">
  49. var credit = new Array();
  50. <?php foreach((array)$creditselect as $select) {?><?php echo $select;?><?php } ?>
  51. <?php if($appsrc) { ?>
  52. setselect($('creditform').appsrc, <?php echo $appsrc;?>);
  53. switchcredit('src', <?php echo $appsrc;?>);
  54. <?php } ?>
  55. <?php if($appdesc) { ?>
  56. setselect($('creditform').appdesc, <?php echo $appdesc;?>);
  57. switchcredit('desc', <?php echo $appdesc;?>);
  58. <?php } ?>
  59. <?php if($creditsrc) { ?>
  60. setselect($('creditform').creditsrc, <?php echo $creditsrc;?>);
  61. <?php } ?>
  62. <?php if($creditdesc) { ?>
  63. setselect($('creditform').creditdesc, <?php echo $creditdesc;?>);
  64. <?php } ?>
  65. </script>
  66. </div>
  67. </form>
  68. </div>
  69. </div>
  70. <br />
  71. <h3>积分兑换</h3>
  72. <div class="mainbox">
  73. <?php if($creditexchange) { ?>
  74. <form action="admin.php?m=credit&a=ls&delexchange=yes" method="post">
  75. <input type="hidden" name="formhash" value="<?php echo FORMHASH;?>">
  76. <table class="datalist fixwidth" onmouseover="addMouseEvent(this);">
  77. <tr>
  78. <th><input type="checkbox" name="chkall" id="chkall" onclick="checkall('delete[]')" class="checkbox" /><label for="chkall">删除</label></th>
  79. <th style="padding-right: 11px; text-align: right">兑换方向</th>
  80. <th></th>
  81. <th style="text-align: center">兑换比率</th>
  82. </tr>
  83. <?php foreach((array)$creditexchange as $key => $exchange) {?>
  84. <tr>
  85. <td class="option"><input type="checkbox" name="delete[]" value="<?php echo $key;?>" class="checkbox" /></td>
  86. <td align="right"><?php echo $exchange['appsrc'];?> <?php echo $exchange['creditsrc'];?></td>
  87. <td>&nbsp;&gt;&nbsp;<?php echo $exchange['appdesc'];?> <?php echo $exchange['creditdesc'];?></td>
  88. <td align="center"><?php echo $exchange['ratiosrc'];?> : <?php echo $exchange['ratiodesc'];?></td>
  89. </tr>
  90. <?php }?>
  91. <tr class="nobg">
  92. <td><input type="submit" value="提 交" class="btn" /></td>
  93. </tr>
  94. </table>
  95. </form>
  96. <?php } else { ?>
  97. <div class="note">
  98. <p class="i">目前没有相关记录!</p>
  99. </div>
  100. <?php } ?>
  101. </div>
  102. <?php include $this->gettpl('footer');?>