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

53 lines
1.7KB

  1. <?php
  2. /**
  3. * 会员积分
  4. *
  5. * @version $Id: member_scores.php 1 11:24 2010年7月20日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('member_Scores');
  14. if(!isset($action)) $action = '';
  15. if($action=='save')
  16. {
  17. if(!empty($add_integral)&&!empty($add_icon)&&!empty($add_titles))
  18. {
  19. $integral = preg_replace("#[^0-9]#", "", $add_integral);
  20. $add_icon = preg_replace("#[^0-9]#", "", $add_icon);
  21. $add_titles = cn_substr($add_titles, 15);
  22. $dsql->ExecuteNoneQuery("INSERT INTO `#@__scores`(integral,icon,titles,isdefault) VALUES('$integral','$add_icon','$add_titles','$add_isdefault')");
  23. }
  24. foreach($_POST as $rk=>$rv)
  25. {
  26. if(preg_match("#-#", $rk))
  27. {
  28. $ID = preg_replace("#[^0-9]#", "", $rk);
  29. $fildes = preg_replace("#[^a-z]#", "", $rk);
  30. $k = $$rk;
  31. if(empty($k))
  32. {
  33. $k = 0;
  34. }
  35. $sql = $fildes."='".$k."'";
  36. $dsql->ExecuteNoneQuery("UPDATE `#@__scores` SET ".$sql." WHERE id='{$ID}'");
  37. if(preg_match("#Ids-#", $rk))
  38. {
  39. if($k) $dsql->ExecuteNoneQuery("DELETE FROM `#@__scores` WHERE id='$ID'");
  40. }
  41. }
  42. }
  43. }
  44. $Scores = array();
  45. $dsql->SetQuery("SELECT * FROM `#@__scores` ORDER BY id ASC");
  46. $dsql->Execute();
  47. while($rs = $dsql->GetArray())
  48. {
  49. array_push($Scores,$rs);
  50. }
  51. include DedeInclude('templets/member_scores.htm');