live.groupbuyclass.add.php 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <h3>线下抢分类</h3>
  6. <ul class="tab-base">
  7. <li><a href="index.php?act=live_class" ><span><?php echo $lang['nc_manage'];?></span></a></li>
  8. <li><a href="JavaScript:void(0);" class="current"><span><?php echo $lang['nc_new'];?></span></a></li>
  9. </ul>
  10. </div>
  11. </div>
  12. <div class="fixed-empty"></div>
  13. <form id="add_form" method="post" enctype="multipart/form-data" action="index.php?act=live_class&op=add_class">
  14. <input type="hidden" name="form_submit" value="ok" />
  15. <input type="hidden" name="submit_type" id="submit_type" value="" />
  16. <table class="table tb-type2">
  17. <tbody>
  18. <tr class="noborder">
  19. <td colspan="2" class="required"><label class="validation" for="live_class_name"><?php echo $lang['live_groupbuy_class_name'].$lang['nc_colon'];?></label></td>
  20. </tr>
  21. <tr class="noborder">
  22. <td class="vatop rowform"><input type="text" name="live_class_name" id="live_class_name" class="txt"></td>
  23. <td class="vatop tips"></td>
  24. </tr>
  25. <tr>
  26. <td colspan="2" class="required"><label for="parent_class_id"><?php echo $lang['live_groupbuy_parent_class_name'].$lang['nc_colon'];?></label></td>
  27. </tr>
  28. <tr class="noborder">
  29. <td class="vatop rowform"><select id="parent_class_id" name="parent_class_id" class="valid" >
  30. <option value="0"><?php echo $lang['nc_common_pselect'];?></option>
  31. <?php if(!empty($output['list']) && is_array($output['list'])) {?>
  32. <?php foreach($output['list'] as $key=>$val) {?>
  33. <option value="<?php echo $val['live_class_id'];?>" <?php if($output['parent_class_id']==$val['live_class_id']){echo 'selected';}?>><?php echo $val['live_class_name'];?></option>
  34. <?php } ?>
  35. <?php } ?>
  36. </select></td>
  37. <td class="vatop tips"></td>
  38. </tr>
  39. <tr>
  40. <td colspan="2" class="required"><label for="live_class_sort" class="validation"><?php echo $lang['nc_sort'].$lang['nc_colon'];?></label></td>
  41. </tr>
  42. <tr class="noborder">
  43. <td class="vatop rowform"><input id="live_class_sort" name="live_class_sort" type="text" class="txt" /></td>
  44. <td class="vatop tips"><?php echo $lang['class_sort_explain'];?></td>
  45. </tr>
  46. </tbody>
  47. <tfoot>
  48. <tr>
  49. <td colspan="2"><a id="submit" href="javascript:void(0)" class="btn"><span><?php echo $lang['nc_submit'];?></span></a></td>
  50. </tr>
  51. </tfoot>
  52. </table>
  53. </form>
  54. </div>
  55. <script type="text/javascript">
  56. $(document).ready(function(){
  57. $('#submit').click(function(){
  58. $('#add_form').submit();
  59. });
  60. $('#add_form').validate({
  61. errorPlacement: function(error, element){
  62. error.appendTo(element.parent().parent().prev().find('td:first'));
  63. },
  64. success: function(label){
  65. label.addClass('valid');
  66. },
  67. rules : {
  68. live_class_name: {
  69. required : true,
  70. maxlength : 10
  71. },
  72. live_class_sort: {
  73. required : true,
  74. digits: true,
  75. max: 255,
  76. min: 0
  77. }
  78. },
  79. messages : {
  80. live_class_name: {
  81. required : "<?php echo $lang['live_groupbuy_class_name_is_not_null'];?>",
  82. maxlength : jQuery.validator.format("<?php echo $lang['live_groupbuy_class_name_length'];?>")
  83. },
  84. live_class_sort: {
  85. required : "<?php echo $lang['live_groupbuy_class_sort_is_not_null'];?>",
  86. digits: "<?php echo $lang['live_groupbuy_class_sort_is_number'];?>",
  87. max : jQuery.validator.format("<?php echo $lang['live_groupbuy_class_sort_is_number'];?>"),
  88. min : jQuery.validator.format("<?php echo $lang['live_groupbuy_class_sort_is_number'];?>")
  89. }
  90. }
  91. });
  92. });
  93. </script>