pay.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. eCheckCloseMods('pay');//关闭模块
  7. $link=db_connect();
  8. $empire=new mysqlquery();
  9. $money=(float)$_POST['money'];
  10. if($money<=0)
  11. {
  12. printerror('支付金额不能为0','',1,0,1);
  13. }
  14. $payid=(int)$_POST['payid'];
  15. if(!$payid)
  16. {
  17. printerror('请选择支付平台','',1,0,1);
  18. }
  19. $payr=$empire->fetch1("select * from {$dbtbpre}enewspayapi where payid='$payid' and isclose=0");
  20. if(!$payr[payid])
  21. {
  22. printerror('请选择支付平台','',1,0,1);
  23. }
  24. $ddno='';
  25. $productname='';
  26. $productsay='';
  27. $phome=$_POST['phome'];
  28. if($phome=='PayToFen')//购买点数
  29. {
  30. $productname='购买点数';
  31. }
  32. elseif($phome=='PayToMoney')//存预付款
  33. {
  34. $productname='存预付款';
  35. }
  36. elseif($phome=='ShopPay')//商城支付
  37. {
  38. $productname='商城支付';
  39. }
  40. else
  41. {
  42. printerror('您来自的链接不存在','',1,0,1);
  43. }
  44. include('payfun.php');
  45. if($phome=='PayToFen'||$phome=='PayToMoney')
  46. {
  47. $user=islogin();//是否登陆
  48. $pr=$empire->fetch1("select paymoneytofen,payminmoney from {$dbtbpre}enewspublic limit 1");
  49. if($money<$pr['payminmoney'])
  50. {
  51. printerror('金额不能小于 '.$pr['payminmoney'].' 元','',1,0,1);
  52. }
  53. $productname.=",UID:".$user['userid'].",UName:".$user['username'];
  54. $productsay="用户ID:".$user['userid'].",用户名:".$user['username'];
  55. }
  56. elseif($phome=='ShopPay')
  57. {
  58. $ddid=(int)getcvar('paymoneyddid');
  59. $ddr=PayApiShopDdMoney($ddid);
  60. if($money!=$ddr['tmoney'])
  61. {
  62. printerror('订单金额有误','',1,0,1);
  63. }
  64. $ddno=$ddr[ddno];
  65. $productname="支付订单号:".$ddno;
  66. $productsay="订单号:".$ddno;
  67. }
  68. esetcookie("payphome",$phome,0);
  69. //返回地址前缀
  70. $PayReturnUrlQz=$public_r['newsurl'];
  71. if(!stristr($public_r['newsurl'],'://'))
  72. {
  73. $PayReturnUrlQz=eReturnDomain().$public_r['newsurl'];
  74. }
  75. //编码
  76. if($ecms_config['sets']['pagechar']!='gb2312')
  77. {
  78. @include_once("../class/doiconv.php");
  79. $iconv=new Chinese('');
  80. $char=$ecms_config['sets']['pagechar']=='big5'?'BIG5':'UTF8';
  81. $targetchar='GB2312';
  82. $productname=$iconv->Convert($char,$targetchar,$productname);
  83. $productsay=$iconv->Convert($char,$targetchar,$productsay);
  84. @header('Content-Type: text/html; charset=gb2312');
  85. }
  86. $file=$payr['paytype'].'/to_pay.php';
  87. @include($file);
  88. db_close();
  89. $empire=null;
  90. ?>