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

50 lines
1.9KB

  1. <?php
  2. /**
  3. * 点卡类型
  4. *
  5. * @version $Id: cards_type.php 1 14:31 2010年7月12日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__) . '/config.php');
  12. CheckPurview('member_Type');
  13. if (empty($dopost)) $dopost = "";
  14. //保存更改
  15. if ($dopost == "save") {
  16. $startID = 1;
  17. $endID = $idend;
  18. for (; $startID <= $endID; $startID++) {
  19. $query = '';
  20. $tid = ${'ID_' . $startID};
  21. $pname = ${'pname_' . $startID};
  22. $money = ${'money_' . $startID};
  23. $num = ${'num_' . $startID};
  24. if (isset(${'check_' . $startID})) {
  25. if ($pname != '') {
  26. $query = "UPDATE #@__moneycard_type SET pname='$pname',money='$money',num='$num' WHERE tid='$tid'";
  27. $dsql->ExecuteNoneQuery($query);
  28. $query = "UPDATE #@__moneycard_record SET money='$money',num='$num' WHERE ctid='$tid' ; ";
  29. $dsql->ExecuteNoneQuery($query);
  30. }
  31. } else {
  32. $query = "DELETE FROM #@__moneycard_type WHERE tid='$tid' ";
  33. $dsql->ExecuteNoneQuery($query);
  34. $query = "DELETE FROM #@__moneycard_record WHERE ctid='$tid' AND isexp<>-1 ; ";
  35. $dsql->ExecuteNoneQuery($query);
  36. }
  37. }
  38. //增加新记录
  39. if (isset($check_new) && $pname_new != '') {
  40. $query = "INSERT INTO #@__moneycard_type(num,pname,money) VALUES('{$num_new}','{$pname_new}','{$money_new}');";
  41. $dsql->ExecuteNoneQuery($query);
  42. }
  43. header("Content-Type: text/html; charset={$cfg_soft_lang}");
  44. echo "<script> alert('成功更新点卡产品分类表!'); </script>";
  45. }
  46. require_once(DEDEADMIN . "/templets/cards_type.htm");