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

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