心理咨询网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

form.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. {include file='common/head.html'}
  2. <div class="layui-body">
  3. {if([$list])}
  4. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  5. <ul class="layui-tab-title">
  6. <li class="layui-this" lay-id="t1">表单列表</li>
  7. <li lay-id="t2">表单新增</li>
  8. </ul>
  9. <div class="layui-tab-content">
  10. <div class="layui-tab-item layui-show">
  11. <table class="layui-table">
  12. <thead>
  13. <tr>
  14. <th>编码</th>
  15. <th>表单名称</th>
  16. <th>表名称</th>
  17. <th>数据</th>
  18. <th>字段</th>
  19. <th>操作</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. {foreach $forms(key,value)}
  24. <tr>
  25. <td>[value->fcode]</td>
  26. <td>[value->form_name]</td>
  27. <td>[value->table_name]</td>
  28. <td>
  29. {if($value->id==1)}
  30. <a href="{url./admin/Message/index}"><i class="fa fa-list"></i> 查看数据</a></td>
  31. {else}
  32. <a href="{url./admin/Form/index/fcode/'.$value->fcode.'/action/showdata}"><i class="fa fa-list"></i> 查看数据</a></td>
  33. {/if}
  34. <td><a href="{url./admin/Form/index/fcode/'.$value->fcode.'/action/showfield}"><i class="fa fa-pencil-square-o"></i> 编辑字段</a></td>
  35. <td>
  36. {if($value->id!=1)}
  37. <a href="{url./admin/Form/mod/id/'.$value->id.'/action/addmenu}{$btnqs}" class="layui-btn layui-btn-xs layui-btn-primary">添加到菜单</a>
  38. <a href="{url./admin/Form/del/id/'.$value->id.'/action/delform}" onclick="return confirm('您确定要删除么?')" class="layui-btn layui-btn-xs layui-btn-danger" title="删除">删除</a>
  39. {/if}
  40. <a href="{url./admin/Form/mod/id/'.$value->id.'/action/modform}{$btnqs}" class="layui-btn layui-btn-xs">修改</a>
  41. </td>
  42. </tr>
  43. {/foreach}
  44. </tbody>
  45. </table>
  46. <div class="page">{$pagebar}</div>
  47. </div>
  48. <div class="layui-tab-item">
  49. <form action="{url./admin/Form/add/action/addform}" method="post" class="layui-form">
  50. <input type="hidden" name="formcheck" value="{$formcheck}" >
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">表单名称</label>
  53. <div class="layui-input-block">
  54. <input type="text" name="form_name" maxlength=20 required lay-verify="required" placeholder="请输入表单名称,如:报名表" class="layui-input">
  55. </div>
  56. </div>
  57. <div class="layui-form-item">
  58. <label class="layui-form-label">表名称</label>
  59. <div class="layui-input-block">
  60. <input type="text" name="table_name" maxlength=30 required lay-verify="required" placeholder="请输入表名称,如:baoming" class="layui-input">
  61. </div>
  62. </div>
  63. <div class="layui-form-item">
  64. <div class="layui-input-block">
  65. <button class="layui-btn" lay-submit>立即提交</button>
  66. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  67. </div>
  68. </div>
  69. </form>
  70. </div>
  71. </div>
  72. </div>
  73. {/if}
  74. {if([$showdata])}
  75. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  76. <ul class="layui-tab-title">
  77. <li class="layui-this" lay-id="t1">{$form->form_name} — 数据</li>
  78. </ul>
  79. <div class="layui-tab-content">
  80. <div class="layui-tab-item layui-show">
  81. {foreach $formdata(key,value,num)}
  82. <table class="layui-table table-two">
  83. <thead>
  84. <tr>
  85. <th colspan="2">
  86. {$form->form_name}-[num]
  87. <span style="float:right"><a href="{url./admin/Form/del/id/'.$value->id.'/fcode/'.[$form->fcode].'/action/deldata}" onclick="return confirm('您确定要删除么?')" class="layui-btn layui-btn-xs layui-btn-danger" style="margin-bottom:0px" title="删除">删除</a></span>
  88. </th>
  89. </tr>
  90. </thead>
  91. <tbody>
  92. {foreach $fields(key2,value2,num2)}
  93. <tr>
  94. <th>[value2->description]</th>
  95. {php} $field=$value2->name {/php}
  96. <td>[value->$field]</td>
  97. </tr>
  98. {/foreach}
  99. <tr>
  100. <th>时间</th>
  101. <td>[value->create_time]</td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. {/foreach}
  106. {if(session('ucode')==10001 && [$formdata])}
  107. <a href="{url./admin/Form/clear/fcode/'.[$form->fcode].'}" onclick='return confirm("您确定要清空么?")' class="layui-btn layui-btn-sm">清空记录</a>
  108. {/if}
  109. {if([$formdata])}
  110. <a href="{url./admin/Form/index/fcode/'.[$form->fcode].'/action/showdata/export/1}" class="layui-btn layui-btn-sm">导出记录</a>
  111. {/if}
  112. <div class="page">{$pagebar}</div>
  113. </div>
  114. </div>
  115. </div>
  116. {/if}
  117. {if([$showfield])}
  118. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  119. <ul class="layui-tab-title">
  120. <li class="layui-this" lay-id="t1">{$form->form_name}-表单字段</li>
  121. <li lay-id="t2">新增字段</li>
  122. </ul>
  123. <div class="layui-tab-content">
  124. <div class="layui-tab-item layui-show">
  125. <table class="layui-table">
  126. <thead>
  127. <tr>
  128. <th width=40>序号</th>
  129. <th>描述</th>
  130. <th>字段</th>
  131. <th>长度</th>
  132. <th>是否必填</th>
  133. <th>排序</th>
  134. <th>操作</th>
  135. </tr>
  136. </thead>
  137. <tbody>
  138. {foreach $fields(key,value)}
  139. <tr>
  140. <td>[num]</td>
  141. <td>[value->description]</td>
  142. <td>[value->name]</td>
  143. <td>[value->length]</td>
  144. <td>
  145. {if($value->required)}
  146. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/required/value/0}"><i class='fa fa-toggle-on' title="点击关闭必填"></i></a>
  147. {else}
  148. <a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/required/value/1}"><i class='fa fa-toggle-off' title="点击开启必填"></i></a>
  149. {/if}
  150. </td>
  151. <td>[value->sorting]</td>
  152. <td>
  153. <a href="{url./admin/Form/del/id/'.$value->id.'/fcode/'.[$get.fcode].'}" onclick="return confirm('您确定要删除么?')" class="layui-btn layui-btn-xs layui-btn-danger" title="删除">删除</a>
  154. {fun=get_btn_mod($value->id)}
  155. </td>
  156. </tr>
  157. {/foreach}
  158. </tbody>
  159. </table>
  160. <div class="page">{$pagebar}</div>
  161. <div><a href="{url./admin/Form/index}" class="layui-btn">返回表单</a></div>
  162. </div>
  163. <div class="layui-tab-item">
  164. <form action="{url./admin/Form/add}" method="post" class="layui-form">
  165. <input type="hidden" name="formcheck" value="{$formcheck}" >
  166. <div class="layui-form-item">
  167. <label class="layui-form-label">字段描述</label>
  168. <div class="layui-input-block">
  169. <input type="hidden" value="{$get.fcode}" name="fcode" >
  170. <input type="text" name="description" required lay-verify="required" placeholder="请输入字段描述,如:联系人" class="layui-input">
  171. </div>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label">字段名称</label>
  175. <div class="layui-input-block">
  176. <input type="text" name="name" required maxlength="20" lay-verify="required" placeholder="请输入字段名称,必须以字母开头,如:contacts" class="layui-input">
  177. </div>
  178. </div>
  179. <div class="layui-form-item">
  180. <label class="layui-form-label">字段长度</label>
  181. <div class="layui-input-block">
  182. <input type="text" name="length" value="20" required lay-verify="required" class="layui-input">
  183. </div>
  184. </div>
  185. <div class="layui-form-item">
  186. <label class="layui-form-label">是否必填</label>
  187. <div class="layui-input-block">
  188. <input type="radio" name="required" value="1" title="必填" checked>
  189. <input type="radio" name="required" value="0" title="非必填" checked>
  190. </div>
  191. </div>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label">字段排序</label>
  194. <div class="layui-input-block">
  195. <input type="text" name="sorting" value="255" required lay-verify="required" class="layui-input">
  196. </div>
  197. </div>
  198. <div class="layui-form-item">
  199. <div class="layui-input-block">
  200. <button class="layui-btn" lay-submit>立即提交</button>
  201. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  202. </div>
  203. </div>
  204. </form>
  205. </div>
  206. </div>
  207. </div>
  208. {/if}
  209. {if(@[$mod])}
  210. {if([$form])}
  211. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  212. <ul class="layui-tab-title">
  213. <li class="layui-this">自定义表单修改</li>
  214. </ul>
  215. <div class="layui-tab-content">
  216. <div class="layui-tab-item layui-show">
  217. <form action="{url./admin/Form/mod/id/'.[$get.id].'/action/modform}{$backurl}" method="post" class="layui-form">
  218. <input type="hidden" name="formcheck" value="{$formcheck}" >
  219. <div class="layui-form-item">
  220. <label class="layui-form-label">表单名称</label>
  221. <div class="layui-input-block">
  222. <input type="text" name="form_name" maxlength=20 required value="{$form->form_name}" lay-verify="required" placeholder="请输入表单名称,如:报名表" class="layui-input">
  223. </div>
  224. </div>
  225. <div class="layui-form-item">
  226. <label class="layui-form-label">表名称</label>
  227. <div class="layui-input-block">
  228. <input type="text" maxlength=30 required readonly value="{$form->table_name}" lay-verify="required" placeholder="请输入表名称,如:baoming" class="layui-input readonly">
  229. </div>
  230. </div>
  231. <div class="layui-form-item">
  232. <div class="layui-input-block">
  233. <button class="layui-btn" lay-submit>立即提交</button>
  234. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  235. {fun=get_btn_back()}
  236. </div>
  237. </div>
  238. </form>
  239. </div>
  240. </div>
  241. </div>
  242. {/if}
  243. {if(@[$field])}
  244. <div class="layui-tab layui-tab-brief" lay-filter="tab">
  245. <ul class="layui-tab-title">
  246. <li class="layui-this">表单字段修改</li>
  247. </ul>
  248. <div class="layui-tab-content">
  249. <div class="layui-tab-item layui-show">
  250. <form action="{url./admin/Form/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
  251. <input type="hidden" name="formcheck" value="{$formcheck}" >
  252. <div class="layui-form-item">
  253. <label class="layui-form-label">字段描述</label>
  254. <div class="layui-input-block">
  255. <input type="text" name="description" value="{$field->description}" placeholder="请输入字段描述,如:联系人" class="layui-input">
  256. </div>
  257. </div>
  258. <div class="layui-form-item">
  259. <label class="layui-form-label">字段名称</label>
  260. <div class="layui-input-block">
  261. <input type="text" name="name" readonly value="{$field->name}" class="layui-input readonly">
  262. </div>
  263. </div>
  264. <div class="layui-form-item">
  265. <label class="layui-form-label">字段长度</label>
  266. <div class="layui-input-block">
  267. <input type="text" name="length" readonly value="{$field->length}" class="layui-input readonly">
  268. </div>
  269. </div>
  270. <div class="layui-form-item">
  271. <label class="layui-form-label">是否必填</label>
  272. <div class="layui-input-block">
  273. <input type="radio" name="required" value="1" title="必填" {if([$field->required]==1)}checked{/if}>
  274. <input type="radio" name="required" value="0" title="非必填" {if([$field->required]==0)}checked{/if}>
  275. </div>
  276. </div>
  277. <div class="layui-form-item">
  278. <label class="layui-form-label">字段排序</label>
  279. <div class="layui-input-block">
  280. <input type="text" name="sorting" value="{$field->sorting}" required lay-verify="required" class="layui-input">
  281. </div>
  282. </div>
  283. <div class="layui-form-item">
  284. <div class="layui-input-block">
  285. <button class="layui-btn" lay-submit>立即提交</button>
  286. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  287. {fun=get_btn_back()}
  288. </div>
  289. </div>
  290. </form>
  291. </div>
  292. </div>
  293. </div>
  294. {/if}
  295. {/if}
  296. </div>
  297. {include file='common/foot.html'}