✏️ 正在编辑: credit.php
路径:
/home/llpreacharge/public_html/Project/distributer/credit.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php session_start(); ob_start(); if($_SESSION['did']) { $userid= $_SESSION['did']; //$from=$userid; } 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']; $quDisname="select * from distributer where Userid='$userid'"; $reDisName=mysqli_query($con,$quDisname); $dataDisName=mysqli_fetch_array($reDisName); $disName=$dataDisName['Name']; ?> <html> <title>Credit</title> <head> <style> body{background:url('bg.jpg'); background-size:cover; width:100%; height:700px; margin:0px;} .head{background:; width:1350px; height:100px; 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;} #link1:hover{ padding:5px; border-radius:4px; color:black;} .menu{background:#996420; height:40px; width:1300px; margin:0 0 0 20px; padding:0;} .menu ul{padding:0; margin:0; position:relative; display:inline-block;} .menu ul li{list-style:none; float:left; width:170px; line-height:40px; text-align:center; font-size:15px; margin:0; 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;} .content{background:; height:;} .content h3{margin:10 20px; font-size:20px;} .content #tb1{margin:10 0 0 150px;} .content #tb1 #tbp{float:right; margin:10 20px;} .viewstate{background:#996420; width:97%; height:40px; margin:10 0 0 20px;} .viewstate h3{line-height:40px; margin-left:20px; color:white;} #tb1{width:450px; margin:10 20px; border-collapse:collapse; font-size:18px} #td1{background:#fef6ec;} #td2{background:#e8edfd; padding:0 0 0 10px;} #th1{background:green; color:white; font-size:25px; font-family:sans-serif;} #th2{background:green; color:white; font-size:25px; font-family:sans-serif;} #inp{width:100px;} #btn{margin:10 0 0 520px; padding:5px; width:80px; background:green; color:white; cursor:pointer;} #actionmsg{border:2px solid #4779b6; width:30%; padding:10 20px; font-size:18px; font-weight:bold; color:#4779b6; font-family:sans-serif; background:white; margin-left:50px; border-radius:5px;} #actionmsg2{border:2px solid #4779b6; width:30%; padding:10 20px; font-size:18px; font-weight:bold; color:red; font-family:sans-serif; background:white; margin-left:50px; border-radius:5px;} #loaddiv{ width:1580px; height:100%; z-index:3; display:none; position:absolute; margin:0px; padding:0; float:right;} #loader{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:300px; display:none; z-index:4; float:right;} .foot{background:#996420; width:100%; height:50px; float:left; text-align:center; margin-top:10px;} </style> </head> <body> <div id="loaddiv"> <img src="../loader2.gif" id="loader"></img> </div> <script> window.on(load, hide()) function show() { var d = document.getElementById("loaddiv"); d.style.display = "block"; var i = document.getElementById("loader"); i.style.display="block"; } function hide() { var d = document.getElementById("loaddiv"); d.style.display = "none"; var i = document.getElementById("loader"); i.style.display="none"; alert("hello"); } </script> <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> </div> <div class="menu"> <?php include'menu.php'; ?> </div> <div class="content"> <?php include'connection.php'; $uid=$_GET['id']; $resultTo=$pdoCon->query("SELECT * FROM retailer WHERE Userid='$uid'"); $dataTo=$resultTo->fetch(); $retaName=$dataTo['Name']; date_default_timezone_set("asia/kolkata"); $date=date("Y-m-d"); $time=date("h:i:s A"); if(isset($_POST['submit'])) { $inputbal=$_POST['addbal']; $rmark=$_POST['rmark']; $moduleBal=$inputbal%500; if($inputbal>$currentbal) { echo "<p id='actionmsg2'>Insufficiant Balance !</p>"; } elseif($inputbal<500) { echo "<p id='actionmsg2'>Amount Is Less Than 500 !</p>"; } elseif($moduleBal!==0) { echo "<p id='actionmsg2'>Amount Is Not Multiple in 500 !</p>"; } else { $sql1="INSERT INTO transaction(Fromid,Toid,Credit,Debit) VALUES(?,?,?,?)"; if($pdoCon->prepare($sql1)->execute([$userid,$uid,$inputbal,$inputbal])) { $paymentid=$pdoCon->lastInsertId(); $result3 = $pdoCon->query("SELECT Balance FROM `wallet` WHERE Userid='$userid' order by Id desc"); if($data3 = $result3->fetch()) { $oldbalance3 = $data3['Balance']; $newbal3=$oldbalance3-$inputbal; $sql4="INSERT INTO wallet (Userid,Openingbalance,Debit,Remarks,Balance,Date,Time,Paymentto,Paytoname,Transactiontype,Paynrechid) VALUES(?,?,?,?,?,?,?,?,?,?,?)"; if($pdoCon->prepare($sql4)->execute([$userid,$oldbalance3,$inputbal,$rmark,$newbal3,$date,$time,$uid,$retaName,Payment_Transfer,$paymentid])) { $result5 = $pdoCon->query("SELECT Balance FROM `wallet` WHERE Userid='$uid' order by Id desc"); if($data5 = $result5->fetch()) { $oldbalance5= $data5['Balance']; $newbal5=$oldbalance5+$inputbal; $sql6="INSERT INTO wallet(Userid,Openingbalance,Credit,Balance,Date,Time,Paymentfrom,Payfromname,Transactiontype,Paynrechid) VALUES(?,?,?,?,?,?,?,?,?,?)"; if($pdoCon->prepare($sql6)->execute([$uid,$oldbalance5,$inputbal,$newbal5,$date,$time,$userid,$disName,Payment_Transfer,$paymentid])) { $sql7 = "UPDATE retailer SET Balance=? WHERE Userid=?"; if($pdoCon->prepare($sql7)->execute([$newbal5, $uid])) { $sql8="UPDATE distributer SET Balance=? WHERE Userid=?"; if($pdoCon->prepare($sql8)->execute([$newbal3, $userid])) { echo "<p id='actionmsg'>Balance Update Successfully !</p>"; header( "refresh:5; url=http://llprecharge.in/distributer/credit.php?id=$uid" ); } else { echo "<error query 8>"; } } else { echo "<error query 7>"; } } else { echo "<error query 6>"; } } else { echo "error in query 5"; } } else { echo "<echo error 5>"; } } else { echo "<error query 3>"; } } else { echo "<error query 2>"; } } mysqli_close($con); } else { echo "<center><h3 style='background:white; color:red;'>You Can Credit Amount Multiple In 500 Only !</h3></center>"; } ?> <h3>Add Balance</h3><hr> <form method="post"> <?php include'connection.php'; $querygetname="select * from retailer where Userid='$uid'"; $resultgetname=mysqli_query($con,$querygetname); $datagetname=mysqli_fetch_array($resultgetname); $username=$datagetname['Name']; $address=$datagetname['Address']; echo"<table border='1' cellpadding='5' id='tb1'>"; echo "<tr>"; echo "<th id='th1'><p id='tbp'>My Balance : </p></td>"; echo "<th id='th2'>".$currentbal."</td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>Client Balance :</p></td>"; $query9="select * from wallet where Userid='$uid' order by Id desc"; $result9=mysqli_query($con,$query9); $data9=mysqli_fetch_array($result9); $currentbal9= $data9['Balance']; echo "<td id='td2'>".$currentbal9."</td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>User Id : </p></td>"; echo "<td id='td2'>".$uid."</td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>User Name : </p></td>"; echo "<td id='td2'>".$username."</td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>Address : </p></td>"; echo "<td id='td2'>".$address."</td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>Add Amount: </p></td>"; echo "<td id='td2'><input type='text' name='addbal' id='inp' required></td>"; echo "</tr>"; echo "<tr>"; echo "<td id='td1'><p id='tbp'>Add Remark: </p></td>"; echo "<td id='td2'><input type='text' name='rmark'></td>"; echo "</tr>"; echo "</table>"; ob_end_flush(); ?> <input type="submit" name="submit" id="btn" onclick="show()"> </form> </div> <div class="footer"> <p style="text-align:center;">Copyright © 2018 -2019 Long Life Product Pvt. Ltd.</p> </div> </body> </html>
💾 保存文件
← 返回文件管理器