国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
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.

139 lines
6.2KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>自定义表单修改字段</title>
  7. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  8. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <script src="../static/web/js/jquery.min.js"></script>
  11. <script src="../static/web/js/bootstrap.bundle.min.js"></script>
  12. <script src="js/main.js"></script>
  13. <style>.nw{float:left;width:160px}.cls{clear:both}</style>
  14. <script>
  15. function GetFields()
  16. {
  17. var theform = document.form1;
  18. var itemname = theform.itemname.value;
  19. var fieldname = theform.fname.value;
  20. var dtype = theform.dtype.value;
  21. var isnull = theform.isnull.value;
  22. var vdefault = theform.vdefault.value;
  23. var maxlength = theform.maxlength.value;
  24. var vinnertext = theform.vinnertext.value;
  25. var spage = (theform.spage[0].checked ? theform.spage[0].value : theform.spage[1].value);
  26. var sisnull = (isnull==0 ? "false" : "true");
  27. if (itemname=="")
  28. {
  29. ShowMsg("表单提示名称不能为空");
  30. theform.itemname.focus();
  31. return false;
  32. }
  33. if ((dtype=="radio"||dtype=="select"||dtype=="checkbox") && vdefault=="")
  34. {
  35. ShowMsg("您选择的select或radio、checkbox类型,必须默认值设置选择的项目(用英文逗号)");
  36. return false;
  37. }
  38. if (spage=="no") spage = "";
  39. revalue = "<field:"+fieldname+" itemname=\""+itemname+"\" autofield=\"1\" type=\""+dtype+"\"";
  40. revalue += " isnull=\""+sisnull+"\" default=\""+vdefault+"\" ";
  41. revalue += " maxlength=\""+maxlength+"\" page=\""+spage+"\">"+vinnertext+"</field:"+fieldname+">";
  42. document.form1.fieldstring.value = revalue;
  43. return true;
  44. }
  45. </script>
  46. </head>
  47. <body>
  48. <table cellpadding="1" cellspacing="1" align="center" class="table maintable my-3">
  49. <form name="form1" action="diy_field_edit.php" method="post" onSubmit="return GetFields();">
  50. <input type="hidden" name="action" value="save">
  51. <input type="hidden" name="diyid" value="<?php echo $diyid?>">
  52. <input type="hidden" name="fname" value="<?php echo $fname?>">
  53. <input type="hidden" name="issystem" value="<?php echo $issystem?>">
  54. <input type="hidden" name="fieldstring" value="">
  55. <tr>
  56. <td bgcolor="#f5f5f5" colspan="2">
  57. <table cellspacing="0" cellpadding="0" class="table table-borderless w-100">
  58. <tr>
  59. <td width="30%"><a href="diy_main.php">自定义表单管理</a> &gt; 修改字段</td>
  60. <td width="70%" align="right"><button type="button" name="ss1" onClick="location='diy_edit.php?diyid=<?php echo $diyid;?>&dopost=edit';" class="btn btn-success btn-sm">当前表单信息</button></td>
  61. </tr>
  62. </table>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>表单提示文字:发布文档时显示的提示文字</td>
  67. <td><input type="text" name="itemname" id="itemname" value="<?php echo $ctag->GetAtt('itemname')?>">(发布文档时显示的项名字)</td>
  68. </tr>
  69. <tr>
  70. <td width="28%">字段名称:只能用英文字母或数字,数据表的真实字段名</td>
  71. <td width="72%" style="table-layout:fixed;word-break:break-all"><?php echo $fname?></td>
  72. </tr>
  73. <tr>
  74. <td>数据类型:</td>
  75. <td>
  76. <select name="dtype" id="type" class="admin-input-md">
  77. <?php
  78. $dtype = $ctag->GetAtt('type');
  79. if ($dtype!='' && isset($fieldtypes[$dtype]))
  80. {
  81. echo "<option value='{$dtype}'>{$fieldtypes[$dtype]}</option>";
  82. $canchange = true;
  83. } else {
  84. echo "<option value='{$dtype}'>系统专用类型</option>";
  85. $canchange = false;
  86. }
  87. if ($canchange)
  88. {
  89. ?>
  90. <option value="text">单行文本(varchar)</option>
  91. <option value="textchar">单行文本(char)</option>
  92. <option value="multitext">多行文本</option>
  93. <option value="htmltext">网页文本</option>
  94. <option value="int">整数类型</option>
  95. <option value="float">小数类型</option>
  96. <option value="datetime">时间类型</option>
  97. <option value="img">图片</option>
  98. <option value="addon">附件类型</option>
  99. <option value="select">option下拉框</option>
  100. <option value="radio">radio选项卡</option>
  101. <option value="checkbox">checkbox多选框</option>
  102. <?php }?>
  103. </select>
  104. </td>
  105. </tr>
  106. <tr>
  107. <td>文档是否需要分页符:如果文档需要分页符,不论何种文档,都可以用#P#副标题#e#作为分页符号实现文档分页,但一个模型里仅允许一个这样的字段</td>
  108. <td>
  109. <input type="hidden" name="isnull" value="1">
  110. <label><input type="radio" name="spage" value="split" <?php if ($ctag->GetAtt('page')=='split') echo "checked='1'";?>> 是</label>
  111. <label><input type="radio" name="spage" value="no" <?php if ($ctag->GetAtt('page')=='no'||$ctag->GetAtt('page')=='') echo "checked='1'";?>> 否</label>
  112. </td>
  113. </tr>
  114. <tr>
  115. <td>默认值:如果定义数据类型为select、radio、checkbox时,此处填写被选择的项目(英文逗号分开,如“天涯,叙述”)如果为联动选框,这里填写联动选框项目名称</td>
  116. <td><textarea name="vdefault" id="vdefault" class="admin-textarea-xl"><?php echo $ctag->GetAtt('default');?></textarea></td>
  117. </tr>
  118. <tr>
  119. <td>最大长度:文本数据必须填写,大于255为text类型</td>
  120. <td><input type="text" name="maxlength" id="maxlength" value="<?php echo $ctag->GetAtt('maxlength')?>"></td>
  121. </tr>
  122. <tr>
  123. <td>自定义网页表单:</td>
  124. <td>自定义网页表单用~name~表示提示文字,~form~表示表单元素</td>
  125. </tr>
  126. <tr>
  127. <td align="center"></td>
  128. <td><textarea name="vinnertext" id="vinnertext" class="admin-textarea-xl"><?php echo $ctag->GetInnerText();?></textarea></td>
  129. </tr>
  130. <tr>
  131. <td bgcolor="#f5f5f5" colspan="2" align="center">
  132. <button type="submit" class="btn btn-success btn-sm">保存</button>
  133. <button type="reset" class="btn btn-outline-success btn-sm">重置</button>
  134. </td>
  135. </tr>
  136. </form>
  137. </table>
  138. </body>
  139. </html>