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

89 lines
4.0KB

  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. <span class="float-left">修改类别</span>
  8. <span class="float-right"><a class="btn btn-success btn-sm" href="javascript:;" onclick="javascript:CloseTWin();">关闭</a></span>
  9. <br style="clear:both">
  10. <form action="stepselect_main.php" method="post" <?php echo $sbjs;?>>
  11. <input type="hidden" name="action" value="edit_save">
  12. <input type="hidden" name="id" value="<?php echo $arr['id'];?>">
  13. <div>类 别 名:<input type="text" name="itemname" value="<?php echo $arr['itemname'];?>" style="width:160px"></div>
  14. <div>缓存组名:<input type="text" name="egroup" value="<?php echo $arr['egroup'];?>" style="width:160px"></div>
  15. <div>缓存组名必须为英文或数字组合</div>
  16. <div><button type="submit" class="btn btn-success btn-sm">保存</button></div>
  17. </form>
  18. <?php
  19. } else if ($action=='addnew') {
  20. ?>
  21. <span class="float-left">新增类别</span>
  22. <span class="float-right"><a class="btn btn-success btn-sm" href="javascript:;" onclick="javascript:CloseTWin();">关闭</a></span>
  23. <br style="clear:both">
  24. <form action="stepselect_main.php" method="post">
  25. <input type="hidden" name="action" value="addnew_save">
  26. <div>类 别 名:<input type="text" name="itemname" style="width:160px"></div>
  27. <div>缓存组名:<input type="text" name="egroup" style="width:160px"></div>
  28. <div>缓存组名必须为英文或数字组合</div>
  29. <div><button type="submit" class="btn btn-success btn-sm">保存</button></div>
  30. </form>
  31. <?php
  32. } else if ($action=='addenum') {
  33. $arr = $dsql->GetOne("Select * from `#@__stepselect` where id='$id' ");
  34. $dsql->Execute('out',"Select evalue,ename from `#@__sys_enum` where egroup='{$arr['egroup']}' And (evalue mod 500)=0 order by disorder asc,evalue asc");
  35. $options = '';
  36. if ($arr['issign']==0)
  37. {
  38. while($row1 = $dsql->GetArray('out')) $options .= "<option value='{$row1['evalue']}'>{$row1['ename']}</option>";
  39. }
  40. ?>
  41. <span class="float-left">添加枚举</span>
  42. <span class="float-right"><a class="btn btn-success btn-sm" href="javascript:;" onclick="javascript:CloseTWin();">关闭</a></span>
  43. <br style="clear:both">
  44. <form action="stepselect_main.php" method="post">
  45. <input type="hidden" name="action" value="addenum_save">
  46. <input type="hidden" name="issign" value="<?php echo $arr['issign'];?>">
  47. <input type="hidden" name="egroup" value="<?php echo $arr['egroup'];?>">
  48. <div>
  49. 隶属枚举:<select name="topvalue" style="width:160px">
  50. <option value="0">保存一级枚举</option>
  51. <?php echo $options;?>
  52. </select>
  53. </div>
  54. <div>枚举名:<input type="text" name="ename" style="width:160px"></div>
  55. <div>排序值:<input type="text" name="disorder" style="width:160px"></div>
  56. <div>如果不指定,默认以枚举添加先后来排序</div>
  57. <div><input type="submit" value="保存" class="np coolbg"/></div>
  58. </form>
  59. <?php
  60. } else if ($action=='view') {
  61. $arr = $dsql->GetOne("Select * from `#@__stepselect` where id='$id' ");
  62. $dsql->Execute('out',"Select * From `#@__sys_enum` where egroup like '{$arr['egroup']}' order by disorder asc, evalue asc");
  63. $options = '';
  64. while($row1 = $dsql->GetArray('out'))
  65. {
  66. if ($row1['evalue']%500==0 || $arr['issign']==1)
  67. {
  68. $options .= "<option value='{$row1['evalue']}'>{$row1['ename']}</option>";
  69. } else {
  70. $options .= "<option value='{$row1['evalue']}'>└─{$row1['ename']}</option>";
  71. }
  72. }
  73. ?>
  74. <span class="float-left">预览联动表单</span>
  75. <span class="float-right"><a class="btn btn-success btn-sm" href="javascript:;" onclick="javascript:CloseTWin();">关闭</a></span>
  76. <br style="clear:both">
  77. <div>
  78. 类别关系:
  79. <select name="topvalue" style="width:160px">
  80. <option value="0">请选择</option>
  81. <?php echo $options;?>
  82. </select>
  83. <br>
  84. 这里仅显示数据关系,实际应用中,二级联动生成的表单是支持级连的,并非全部列出
  85. </div>
  86. <br style="clear:both">
  87. <?php
  88. }
  89. ?>