ppt_edit.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. require(dirname(__FILE__)."/config.php");
  3. CheckPurview('plus_幻灯管理');
  4. require_once(DEDEINC.'/typelink.class.php');
  5. if(empty($dopost))
  6. {
  7. $dopost = '';
  8. }
  9. $aid = preg_replace('[^0-9]','',$aid);
  10. $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "ppt_main.php" : $_COOKIE['ENV_GOBACK_URL'];
  11. if($dopost=='delete')
  12. {
  13. $dsql->ExecuteNoneQuery("Delete From `#@__myppt` where aid='$aid' ");
  14. ShowMsg("成功删除幻灯片!",$ENV_GOBACK_URL);
  15. exit();
  16. }
  17. else if($dopost=='saveedit')
  18. {
  19. $starttime = GetMkTime($starttime);
  20. $endtime = GetMkTime($endtime);
  21. $query = "Update `#@__myppt`
  22. set
  23. orderid='$orderid',
  24. title='$title',
  25. introduce='$introduce',
  26. typeid='$typeid',
  27. pic='$pic',
  28. url='$url'
  29. where aid='$aid'
  30. ";
  31. $dsql->ExecuteNoneQuery($query);
  32. ShowMsg("成功更改幻灯片!",$ENV_GOBACK_URL);
  33. exit();
  34. }
  35. $row = $dsql->GetOne("Select * From `#@__myppt` where aid='$aid'");
  36. $dsql->Execute('dd','SELECT * FROM `#@__myppttype` ORDER BY id DESC');
  37. $option = '';
  38. while($arr = $dsql->GetArray('dd'))
  39. {
  40. if ($arr['id'] == $row['typeid'])
  41. {
  42. $option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
  43. } else {
  44. $option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
  45. }
  46. }
  47. include DedeInclude('templets/ppt_edit.htm');
  48. ?>