✏️ 正在编辑: add_user.php
路径:
/home/llpreacharge/public_html/LLPRECHARGE/Admin/add_user.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php include'session.php'; include'../connection.php'; include'../functions.php'; ?> <html> <head> <title>Add API</title> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="icon" href="images/logo.png" type="image/gif" sizes="16x16"> <!-- Admin CSS File Link --> <link rel="stylesheet" href="css/style.css"> <!-- User JAVA SCRIPT File Link --> <script type="text/javascript" src="js/script.js"></script> <!-- Font Awesome Icone --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <style> .div1{ background:#f7f7f7; width:50%; height:550px; float:left; text-align:center; } .div1 table{ width:94%; text-align:center; font-size:17px; border-collapse:collapse; margin:10px; padding:2px 10px; } .div1 hr{ margin:5px 10px; padding:0 10px; } table th{ background:#6b5127; color:white; height:40px; border:solid white 1px; } table td{ background:white; height:40px; border:solid black 1px; } .div1 hr{width:94%;} .div1 input, .div1 select{ width:94%; height:45px; margin:8px; padding:2px 10px; border-radius:5px; border:1px solid #6b5127; font-size:17px; } input[type=file] { border:none; } .div1 textarea{ width:94%; height:100px; margin:10px 0; padding:2px 10px; border-radius:5px; border:1px solid #6b5127; font-size:19px; } .divImg{ background:white; width:94%; height:100px; margin:10 15px; padding:8px; border-radius:5px; border:1px solid #6b5127; font-size:19px; text-align:left; } .divImg img{ width:19%; height:80px; float:left; } .divImg input{ width:70%; float:right; font-size:15px; } input[type=submit]{ background:#6b5127; color:white; font-size:30px; transition:1s; } input[type=submit]:hover{ background:white; color:#6b5127; border:1px solid #6b5127; cursor:pointer; transition:1s; } @media(max-width:768px) { .div1{ width:100%; height:auto; } .nav,.container{ height:auto; } } </style> <link rel="stylesheet" href="css/mediaStyle.css"> </head> <body> <!--Header Divison--> <?php require'header.php'; ?> <!--Container Division--> <div class="container"> <?php include'menu.php'; if(isset($_POST['submit'])) { $userType = $_POST['userType']; $parent = $_POST['parent']; $uName = $_POST['uName']; $mobile = $_POST['mobile']; $email = $_POST['email']; $state = $_POST['state']; $district = $_POST['district']; $pin = $_POST['pin']; $address = $_POST['address']; $quGetDupId="SELECT * FROM user WHERE Mobile='$mobile'"; $reGetDupId=mysqli_query($con,$quGetDupId); $DupId=mysqli_num_rows($reGetDupId); if(empty($uName)) { echo "<div class='msg-div'> <form method='post'> <h3>Please Insert User's Name !</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($DupId>0) { echo "<div class='msg-div'> <form method='post'> <h3>This Mobile Number Already Exist !</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($mobile)) { echo "<div class='msg-div'> <form method='post'> <h3>Please Insert User's Mobile Number !</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($state=="--Select State--") { echo "<div class='msg-div'> <form method='post'> <h3>Select State Please !</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($state=="--Select District--") { echo "<div class='msg-div'> <form method='post'> <h3>Select District Please !</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 { if($userType=="ADMIN") { $maxusrkey="AD"; } elseif($userType=="API") { $maxusrkey="AU"; } elseif($userType=="MASTER") { $maxusrkey="MU"; } elseif($userType=="DISTRIBUTER") { $maxusrkey="DU"; } elseif($userType=="RETAILER") { $maxusrkey="RU"; } $G_Parent = ''; if($userType=="DISTRIBUTER" || $userType=="RETAILER") { $dataParent = getUser($parent); $G_Parent = $dataParent['Parent']; } $querygetmaxid="SELECT Userid FROM user ORDER BY Id DESC"; $resultgetmaxid=mysqli_query($con,$querygetmaxid); $row=mysqli_fetch_array($resultgetmaxid); $maxid=$row['Userid']; $maxusrid=substr($maxid,2); $newMaxid=$maxusrid+1; $newUsrid=$maxusrkey.$newMaxid; $pwd=rand(100000,999999); //Insert into User profile //Pending Parent And Grand Parent parameters $query = "INSERT INTO user(Date,Userid,Password,Name,Mobile,Mail,State,City,Address,Pincode,Type,Parent,G_Parent) values('$datetime','$newUsrid','$pwd','$uName','$mobile','$email','$state','$district','$address','$pin','$userType','$parent','$G_Parent')"; if(mysqli_query($con,$query)) { if($userType=="API") { $quInsertApiUsr = "INSERT INTO api_user (Userid,OwnerName) VALUES ('$newUsrid','$uName')"; mysqli_query($con,$quInsertApiUsr); } if($userType=="API" || $userType=="ADMIN") { $quOp="SELECT * FROM operator WHERE Status='ACTIVE'"; } else { $quOp="SELECT * FROM operator WHERE Status='ACTIVE' AND Type='ALL'"; } $reOp=mysqli_query($con,$quOp); while($dataOp=mysqli_fetch_array($reOp)) { $OpName = $dataOp['Name']; $OpCode = $dataOp['Id']; $ServiceType = $dataOp['ServiceType']; $quCommSlab="INSERT INTO comm_slab (Userid,OpName,OpCode) VALUES ('$newUsrid','$OpName','$OpCode')"; mysqli_query($con,$quCommSlab); if($ServiceType=="DTH") { $useApiName = "RechBS"; $ApiOpCode = $dataOp['RechBS']; } else { $useApiName = "M_ROBO"; $ApiOpCode = $dataOp['M_ROBO']; } $quSetApi="INSERT INTO set_api (Userid,OpCode,UseApi,ApiOpCode) VALUES ('$newUsrid','$OpCode','$useApiName','$ApiOpCode')"; mysqli_query($con,$quSetApi); } if(!empty($email)) { $toMail = $email; $toName = $uName; $subjectMail ="Welcome To LLP Recharge"; $msgMail = "Dear $toName , Your Registration Is Successfull. Your Userid is $newUsrid & Password is $pwd , Login Your LLP Account on https://www.llprecharge.in/login.php"; require'../LinkFile/mail.php'; } echo "<div class='msg-div'> <form method='post'> <h3>Registration Successfully !</h3><br> <h3>Userid : ".$newUsrid."</h3><br> <h3>Password : ".$pwd."</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>"; } else { echo "<div class='msg-div'> <form method='post'> <h3>Something Error !</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>"; } } } ?> <div class="content"> <input type="text" style="display:none;" value="<?php echo $userid; ?>" id="user"> <div class="head"> <div class="title"><p>Add Retailers :-</p></div> <div class="msg"><marquee><?php include'../msg.php'; ?></marquee></msg> </div><hr> <div class="data-content"> <script> function dist() { var stateId = document.getElementById("stat").value; var xmlhttpState = new XMLHttpRequest(); xmlhttpState.open("GET","ajax_district.php?stateId="+stateId, false) xmlhttpState.send(null); document.getElementById("distPlace").innerHTML = xmlhttpState.responseText; } function parentUsr() { var AjaxName = "Ajax13"; var usrType = document.getElementById("usrType").value; if(usrType!="ADMIN") { var xmlhttpState = new XMLHttpRequest(); xmlhttpState.open("GET","Ajax.php?AjaxName="+AjaxName+"&usrType="+usrType, false) xmlhttpState.send(null); document.getElementById("parentPlace").style.display = "inline"; document.getElementById("parentPlace").innerHTML = xmlhttpState.responseText; } else { document.getElementById("parentPlace").style.display = "none"; } } </script> <form method="post"> <div class="div1"> <select name="userType" onchange="parentUsr()" id="usrType"> <option>--Select Type--</option> <option>ADMIN</option> <option>API</option> <option>MASTER</option> <option>DISTRIBUTER</option> <option>RETAILER</option> </select> <select name="parent" id="parentPlace"> <option>--Select Parent--</option> </select> <input type="text" name="uName" placeholder="Full Name ..." required> <input type="number" id="mobile" name="mobile" placeholder="Mobile No ..." required> <input type="email" name="email" placeholder="E-Mail ..." > <select name="state" id="stat" onchange="dist()"> <option>--Select State--</option> <?php $reState=mysqli_query($con,"SELECT * FROM state ORDER BY Name"); while($dataState=mysqli_fetch_array($reState)) { echo "<option>".$dataState['Name']."</option>"; } ?> </select> <select name="district" id="distPlace"> <option>--Select District--</option> </select> <input type="text" name="pin" placeholder="Pin Code..."> <textarea name="address" placeholder="Address .."></textarea> <input type="submit" name="submit" value="Submit" onclick='showLoader()'> </div> <div class="div1"> <center><h1>Recent Added</h1></center><hr> <table cellpadding="20" border="2"> <tr> <th>Userid</th> <th>Name</th> <th>Mobile</th> <th>Type</th> </tr> <?php $quGetTxn="SELECT * FROM user ORDER BY Id DESC LIMIT 10"; $reGetTxn=mysqli_query($con,$quGetTxn); while($dataGetTxn=mysqli_fetch_array($reGetTxn)) { echo "<tr>"; echo "<td>".$dataGetTxn['Userid']."</td>"; echo "<td>".$dataGetTxn['Name']."</td>"; echo "<td>".$dataGetTxn['Mobile']."</td>"; echo "<td>".$dataGetTxn['Type']."</td>"; echo "</tr>"; } ?> </table> </div> </form> </div> </div> </div> <?php require'footer.php'; ?> </body> </html>
💾 保存文件
← 返回文件管理器