国内流行的内容管理系统(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.

134 lines
5.3KB

  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.min.js"></script>
  12. <script src="js/main.js"></script>
  13. <script>
  14. function checkSubmit() {
  15. if (document.form1.name.value == '') {
  16. ShowMsg("自定义表单名称不能为空");
  17. return false;
  18. }
  19. return true;
  20. }
  21. </script>
  22. </head>
  23. <body>
  24. <table cellpadding="1" cellspacing="1" align="center" class="table maintable my-3">
  25. <form name="form1" action="diy_edit.php" method="post" onSubmit="return checkSubmit();">
  26. <input type="hidden" name="diyid" value="<?php echo $diyid;?>">
  27. <input type="hidden" name="dopost" value="save">
  28. <tr>
  29. <td bgcolor="#f5f5f5" colspan="2"><a href="diy_main.php">自定义表单管理</a> &gt; 修改自定义表单</td>
  30. </tr>
  31. <tr>
  32. <td width="260">自定义表单diyid:</td>
  33. <td><?php echo $diyid;?>(创建后不可修改,并具有唯一性)</td>
  34. </tr>
  35. <tr>
  36. <td>自定义表单名称:</td>
  37. <td><input type="text" name="name" id="name" class="admin-input-sm" value="<?php echo $row['name']?>">(修改表名不会创建新表,如果您不懂手工处理这些表,请不要修改)</td>
  38. </tr>
  39. <tr>
  40. <td>数据表:</td>
  41. <td><input type="text" name="table" id="table" class="admin-input-sm" value="<?php echo $row['table'];?>" disabled="1">(自定义表单数据表创建后不可修改表名)</td>
  42. </tr>
  43. <tr>
  44. <td>列表模板:</td>
  45. <td><input type="text" name="listtemplate" id="listtemplate" class="admin-input-sm" value="<?php echo $row['listtemplate'];?>"></td>
  46. </tr>
  47. <tr>
  48. <td>文档模板:</td>
  49. <td><input type="text" name="viewtemplate" id="viewtemplate" class="admin-input-sm" value="<?php echo $row['viewtemplate'];?>"></td>
  50. </tr>
  51. <tr>
  52. <td>发布模板:</td>
  53. <td><input type="text" name="posttemplate" id="posttemplate" class="admin-input-sm" value="<?php echo $row['posttemplate'];?>"></td>
  54. </tr>
  55. <tr>
  56. <td>前台列表和文档页公开:</td>
  57. <td>
  58. <label><input type="radio" name="public" value="2" <?php echo $row['public'] == 2 ? 'checked' : '';?>> 完全公开</label>
  59. <label><input type="radio" name="public" value="1" <?php echo $row['public'] == 1 ? 'checked' : '';?>> 公开审核过的</label>
  60. <label><input type="radio" name="public" value="0" <?php echo $row['public'] == 0 ? 'checked' : '';?>> 不公开</label>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td colspan="2">
  65. <table width="100%" cellpadding="1" cellspacing="1" align="center" class="table maintable">
  66. <tr>
  67. <td colspan="5" bgcolor="f5f5f5">修改自定义表单</td>
  68. </tr>
  69. <tr bgcolor="#e9ecef" align="center">
  70. <td width="16%">表单提示文字</td>
  71. <td width="16%">数据字段名</td>
  72. <td width="16%">数据类型</td>
  73. <td width="16%">表单类型</td>
  74. <td>操作</td>
  75. </tr>
  76. <?php
  77. $ds = file(DedeInclude('/inc/fieldtype.txt'));
  78. foreach($ds as $d){
  79. $dds = explode(',',trim($d));
  80. $fieldtypes[$dds[0]] = $dds[1];
  81. }
  82. $fieldset = stripslashes($row['info']);
  83. $dtp = new DedeTagParse();
  84. $dtp->SetNameSpace("field","<",">");
  85. $dtp->LoadSource($fieldset);
  86. if (is_array($dtp->CTags)){
  87. foreach($dtp->CTags as $ctag)
  88. {
  89. ?>
  90. <tr align="center">
  91. <td>
  92. <?php
  93. $itname = $ctag->GetAtt('itemname');
  94. if ($itname=='') echo "没指定";
  95. else echo $itname;
  96. ?>
  97. </td>
  98. <td><?php echo $ctag->GetTagName()?></td>
  99. <td>
  100. <?php
  101. $ft = $ctag->GetAtt('type');
  102. if (isset($fieldtypes[$ft])) echo $fieldtypes[$ft];
  103. else echo "系统专用类型";
  104. ?>
  105. </td>
  106. <td>
  107. <?php
  108. $ft = $ctag->GetAtt('autofield');
  109. if ($ft==''||$ft==0) echo "固化表单";
  110. else echo "自动表单";
  111. ?>
  112. </td>
  113. <td>
  114. <a href="diy_field_edit.php?diyid=<?php echo $diyid;?>&fname=<?php echo $ctag->GetTagName()?>" class="btn btn-success btn-sm"><i class="fa fa-pencil-square"></i> 修改</a>
  115. <a href="diy_field_edit.php?diyid=<?php echo $diyid;?>&action=delete&fname=<?php echo $ctag->GetTagName()?>" class="btn btn-danger btn-sm"><i class="fa fa-trash"></i> 删除</a>
  116. </td>
  117. </tr>
  118. <?php }}?>
  119. </table>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td colspan="2"><button type="button" name="fset" id="fset" class="btn btn-success btn-sm" onclick="location.href='diy_field_add.php?diyid=<?php echo $diyid;?>'">添加新字段</button></td>
  124. </tr>
  125. <tr>
  126. <td bgcolor="#f5f5f5" colspan="2" align="center">
  127. <button type="submit" name="button" id="button" class="btn btn-success btn-sm">保存</button>
  128. <button type="button" id="button2" class="btn btn-outline-success btn-sm" onclick="location='diy_main.php';">返回</button>
  129. </td>
  130. </tr>
  131. </form>
  132. </table>
  133. </body>
  134. </html>