Server IP : 111.118.215.189 / Your IP : 52.14.3.26 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home1/a1673wkz/propstonerealty.com/Admin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); if(empty($_SESSION['username'])) { echo '<script>window.location.href="login.php"</script>'; } ?> <!DOCTYPE html> <html> <body> <?php //header link include("header_link.php"); //database file link include("config.php"); ?> <link href="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.css" rel="stylesheet"> <!-- Main Wrapper --> <div class="main-wrapper"> <!-- Page Wrapper --> <div class="page-wrapper"> <!-- Page Content --> <div class="content container-fluid"> <!-- Page Header --> <div class="page-header"> <div class="row align-items-center"> <div class="col"> <h3 class="page-title">Submenu</h3> <ul class="breadcrumb"> <li class="breadcrumb-item"><a href="index.html">Dashboard</a></li> <li class="breadcrumb-item active">Submenu</li> </ul> </div> <div class="col-auto float-right ml-auto"> <a href="#" class="btn add-btn" data-toggle="modal" data-target="#add_holiday"><i class="fa fa-plus"></i> Add Submenu</a> </div> </div> </div> <!-- /Page Header --> <script src="js/jquery-3.2.1.min.js"></script> <div class="row"> <div class="col-md-12"> <div class="table-responsive"> <table class="table table-striped datatable custom-table mb-0" id="menu-load"> <thead> <tr> <th>Sl no.</th> <th>Menu</th> <th>Submenu</th> <th>Link</th> <th class="text-right">Action</th> </tr> </thead> <tbody> <?php $cnt='0'; $selct=$obj->fetch("SELECT * FROM submenu ORDER BY id DESC"); foreach($selct as $val) { $cnt++; ?> <tr class="holiday-upcoming"> <td><?php echo $cnt; ?></td> <td> <?php $menu=$val['menu']; $dt=$obj->arr("SELECT * FROM menu WHERE id='$menu'"); echo $dt['menu']; ?> </td> <td><?php echo $val['submenu'] ?></td> <td><?php echo $val['link'] ?></td> <td class="text-right"> <div class="dropdown dropdown-action"> <a href="#" class="action-icon dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="material-icons">more_vert</i></a> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="#" data-toggle="modal" data-target="#edit_holiday<?php echo $cnt; ?>"><i class="fa fa-pencil m-r-5"></i> Edit</a> <a class="dropdown-item" href="#" data-toggle="modal" data-target="#delete_holiday<?php echo $val['id']; ?>"><i class="fa fa-trash-o m-r-5"></i> Delete</a> </div> </div> </td> </tr> <!-- Edit Menu Modal --> <div class="modal custom-modal fade" id="edit_holiday<?php echo $cnt; ?>" role="dialog"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Edit Sevices</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form id="edit_menu"> <div class="form-group"> <label>Menu<span class="text-danger">*</span></label> <select class="form-control" name="menu" id="menu<?php echo $val['id']; ?>"> <option>Select Menu</option> <?php $select1=$obj->fetch("SELECT * FROM menu"); foreach($select1 as $data) { ?> <option value="<?php echo $data['id']; ?>" <?php echo ($data['id']==$menu_id)?'selected':'' ?> ><?php echo $data['menu']; ?></option> <?php } ?> </select> <span class="menu1" style="color: red;"></span> </div> <div class="form-group"> <label>Submenu <span class="text-danger">*</span></label> <input id="submenu<?php echo $val['id']; ?>" class="form-control" value="<?php echo $val['submenu']; ?>" type="text" /> <span class="submenu1" style="color: red;"></span> </div> <div class="submit-section"> <input type="button" name="submit" id="edit_menu_btn<?php echo $val['id']; ?>" class="btn btn-primary edit_menu_btn" value="Submit" /> </div> </form> <div class="preview1" style="text-align: center;"></div> </div> </div> </div> </div> <!-- / End Edit Menu Modal --> <!-- Delete Menu Modal --> <div class="modal custom-modal fade" id="delete_holiday<?php echo $val['id']; ?>" role="dialog"> <div class="modal-dialog modal-dialog-centered"> <div class="modal-content"> <div class="modal-body"> <div class="form-header"> <h3>Delete Submenu</h3> <p>Are you sure want to delete?</p> </div> <div class="modal-btn delete-action"> <div class="row"> <div class="col-6"> <button class="btn btn-primary continue-btn" value="<?php echo $val['id']; ?>" id="dlt_btn<?php echo $val['id']; ?>" style="width: 100%;">Delete</button> </div> <div class="col-6"> <a href="javascript:void(0);" data-dismiss="modal" class="btn btn-primary cancel-btn">Cancel</a> </div> </div> <div class="row"> <div class="col-12" align="center" style="padding-top: 15px;"><span id="preview2"></span></div> </div> </div> </div> </div> </div> </div> <!-- / End Delete Menu Modal --> <!-- Edit script Modal --> <script> $("#edit_menu_btn<?php echo $val['id']; ?>").click("submit", function() { var menu1 = $('#menu<?php echo $val['id']; ?>').val(); var submenu1 = $('#submenu<?php echo $val['id']; ?>').val(); var title1 = $('#title<?php echo $val['id']; ?>').val(); var des1 = $('#des<?php echo $val['id']; ?>').val(); var link1 = $('#link<?php echo $val['id']; ?>').val(); var submenu_id = $('#submenu_id<?php echo $val['id']; ?>').val(); $("add_holiday").modal('show'); var flag = true; //alert(menu1); /********validate all our form fields***********/ if(submenu1==""){ $('#submenu').css('border-color','red'); $('.submenu1').html('Empty Field'); flag = false; } if(title1==""){ $('#title').css('border-color','red'); $('.title1').html('Empty Field'); flag = false; } if(des1==""){ $('#des').css('border-color','red'); $('.des1').html('Empty Field'); flag = false; } if(menu1==""){ $('#menu').css('border-color','red'); $('.menu1').html('Empty Field'); flag = false; } if(flag) { $.ajax({ url:"edit_submenu.php", method:"POST", data:{submenu1:submenu1,menu1:menu1,link1:link1,submenu_id:submenu_id,title1:title1,des1:des1}, success:function(data) { //var result=JSON.parse(data); //alert(data); $(".preview1").html(data); //alert("success"); //location.reload(); setTimeout(location.reload.bind(location), 1500); } }); } }); </script> <!-- End Edit Script Modal --> <!-- Delete Script Modal --> <script> $("#dlt_btn<?php echo $val['id']; ?>").click("submit", function () { var dlt_btn = $(this).val(); var flag = true; //alert(dlt_btn); /********validate all our form fields***********/ if (flag) { $.ajax({ url: "delete_submenu.php", method: "POST", data: { dlt_btn: dlt_btn }, success: function (data) { //var result=JSON.parse(data); //alert(data); $("#preview2").html(data); //alert("success"); //location.reload(); setTimeout(location.reload.bind(location), 1500); }, }); } }); </script> <!-- End Delete Script Modal --> <?php } ?> </tbody> </table> </div> </div> </div> </div> <!-- /Page Content --> <!-- Add Menu Modal --> <div class="modal custom-modal fade" id="add_holiday" role="dialog"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title">Add Comenu</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body" id="refresh"> <form id="add_menu"> <div class="form-group"> <label>Menu <span class="text-danger">*</span></label> <select class="form-control" name="menu" id="menu"> <option>Select Menu</option> <?php $select1=$obj->fetch("SELECT * FROM menu"); foreach($select1 as $data) { ?> <option value="<?php echo $data['id']; ?>"><?php echo $data['menu']; ?></option> <?php } ?> </select> <span class="menu" style="color: red;"></span> </div> <div class="form-group"> <select class="form-control" id="submenu"></select> </div> <div class="form-group"> <label>Submenu<span class="text-danger">*</span></label> <input class="form-control" type="text" name="submenu" id="submenu" /> <span class="submenu" style="color: red;"></span> </div> <div class="form-group"> <label>link<span class="text-danger">*</span></label> <input class="form-control" type="text" name="link" id="link" /> <span class="link" style="color: red;"></span> </div> <div class="submit-section"> <input type="button" name="" class="btn btn-primary submit-btn" id="submit" value="Submit" /> </div> </form> <div class="preview" style="text-align: center;"></div> </div> </div> </div> </div> <!-- /Add Menu Modal --> <?php // header include("header.php"); ?> </div> </div> <?php //footer link include("footer_link.php"); //footer include("footer.php"); ?> </body> </html> <script type="text/javascript"> $("#submit").click(function () { //get input field values var submenu = $("#submenu").val(); var title = $("#title").val(); var des = $("#des").val(); var menu = $("#menu").val(); var link = $("#link").val(); var flag = true; /********validate all our form fields***********/ if (submenu == "") { $("#submenu").css("border-color", "red"); $(".submenu").html("Empty Field"); flag = false; } if (title == "") { $("#title").css("border-color", "red"); $(".title").html("Empty Field"); flag = false; } if (des == "") { $("#des").css("border-color", "red"); $(".des").html("Empty Field"); flag = false; } if (menu == "") { $("#menu").css("border-color", "red"); $(".menu").html("Empty Field"); flag = false; } if (flag) { $.ajax({ url: "add_submenu.php", method: "POST", data: { menu: menu, link: link, submenu: submenu,des:des,title:title }, success: function (data) { //var result=JSON.parse(data); //alert(data); $(".preview").html(data); //alert("success"); //location.reload(); setTimeout(location.reload.bind(location), 1500); }, }); } }); //reset previously set border colors on .keyup() $("#menu").keyup(function () { $("menu").css("border-color", ""); }); </script> <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote.min.js"></script> <script> $(document).ready(function() { $('.summernote').summernote(); }); </script> <script> $('#menu').on("change",function(){ var menu = $('#menu').val(); $.ajax({ url: "fetch-submenu.php", type: "POST", data: {menu:menu}, success: function(data) { $('#submenu').html(data); } }) }) </script>