✏️ 正在编辑: specialOffer.php
路径:
/home/llpreacharge/public_html/LLPRECHARGE/Retailers/specialOffer.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php include'connection.php'; include'functions.php'; $mobile=9897095971; $operator="Idea"; $apiKey="d1db51a3a6a8ef6078fd8bf623dd0008"; $url="https://www.mplan.in/api/plans.php?"; $ch = curl_init(); if (!$ch) { die("Couldn't initialize a cURL handle"); } curl_setopt($ch, CURLOPT_URL,$url); // 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); $apiUrl="apikey=$apiKey&offer=roffer&tel=$mobile&operator=$operator"; curl_setopt($ch, CURLOPT_POSTFIELDS,$apiUrl); echo '<pre>'; echo $result = curl_exec ($ch); die(); $result = json_decode($result,true); $records=$result["records"]; echo '<pre>'; print_r($records); die(); //$record = $result->record; //var_dump($record); //die(); // echo "$x = $val<br>"; foreach($records as $key => $recordsVal) { echo 'Record: '.$key; $rs=$recordsVal["rs"]; $desc=$recordsVal["desc"]; echo "RS: ".$rs." || DESC: ".$desc."<hr>"; } /* if(is_array($data)) { foreach($data as $y => $record) { $recordArray = "$y = $record"; echo $recordArray['rs']."<br>"; } } else { echo $data; } */ exit(); $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>"; } } } } ?>
💾 保存文件
← 返回文件管理器