index.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <a href="{:U('Config/add')}" class="btn btn-primary">新增</a>
  5. </div>
  6. <table class="table table-striped table-bordered table-hover search-form">
  7. <thead>
  8. <th><input name="name" type="text" placeholder="输入配置名称" value="{:I('name')}" /></th>
  9. <th>
  10. <select name="config_group">
  11. <option value="">-选择分组-</option>
  12. <option <?php if(isset($get_group)&&($get_group=='site')){echo ' selected="selected"';} ?> value="site">site</option>
  13. <option <?php if(isset($get_group)&&($get_group=='image')){echo ' selected="selected"';} ?> value="image">image</option>
  14. <option <?php if(isset($get_group)&&($get_group=='smtp')){echo ' selected="selected"';} ?> value="smtp">smtp</option>
  15. <option <?php if(isset($get_group)&&($get_group=='other')){echo ' selected="selected"';} ?> value="other">other</option>
  16. </select>
  17. </th>
  18. <th>
  19. <a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Config/index')}">查询</a>
  20. </th>
  21. </thead>
  22. </table>
  23. <div class="row">
  24. <div class="col-xs-12">
  25. <div class="table-responsive">
  26. <table class="table table-striped table-bordered table-hover">
  27. <thead>
  28. <tr>
  29. <th>名称</th>
  30. <th>分组</th>
  31. <th>值</th>
  32. <th>描述</th>
  33. <th>操作</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. <volist name="list" id="c" empty="$empty">
  38. <tr>
  39. <td>{$c.name}</td>
  40. <td>{$c.config_group}</td>
  41. <td>{$c.value}</td>
  42. <td>{$c.info}</td>
  43. <td>
  44. <a class="btn btn-xs btn-info" href='{:U("Config/edit",array("id"=>$c["id"]))}'>
  45. <i class="icon-edit bigger-120"></i>
  46. </a>
  47. <a class="delete btn btn-xs btn-danger" href='{:U("Config/del",array("id"=>$c["id"]))}' >
  48. <i class="icon-trash bigger-120"></i>
  49. </a>
  50. </td>
  51. </tr>
  52. </volist>
  53. <tr>
  54. <td colspan="20" class="page">{$page}</td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. </block>
  62. <block name="javascript">
  63. <script>
  64. $(function(){
  65. $("#search").click(function () {
  66. var url = $(this).attr('url');
  67. var query = $('.search-form').find('input,select').serialize();
  68. query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
  69. query = query.replace(/^&/g, '');
  70. if (url.indexOf('?') > 0) {
  71. url += '&' + query;
  72. } else {
  73. url += '?' + query;
  74. }
  75. window.location.href = url;
  76. });
  77. });
  78. </script>
  79. </block>