pd_add.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. {include file="public/header" /}
  2. <div class="page">
  3. <form id="user_form" method="post">
  4. <div class="ds-default-table">
  5. <table>
  6. <tbody>
  7. <tr class="noborder">
  8. <td class="required w120">{$Think.lang.ds_member_name}</td>
  9. <td class="vatop rowform">
  10. <input type="hidden" name="member_id" id="member_id" value="{$member_info.member_id|default='0'}"/>
  11. <input id="member_name" name="member_name" value="{$member_info.member_name|default=''}" class="input-txt" type="text" onchange="javascript:checkmember();">
  12. <span class="err"></span>
  13. <p class="notic"></p>
  14. </td>
  15. </tr>
  16. <tr class="noborder" id="tr_memberinfo">
  17. <td colspan="2" class="required" id="td_memberinfo">
  18. {notempty name="member_info"}
  19. {$member_info.member_name}, {$Think.lang.now_available_predeposit}{$member_info.available_predeposit}, {$Think.lang.now_freeze_predeposit}{$member_info.freeze_predeposit}
  20. {/notempty}
  21. </td>
  22. </tr>
  23. <tr>
  24. <td class="required w120">{$Think.lang.admin_predeposit_artificial_operatetype}</td>
  25. <td class="vatop rowform">
  26. <select id="operatetype" name="operatetype">
  27. <option value="1">{$Think.lang.operatetype_1}</option>
  28. <option value="2">{$Think.lang.operatetype_2}</option>
  29. <option value="3">{$Think.lang.operatetype_3}</option>
  30. <option value="4">{$Think.lang.operatetype_4}</option>
  31. </select>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td class="required w120">{$Think.lang.admin_predeposit_price}</td>
  36. <td class="vatop rowform"><input type="text" class="form-control" name="amount" id="amount" value="" /></td>
  37. </tr>
  38. <tr>
  39. <td class="required w120">{$Think.lang.lg_desc}</td>
  40. <td class="vatop rowform"><textarea name="lg_desc" ></textarea></td>
  41. </tr>
  42. </tbody>
  43. <tfoot>
  44. <tr class="tfoot">
  45. <td colspan="15"><input class="btn" type="submit" value="{$Think.lang.ds_submit}"/></td>
  46. </tr>
  47. </tfoot>
  48. </table>
  49. </div>
  50. </form>
  51. </div>
  52. <script>
  53. function checkmember() {
  54. var membername = $.trim($("#member_name").val());
  55. if (membername == '') {
  56. $("#member_id").val('0');
  57. layer.alert('{$Think.lang.admin_predeposit_artificial_membernamenull_error}');
  58. return false;
  59. }
  60. var url = ADMINSITEURL + '/Predeposit/checkmember.html';
  61. $.post(url, {'name': membername}, function(data) {
  62. if (data.id)
  63. {
  64. $("#tr_memberinfo").show();
  65. var msg = " " + data.name + ", {$Think.lang.now_available_predeposit}" + data.available_predeposit + ", {$Think.lang.now_freeze_predeposit}" + data.freeze_predeposit;
  66. $("#member_name").val(data.name);
  67. $("#member_id").val(data.id);
  68. $("#td_memberinfo").text(msg);
  69. }
  70. else
  71. {
  72. $("#member_name").val('');
  73. $("#member_id").val('0');
  74. layer.alert("{$Think.lang.admin_predeposit_userrecord_error}");
  75. }
  76. }, 'json');
  77. }
  78. </script>
  79. <script type="text/javascript">
  80. $(function(){
  81. $('#user_form').validate({
  82. errorPlacement: function(error, element) {
  83. error.appendTo(element.parent().parent().find('td:last'));
  84. },
  85. rules: {
  86. amount :{
  87. required: true,
  88. number:true,
  89. min:0,
  90. },
  91. member_id:{
  92. required: true,
  93. }
  94. },
  95. messages: {
  96. amount :{
  97. required: '{$Think.lang.amount_required}',
  98. number: '{$Think.lang.amount_number}',
  99. min: '{$Think.lang.amount_min}'
  100. },
  101. }
  102. });
  103. });
  104. </script>
  105. </body>