✏️ 正在编辑: recharge_code.php
路径:
/home/llpreacharge/public_html/API_Users/recharge_code.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php $mnum = $_POST['mobileNo1']; $cMnum = $_POST['mobileNo2']; $amount = $_POST['amount']; $opcodedata=getOp($opName); $opCodeMyApi2=$opcodedata['My_API2']; $opcode=$opcodedata['Value']; //$myApiOpCode=$opcodedata['MyApiValue']; $MyApi2OpCode=$opcodedata['My_API2']; $KwikApiOpCode=$opcodedata['KwikAPI']; $UniqueApiOpCode=$opcodedata['UniqueAPI']; $DiziPayOpCode=$opcodedata['DiziPayApi']; $OzzyOpCode=$opcodedata['Ozzy_Api']; $PP_ApiOpCode=$opcodedata['PP_Api']; $Dizi_KwikOpCode=$opcodedata['Dizi_Kwik']; $columName=$opcodedata['Commision_Column']; $myApiOpCode=$MyApi2OpCode; //$opName=$opcodedata['Operator']; $UseApi1=$opcodedata['UseAPI']; $UseApi2=$opcodedata['UseAPI2']; $opserviceId=$opcodedata['Serviceid']; $mnumLength=strlen($mnum); $Parentid=$dataUser['Parentid']; $Grandparentid=$dataUser['Grandparentid']; $UserComm=getComm($userid,$opName); $ParentComm=getComm($Parentid,$opName); $GrandparentComm=getComm($Grandparentid,$opName); if(empty($opName) || $opName=="--Select Operator--") { $error_msg="Please Select Any Operator first !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif(empty($mnum) || empty($cMnum) || empty($amount)) { $error_msg="Fill All Input Feilds Please !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($opserviceId==1 && $mnumLength!=10 || $opserviceId==3 && $mnumLength!=10) { $error_msg="Mobile Number Must Be In 10 Digit Only !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($amount>$usrBal) { $error_msg="Insufficiant Wallet Balance !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($mnum!=$cMnum) { $error_msg="Please Insert Mobile/DTH No. Correctly !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($amount<10) { $error_msg="Amount Is Less Than 10 !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif(0<getDupRech($mnum,$amount,$opName,$date)) { $error_msg="Same Recharge Not Allowed At Same Day !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } elseif($GrandparentComm<$ParentComm || $ParentComm<$UserComm) { $error_msg="Invalid Commission Value !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } else { $UserCommAmt=$amount*$UserComm/100; $DebitAmount=$amount-$UserCommAmt; $actualParentComm=$ParentComm-$UserComm; $ParentCommAmt=$amount*$actualParentComm/100; $actualGrandParentComm=$GrandparentComm-$ParentComm; $GrandParentCommAmt=$amount*$actualGrandParentComm/100; $usrNewBal=$usrBal-$DebitAmount; $insertRech="INSERT INTO recharge(Userid,RetComm,RetCommAmt,Parentid,DisComm,Grandparentid,MdComm,Rechargedate,Time,PTime,Agentname,Balance,Companyname,Mobile,Amount,Debitamount) VALUES ('$userid','$UserComm','$UserCommAmt','$Parentid','$ParentComm','$Grandparentid','$GrandparentComm','$date','$time','$PTime','$usrName','$usrNewBal','$opName','$mnum','$amount','$DebitAmount')"; if(mysqli_query($con,$insertRech)) { $newrechid=mysqli_insert_id($con); $insertWallet="INSERT INTO wallet (Userid,OpBal,Txn,ClBal,TxnType,TxnWith,TxnId,Remarks,Date,Time,APBU) VALUES ('$userid','$usrBal','-$DebitAmount','$usrNewBal','RECHARGE','SELF','$newrechid','DEBIT FOR RECHARGE','$date','$time','$userid')"; if(mysqli_query($con,$insertWallet)) { $ewalletid=mysqli_insert_id($con); $updateRech="UPDATE recharge SET Ewalletid='$ewalletid' where Id='$newrechid'"; mysqli_query($con,$updateRech); $UpdateBal="UPDATE retailer SET Balance='$usrNewBal', Lastrechdate='$date' where Userid='$userid'"; mysqli_query($con,$UpdateBal); $quParComm="INSERT INTO commwallet(Userid,Balance,Date,Time,Rechargeid) VALUES ('$Parentid','$ParentCommAmt','$date','$time','$newrechid')"; mysqli_query($con,$quParComm); $quGparComm="INSERT INTO commwallet(Userid,Balance,Date,Time,Rechargeid) values('$Grandparentid','$GrandParentCommAmt','$date','$time','$newrechid')"; mysqli_query($con,$quGparComm); $quGetUsrOp="SELECT * FROM CommSlab WHERE Userid='$userid' AND OpName='$opName'"; $reGetUsrOp=mysqli_query($con,$quGetUsrOp); $dataGetUsrOp=mysqli_fetch_array($reGetUsrOp); $UsrPersApi1=$dataGetUsrOp['API1']; $UsrPersApi2=$dataGetUsrOp['API2']; if($UsrPersApi1!="OFF") { if($UsrPersApi1=="By_Default" || $UsrPersApi1=="ON") { if($UseApi1!="OFF") { $UseApiName=$UseApi1; } else { $UseApiName=$UseApi2; } } else { $UseApiName=$UsrPersApi1; } } else { if($UsrPersApi2=="By_Default" || $UsrPersApi2=="ON") { if($UseApi1!="OFF") { $UseApiName=$UseApi1; } else { $UseApiName=$UseApi2; } } else { $UseApiName=$UsrPersApi2; } } $apiFile="RechFile_".$UseApiName.".php"; include $apiFile; } else { $error_msg="Error No. 2 !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } } else { $error_msg="Error No. 1 !"; echo "<div class='msg-div'> <form method='post'> <h3>".$error_msg."</h3><br> <i class='fa fa-ban' aria-hidden='true' id='NotokIcon'></i><br><br> <button type='submit' class='btnPopup'>OK</button><br><br> </form> </div>"; } } ?>
💾 保存文件
← 返回文件管理器