✏️ 正在编辑: ApiFile_M_ROBO2.php
路径:
/home/llpreacharge/public_html/LLPRECHARGE/LinkFile/ApiFile_M_ROBO2.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php $apiLoop = "STOP"; $status = ""; $errorMsg = ""; $respoMsg = ""; $txnId = ""; $LapuNo = ""; $ApiBal = ""; $roffer = ""; $is_roam = ""; $LapuApi = ""; if($LapuGroup>0) { $LapuGroupIdCode="&group_id=".$LapuGroup; } else { $LapuGroupIdCode=""; } if($ReqRoffer>0 && $R_offer="false") { $quReqRoffer = "SELECT SUM(Amount), SUM(R_offer) FROM recharge WHERE Date='$date' AND Status='SUCCESS' AND OpCode='$OpCode' AND Userid='$userid'"; $reReqRoffer = mysqli_query($con,$quReqRoffer); $dataReqRoffer = mysqli_fetch_array($reReqRoffer); $countReqRoffer = mysqli_num_rows($reReqRoffer); $totalAmt = $dataReqRoffer[0]; $totalRoffer = $dataReqRoffer[1]; $rofferPercent = $totalRoffer*100/$totalAmt; if($rofferPercent<$ReqRoffer && $countReqRoffer>10) { $R_offer = "true"; } } $apiHTTPurl = "https://mrobotics.in/api/recharge?"; $apiUrl = "api_token=37a1e7bd-3d24-4d73-8c17-ecd76d5a847e&mobile_no=$mnum&amount=$amount&company_id=$ApiOpCode&order_id=$newrechid&is_stv=$STV&only_roffer=$R_offer$LapuGroupIdCode"; $reqUrl = $apiHTTPurl.$apiUrl; $quApiHit = "INSERT INTO api_hit (Date,Time,TxnId,ApiName,Type,Disc) VALUES ('$date','$time','$newrechid','$api','REQUEST','$reqUrl')"; mysqli_query($con,$quApiHit); $ch = curl_init(); if (!$ch) { die("Couldn't initialize a cURL handle"); } curl_setopt($ch, CURLOPT_URL, $apiHTTPurl); // Target URL curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$apiUrl); $result = curl_exec ($ch); $quApiHit="INSERT INTO api_hit (Date,Time,TxnId,ApiName,Type,Disc) VALUES ('$date','$time','$newrechid','$api','RESULT','$result')"; mysqli_query($con,$quApiHit); $result = (array)json_decode($result); $status = $result['status']; $errorMsg = $result['errorMessage'] ?? ''; $respoMsg = $result['response'] ?? ''; $txnId = $result['tnx_id'] ?? ''; $LapuNo = $result['lapu_no'] ?? ''; $ApiBal = $result['balance'] ?? ''; $roffer = $result['roffer'] ?? ''; $is_roam = $result['is_roaming'] ?? ''; $LapuApi = $LapuNo; if($is_roam=="true") { $roamingMsg="R"; } else { $roamingMsg="C"; } $updateLapu="UPDATE recharge SET Api='$api', Lapu='$LapuApi', Roaming='$roamingMsg' where Id='$newrechid'"; mysqli_query($con,$updateLapu); if($status=="SUCCESS" || $status=="success") { require'../LinkFile/rechSuccess.php'; } elseif($status=="FAILED" || $status=="failure") { $flag=0; require'../LinkFile/reasonFailed.php'; if($flag==0 && $countSetApi>$x) { $apiLoop="CONTINUE"; } else { require'../LinkFile/rechFailed.php'; } } elseif($status=="PENDING" || $status=="pending") { require'../LinkFile/rechPending.php'; } ?>
💾 保存文件
← 返回文件管理器