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

68 lines
2.2KB

  1. <?php
  2. /**
  3. * 点卡管理
  4. *
  5. * @version $Id: cards_manage.php 1 14:31 2010年7月12日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. require_once(DEDEINC.'/datalistcp.class.php');
  14. $dopost=empty($dopost)? "" : $dopost;
  15. if($dopost=="delete"){
  16. $ids = explode('`',$aids);
  17. $dquery = "";
  18. foreach($ids as $id){
  19. if($dquery=="") $dquery .= "aid='$id' ";
  20. else $dquery .= " OR aid='$id' ";
  21. }
  22. if($dquery!="") $dquery = " WHERE ".$dquery;
  23. $dsql->ExecuteNoneQuery("DELETE FROM #@__moneycard_record $dquery");
  24. ShowMsg("成功删除指定的记录!","cards_manage.php");
  25. exit();
  26. }else{
  27. $addsql = '';
  28. if(isset($isexp)) $addsql = " WHERE isexp='$isexp' ";
  29. $sql = "SELECT * FROM #@__moneycard_record $addsql ORDER BY aid DESC";
  30. $dlist = new DataListCP();
  31. $dlist->pageSize = 25; //设定每页显示记录数(默认25条)
  32. if(isset($isexp)) $dlist->SetParameter("isexp",$isexp);
  33. $dlist->dsql->SetQuery("SELECT * FROM #@__moneycard_type ");
  34. $dlist->dsql->Execute('ts');
  35. while($rw = $dlist->dsql->GetArray('ts'))
  36. {
  37. $TypeNames[$rw['tid']] = $rw['pname'];
  38. }
  39. $tplfile = DEDEADMIN."/templets/cards_manmage.htm";
  40. //这两句的顺序不能更换
  41. $dlist->SetTemplate($tplfile); //载入模板
  42. $dlist->SetSource($sql); //设定查询SQL
  43. $dlist->Display(); //显示
  44. }
  45. function GetMemberID($mid)
  46. {
  47. global $dsql;
  48. if($mid==0) return '0';
  49. $row = $dsql->GetOne("SELECT userid FROM #@__member WHERE mid='$mid' ");
  50. if(is_array($row)) return "<a href='member_view.php?mid={$mid}'>".$row['userid']."</a>";
  51. else return '0';
  52. }
  53. function GetUseDate($time=0)
  54. {
  55. if(!empty($time)) return GetDateMk($time);
  56. else return '未使用';
  57. }
  58. function GetSta($sta)
  59. {
  60. if($sta==1) return '已售出';
  61. else if($sta==-1) return '已使用';
  62. else return '未使用';
  63. }