add.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <form method="post" action="{:url('add')}" class="form-horizontal">
  8. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  9. <input type="hidden" name="patrol_mode" value="{$info['patrol_mode']|default=$mode}">
  10. <div class="form-group">
  11. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  12. <div class="col-sm-6">
  13. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  14. </div>
  15. </div>
  16. <div class="form-group">
  17. <label class="col-sm-2 control-label">类型<span class="text-danger">*</span></label>
  18. <div class="col-sm-6">
  19. <select name="type" class="form-control">
  20. {foreach $type as $k=>$v}
  21. <option {if isset($info) && $info['type']==$k} selected {/if} value="{$k}">{$v}</option>
  22. {/foreach}
  23. </select>
  24. </div>
  25. </div>
  26. {if $mode==4}
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label">所属分类</label>
  29. <div class="col-sm-6">
  30. {:widget('common/multiselect',['name'=>'cate_id','lists'=>$cate,'val'=>isset($info)?$info.cate_id:[]])}
  31. </div>
  32. </div>
  33. <div class="form-group">
  34. <label class="col-sm-2 control-label">排序</label>
  35. <div class="col-sm-6">
  36. <input type="number" class="form-control" name="sort" value="{$info.sort|default='0'}">
  37. </div>
  38. </div>
  39. {/if}
  40. <div class="form-group">
  41. <label class="col-sm-2 control-label">状态</label>
  42. <div class="col-sm-6">
  43. <label class="cr-inline">
  44. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  45. </label>
  46. <label class="cr-inline">
  47. <input type="radio" value="0" name="enable">禁用
  48. </label>
  49. </div>
  50. </div>
  51. <div class="form-group">
  52. <label class="col-sm-2 control-label">备注</label>
  53. <div class="col-sm-6">
  54. <textarea name="remark" class="form-control" id="" cols="30" rows="5">{$info.remark|default=''}</textarea>
  55. </div>
  56. </div>
  57. <div class="hr-line-dashed"></div>
  58. <div class="form-group">
  59. <div class="col-sm-6 col-sm-offset-2">
  60. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  61. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  62. </div>
  63. </div>
  64. </form>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. {/block}
  70. {block name="script"}
  71. <script>
  72. $(document).ready(function(){
  73. formSetValue("enable", {$info.enable|default=1});
  74. });
  75. </script>
  76. {/block}