Server IP : 111.118.215.189 / Your IP : 3.142.194.183 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">Sub Location</h3> <ul class="breadcrumb"> <li class="breadcrumb-item"><a href="index.html">Dashboard</a></li> <li class="breadcrumb-item active">Sub Location</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 Sub Location</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>Location</th> <th>Sub Location</th> <th class="text-right">Action</th> </tr> </thead> <tbody> <?php $cnt='0'; $selct=$obj->fetch("SELECT * FROM model ORDER BY id DESC"); foreach($selct as $val) { $cnt++; ?> <tr class="holiday-upcoming"> <td><?php echo $cnt; ?></td> <td> <?php $brand=$val['brand']; $dt=$obj->arr("SELECT * FROM brand WHERE id='$brand'"); echo $dt['brand']; ?> </td> <td><?php echo $val['model'] ?></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 brand 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 Sub Location</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_brand"> <div class="form-group"> <label>Location<span class="text-danger">*</span></label> <select class="form-control" name="brand" id="brand<?php echo $val['id']; ?>"> <option>Select Location</option> <?php $select1=$obj->fetch("SELECT * FROM brand"); foreach($select1 as $data) { ?> <option value="<?php echo $data['id']; ?>" <?php echo ($data['id']==$brand)?'selected':'' ?> ><?php echo $data['brand']; ?></option> <?php } ?> </select> <span class="brand1" style="color: red;"></span> </div> <div class="form-group"> <label>Sub Location <span class="text-danger">*</span></label> <input id="model<?php echo $val['id']; ?>" class="form-control" value="<?php echo $val['model']; ?>" type="text" /> <span class="model1" style="color: red;"></span> </div> <div class="submit-section"> <input type="button" name="submit" id="edit_brand_btn<?php echo $val['id']; ?>" class="btn btn-primary edit_brand_btn" value="Submit" /> </div> </form> <div class="preview1" style="text-align: center;"></div> </div> </div> </div> </div> <!-- / End Edit brand Modal --> <!-- Delete brand 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 Sub Location</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 brand Modal --> <!-- Edit script Modal --> <script> $("#edit_brand_btn<?php echo $val['id']; ?>").click("submit", function() { var brand1 = $('#brand<?php echo $val['id']; ?>').val(); var model1 = $('#model<?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 model_id = <?php echo $val['id']; ?>; $("add_holiday").modal('show'); var flag = true; //alert(brand1); /********validate all our form fields***********/ if(model1==""){ $('#model').css('border-color','red'); $('.model1').html('Empty Field'); flag = false; } if(brand1==""){ $('#brand').css('border-color','red'); $('.brand1').html('Empty Field'); flag = false; } if(flag) { $.ajax({ url:"edit_model.php", method:"POST", data:{model1:model1,brand1:brand1,model_id:model_id}, 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_model.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 brand 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 Sub Location</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_brand"> <div class="form-group"> <label>Location <span class="text-danger">*</span></label> <select class="form-control" name="brand" id="brand"> <option>Select Location</option> <?php $select1=$obj->fetch("SELECT * FROM brand"); foreach($select1 as $data) { ?> <option value="<?php echo $data['id']; ?>"><?php echo $data['brand']; ?></option> <?php } ?> </select> <span class="brand" style="color: red;"></span> </div> <div class="form-group"> <label>Sub Location<span class="text-danger">*</span></label> <input class="form-control" type="text" name="model" id="model" /> <span class="model" 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 brand 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 model = $("#model").val(); var brand = $("#brand").val(); var flag = true; /********validate all our form fields***********/ if (model == "") { $("#model").css("border-color", "red"); $(".model").html("Empty Field"); flag = false; } if (brand == "") { $("#brand").css("border-color", "red"); $(".brand").html("Empty Field"); flag = false; } if (flag) { $.ajax({ url: "add_model.php", method: "POST", data: { brand: brand, model: model }, 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() $("#brand").keyup(function () { $("brand").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>