add.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. <div class="form-group">
  10. <label class="col-sm-2 control-label">名称<span class="text-danger">*</span></label>
  11. <div class="col-sm-6">
  12. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  13. </div>
  14. </div>
  15. <div class="form-group">
  16. <label class="col-sm-2 control-label">类型<span class="text-danger">*</span></label>
  17. <div class="col-sm-6">
  18. <select name="type" class="form-control">
  19. {foreach $type as $k=>$v}
  20. <option {if isset($info) && $info['type']==$k} selected {/if} value="{$k}">{$v}</option>
  21. {/foreach}
  22. </select>
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="col-sm-2 control-label">状态</label>
  27. <div class="col-sm-6">
  28. <label class="cr-inline">
  29. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  30. </label>
  31. <label class="cr-inline">
  32. <input type="radio" value="0" name="enable">禁用
  33. </label>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-sm-2 control-label">备注</label>
  38. <div class="col-sm-6">
  39. <textarea name="remark" class="form-control" id="" cols="30" rows="5">{$info.remark|default=''}</textarea>
  40. </div>
  41. </div>
  42. <div class="hr-line-dashed"></div>
  43. <div class="form-group">
  44. <div class="col-sm-6 col-sm-offset-2">
  45. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  46. <button class="btn cancel-btn btn-default" type="button">取 消</button>
  47. </div>
  48. </div>
  49. </form>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. {/block}
  55. {block name="script"}
  56. <script>
  57. $(document).ready(function(){
  58. formSetValue("enable", {$info.enable|default=1});
  59. });
  60. </script>
  61. {/block}