PayApi.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. define('EmpireCMSAdmin','1');
  3. require("../../class/connect.php");
  4. require("../../class/db_sql.php");
  5. require("../../class/functions.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. $editor=1;
  9. //验证用户
  10. $lur=is_login();
  11. $logininid=$lur['userid'];
  12. $loginin=$lur['username'];
  13. $loginrnd=$lur['rnd'];
  14. $loginlevel=$lur['groupid'];
  15. $loginadminstyleid=$lur['adminstyleid'];
  16. //ehash
  17. $ecms_hashur=hReturnEcmsHashStrAll();
  18. //验证权限
  19. CheckLevel($logininid,$loginin,$classid,"pay");
  20. //设置接口
  21. function EditPayApi($add,$userid,$username){
  22. global $empire,$dbtbpre;
  23. $add[payid]=(int)$add[payid];
  24. if(empty($add[payname])||!$add[payid])
  25. {
  26. printerror("EmptyPayApi","history.go(-1)");
  27. }
  28. $add[isclose]=(int)$add[isclose];
  29. $add[myorder]=(int)$add[myorder];
  30. $add[paymethod]=(int)$add[paymethod];
  31. $add['payname']=hRepPostStr($add['payname'],1);
  32. $add['paysay']=hRepPostStr2($add['paysay']);
  33. $add['payuser']=hRepPostStr2($add['payuser']);
  34. $add['paykey']=hRepPostStr2($add['paykey']);
  35. $add['payfee']=hRepPostStr($add['payfee'],1);
  36. $add['payemail']=hRepPostStr($add['payemail'],1);
  37. $sql=$empire->query("update {$dbtbpre}enewspayapi set isclose='$add[isclose]',payname='$add[payname]',paysay='$add[paysay]',payuser='$add[payuser]',paykey='$add[paykey]',payfee='$add[payfee]',payemail='$add[payemail]',myorder='$add[myorder]',paymethod='$add[paymethod]' where payid='$add[payid]'");
  38. if($sql)
  39. {
  40. //操作日志
  41. insert_dolog("payid=".$add[payid]."<br>payname=".$add[payname]);
  42. printerror("EditPayApiSuccess","PayApi.php".hReturnEcmsHashStrHref2(1));
  43. }
  44. else
  45. {
  46. printerror("DbError","history.go(-1)");
  47. }
  48. }
  49. //支付参数设置
  50. function SetPayFen($add,$userid,$username){
  51. global $empire,$dbtbpre;
  52. $add[paymoneytofen]=(int)$add[paymoneytofen];
  53. $add[payminmoney]=(int)$add[payminmoney];
  54. if(empty($add[paymoneytofen]))
  55. {
  56. printerror("EmptySetPayFen","history.go(-1)");
  57. }
  58. $sql=$empire->query("update {$dbtbpre}enewspublic set paymoneytofen='$add[paymoneytofen]',payminmoney='$add[payminmoney]'");
  59. if($sql)
  60. {
  61. //操作日志
  62. insert_dolog("moneytofen=$add[paymoneytofen]&minmoney=$add[payminmoney]");
  63. printerror("SetPayFenSuccess","SetPayFen.php".hReturnEcmsHashStrHref2(1));
  64. }
  65. else
  66. {
  67. printerror("DbError","history.go(-1)");
  68. }
  69. }
  70. $enews=$_POST['enews'];
  71. if(empty($enews))
  72. {$enews=$_GET['enews'];}
  73. if($enews)
  74. {
  75. hCheckEcmsRHash();
  76. }
  77. //增加用户
  78. if($enews=="EditPayApi")
  79. {
  80. EditPayApi($_POST,$logininid,$loginin);
  81. }
  82. elseif($enews=="SetPayFen")
  83. {
  84. SetPayFen($_POST,$logininid,$loginin);
  85. }
  86. $sql=$empire->query("select payid,paytype,payfee,paylogo,paysay,payname,isclose from {$dbtbpre}enewspayapi order by myorder,payid");
  87. ?>
  88. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  89. <html>
  90. <head>
  91. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  92. <title>支付接口</title>
  93. <link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
  94. </head>
  95. <body>
  96. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  97. <tr>
  98. <td width="50%">位置:在线支付&gt; <a href="PayApi.php<?=$ecms_hashur['whehref']?>">管理支付接口</a> </td>
  99. <td><div align="right" class="emenubutton">
  100. <input type="button" name="Submit5" value="管理支付记录" onclick="self.location.href='ListPayRecord.php<?=$ecms_hashur['whehref']?>';">
  101. &nbsp;&nbsp;
  102. <input type="button" name="Submit52" value="支付参数设置" onclick="self.location.href='SetPayFen.php<?=$ecms_hashur['whehref']?>';">
  103. </div></td>
  104. </tr>
  105. </table>
  106. <br>
  107. <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  108. <tr class="header">
  109. <td width="15%"><div align="center">接口名称</div></td>
  110. <td width="47%"><div align="center">接口描述</div></td>
  111. <td width="7%"><div align="center">状态</div></td>
  112. <td width="12%" height="25"><div align="center">接口类型</div></td>
  113. <td width="11%" height="25"><div align="center">操作</div></td>
  114. </tr>
  115. <?
  116. while($r=$empire->fetch($sql))
  117. {
  118. if($r[paytype]=='alipay')
  119. {
  120. //$r[payname]="<font color='red'><b>".$r[payname]."</b></font>";
  121. }
  122. ?>
  123. <tr bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#C3EFFF'">
  124. <td height="38" align="center">
  125. <?=$r[payname]?>
  126. </td>
  127. <td>
  128. <?=ehtmlspecialchars($r[paysay])?>
  129. </td>
  130. <td><div align="center">
  131. <?=$r[isclose]==0?'开启':'关闭'?>
  132. </div></td>
  133. <td height="25"> <div align="center">
  134. <?=$r[paytype]?>
  135. </div></td>
  136. <td height="25"> <div align="center"><a href="SetPayApi.php?enews=EditPayApi&payid=<?=$r[payid]?><?=$ecms_hashur['ehref']?>">配置接口</a></div></td>
  137. </tr>
  138. <?
  139. }
  140. db_close();
  141. $empire=null;
  142. ?>
  143. </table>
  144. </body>
  145. </html>