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

55 lines
1.9KB

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