✏️ 正在编辑: RechFile_My_API.php
路径:
/home/llpreacharge/public_html/MLM_Users/RechFile_My_API.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php //include'connection.php'; //include'functions.php'; $apiOldNo=getApiNo($newrechid); $apiNewNo=$apiOldNo+1; $UpdateRechApi="UPDATE recharge SET API='My_API', API_NO='$apiNewNo' where Id='$newrechid'"; mysqli_query($con,$UpdateRechApi); $ch = curl_init(); if (!$ch) { die("Couldn't initialize a cURL handle"); } curl_setopt($ch, CURLOPT_URL,'https://mrobotics.in/api/recharge_statewise?'); // 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); if($OwnApiOpCode==31 || $OwnApiOpCode==32) { $apiUrl="api_token=37a1e7bd-3d24-4d73-8c17-ecd76d5a847e&mobile_no=$mnum&amount=$amount&company_id=$myApiOpCode&only_roffer=true&order_id=$newrechid&is_stv=false&no_roaming=false"; } else { $apiUrl="api_token=37a1e7bd-3d24-4d73-8c17-ecd76d5a847e&mobile_no=$mnum&amount=$amount&company_id=$myApiOpCode&order_id=$newrechid&is_stv=false&no_roaming=false"; } curl_setopt($ch, CURLOPT_POSTFIELDS,$apiUrl); $result = curl_exec ($ch); $result = (array)json_decode($result); $status1 = $result['status']; $errorMsg = $result['errorMessage']; $msg = $result['response']; $txnId = $result['tnx_id']; $LapuNo = $result['lapu_no']; $LapuBal = $result['balance']; $roffer = $result['roffer']; $romingStatus = $result['is_roaming']; if($romingStatus=="true") { $roamingMsg="Y"; } else { $roamingMsg="N"; } $updateLapu="UPDATE recharge SET LapuNo='$LapuNo', Roaming='$roamingMsg' where Id='$newrechid'"; mysqli_query($con,$updateLapu); if($status1=="SUCCESS" || $status1=="success") { $GetLapuOldBal="SELECT * FROM recharge WHERE LapuNo='$LapuNo' AND status='SUCCESS' ORDER BY Id DESC"; $reGetLapuOldBal=mysqli_query($con,$GetLapuOldBal); $dataGetLapuOldBal=mysqli_fetch_array($reGetLapuOldBal); $LapuOldBal=$dataGetLapuOldBal['ApiBal']; $LapuOldBalRow=mysqli_num_rows($reGetLapuOldBal); if($LapuOldBalRow==0 || $LapuOldBal==0 || empty($LapuOldBal)) { $LapuOldBal=0; $remaiBal=$LapuOldBal-$amount; $LapuDiff = $LapuBal-$remaiBal; } else { $remaiBal=$LapuOldBal-$amount; $LapuDiff = $LapuBal-$remaiBal; } $UpadateStatus="UPDATE recharge SET Status='SUCCESS', R_Offer='$roffer', Operatorid='$txnId', LapuOldBal='$LapuOldBal', Diff='$LapuDiff', ApiBal='$LapuBal' WHERE Id='$newrechid'"; mysqli_query($con,$UpadateStatus); $quUpdatebal="UPDATE myapi SET LapuBal='$LapuBal', LastUpdate='$date', OrderId='$newrechid' WHERE LapuNumber='$LapuNo'"; mysqli_query($con,$quUpdatebal); $success_msg="Recharge Successful !"; echo "<div class='msg-div'> <form method='post'> <h3>".$success_msg."</h3><br> <i class='fa fa-check-circle' aria-hidden='true' id='okIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($status1=="FAILED" || $status1=="failure") { $autoFailedStatus=getAFS(); if(chk_msg($msg,'Noreco')==6 || chk_msg($msg,'BadMSISDN')==9 || chk_msg($msg,'SubsNot')==7) { $Printmsg ="Invalid Number Or Operator !"; $flag=1; } elseif(chk_msg($msg,'NoPlans')==7 || chk_msg($msg,'TranFail')==8 || chk_msg($msg,'Cardgorup')==9) { $Printmsg ="Invalid Amount !"; $flag=1; } elseif(chk_msg($msg,'PrimePlan')==9) { $Printmsg ="You can only select other than prime plan for recharge. "; $flag=1; } elseif(chk_msg($msg,'sessExpi')==8) { $Printmsg ="Lapu Session Expired !"; $flag=0; } elseif(chk_msg($msg,'insufbalan')==10) { $Printmsg ="Insufficiant Balance !"; $flag=0; } else { $Printmsg = $msg; $flag=0; } if($flag==1 || $apiNewNo==2) { include'rechFailed.php'; } else { if($UsrPersApi2!="OFF" && $UsrPersApi2!="My_API") { if($UsrPersApi2=="ON" || $UsrPersApi2=="By_Default") { if($UseApi1!="OFF" && $UseApi1!="My_API") { $apiFile2="RechFile_".$UseApi1.".php"; } else { $apiFile2="RechFile_".$UseApi2.".php"; } } else { $apiFile2="RechFile_".$UsrPersApi2.".php"; } include $apiFile2; } else { if($autoFailedStatus!="Deactive") { include'rechFailed.php'; } else { $UpdateRechApibal="UPDATE recharge SET ReHit='1', AdminOpId='$Printmsg' WHERE Id='$newrechid'"; mysqli_query($con,$UpdateRechApibal); $success_msg="Request Submitted Successfully !"; echo "<div class='msg-div'> <form method='post'> <h3>".$success_msg."</h3><br> <i class='fa fa-check-circle' aria-hidden='true' id='okIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } } } } ?>
💾 保存文件
← 返回文件管理器