国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

146 rindas
4.9KB

  1. <?php
  2. if ($action=='edit') {
  3. $arr = $dsql->GetOne("SELECT * FROM `#@__stepselect` WHERE id='$id' ");
  4. $sbjs = " onsubmit=\"alert('该分类是系统内置枚举,不允许修改'); return false;\" ";
  5. if ($arr['issystem']==0) $sbjs = '';
  6. ?>
  7. <div class="card shadow-sm">
  8. <div class="card-body">
  9. <form action="stepselect_main.php" method="post" <?php echo $sbjs;?>>
  10. <input type="hidden" name="action" value="edit_save">
  11. <input type="hidden" name="id" value="<?php echo $arr['id'];?>">
  12. <table class="table table-borderless">
  13. <tbody>
  14. <tr>
  15. <td width="160">类别名</td>
  16. <td><input type="text" name="itemname" class="admin-input-lg" value="<?php echo $arr['itemname'];?>" required></td>
  17. </tr>
  18. <tr>
  19. <td>缓存名</td>
  20. <td><input type="text" name="egroup" value="<?php echo $arr['egroup'];?>" class="admin-input-lg" required>(缓存名必须用英文或数字)</td>
  21. </tr>
  22. <tr>
  23. <td colspan="2">
  24. <a href="javascript:CloseTWin();" class="btn btn-success btn-sm">关闭</a>
  25. <button type="submit" class="btn btn-success btn-sm">保存</button>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </form>
  31. </div>
  32. </div>
  33. <?php
  34. } else if ($action=='addnew') {
  35. ?>
  36. <div class="card shadow-sm">
  37. <div class="card-body">
  38. <form action="stepselect_main.php" method="post">
  39. <input type="hidden" name="action" value="addnew_save">
  40. <table class="table table-borderless">
  41. <tbody>
  42. <tr>
  43. <td width="160">类别名</td>
  44. <td><input type="text" name="itemname" class="admin-input-lg" required></td>
  45. </tr>
  46. <tr>
  47. <td>缓存名</td>
  48. <td><input type="text" name="egroup" class="admin-input-lg" required>(缓存名必须用英文或数字)</td>
  49. </tr>
  50. <tr>
  51. <td colspan="2">
  52. <a href="javascript:CloseTWin();" class="btn btn-success btn-sm">关闭</a>
  53. <button type="submit" class="btn btn-success btn-sm">保存</button>
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </form>
  59. </div>
  60. </div>
  61. <?php
  62. } else if ($action=='addenum') {
  63. $arr = $dsql->GetOne("SELECT * FROM `#@__stepselect` WHERE id='$id' ");
  64. $dsql->Execute('out',"SELECT evalue,ename FROM `#@__sys_enum` WHERE egroup='{$arr['egroup']}' AND (evalue mod 500)=0 ORDER BY disorder ASC,evalue ASC");
  65. $options = '';
  66. if ($arr['issign']==0)
  67. {
  68. while($row1 = $dsql->GetArray('out')) $options .= "<option value='{$row1['evalue']}'>{$row1['ename']}</option>";
  69. }
  70. ?>
  71. <div class="card shadow-sm">
  72. <div class="card-body">
  73. <form action="stepselect_main.php" method="post">
  74. <input type="hidden" name="action" value="addenum_save">
  75. <input type="hidden" name="issign" value="<?php echo $arr['issign'];?>">
  76. <input type="hidden" name="egroup" value="<?php echo $arr['egroup'];?>">
  77. <table class="table table-borderless">
  78. <tbody>
  79. <tr>
  80. <td width="160">所属枚举</td>
  81. <td>
  82. <select name="topvalue" class="admin-input-lg">
  83. <option value="0">保存一级枚举</option>
  84. <?php echo $options;?>
  85. </select>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td>枚举名</td>
  90. <td><input type="text" name="ename" class="admin-input-lg" required></td>
  91. </tr>
  92. <tr>
  93. <td>排序值</td>
  94. <td><input type="text" name="disorder" class="admin-input-lg" required></td>
  95. </tr>
  96. <tr>
  97. <td colspan="2">
  98. <a href="javascript:CloseTWin();" class="btn btn-success btn-sm">关闭</a>
  99. <button type="submit" class="btn btn-success btn-sm">保存</button>
  100. </td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. </form>
  105. </div>
  106. </div>
  107. <?php
  108. } else if ($action=='view') {
  109. $arr = $dsql->GetOne("SELECT * FROM `#@__stepselect` WHERE id='$id' ");
  110. $dsql->Execute('out',"SELECT * FROM `#@__sys_enum` where egroup like '{$arr['egroup']}' ORDER BY disorder asc, evalue ASC");
  111. $options = '';
  112. while($row1 = $dsql->GetArray('out'))
  113. {
  114. if ($row1['evalue']%500==0 || $arr['issign']==1)
  115. {
  116. $options .= "<option value='{$row1['evalue']}'>└─ {$row1['ename']}</option>";
  117. } else {
  118. $options .= "<option value='{$row1['evalue']}'>└── {$row1['ename']}</option>";
  119. }
  120. }
  121. ?>
  122. <div class="card shadow-sm">
  123. <div class="card-body">
  124. <table class="table table-borderless">
  125. <tbody>
  126. <tr>
  127. <td width="160">类别关系</td>
  128. <td>
  129. <select name="topvalue" class="admin-input-lg">
  130. <option value="0">请选择</option>
  131. <?php echo $options;?>
  132. </select>
  133. <span>(这里仅显示数据关系,实际应用中,二级联动生成的表单是支持级连的,并非全部列出)</span>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td colspan="2">
  138. <a href="javascript:CloseTWin();" class="btn btn-success btn-sm">关闭</a>
  139. <button type="submit" class="btn btn-success btn-sm">保存</button>
  140. </td>
  141. </tr>
  142. </tbody>
  143. </table>
  144. </div>
  145. </div>
  146. <?php }?>