✏️ 正在编辑: add_new_agent.php
路径:
/home/llpreacharge/public_html/Project/distributer/add_new_agent.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php session_start(); if($_SESSION['did']) { $userid= $_SESSION['did']; } 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 distributer where Userid='$userid'"; $result2=mysqli_query($con,$query2); $data=mysqli_fetch_array($result2); $username=$data['Name']; $grandparentid=$data['Parentid']; ?> <?php include'connection.php'; $query="select * from state"; $result=mysqli_query($con,$query); ?> <script> function Showmnum() { var umnum = document.getElementById("umnum").value; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","userMnum.php?mnum="+umnum,false); xmlhttp.send(null); document.getElementById("usrdetail").innerHTML= xmlhttp.responseText; } </script> <html> <title>Add Retailer</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:800px; margin:0; padding:0;} .content #conp1{margin:10px; font-size:19px; font-family:calibri; font-weight:bold;} .addagent{background:#996420; height:40px; width:600px; margin:0px; border:1px solid black; line-height:40px; padding:0px;} .addagent h3{margin:0 0 0 10px; padding:0; color:white; font-size:20px;} .form{background:; margin:10 0 0 100px; width:400px; float:left;} .form td{padding:5px 0 0 20px; height:20px;} #t1{ width:602px; height:800px;text-align:center; border-collapse:collapse; border-color:black; margin:-1 0 0 0px; padding:5px;} #t1 th{font-family:calibri; background:#f6f0e8; width:200px; text-align:right; margin-right:25px; font-size:20px;} #t1 td{font-family:calibri; background:#d9e0fb;} #t1 input{padding-left:8px; width:280px; height:35px; font-size:20px; border:1px solid black;} #t1 select{padding-left:8px; width:280px; height:35px; border:1px solid black;} #t1 textarea{padding-left:8px; width:280px; border:1px solid black;} #t2{ width:500px; text-align:center; border-collapse:collapse; border-color:black; margin:0px; padding:10px; background:white;} #star{color:red; text-align:right; margin-right:10px;} #btntd{background:none; height:60px;} #subbtn{ background:green; color:white; font-size:17px; border-radius:5px; border:1px solid white; height:40px; width:200px; margin:30 0 0 400px;} #subbtn:hover{background:#d1994a; cursor:pointer;} .foot{background:#996420; width:100%; height:50px; float:left;text-align:center; margin-top:50px;} </style> </head> <body> <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"Balance : ". $currentbal; ?></p> </div> <div class="menu"> <?php include'menu.php'; ?> </div> <div class="content"> <p id="conp1">Personal Information</p><hr> <div class="form"> <div class="addagent"> <h3>Fill Details For Add New Retailer</h3> </div> <?php include'connection.php'; date_default_timezone_set("asia/Kolkata"); $time= Date("h:i:s A"); $date= Date("Y-m-d"); if(isset($_POST['submit'])) { $querygetmaxid="select max(Userid) from retailer"; $resultgetmaxid=mysqli_query($con,$querygetmaxid); $row=mysqli_fetch_array($resultgetmaxid); $maxid=$row[0]; $newuserid=$maxid+1; $uname=$_POST['uname']; $address=$_POST['address']; $state=$_POST['state']; $mnum=$_POST['mnum']; $pwd=rand(100000,999999); $biztype=$_POST['biztype']; $pannum=$_POST['pannum']; $pincode=$_POST['pincode']; $city=$_POST['city']; $email=$_POST['email']; $bizname=$_POST['biztype']; $opbal=$_POST['opbal']; if(empty($opbal)) { $opbal=0; } $quGetDupId="select * from retailer where Mobile='$mnum'"; $reGetDupId=mysqli_query($con,$quGetDupId); $DupId=mysqli_num_rows($reGetDupId); if($opbal>$currentbal) { echo "<h1 align='center'><font color='#ff0000'> ✖ Insufficiant Balance !</font></h1><br>"; } elseif($DupId>=1) { echo "<h1 align='center'><font color='#ff0000'> ✖ This Mobile Number Already Exist !</font></h1><br>"; } else { $queryinsert="insert into retailer(JoinDate,Userid,Password,Name,Balance,Address,State,Mobile,Businessname,Pan,Parentid,Grandparentid,Pincode,City,Email,Businesstype) values('$date','$newuserid','$pwd','$uname','$opbal','$address','$state','$mnum','$bizname','$pannum','$userid','$grandparentid','$pincode','$city','$email','$biztype')"; if(mysqli_query($con,$queryinsert)) { $quDeductBal="insert into transaction(Fromid, Toid, Credit, Debit) values('$userid','$newuserid','$opbal','$opbal')"; if(mysqli_query($con,$quDeductBal)) { $quGetId="select * from transaction where Fromid='$userid' order by Id desc"; $rGetId=mysqli_query($con,$quGetId); $dataGetId=mysqli_fetch_array($rGetId); $paymentId=$dataGetId['Id']; $quUpdatWallet="select * from wallet where Userid='$userid' order by Id desc"; $rUpdatWallet=mysqli_query($con,$quUpdatWallet); $dataUpdateWallet=mysqli_fetch_array($rUpdatWallet); $disBal=$dataUpdateWallet['Balance']; $currBal=$disBal-$opbal; $quInsertBal="insert into wallet(Userid,Openingbalance,Debit,Remarks,Balance,Date,Time,Paymentto,Paytoname,Transactiontype,Paynrechid) value('$userid','$disBal','$opbal','Opening_Balance_To_New_Retailer','$currBal','$date','$time','$newuserid','$uname','Transfer_Opening_Balance','$paymentId')"; if(mysqli_query($con,$quInsertBal)) { $queryinsertwallet="insert into wallet(Userid,Openingbalance,Credit,Remarks,Balance,Date,Time,Paymentfrom,Payfromname,Transactiontype,Paynrechid) value('$newuserid','$opbal','$opbal','Add_Opening_Balance','$opbal','$date','$time','$userid','$username','Recieved_Opening_Balance','$paymentId')"; if(mysqli_query($con,$queryinsertwallet)) { $queryinsertcomm="insert into commision(Userid)values('$newuserid')"; if(mysqli_query($con,$queryinsertcomm)) { $updateComm="select * from operator"; $reUpdateComm=mysqli_query($con,$updateComm); while($dataUpdateComm=mysqli_fetch_array($reUpdateComm)) { $Columname=$dataUpdateComm['Commision_Column']; $RetComm=$dataUpdateComm['RetComm']; $quUpdateComm="update commision set $Columname='$RetComm' where Userid='$newuserid'"; mysqli_query($con,$quUpdateComm); } $quUpdate="update retailer set Balance='$opbal' where Userid='$userid'"; if(mysqli_query($con,$quUpdate)) { $quUpdate1="update distributer set Balance='$currBal' where Userid='$userid'"; if(mysqli_query($con,$quUpdate1)) { echo "<h1 align='center'><font color='#008000'> ✔ Registration Successfull !</font></h1><br>"; $query="select * from retailer where Userid='$newuserid'"; $result=mysqli_query($con,$query); $data=mysqli_fetch_array($result); echo "<table border='0' cellpadding='10' id='t2'> <tr> <th>User Id : </th> <td> ".$data['Userid']."</td> </tr> <tr> <th>Password : </th> <td>". $data['Password']."</td> </tr> <tr> <th>Agent Name : </th> <td>".$data['Name']."</td> </tr> <tr> <th></th> <td><a href='admin.php'>OK</a></td> </tr> </table><br><br><br>"; $msg="Welcome To LLP Recharge Dear ".$uname." Your Userid = ".$newuserid." and Password Is = ".$data['Password']." . Thanks To Join LLP Recharge ! Log On: www.llprecharge.in"; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "http://sms2.kwikapi.com/sendSMS?username=sameermansuri111&message=".urlencode($msg)."&sendername=LLPRCH&smstype=TRANS&numbers=$mnum&apikey=dc086ecd-1a22-4928-9e4e-69703230fd4e", 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) { "cURL Error #:" . $err; } else { $response; $data2=json_decode($response); } } else { echo "Registration error !"; } } else { echo "Registration error !"; } } else { echo "error 5"; } } else { echo "error 4"; } } else { echo "error 3"; } } } else { echo "error"; } } mysqli_close($con); } ?> <form method="post"> <table border="1" cellpadding="10" id="t1"> <tr> <th>Agent Name : <span style="color:red;"> * </span></th> <td><input type="text" name="uname" required></td> </tr> <tr> <th>Mobile No. : <span style="color:red;">*</span></th> <td><input type="text" name="mnum" id="umnum" onblur="Showmnum()" required><br><br> <div id="usrdetail" style="color:red; font-size:19px;"></div> </td> </tr> <tr> <th>E-Mail : </th> <td><input type="email" name="email" placeholder="example@gmail.com"></td> </tr> <tr> <th>Postal Address : <span style="color:red;">*</span></th> <td><textarea rows="4" cols="22" name="address" required></textarea></td> </tr> <tr> <th>State : <span style="color:red;">*</span></th> <td><input type="text" name="state"></td> </tr> <tr> <th>City/District : <span style="color:red;">*</span></th> <td><input type="text" name="city"></td> </tr> <tr> <th>Pin Code : </th> <td><input type="text" name="pincode"></td> </tr> <tr> <th>Agent Business Type : <span style="color:red;">*</span></th> <td> <select name="biztype" required> <option>--Select Business Type--</option> <?php include'connection.php'; $querybt="select * from retailertype"; $resultbt=mysqli_query($con,$querybt); while($row=mysqli_fetch_array($resultbt)) { echo "<option>".$row['Businessname']."</option>"; } ?> </select> </td> </tr> <tr> <th>Pan No. : </th> <td><input type="text" name="pannum"></td> </tr> <tr> <th>Business name : </th> <td><input type="text" name="bizname"></td> </tr> <tr> <th>Opening Balance : </th> <td><input type="text" name="opbal" placeholder="Rs."></td> </tr> </table> <input type="submit" name="submit" value="Submit" id="subbtn"><br><br> <input type="submit" name="cancel" value="Cancel" id="subbtn"> </form> </div> </div> <div class="foot"> <p style="text-align:center;">Copyright © 2018 -2019 Long Life Product Pvt. Ltd.</p> </div> </body> </html>
💾 保存文件
← 返回文件管理器