class_add.html 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <div class="eject_con">
  2. <div id="warning" class="alert alert-error"></div>
  3. <form id="category_form" method="post" target="_parent" action="{:url('Sellergoodsclass/goods_class_save')}">
  4. <input type="hidden" name="storegc_id" value="{$Request.param.top_class_id}" />
  5. <input type="hidden" name="type" value="{$type}" />
  6. <dl>
  7. <dt><i class="required">*</i>{$Think.lang.store_goods_class_name}{$Think.lang.ds_colon}</dt>
  8. <dd>
  9. <input class="text w200" type="text" name="storegc_name" id="storegc_name" value="{present name='class_info.storegc_name'}{$class_info.storegc_name}{/present}" />
  10. </dd>
  11. </dl>
  12. <dl>
  13. <dt>{$Think.lang.store_goods_class_sup_class}{$Think.lang.ds_colon}</dt>
  14. <dd>
  15. <select name="storegc_parent_id" id="storegc_parent_id">
  16. <option value="0">{$Think.lang.store_create_please_choose}</option>
  17. {notempty name="goods_class"}
  18. {foreach name="goods_class" item="val"}
  19. <option value="{$val.storegc_id}" {if $val.storegc_id == $class_info.storegc_parent_id}selected="selected"{/if}>{$val.storegc_name}</option>
  20. {/foreach}
  21. {/notempty}
  22. </select>
  23. </dd>
  24. </dl>
  25. <dl>
  26. <dt>{$Think.lang.store_goods_class_sort}{$Think.lang.ds_colon}</dt>
  27. <dd>
  28. <input class="text w60" type="text" name="storegc_sort" value="{present name='class_info.storegc_sort'}{:intval($class_info.storegc_sort)}{/present}" />
  29. </dd>
  30. </dl>
  31. <dl>
  32. <dt>{$Think.lang.store_goods_class_display_state}{$Think.lang.ds_colon}</dt>
  33. <dd>
  34. <label>
  35. <input type="radio" name="storegc_state" value="1"
  36. {present name="class_info.storegc_state"}
  37. {if $class_info.storegc_state == 1}
  38. checked="checked"
  39. {/if}{else}checked="checked"{/present}/>
  40. {$Think.lang.store_create_yes}</label>
  41. <label>
  42. <input type="radio" name="storegc_state" value="0" {present name="class_info.storegc_state"}{if $class_info.storegc_state == 0 }checked="checked"{/if}{/present} />
  43. {$Think.lang.store_create_no}</label>
  44. </dd>
  45. </dl>
  46. <div class="bottom">
  47. <input type="submit" class="submit" value="{$Think.lang.store_goods_class_submit}" />
  48. </div>
  49. </form>
  50. </div>
  51. <script type="text/javascript">
  52. $(function(){
  53. $('#category_form').validate({
  54. errorLabelContainer: $('#warning'),
  55. invalidHandler: function(form, validator) {
  56. $('#warning').show();
  57. },
  58. submitHandler:function(form){
  59. ds_ajaxpost('category_form', 'url', "{:url('Sellergoodsclass/index')}")
  60. },
  61. rules : {
  62. storegc_name : {
  63. required : true
  64. },
  65. storegc_sort : {
  66. number : true
  67. }
  68. },
  69. messages : {
  70. storegc_name : {
  71. required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.store_goods_class_name_null}'
  72. },
  73. storegc_sort : {
  74. number : '<i class="iconfont">&#xe64c;</i>{$Think.lang.store_goods_class_input_int}'
  75. }
  76. }
  77. });
  78. });
  79. </script>