✏️ 正在编辑: RechFile_My_API2.php
路径:
/home/llpreacharge/public_html/user/RechFile_My_API2.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php //include'connection.php'; //include'functions.php'; if($OwnApiOpCode==1 && $countTotRech>10 && $RechQualityStatus<$AO && $AOflag==1 || $OwnApiOpCode==7 && $countTotRech>10 && $RechQualityStatus<$AO && $AOflag==1 || $OwnApiOpCode==33 && $countTotRech>10 && $RechQualityStatus<$AO && $AOflag==1|| $OwnApiOpCode==36 && $countTotRech>10 && $RechQualityStatus<$AO && $AOflag==1) { $flagLowTxn=1; } $apiOldNo=getApiNo($newrechid); $apiNewNo=$apiOldNo+1; $UpdateRechApi="UPDATE recharge SET API='My_API2', 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?'); // 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($apiNewNo==1 && !empty($LapuGroupId)) { $LapuGroupIdCode="&group_id=".$LapuGroupId; } elseif($apiNewNo==2 && !empty($LapuGroupId2)) { $LapuGroupIdCode="&group_id=".$LapuGroupId2; } else { $LapuGroupIdCode=""; } if($OwnApiOpCode==31 || $OwnApiOpCode==32 || $flagLowTxn==1) { $apiUrl="api_token=37a1e7bd-3d24-4d73-8c17-ecd76d5a847e&mobile_no=$mnum&amount=$amount&company_id=$MyApi2OpCode&only_roffer=true&order_id=$newrechid&is_stv=$stv_stts$LapuGroupIdCode"; } else { $apiUrl="api_token=37a1e7bd-3d24-4d73-8c17-ecd76d5a847e&mobile_no=$mnum&amount=$amount&company_id=$MyApi2OpCode&order_id=$newrechid&is_stv=$stv_stts$LapuGroupIdCode"; } 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") { if($LapuNo=="8865063210") { if($OwnApiOpCode==35) { $GetLapuOldBal="SELECT * FROM recharge WHERE LapuNo='$LapuNo' AND status='SUCCESS' AND OpCode='35' ORDER BY Id DESC"; } else { $GetLapuOldBal="SELECT * FROM recharge WHERE LapuNo='$LapuNo' AND status='SUCCESS' AND OpCode!='35' ORDER BY Id DESC"; } } else { $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); $myresponse = array("status"=>"SUCCESS", "partnertid"=>"$partnerId", "orderid"=>"$newrechid", "opid"=>"$txnId"); echo $myresult = json_encode($myresponse); /* $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>";*/ } 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,'amountdue')==9) { $Printmsg ="Please clear due amount and then proceed with the recharge."; $flag=1; } elseif(chk_msg($msg,'sessExpi')==8) { $Printmsg ="Lapu Session Expired !"; $flag=0; $toMail="sameermansuri111@gmail.com"; $toName="Sameer"; $subjectMail="Lapu Session Expired !"; $msgMail="Your Lapu Session Has Been Expired ! Lapu No. Is ".$LapuNo; include'../Admin1/testMail/send_mail.php'; } elseif(chk_msg($msg,'insufbalan')==10 || chk_msg($errorMsg,'lapuONLowLapu')==13) { $Printmsg ="FAILED I.B. !"; $flag=0; $toMail="sameermansuri111@gmail.com"; $toName="Sameer"; $subjectMail="Insufficiant Balance !"; $msgMail="You Have Insufficiant Balance In Your Lapu ! Lapu No. Is ".$LapuNo; //include'../Admin1/testMail/send_mail.php'; } else { if($flagLowTxn==1) { $Printmsg="FAILED !"; $flag=0; } else { $Printmsg = $msg; $flag=0; } } if($flag==1 || $apiNewNo==2) { include'rechFailed.php'; if(chk_msg($errorMsg,'lapuONLowLapu')==13) { $toMail="sameermansuri111@gmail.com"; $toName="Sameer"; $subjectMail="Rechrage Failed !"; $msgMail="Your Recharge Is Failed [ '.$errorMsg.' ] [ '.$msg.' ]"; //include'../Admin1/testMail/send_mail.php'; } } else { $flagFailed=0; if($UsrPersApi2!="OFF" && $UsrPersApi2!="My_API2") { if($UsrPersApi2=="ON" || $UsrPersApi2=="By_Default") { if($UseApi1!="OFF" && $UseApi1!="My_API2") { $apiFile2="RechFile_".$UseApi1.".php"; } elseif($UseApi2!="OFF" && $UseApi2!="My_API2") { $apiFile2="RechFile_".$UseApi2.".php"; } else { $flagFailed=1; } } else { $apiFile2="RechFile_".$UsrPersApi2.".php"; } if($flagFailed==0) { include $apiFile2; } } else { $flagFailed=1; } if($flagFailed==1) { if($autoFailedStatus!="Deactive") { include'rechFailed.php'; $toMail="sameermansuri111@gmail.com"; $toName="Sameer"; $subjectMail="Rechrage Failed 2 !"; $msgMail="Your Recharge Is Failed [ '.$errorMsg.' ] [ '.$msg.' ]"; //include'../Admin1/testMail/send_mail.php'; } else { $UpdateRechApibal="UPDATE recharge SET ReHit='1', AdminOpId='$Printmsg' WHERE Id='$newrechid'"; mysqli_query($con,$UpdateRechApibal); $myresponse = array("status"=>"PENDING", "partnertid"=>"$partnerId", "orderid"=>"$newrechid", "opid"=>"$txnId"); echo $myresult = json_encode($myresponse); /*$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>";*/ } } } } ?>
💾 保存文件
← 返回文件管理器