✏️ 正在编辑: create2.php
路径:
/home/llpreacharge/public_html/user/create2.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
// Recharge page// <?php session_start(); if($_SESSION['rid']) { $userid= $_SESSION['rid']; } else { header('location:../login.php'); } ?> <?php include'connection.php'; $query8="select * from wallet where Userid='$userid' order by Id desc"; $result8=mysqli_query($con,$query8); $data8=mysqli_fetch_array($result8); $currentbal= $data8['Balance']; $query2="select * from retailer where Userid='$userid'"; $result2=mysqli_query($con,$query2); $databal=mysqli_fetch_array($result2); $username=$databal['Name']; $parentid=$databal['Parentid']; // Get Diffrance Value // $quAdminBal="select * from wallet where Userid='1111' order by Id desc"; $reAdminBal=mysqli_query($con,$quAdminBal); $dataAdminBal=mysqli_fetch_array($reAdminBal); $currentAdminbal= $dataAdminBal['Balance']; $quMyAPI="select * from myapi where LapuName='Idea1'"; $reMyAPI=mysqli_query($con,$quMyAPI); $dataMyAPI=mysqli_fetch_array($reMyAPI); $LapuIdea1Bal=$dataMyAPI['LapuBal']; $quUniqueAPI="select * from myapi where LapuName='Unique_API'"; $reUniqueAPI=mysqli_query($con,$quUniqueAPI); $dataUniqueAPI=mysqli_fetch_array($reUniqueAPI); $UniqueAPIBal=$dataUniqueAPI['LapuBal']; $quMyAPI2="select * from myapi where LapuName='Idea2'"; $reMyAPI2=mysqli_query($con,$quMyAPI2); $dataMyAPI2=mysqli_fetch_array($reMyAPI2); $LapuIdea2Bal=$dataMyAPI2['LapuBal']; $quMyAPI3="select * from myapi where LapuName='Idea3'"; $reMyAPI3=mysqli_query($con,$quMyAPI3); $dataMyAPI3=mysqli_fetch_array($reMyAPI3); $LapuIdea3Bal=$dataMyAPI3['LapuBal']; $quMyApiJio="select * from myapi where LapuName='JIO'"; $reMyApiJio=mysqli_query($con,$quMyApiJio); $dataMyApiJio=mysqli_fetch_array($reMyApiJio); $LapuJioBal=$dataMyApiJio['LapuBal']; $quMyApiVoda="select * from myapi where LapuName='Vodafone'"; $reMyApiVoda=mysqli_query($con,$quMyApiVoda); $dataMyApiVoda=mysqli_fetch_array($reMyApiVoda); $LapuVodaBal=$dataMyApiVoda['LapuBal']; $quMyApiVdth="select * from myapi where LapuName='VDTH'"; $reMyApiVdth=mysqli_query($con,$quMyApiVdth); $dataMyApiVdth=mysqli_fetch_array($reMyApiVdth); $LapuVdthBal=$dataMyApiVdth['LapuBal']; $quMyApiAirtel="select * from myapi where LapuName='Airtel'"; $reMyApiAirtel=mysqli_query($con,$quMyApiAirtel); $dataMyApiAirtel=mysqli_fetch_array($reMyApiAirtel); $LapuAirtelBal=$dataMyApiAirtel['LapuBal']; $url="http://api.rechapi.com/bal.php?format=xml&token=Q21c5rsQorimWRxSCtds"; $request_timeout = 60; // 60 seconds timeout $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $curl_error = curl_errno($ch); $getserver= curl_getinfo($ch); curl_close($ch); if($getserver["http_code"]==200) { $xml = simplexml_load_string($output); $rechApiBal=$xml->bal; } $curl = curl_init(); //RECHRAGE DADDY BALANCE CODE// curl_setopt_array($curl, array( CURLOPT_URL => "https://www.rechargedaddy.in/RDRechargeAPI/RechargeAPI.aspx", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"MobileNo\"\r\n\r\n9897095971\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"APIKey\"\r\n\r\nFROY38amkREsr7mHOutxIou64PDe3t02Qr9\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"REQTYPE\"\r\n\r\nBAL\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"RESPTYPE\"\r\n\r\nJSON\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", CURLOPT_HTTPHEADER => array( "Postman-Token: 1aefc6a6-7b92-4330-b713-4924dfea7f7d", "cache-control: no-cache", "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $response; $data2=json_decode($response); $QuickApiMsg=$data2->STATUSMSG; if($QuickApiMsg=="Success") { $QuickAPIBal= $data2->BALANCE; } else { $QuickAPIBal= $data2->STATUSMSG; } } $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.kwikapi.com/api/v2/balance.php?api_key=8tyeubd-prieyeiw-854125-75yhr-8454adz", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => false, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $data2=json_decode($response); $KwikApiBal = $data2->response->balance;; } $queryMd="select * from masterdis"; $resultMd=mysqli_query($con,$queryMd); $rowMd=mysqli_num_rows($resultMd); $sumMdBal=0; while($mdData=mysqli_fetch_array($resultMd)) { $totalMdBal=$mdData['Balance']; $sumMdBal=$sumMdBal+$totalMdBal; } $querydis="select * from distributer"; $resultdis=mysqli_query($con,$querydis); $rowdis=mysqli_num_rows($resultdis); $sumDisBal=0; while($disData=mysqli_fetch_array($resultdis)) { $totalDisBal=$disData['Balance']; $sumDisBal=$sumDisBal+$totalDisBal; } $query1="select * from retailer"; $result1=mysqli_query($con,$query1); $row1=mysqli_num_rows($result1); $sumRet=0; while($row11=mysqli_fetch_array($result1)) { $retalrBal=$row11['Balance']; $sumRet=$sumRet+$retalrBal; } $query4="select * from commwallet where Active='0'"; $result4=mysqli_query($con,$query4); $sum4=0; while($row4=mysqli_fetch_array($result4)) { $data4=$row4['Balance']; $sum4=$sum4+$data4; } $totalWalletBal=$currentAdminbal+$sumMdBal+$sumDisBal+$sumRet+$sum4; $ActualLapuIdea1Bal=$LapuIdea1Bal*96.62/100; $ActualLapuIDEA2Bal=$LapuIdea2Bal*96.312/100; $ActualLapuIDEA3Bal=$LapuIdea3Bal*96.34/100; $ActualLapuJioBal=$LapuJioBal*92.60/100; $ActualLapuVodaBal=$LapuVodaBal*96.34/100; $ActualLapuAirtelBal=$LapuAirtelBal*96.34/100; $ActualLapuVdthBal=$LapuVdthBal*96.16/100; $TotalApiBal=$rechApiBal+$ActualLapuIdea1Bal+$ActualLapuIDEA2Bal+$ActualLapuIDEA3Bal+$ActualLapuJioBal+$QuickAPIBal+$KwikApiBal+$UniqueAPIBal+$ActualLapuVodaBal+$ActualLapuVdthBal+$ActualLapuAirtelBal; $Managebal=$totalWalletBal-$TotalApiBal; $BenefitBal=1000000-$Managebal; $updateDiff="update AdminDiff set Diff='$BenefitBal' where Id='1'"; mysqli_query($con,$updateDiff); ?> <html> <title>LLP Recharge</title> <head> <script type='text/javascript' src='//platform-api.sharethis.com/js/sharethis.js#property=5c01770ef30c5a001138cb08&product=social-ab' async='async'></script> <style> body{background:url('bg.jpg'); background-size:cover; width:100%; margin:0px;} .head{background:; width:1500px; height:85px; margin:0px;} #p1{font-size:34px; float:left; Margin:10 0 0 45px; color:#996420; font-weight:bold;} #p2{font-size:20px; float:left; margin:28 0 0 -8px; color:#eaa040; font-family:Courier;} #p3{font-size:15px; font-family:Comic Sans MS; float:left; color:#996420; margin-top:48px; margin-left:-153px;} .h2{background:white; width:400px; height:70px; margin:10 200px;} #link1{float:right; margin:10 30 0 0px; font-size:20px; text-decoration:none; color:white; background:red; padding:5px; border-radius:4px;} #link2{float:right; margin:10 30 0 0px; font-size:20px; background:white;color:Green; padding:5px; border-radius:4px;} #link3{float:right; margin:25 40 0 0px;} #link1:hover{ padding:5px; border-radius:4px; color:black;} .menu{background:#996420; height:50px; width:1400px; margin-left:10px; padding:0; line-height:40px;} .menu ul{padding:0; margin:0; position:relative; display:inline-block;} .menu ul li{list-style:none; float:left; width:260px; line-height:50px; text-align:center; font-size:22px; margin:0px; padding:0; color:white;} .menu ul li ul {display:none;} .menu ul li:hover{background:#d1994a; cursor:pointer;} .menu ul li:hover ul {display:block; z-index:2;} .menu ul li:hover ul li{background:#d1994a; border-top:solid white 0.1px;} .menu ul li ul li:hover{background:#996420; color:white;} .menu ul li ul li:hover a{ color:white;} .menu ul li a{ text-decoration:none; color:white;} #a1{border:none; color:white;} .menu{letter-spacing:1px;} #bal:hover{background:#996420; cursor:text;} .dmorq{background:#565450; color:white; width:1200px; margin:10 0 0 50px; line-height:40px; z-index:0; border-radius:18px; font-size:24px; font-family:sans-serif;} .rech{width:550px; margin:10 0 0 80px;} table{width:550px; font-size:20px;} #tdfl{float:right; margin-right:15px;} #greenbal{background:; color:white; font-size:22px; border-radius:5px; text-align:center; height:30px; width:180px; line-height:30px; border:2px solid white;} #redbal{background:red; color:white; font-size:22px; border-radius:5px; text-align:center; height:30px; width:180px; line-height:30px; border:2px solid white;} #inpset{width:180px; border-radius:2px; border:1px solid #996420; padding:4px; font-size:20px;} #inpset1{width:180px; border-radius:2px; border:1px solid #996420; padding:4px; font-size:16px;} ::-webkit-input-placeholder{font-size:15px; padding-left:5px; } #rechbtn{background:green; border:none; color:white; font-size:20px; border-radius:5px; cursor:pointer; padding:6px 10px; border:2px solid white; width:180px;} #rechbtn:focus{outline:none;} #rechbtn:hover{ background:#c7fac8; color:black; border:2px solid black; width:180px;} .trarepo{height:30px; background:#996420; width:1450px; margin:0 0 0 20px; padding:0px; line-height:30px;} .trarepo p{font-size:20px; margin-left:20px; color:white;} .addiv1{background:white; width:400px; height:200px; float:left; position:absolute; top:320px; left:800px; text-align:center; line-height:250px; border-radius:20px;} #addImg{width:380px; height:180px; margin:10px;} #paytmimg{width:200px; height:200px; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); transition:1s;} #paytmimg:hover{width:250px; height:250px; transition:1s;} #rechreport{width:1450px; margin:0 0 0 20px; padding:0px;} #t1{ width:1450px; text-align:center; border-collapse:collapse; border-color:black; } #t1 th{font-family:calibri; background:#94928f; color:white; } #t1 td{font-family:calibri;} #t1 tr:nth-child(odd){background:#f6f0e8;} #t1 tr:nth-child(even){background:white; } #RechIdColor{color:blue; font-size:22px;} #green{background:green; color:white; font-size:18px; padding:2 5px; border-radius:4px; font-weight:bold;} #red{background:red; color:white; font-size:18px; padding:2 5px; border-radius:4px; font-weight:bold;} #blue{background:blue; color:white; font-size:18px; padding:2 5px; border-radius:4px; font-weight:bold;} </style> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-8510562507020545", enable_page_level_ads: true }); </script> <script> function GetBal() { var usrid = document.getElementById("user").value; var xmlhttp2 = new XMLHttpRequest(); xmlhttp2.open("GET", "get_bal_ajax.php?usr="+usrid, false); xmlhttp2.send(null); var bal = xmlhttp2.responseText; var txtClr = document.getElementById("greenbal"); if(bal>500) { txtClr.style.background = "green"; } else { txtClr.style.background ="red"; } document.getElementById("greenbal").innerHTML = xmlhttp2.responseText; setTimeout("GetBal()",10000) } </script> </head> <body onload="GetRechReport(), GetBal()"> <div class="head"> <p id="p1">LLP</p> <p id="p2">Recharge</p> <p id="p3">The Complete Solution</p> <a id="link1" href="logout.php">Log Out</a> <p id="link2"><?php echo "Welcome Dear- ".$username." [ ".$userid." ]"; ?></p> <p id="link3"> <iframe src="http://free.timeanddate.com/clock/i6g7kcjv/n44/fs24/fc077104/tct/pct/ftbi/tt0/th2" frameborder="0" width="568" height="30" allowTransparency="true"></iframe> </p> </div> <div class="menu"> <ul> <li><a href="recharge_home.php" id="a1">Home</a></li> <li>Reports <ul> <li><a href="recharge_history.php">Recharge History</a></li> <li><a href="account_reports.php">Account Reports</a></li> <li><a href="check_status.php">Check Status</a></li> </ul> </li> <li>Documents <ul> <li><a href="my_commission.php">My Commission</a></li> <li><a href="commision.php">Get Commission</a></li> <li><a href="complain.php">Complain</a></li> </ul> </li> <li>Profile <ul> <li><a href="change_profile.php">Change Profile</a></li> <li><a href="change_pwd.php">Change Password</a></li> </ul> </li> <li>Payment Request <ul> <li><a href="payment_request.php">Update Payment</a></li> <li><a href="bank_list.php">Bank List</a></li> </ul> </li> </ul> </div> <div class="dmorq"> <marquee scrollamount="4" onmouseover="stop()" onmouseout="start()"> <?php $dateformat = Date("d/M/Y"); $querymsg="select * from messege order by Id desc"; $resultmsg=mysqli_query($con,$querymsg); while($datamsg=mysqli_fetch_array($resultmsg)) { echo $datamsg['Messege']." "; } ?> </marquee> </div> <?php include'connection.php'; if($_SESSION['rid']) { $query2="select * from distributer where Userid='$parentid'"; $result2=mysqli_query($con,$query2); $datad=mysqli_fetch_array($result2); $username=$datad['Name']; $grandparentid=$datad['Parentid']; $quGetAutoFailedStatus="select * from Auto_Failed where Id='1'"; $reGetAutoFailedStatus=mysqli_query($con,$quGetAutoFailedStatus); $dataGetAutoFailedStatus=mysqli_fetch_array($reGetAutoFailedStatus); $AutoFailedStatus=$dataGetAutoFailedStatus['Status']; $tmpOpId=rand(10000000,99999999); if(isset($_POST['submit'])) { $operator=$_POST['operator']; $mnum=$_POST['mnum']; $cmnum=$_POST['cmnum']; $amount=$_POST['amount']; date_default_timezone_set("asia/Kolkata"); $datetime= Date("Y-m-d - h:i:s A"); $time= Date("h:i:s A"); $date= Date("Y-m-d"); $postpaidOperator=substr($operator, -8); $opcodequery="select * from operator where Operator='$operator'"; $opcoderesult=mysqli_query($con,$opcodequery); $opcodedata=mysqli_fetch_array($opcoderesult); $opcode=$opcodedata['Value']; $myApiOpCode=$opcodedata['MyApiValue']; $QuickApiOpCode=$opcodedata['Quick_API']; $KwikApiOpCode=$opcodedata['KwikAPI']; $UniqueApiOpCode=$opcodedata['UniqueAPI']; $columName=$opcodedata['Commision_Column']; $querygetcom="select * from commision where Userid='$userid'"; $rsultgetcom=mysqli_query($con,$querygetcom); $data=mysqli_fetch_array($rsultgetcom); $usercommvalue=$data[$columName]; $parentq="select * from commision where Userid='$parentid'"; $parentcomm=mysqli_query($con,$parentq); $dataparcomm=mysqli_fetch_array($parentcomm); $parcommvalue=$dataparcomm[$columName]; $parbalcomm= $parcommvalue-$usercommvalue; $gparentq="select * from commision where Userid='$grandparentid'"; $gparentcomm=mysqli_query($con,$gparentq); $gdataparcomm=mysqli_fetch_array($gparentcomm); $gparcommvalue=$gdataparcomm[$columName]; $gparbalcomm= $gparcommvalue-$parcommvalue; if($operator=="--Select Operator--") { echo ""; echo "<h1 align='center'><font color='#ff0000'> ✖ You Did Not Select Any Operator !</font></h1>"; } else { if(empty($operator) || empty($mnum) || empty($cmnum) || empty($amount)) { echo "<h1 align='center'><font color='#ff0000'> ✖ Please Fill All Field !</font></h1>"; } else { if($mnum==$cmnum) { if($amount<=$currentbal) { $quGetSameRech="select * from recharge where Companyname='$operator' and Mobile='$mnum' and Amount='$amount' and Status='PENDING' and Rechargedate='$date'"; $reGetsameRech=mysqli_query($con,$quGetSameRech); $dataGetSameRech=mysqli_num_rows($reGetsameRech); $quGetSameRech1="select * from recharge where Companyname='$operator' and Mobile='$mnum' and Amount='$amount' and Status='SUCCESS' and Rechargedate='$date'"; $reGetsameRech1=mysqli_query($con,$quGetSameRech1); $dataGetSameRech1=mysqli_num_rows($reGetsameRech1); $quGetSameRech2="select * from recharge where Companyname='$operator' and Mobile='$mnum' and Amount='$amount' and Status='' and Rechargedate='$date'"; $reGetsameRech2=mysqli_query($con,$quGetSameRech2); $dataGetSameRech2=mysqli_num_rows($reGetsameRech2); if($dataGetSameRech>=1 || $dataGetSameRech1>=1 || $dataGetSameRech2>=1) { echo "<h1 align='center'><font color='#ff0000'> ✖ Same Recharge Not Allowed At Same Day !</font></h1>"; } else { $commision=$amount*$usercommvalue/100; $actual=$amount-$commision; $quGetDiff="select * from AdminDiff"; $reGetDiff=mysqli_query($con,$quGetDiff); $dataGetDiff=mysqli_fetch_array($reGetDiff); $DiffValue=$dataGetDiff['Diff']; $insertq="insert into recharge(Userid,Parentid,Grandparentid,Rechargedate,Time,Agentname,Companyname,Mobile,Amount,Debitamount,Status,AdminDiffValue) values('$userid','$parentid','$grandparentid','$date','$time','$username','$operator','$mnum','$amount','$actual','PENDING','$DiffValue')"; if(mysqli_query($con,$insertq)) { $querytetsrechid="select * from recharge order by Id desc"; $rs=mysqli_query($con,$querytetsrechid); $rechiddata=mysqli_fetch_array($rs); $newrechid=$rechiddata['Id']; $query4="select * from wallet where Userid='$userid' order by Id desc"; $result4=mysqli_query($con,$query4); $data4=mysqli_fetch_array($result4); $oldbalance= $data4['Balance']; $newbal=$oldbalance-$actual; $query5="insert into wallet(Userid,Openingbalance,Debit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount) values('$userid','$oldbalance','$actual','Recharge','$newbal','$date','$time','Recharge','$newrechid','$operator','$mnum','$amount')"; if(mysqli_query($con,$query5)) { $query9="update retailer set Balance='$newbal' where Userid='$userid'"; mysqli_query($con,$query9); $parcommbal=$amount*$parbalcomm/100; $gparcommbal=$amount*$gparbalcomm/100; $insertparcomm="insert into commwallet(Userid,Balance,Date,Time,Rechargeid,Mobile,Amount,Operator,Retailer,Retailername) values('$parentid','$parcommbal','$date','$time','$newrechid','$mnum','$amount','$operator','$userid','$username')"; mysqli_query($con,$insertparcomm); $insertgparcomm="insert into commwallet(Userid,Balance,Date,Time,Rechargeid,Mobile,Amount,Operator,Retailer,Retailername) values('$grandparentid','$gparcommbal','$date','$time','$newrechid','$mnum','$amount','$operator','$userid','$username')"; mysqli_query($con,$insertgparcomm); $query6="select * from wallet where Userid='$userid' order by Id desc"; $result6=mysqli_query($con,$query6); $data6=mysqli_fetch_array($result6); $ewalletid=$data6['Id']; $query7="update recharge set Balance='$newbal',Ewalletid='$ewalletid' where Id='$newrechid'"; mysqli_query($con,$query7); $query10="update retailer set Lastrechdate='$date' where Userid='$userid'"; mysqli_query($con,$query10); $query8="select * from wallet where Userid='$userid' order by Id desc"; $result8=mysqli_query($con,$query8); $data8=mysqli_fetch_array($result8); $currentbal= $data8['Balance']; $quGetUseApi="select * from operator where Operator='$operator'"; $reGetUseApi=mysqli_query($con,$quGetUseApi); $dataGetUseApi=mysqli_fetch_array($reGetUseApi); $UseApi=$dataGetUseApi['UseAPI']; if($UseApi=="My_API") { $token="01dc7e7d-ec4d-42db-99b4-cdf62a80a72a"; $url="https://www.vastwebindia.com/API/API/Recharge?Mobile=$mnum&OptCode=$myApiOpCode&Amount=$amount&Token=$token&Userid=sameermansuri111@gmail.com&rch_id=$newrechid"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.vastwebindia.com/API/API/Recharge?Mobile=$mnum&OptCode=$myApiOpCode&Amount=$amount&Token=$token&Userid=sameermansuri111@gmail.com&rch_id=$newrechid", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => "", CURLOPT_HTTPHEADER => array( "Postman-Token: 7d11312d-5948-4352-be19-b636152e59fd", "cache-control: no-cache" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $response; $data2=json_decode($response); $queryUpadateOrderId="update recharge set API='My_API' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfully !</font></h1><br>"; } } elseif($UseApi=="Quick_API") { $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.rechargedaddy.in/RDRechargeAPI/RechargeAPI.aspx", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"MobileNo\"\r\n\r\n9897095971\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"APIKey\"\r\n\r\nFROY38amkREsr7mHOutxIou64PDe3t02Qr9\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"REQTYPE\"\r\n\r\nRECH\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"REFNO\"\r\n\r\n$newrechid\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"SERCODE\"\r\n\r\n$QuickApiOpCode\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"CUSTNO\"\r\n\r\n$mnum\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"REFMOBILENO\"\r\n\r\n9897095971\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"AMT\"\r\n\r\n$amount\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"STV\"\r\n\r\n0\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"RESPTYPE\"\r\n\r\nJSON,\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", CURLOPT_HTTPHEADER => array( "Postman-Token: d63db6a7-aaf5-41a6-b73d-45dd8bb173e5", "cache-control: no-cache", "content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } if ($err) { echo "cURL Error #:" . $err; } else { $data2=json_decode($response); $status1 = $data2->STATUSMSG; $resText = $data2->MESSAGE; if($status1=="SUCCESS" || $status1=="Success") { $queryUpadateOrderId="update recharge set API='Quick_API' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfull !</font></h1><br>"; } elseif($resText=="Insufficient Balance.") { $failedquery="update recharge set API='Quick_API', ReHit='1', ApiBal='$resText' where Id='$newrechid'"; mysqli_query($con,$failedquery); } elseif($postpaidOperator=="Postpaid") { } elseif($status1=="FAILED" || $status1=="Failed") { if($AutoFailedStatus=="Deactive") { $UpdateRechApibal="update recharge set ReHit='1' where Id='$id'"; mysqli_query($con,$UpdateRechApibal); } $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','$status')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='$status1', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Quick_API1' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } } elseif($UseApi=="Kwik_API") { $apikey="8tyeubd-prieyeiw-854125-75yhr-8454adz"; if($postpaidOperator=="Postpaid") { $url="https://www.kwikapi.com/api/v2/bills/recharge.php?api_key=$apikey&number=$mnum&amount=$amount&opid=$KwikApiOpCode&state_code=0&order_id=$newrechid"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => false, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $data2=json_decode($response); $status1 = $data2->status; $resText = $data2->message; $txnId = $data2->opr_id; $kwikApiBal = $data2->balance; if($status1=="PENDING" || $status1=="SUCCESS") { $queryUpadateOrderId="update recharge set Transactionid='$orderId', Status='$status1', Operatorid='$txnId', API='Kwik_API', ApiBal='$kwikApiBal' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfull !</font></h1><br>"; } elseif($postpaidOperator=="Postpaid") { } elseif($AutoFailedStatus=="Deactive") { $UpdateRechApibal="update recharge set ReHit='1' where Id='$id'"; mysqli_query($con,$UpdateRechApibal); } else { $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','$status')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='$status1', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Kwik_API' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } } else { $url="https://www.kwikapi.com/api/v2/recharge.php?api_key=$apikey&number=$mnum&amount=$amount&opid=$KwikApiOpCode&state_code=0&order_id=$newrechid"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => false, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $data2=json_decode($response); $status1 = $data2->status; $resText = $data2->message; $txnId = $data2->opr_id; $kwikApiBal = $data2->balance; if($status1=="PENDING" || $status1=="SUCCESS") { $queryUpadateOrderId="update recharge set Transactionid='$orderId', Status='$status1', Operatorid='$txnId', API='Kwik_API', ApiBal='$kwikApiBal' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfull !</font></h1><br>"; } elseif($postpaidOperator=="Postpaid") { } elseif($AutoFailedStatus=="Deactive") { $UpdateRechApibal="update recharge set ReHit='1' where Id='$id'"; mysqli_query($con,$UpdateRechApibal); } else { $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','$status')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='$status1', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Kwik_API' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } } } elseif($UseApi=="Unique_API") { $UpdateRechApibal="update recharge set API='Unique_API' where Id='$newrechid'"; mysqli_query($con,$UpdateRechApibal); $apiUserId="9897095971"; $apiPwd="123456"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "http://uniqueebazaar.store/index.php/RechargeWebService/apitransaction?userid=9897095971&password=123456&mobile=$mnum&opt=$UniqueApiOpCode&amount=$amount&agentid=$newrechid&fmt=json", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "", CURLOPT_HTTPHEADER => array( "Postman-Token: 12172b3e-8111-46ff-a491-71ca0f581b7e", "cache-control: no-cache" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $data2=json_decode($response); $TxnId = $data2->userDATA->RBID; $status1 = $data2->userDATA->Status; $resText = $data2->userDATA->MSG; $opId = $data2->userDATA->OPID; $UniqApiBal = $data2->userDATA->BAL; if($status1=="Error") { if($AutoFailedStatus=="Deactive") { $UpdateRechApibal="update recharge set ReHit='1', API='Unique_API1', AdminOpId='$resText' where Id='$newrechid'"; mysqli_query($con,$UpdateRechApibal); } else { $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','FAILED')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='FAILED', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Unique_API2$status1' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } elseif($status1=="SUCCESS" || $status1=="Success") { $queryUpadateOrderId="update recharge set API='Unique_API2', Operatorid='$opId', ApiBal='$UniqApiBal', AdminOpId='S', Status='$status1' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfull !</font></h1><br>"; } elseif($status1=="FAILED" || $status1=="Failed") { if($AutoFailedStatus=="Deactive") { $UpdateRechApibal="update recharge set ReHit='1', API='Unique_API3', AdminOpId='$status1' where Id='$newrechid'"; mysqli_query($con,$UpdateRechApibal); } else { $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','FAILED')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='FAILED', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Unique_API2$status1' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } } } else { $token="Q21c5rsQorimWRxSCtds"; $url="http://api.rechapi.com/recharge.php?format=xml&token=$token&mobile=$mnum&amount=$amount&opid=$opcode&urid=$newrechid"; $request_timeout = 60; // 60 seconds timeout $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $request_timeout); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); $curl_error = curl_errno($ch); $getserver= curl_getinfo($ch); curl_close($ch); if($getserver["http_code"]==200) { $xml = simplexml_load_string($output); $orderId=$xml->orderId; $status1=$xml->status; $mobile=$xml->mobile; $amount=$xml->amount; $operatorId=$xml->operatorId; $error_code=$xml->error_code; $service=$xml->service; $resText=$xml->resText; if($status1=="PENDING" || $status1=="SUCCESS") { $queryUpadateOrderId="update recharge set Transactionid='$orderId', API='Rech_API' where Id='$newrechid'"; mysqli_query($con,$queryUpadateOrderId); echo "<h1 align='center'><font color='#008000'> ✔ Your Request Submit Successfull !</font></h1><br>"; } else { $refundquery="select * from wallet where Userid='$userid' order by Id desc"; $refundresult=mysqli_query($con,$refundquery); $refunddata=mysqli_fetch_array($refundresult); $refundoldbal=$refunddata['Balance']; $refundnewbal=$refundoldbal+$actual; $refundaddbalquery="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Transactiontype,Paynrechid,Operator,Mobile,Amount,Status) values('$userid','$refundoldbal','$actual','Recharge_Refund','$refundnewbal','$date','$time','Recharge_Refund','$newrechid','$operator','$mnum','$amount','$status')"; if(mysqli_query($con,$refundaddbalquery)) { $getrefundewalletid="select * from wallet where Userid='$userid' order by Id desc"; $resultrefundewalletid=mysqli_query($con,$getrefundewalletid); $datarefundewalletid=mysqli_fetch_array($resultrefundewalletid); $refundewalletid=$datarefundewalletid['Id']; $failedquery="update recharge set Creditewalletid='$refundewalletid', Status='$status1', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText', API='Rech_API' where Id='$newrechid'"; mysqli_query($con,$failedquery); $deletecomm="delete from commwallet where Rechargeid='$newrechid'"; mysqli_query($con,$deletecomm); $query9="update retailer set Balance='$refundnewbal' where Userid='$userid'"; mysqli_query($con,$query9); echo "<h1 align='center'><font color='#ff0000'> ✖ Your Recharge Request Has Been Failed Now !</font></h1>"; } } } elseif($curl_error=="28"){ $pendingquery="update recharge set Status='$status1', Transactionid='$orderId', Operatorid='$resText', Responsetxt='$resText' where Id='$newrechid'"; mysqli_query($con,$pendingquery); echo "<h1 align='center'><font color='#3339FF'> » Your Recharge Request Has Been Pending Now !</font></h1><br>"; } } } else { echo "<h1 align='center'><font color='#ff0000'> ✖ Error 5 !</font></h1>"; } } else { echo "<h1 align='center'><font color='#ff0000'> ✖ Error For Insert Data !</font></h1>"; } } } else { echo "<h1 align='center'><font color='#ff0000'> ✖ Your Balance Is Low !</font></h1>"; } } else { echo "<h1 align='center'><font color='#ff0000'> ✖ Mobile Number And Confirm Number Does Not Match !</font></h1>"; } } } echo "<meta http-equiv='refresh' content='5' />"; } } else { header('location:../login.php'); } ?> <div class="rech"> <input type="number" id="user" value="<?php echo $userid; ?>" style="display:none;"> <form method='post'> <table border="0" cellpadding="10"> <tr> <td id="tdfl">Balance : </td> <?php if($currentbal>=500) { $colorBal="greenbal"; } else { $colorBal="redbal"; } ?> <td ><p id="greenbal"></p></td> </tr> <tr> <td id="tdfl">Recharge: </td> <td > <?php include'connection.php'; $querygetservic="select * from service"; $resultgetservic=mysqli_query($con,$querygetservic); ?> <script> function onchange_event(arg) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","ajax.php?sid="+arg,false); xmlhttp.send(null); document.getElementById("divop").innerHTML=xmlhttp.responseText; } </script> <input type='radio' name='gen' onchange='onchange_event(1)' required/>Mobile <input type='radio' name='gen' onchange='onchange_event(2)' required/>DTH <input type='radio' name='gen' onchange='onchange_event(3)' required/>Postpaid </td> </tr> <tr> <td id="tdfl">Operator: </td> <td> <div id="divop"> <select name="operator" id="inpset1" required> <option id="opfont">--Select Operator--</option> </select> </div></td> </tr> <tr> <td id="tdfl">DTH / Mobile No:</td> <td><input type="number" name="mnum" placeholder="Enter Number.." id="inpset" required></td> <tr> <td id="tdfl">Confirm No:</td> <td><input type="number" name="cmnum" placeholder="Re-Enter Number.." id="inpset" required></td> </tr> <tr> <td id="tdfl">Amount:</td> <td><input type="number" name="amount" placeholder="Enter Amount.." id="inpset" required></td> </tr> <tr> <td></td> <td><input type="submit" name="submit" id="rechbtn" value="Recharge Now" onclick="show()"></td> </tr> </form> </table> </div> <div class="addiv1"><img src="add.jpg" id="addImg"></div> <div class="trarepo"> <p>Transaction Reports</p> </div> <input type="text" id="uid" value="<?php echo $userid; ?>" style="display:none;"> <script> function GetRechReport() { var usrid = document.getElementById("uid").value; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","getrechreport.php?uid="+usrid,false); xmlhttp.send(null); document.getElementById("rechreport").innerHTML = xmlhttp.responseText; setTimeout("GetRechReport()", 10000); } </script> <div id="rechreport"> </div> <div class="foot" > <p >Copyright © 2018 -2019 Long Life Product Pvt. Ltd.</p> </div> </body> </html>
💾 保存文件
← 返回文件管理器