BuyGroupPay.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. require("../class/connect.php");
  3. require("../class/db_sql.php");
  4. require("../class/q_functions.php");
  5. require("../member/class/user.php");
  6. require("../data/dbcache/MemberLevel.php");
  7. eCheckCloseMods('pay');//关闭模块
  8. $link=db_connect();
  9. $empire=new mysqlquery();
  10. //是否登陆
  11. $user=islogin();
  12. //支付平台
  13. $payid=intval($_POST['payid']);
  14. if(!$payid)
  15. {
  16. printerror('请选择支付平台','',1,0,1);
  17. }
  18. //充值类型
  19. $id=intval($_POST['id']);
  20. if(!$id)
  21. {
  22. printerror('请选择充值类型','',1,0,1);
  23. }
  24. $payr=$empire->fetch1("select * from {$dbtbpre}enewspayapi where payid='$payid' and isclose=0 limit 1");
  25. if(!$payr[payid])
  26. {
  27. printerror('请选择支付平台','',1,0,1);
  28. }
  29. $buyr=$empire->fetch1("select * from {$dbtbpre}enewsbuygroup where id='$id'");
  30. if(!$buyr['id'])
  31. {
  32. printerror('请选择充值类型','',1,0,1);
  33. }
  34. //权限
  35. if($buyr[buygroupid]&&$level_r[$buyr[buygroupid]][level]>$level_r[$user[groupid]][level])
  36. {
  37. printerror('此充值类型需要 '.$level_r[$buyr[buygroupid]][groupname].' 会员级别以上','',1,0,1);
  38. }
  39. //有效期验证
  40. if($buyr['gdate']&&$user['groupid']!=$buyr['ggroupid'])
  41. {
  42. if($user['userdate']&&$user['userdate']>=time())
  43. {
  44. if(!$public_r['mhavedatedo'])
  45. {
  46. printerror('您当前的会员组有效期未到,不能充值新会员组','',1,0,1);
  47. }
  48. }
  49. }
  50. include('payfun.php');
  51. $money=$buyr['gmoney'];
  52. if(!$money)
  53. {
  54. printerror('此充值类型金额有误','',1,0,1);
  55. }
  56. $ddno='';
  57. $productname="充值类型:".$buyr['gname'].",UID:".$user['userid'].",UName:".$user['username'];
  58. $productsay="用户ID:".$user['userid'].",用户名:".$user['username'];
  59. esetcookie("payphome","BuyGroupPay",0);
  60. esetcookie("paymoneybgid",$id,0);
  61. //返回地址前缀
  62. $PayReturnUrlQz=$public_r['newsurl'];
  63. if(!stristr($public_r['newsurl'],'://'))
  64. {
  65. $PayReturnUrlQz=eReturnDomain().$public_r['newsurl'];
  66. }
  67. //编码
  68. if($ecms_config['sets']['pagechar']!='gb2312')
  69. {
  70. @include_once("../class/doiconv.php");
  71. $iconv=new Chinese('');
  72. $char=$ecms_config['sets']['pagechar']=='big5'?'BIG5':'UTF8';
  73. $targetchar='GB2312';
  74. $productname=$iconv->Convert($char,$targetchar,$productname);
  75. $productsay=$iconv->Convert($char,$targetchar,$productsay);
  76. @header('Content-Type: text/html; charset=gb2312');
  77. }
  78. $file=$payr['paytype'].'/to_pay.php';
  79. @include($file);
  80. db_close();
  81. $empire=null;
  82. ?>