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

82 lines
2.8KB

  1. <?php
  2. /**
  3. * 编辑自定义表单
  4. *
  5. * @version $Id: diy_add.php 1 14:31 2010年7月12日Z tianya $
  6. * @package DedeCMS.Administrator
  7. * @copyright Copyright (c) 2007 - 2018, DesDev, Inc.
  8. * @copyright Copyright (c) 2020, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license/v6
  10. * @link https://www.dedebiz.com
  11. */
  12. require_once(dirname(__FILE__)."/config.php");
  13. CheckPurview('c_Edit');
  14. require_once(DEDEINC."/dedetag.class.php");
  15. require_once(DEDEINC."/oxwindow.class.php");
  16. if(empty($dopost)) $dopost="";
  17. $diyid = (empty($diyid) ? 0 : intval($diyid));
  18. /*----------------
  19. function __SaveEdit()
  20. -----------------*/
  21. if($dopost=="save")
  22. {
  23. $public = isset($public) && is_numeric($public) ? $public : 0;
  24. $name = dede_htmlspecialchars($name);
  25. $query = "UPDATE `#@__diyforms` SET name = '$name', listtemplate='$listtemplate', viewtemplate='$viewtemplate', posttemplate='$posttemplate', public='$public' WHERE diyid='$diyid' ";
  26. $dsql->ExecuteNoneQuery($query);
  27. ShowMsg("成功更改一个自定义表单!","diy_main.php");
  28. exit();
  29. }
  30. /*----------------
  31. function __Delete()
  32. -----------------*/
  33. else if($dopost=="delete")
  34. {
  35. @set_time_limit(0);
  36. CheckPurview('c_Del');
  37. $row = $dsql->GetOne("SELECT * FROM #@__diyforms WHERE diyid='$diyid'");
  38. if(empty($job)) $job = "";
  39. //确认提示
  40. if($job=="")
  41. {
  42. $wintitle = "自定义表单管理-删除自定义表单";
  43. $wecome_info = "<a href='diy_main.php'>自定义表单管理</a>::删除自定义表单";
  44. $win = new OxWindow();
  45. $win->Init("diy_edit.php", "js/blank.js", "POST");
  46. $win->AddHidden("job", "yes");
  47. $win->AddHidden("dopost", $dopost);
  48. $win->AddHidden("diyid", $diyid);
  49. $win->AddTitle("!将删除所有与该自定义表单相关的文件和数据<br />你确实要删除 \"".$row['name']."\" 这个自定义表单?");
  50. $winform = $win->GetWindow("ok");
  51. $win->Display();
  52. exit();
  53. }
  54. //操作
  55. else if($job=="yes")
  56. {
  57. $row = $dsql->GetOne("SELECT `table` FROM `#@__diyforms` WHERE diyid='$diyid'",MYSQL_ASSOC);
  58. if(!is_array($row))
  59. {
  60. ShowMsg("你所指定的自定义表单信息不存在!","-1");
  61. exit();
  62. }
  63. //删除表
  64. $dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$row['table']}`;");
  65. //删除频道配置信息
  66. $dsql->ExecuteNoneQuery("DELETE FROM `#@__diyforms` WHERE diyid='$diyid'");
  67. ShowMsg("成功删除一个自定义表单!","diy_main.php");
  68. exit();
  69. }
  70. }
  71. /*----------------
  72. function edit()
  73. -----------------*/
  74. $row = $dsql->GetOne("Select * From #@__diyforms where diyid='$diyid'");
  75. include DEDEADMIN."/templets/diy_edit.htm";