JezK
Edit File: warehouse.php
<?php include("app/checkSession.php"); include("header.php"); // include_once("app/adminObj.php"); if(!isset($_SESSION['customer_user_id'])){ //$customerObj->redirect('login.php'); // commented on 27th dec sriram } // print_r($_SESSION); if(isset($_SESSION['customer_role']) &&$_SESSION['customer_role']!=''){ $roleId=$_SESSION['customer_role']; } // $count_query="select count(*) from uflexit_master_warehouse where warehouse_status=1"; // $totalCount=$customerObj->db->get_row($count_query); // print_r($totalCount['count']); $warehouseCity=$warehouseType=$warehouseCountry=''; $warehouseDetails=$customerObj->warehouseDetails($warehouseCity,$warehouseType,$warehouseCountry,0,5,$roleId); // print_r($warehouseDetails); $warehouseData = array(); if($warehouseDetails && isset($warehouseDetails[0])) { $totalCount=$warehouseDetails[0] ? $warehouseDetails[0]:0; } // echo $totalCount; if($warehouseDetails && isset($warehouseDetails[1])) { $warehouseData=$warehouseDetails[1] ? $warehouseDetails[1]:0; } $warehouseStorage=$customerObj->warehouseStorageType(); $warehouseServices=$customerObj->warehouseServicesType(); $warehousefeatures=$customerObj->warehouseFeaturesType(); $warehouseDeals = $customerObj->getWareHouseDeals(); // echo "<pre>"; // print_r($warehouseDetails); $warehouse_sql =""; $warehouseHtml=''; foreach($warehouseData as $warehouse){ $ratedStars=''; $rating= "" ; if(isset($warehouse['rating']) && $warehouse['rating'] > 0) { // echo "h";exit; $rating=round($warehouse['rating']); $select=""; $selected=''; $ratedStars=''; if($rating>=0){ for($i=1;$i<=$rating;$i++){ $select="select"; $selected='selected'; $ratedStars.='<button class="et-app-rating-star '.$select.'" data-star="1"> <i class="fa fa-star-o" aria-hidden="true"></i> <i class="fa fa-star '.$selected.'" aria-hidden="true"></i> <span class="et-app-sr">Rating: 1 star</span> </button>'; } for($j=1;$j<=(5-$rating);$j++){ $ratedStars.='<button class="et-app-rating-star " data-star="1"> <i class="fa fa-star-o" aria-hidden="true"></i> <span class="et-app-sr">Rating: 1 star</span> </button>'; } } } // echo $rating; if(isset($warehouse['warehouse_logo']) && isset($warehouse['warehouse_logo'])!='') { $imgPath = "uploads/warehouse_imgs/".$warehouse['warehouse_logo']; // echo $imgPath;exit; if(file_exists($imgPath)) { $image='<img src="./uploads/warehouse_imgs/'.$warehouse['warehouse_logo'].'" alt="image1" height="200px" width="200%">'; } else{ $image='<img src="pictures/img1.png" alt="image1" height="200px" width="200%"/>'; } } else{ $image='<img src="pictures/img1.png" alt="image1" height="200px" width="200%"/>'; } $onLineBooking= ''; if($warehouse['enable_online_booking']==1) { $onLineBooking= '<a class=" btn online-booking" > <i class="fa fa-circle now" style="color: #07ec07;"></i> <span>'.$lang['BOOK_NOW'].'</span> </a>'; } // echo $image;exit; $warehouseHtml.='<div class="card"> <div class="card-horizontal book"> <div class="img-square-wrapper pt-4 pb-3 pl-3 align-self-right col-sm-4"> <a href="warehouseDetails.php?id='.$warehouse['warehouse_id'].'"> <input type="hidden" value="'.$warehouse['warehouse_id'].'" class="warehouseId" /> '.$image.' </a> </div> <div class="card-body"> <div class="row"> <div class="col-sm-6 text-right"> </div> <div class="col-sm-6 text-right status-btn"> <a class=" btn request-btn" href="./req.php?id='.$warehouse['warehouse_id'].'"> '.$lang['REQUEST_QUOTE'].' </a> '.$onLineBooking.' </div> <div class="col-md-6 mt-2"> <h6 class = "warehouse pt-3"><b> '.$lang['WAREHOUSE_NAME'].'</b></h6> <p class = "pt-2 text-capitalize" style="color: black;"> '.$warehouse['warehouse_name'].'</p> </div> <div class="col-md-6 mt-2"> <h6 class = "location pt-3"><b> '. $lang['LOCATION'].'</b></h6> <img src="pictures/location.png" alt="" height="15px"> <label> <p class = "pt-2 text-capitalize"> '.$lang[$warehouse['city_lang_variable']].', '.$lang[$warehouse['lang_variables']].'</p> </label> </div> <div class="col-md-6"> <h6 class = "type pt-3 "><b> '.$lang['WAREHOUSE_ID'].' </b></h6> <p class = "pt-2 text-capitalize">'. $warehouse['warehouse_id'] .'</p> </div> <div class="col-md-6"> <h6 class = "type pt-3"><b> '. $lang['WAREHOUSE_TYPE'].' </b></h6> <p class = "pt-2 text-capitalize">'. $lang[$warehouse['lang_variable']].'</p> </div> </div> <div class="col-md-12 text-right d-flex justify-content-end rating-stars"> <div class="et-app-rating-stars" style="pointer-events:none;"> <input type="hidden" value='.$rating.'>'.$ratedStars.' </div> </div> </div> </div> </div>'; } // print_r($warehouseHtml);exit; $storage=$services=$features=$eproductwareHouseDeals=$products=$storage1=''; foreach($warehouseStorage as $storageType) { $storage.='<div class="form-check my-2"> <label class="ml-2"> '.$lang[$storageType['lang_variables']].' <input type="checkbox" class="form-check-input filterWareHouse storageTypeClass stortype'.$storageType['pricetype_id'].'" id="checkboxall" value='.$storageType['pricetype_id'].' > <span class="checkbox"></span> </label> </div>'; } foreach($warehouseStorage as $storageType) { $storage1.= '<div class="form-check d-inline my-2 col-6"> <label class="ml-2 "> '.$lang[$storageType['lang_variables']].' <input type="checkbox" class="form-check-input requestWareHouse storageTypeClass1 stype'.$storageType['pricetype_id'].'" id="checkboxall " name="storageType[]" value='.$storageType['pricetype_id'].'> <span class="checkbox1"></span> </label> </div>'; } if(count($warehousefeatures)>0) { $className=''; foreach($warehousefeatures as $featureType) { if($featureType['feature_id']==1){ $id='featuresCheckboxall'; $className='featuresTypeClass1'; }else{ $className='featuresTypeClass'; } if($featureType['feature_id']!=4) { $features.='<div class="form-check my-2"> <label class="form-check-label ml-2" for="featureTypeRadio'.$featureType['feature_id'].'"> <input type="checkbox" class="form-check-input filterWareHouse '.$className.'" id="featureTypeRadio'.$featureType['feature_id'].'" name="optradio" value='.$featureType['feature_id'].'> '.$lang[$featureType['lang_variables']].' <span class="checkbox"></span> </label> </div>'; } } } if(count($warehousefeatures)>0){ $className=''; foreach($warehouseServices as $servicesType){ if($servicesType['service_id']==1){ $id='servicesCheckboxall'; $className='servicesTypeClass1'; }else{ $className='servicesTypeClass'; } $services.='<div class="form-check my-2"> <label class="form-check-label ml-2" for="servicesTypeRadio'.$servicesType['service_id'].'"> <input type="checkbox" class="form-check-input filterWareHouse '.$className.' " id="servicesTypeRadio'.$servicesType['service_id'].'" name="optradio" value='.$servicesType['service_id'].'>'.$lang[$servicesType['lang_variables']].' <span class="checkbox"></span> </label> </div>'; } } if(count($warehousefeatures)>0){ $className=''; foreach($warehouseDeals as $productsType){ if($productsType['deal_id']==1){ $id='productsCheckboxall'; $className='productsTypeClass1'; }else{ $className='productsTypeClass'; } $products.='<div class="form-check my-2"> <label class="form-check-label ml-2" for="productDealsTypeRadio'.$productsType['deal_id'].'"> <input type="checkbox" class="form-check-input filterWareHouse '.$className.'" id="productDealsTypeRadio'.$productsType['deal_id'].'" name="optradio" value='.$productsType['deal_id'].'> '.$lang[$productsType['lang_variables']].' <span class="checkbox"></span> </label> </div>'; } } ?> <style> /* .card-text { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; max-width: 85px; font-size: 14px; } .book-now{ background:lightgreen; position:absolute; right:15px; top:20px; } .bg-list-color, .custom-template { border-top-left-radius: 10px !important; border-bottom-left-radius: 10px !important; } .custom-template{ top: 53% !important;} .menu-item-has-children .dropdown-toggle{ font-size:19px!important; font-family: 'Roboto'!important; } .first-position{ top: 20px; } */ /* .round { width: 10px; height: 10px; border-radius: 50px; background: #1ed114; } */ input[type="checkbox"]:checked ~ .checkbox { background-color: #2196F3; } .checkbox { position: absolute; top: 2px; left: 0px; height: 20px; width: 20px; background-color: #eee; border-radius: 12px; cursor: pointer; } input[type="checkbox"] { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; } :hover input ~ .checkbox { background-color: #ccc; } input[type="checkbox"]:checked ~ .checkbox:after { display: block; } .checkbox:after { left: 8px; top: 4px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .checkbox:after { content: ""; position: absolute; display: none; } /* pagination css */ #content{ padding: 15px; border: solid 1px #eee; max-width: 660px; margin: auto; border-radius: 4px; } ul.pagination.bootpag { justify-content: center; border-radius: 1px solid; } .pagination.bootpag li{ padding: 0px 10px; border-radius: 50% ; margin: 0px 4px; } .pagination li.active { background-color: #3663c8; } .pagination li:hover{ background-color: #fff; border:1px solid #3663c8; } .pagination li:hover a{ color:#000 !important; } li.prev,li.next { background: #fff; padding: 2px 8px !important; border-radius: 20px !important; box-shadow: 0px 1px 5px #3663c8; } .pagination li.active a { color:white ; } .pagination li a { line-height: 1.6em; } ul.sub-menu.children.dropdown-menu.features.bg-list-color.mb-3.pl-md-0.show { height: 200px; overflow-y: auto; } ul.sub-menu.children.dropdown-menu.storage.bg-list-color.mb-3.pl-md-0.show { height: 100px; overflow-y: auto; } ul.sub-menu.children.dropdown-menu.services.bg-list-color.pl-md-0.show, ul.sub-menu.children.dropdown-menu.features.bg-list-color.pl-md-0.show{ height: 200px; overflow-y: auto; } .detail{ color:black; } body{ overflow-x: hidden; } .col-sm-12.card.mt-1{ border:0px ; } .warehouse,.id,.type,.location{ color:#2f58c9; } .card-horizontal { display: flex; flex: 1 1 auto; } .checked{ content: "\f005"; color: #3663c8; } .uncheked{ -webkit-text-fill-color: white; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color:#3663c8; } .search::placeholder{ padding-left:20px !important; /* margin-left:25px !important; */ } .search{ background-image: url("pictures/search.png"); background-repeat: no-repeat; height:30px; /* padding-left:40px; */ background-position: right; background-origin:content-box; padding:17px;padding-left:10px;width:300px; font-size:13px; } .spantag{ position:absolute; } .et-app-sr { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important } .et-app-rating-stars { height: 3em; display: flex } .et-app-rating-star { background: none; border: none; box-shadow: none; font-size: 18px; cursor: pointer; } .et-app-rating-star .selected { display: none; color: #f90; } .et-app-rating-star.select i, .et-app-rating-star.highlight i { display: none } .et-app-rating-star.select .selected, .et-app-rating-star.highlight .selected { display: block } .et-app-rating-star:focus { outline: 1px solid #000 } .fa-star-o:before{ color: #ccc; } #searchValue { width: 100% !important; } .search_error{ font-size:12px; } .searchDay::placeholder ,.palletSearch::placeholder ,.spaceSearch::placeholder{ padding-left:10px !important; /* margin-left:25px !important; */ } .searchDay, .palletSearch , .spaceSearch { background-image: url("pictures/search.png"); background-repeat: no-repeat; height:30px; /* padding-left:40px; */ background-position: right; background-origin:content-box; /* padding:17px; */ padding-left:10px; width:225px; font-size:13px; } .navbar .navbar-nav li.menu-item-has-children.show .sub-menu { max-height: 145px !important; } .navbar { margin: 0 0 25px !important; } .nav-side .navbar-nav li>a { padding: 6px 0 !important; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } /* Firefox */ input[type=number] { -moz-appearance: textfield; } .reqWBtn { font-family: Barlow; font-style: normal; font-weight: normal; font-size: 14px; line-height: 16px; /* text-align: center; */ color: #3A3737; } .requWare { background: linear-gradient(90deg, #00C6FF 0%, #0072FF 100%); border-radius: 5px; width: 130px; padding:0px !important; } .reqtext1 { font-family: Roboto; font-style: normal; font-weight: normal; font-size: 16px; line-height: 14px; color: #0090FF; margin-bottom:5px !important; } .warehouseReq { padding-left:40px; } .right { float:left; /* margin:0 0 0 5px; */ width:52px; /* padding-left: 6px; */ } .left { float:left; width:220px; } </style> <!-- side block --> <link href="css/demo.css" type="text/css" rel="stylesheet"> <link href="css/header.css" type="text/css" rel="stylesheet"> <!-- side block --> <div class="container first-position"> <div class="container"> <div class="row px-md-2 px-0 my-3"> <div class="tophead col-md-12 halfWidth mobileTitle"> <h6> <?php echo $lang['WAREHOUSES']; ?> </h6> </div> <div class="tophead col-md-12 halfWidth text-right filterIcon"> <img src="images/filter.png" onclick="ShowFilter()" > </div> </div> </div> <div class="row"> <div class="col-md-4 warehouseReq container2"> <p class="reqtext1">Request for Warehouse</p> <div class="left"> <p class="reqWBtn">(If you cannot find your warehouse,<br>please request Uflexit to help you)</p> </div> <div class="right"> <img src="images/reqWarehouse.png" data-toggle="modal" data-target="#exampleModalCenter"></span> </div> <!-- <button type="button" class="btn btn-primary requWare" data-toggle="modal" data-target="#exampleModalCenter"> Request for warehouse </button> --> <!-- </p> --> </div> <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <!-- Add .modal-dialog-centered to .modal-dialog to vertically center the modal --> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <form action ="app/requestWarehouse.php" method="post"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <!-- <h5 class="mb-2">Request for warehouse</h5> --> <div class="row d-flex justify-content-around mb-2"> <div class="col-md-6"> <label for="inputLocation" class="inpt-label modColor">Select Country</label> <div class="input-container"> <select id="country" name="country" class="form-control frm-input" onchange="getcity(this.value);"> <option value="">Select Country</option> <?= $optionData;?> </select> <!-- <input type="text" id="location" name="location" value="" class="form-control frm-input" placeholder="Location" > --> <!-- <i class="fa fa-map-marker icon icon-display" id="icon1"></i> --> </div> <div class="error country_error"></div> </div> <div class="col-md-6"> <label for="inputEmaill" class="inpt-label modColor">City</label> <div class="input-container"> <select name="city" id="city" class="form-control frm-input" > <option value="">Select City</option> </select> </div> <div class="error city_error"></div> </div> </div> <div class="row"> <div class="col-12"> <label class="modColor"><?php echo $lang['STORAGE_TYPE'] ?></label> <div> <?php echo $storage1 ?> </div> <div class="error storage_error"></div> </div> </div> <div class="row "> <div class="col-6 palletDetails"> <label class="modColor"><?php echo $lang['PALLETS_REQUIRED']; ?></label> <div> <input type="text" name="palletReq" id="palletReq1" class="form-control"> </div> </div> <div class="col-6 spaceDetails"> <label class="modColor"><?php echo $lang['SPACE_REQUIRED_Sqmts']; ?></label> <div> <input type="text" name="spaceReq" id="spaceReq1" class="form-control"> </div> </div> </div> <div class="error storage_error1"></div> <div class="row d-flex justify-content-around mb-2"> <div class="col-md-6"> <label class="modColor"><?php echo $lang['FROM_DATE']; ?></label> <div class="input-container"> <input type="text" name="FromDate" id="fromdatepicker" class="form-control datepicker time_req Fromdatereq" autocomplete="off"> <div class="calendericon1"> <img src="images/Customer_croppings/calender.png"> </div> </div> <div class="error fromDate_error mt-3"></div> </div> <div class="col-md-6"> <label class="modColor"><?php echo $lang['TO_DATE']; ?></label> <div class="input-container"> <input type="text" name="Todatereq" id="todatepicker" class="form-control datepicker time_req Todatereq" onclick="return toDateFun()" autocomplete="off"> <div class="calendericon1"> <img src="images/Customer_croppings/calender.png"> </div> </div> <div class="error toDate_error mt-3"></div> </div> </div> <div class="row"> <div class="col-12"> <label class="modColor"><?php echo $lang['PRODUCT_WE_DEAL_WITH'];?></label> <div class="row m-2"> <?php echo $dealsCheckboxes;?> <div class="error product_error"></div> <span class="error deal_error"></span> <input type="hidden" name="dealsOrglength" id="dealsOrglength" value="<?php if(isset($dealsData) && count($dealsData)>0) echo count($dealsData); else 0; ?>"/> </div> </div> </div> <div class="row"> <div class="col-12"> <label class="modColor"><?php echo $lang['DESCRIPTION'] ?></label> <textarea class="form-control" rows="5" id="reqText" name="reqText"></textarea> <div class="error req_error"></div> </div> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary reqwarehouse" id="requestWarehouses" name="requestWarehouses" onclick= "return warehouseRequest()">Submit</button> </div> </form> </div> </div> </div> <div class="justify-content-end col-sm-8 pr-0 ipad-search"> <div class="form-inline col-offset-sm-3 col-sm-8 row justify-content-end mb-3 " style="display:absloute;"> <div class="col-sm-7 pr-0 search-field"> <input type="text" placeholder="<?php echo $lang['NAME_OR_LOCATION'] ?>" class=" search form-control" id="searchValue" onkeyup="filterReset(this.value)" > </div> <div class="col-sm-3 pr-0"> <button type="button" class=" btn py-2 filterSearch w-100" value="Search"> <?php echo $lang['SEARCH']; ?> </button> </div> <div class="col-sm-10 offset-sm-2 error search_error pt-2"></div> <!-- <div class="spantag"> <span><img src="pictures/search.png"></span> </div> --> </div> </div> </div> <div class="col-sm-9"> <div class="table-width"> <?php echo $warehouseHtml; ?> </div> <div class="row"> <div class="col-sm-12 "> <p id="pagination-here"></p> </div> </div> </div> <form method="post" class="font-small"> <div class="custom-template col-sm-3 pr-0 filterElement" id="filterContent"> <div class="custom-content"> <nav class="navbar navbar-expand-sm navbar-default nav-side"> <ul class="nav navbar-nav w-100"> <li class="menu-item-has-children dropdown bg-list-color px-2 mb-1 mt-2 show" > <a href="#" class="dropdown-toggle text-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $lang['STORAGE_TYPE'] ?></a> <ul class="sub-menu children dropdown-menu storage bg-list-color pl-md-0 show" > <form action="" class="font-small"> <?php echo $storage ?> </form> </ul> </li> <div class="daysCount1 bg-list-color w-100"> <input type="number" class="form-control pb-1 searchDay" placeholder="Search Days" id="searchDays" onkeyup="filterReset(this.value)"> </div> <div class="palletData1 bg-list-color w-100"> <input type="number" class="form-control pb-1 palletSearch mt-2" placeholder="Pallet" id="palletSearch" onkeyup="filterReset(this.value)"> </div> <div class="searchData1 bg-list-color w-100"> <input type="number" class="form-control pb-1 spaceSearch mt-2" placeholder="Space" id="spaceSearch" onkeyup="filterReset(this.value)"> </div> <li class="menu-item-has-children dropdown bg-list-color px-2 my-1"> <a href="#" class="dropdown-toggle text-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $lang['FEATURES'] ?></a> <ul class="sub-menu children dropdown-menu features bg-list-color pl-md-0"> <form action="" class="font-small"> <?php echo $features ?> </form> </ul> </li> <li class="menu-item-has-children dropdown bg-list-color px-2 my-1"> <a href="#" class="dropdown-toggle text-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $lang['SERVICES'] ?></a> <ul class="sub-menu children dropdown-menu services bg-list-color pl-md-0"> <form action="" class="font-small"> <?php echo $services ?> </form> </ul> </li> <li class="menu-item-has-children dropdown bg-list-color px-2 my-1"> <a href="#" class="dropdown-toggle text-primary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $lang['PRODUCT_WE_DEAL_WITH'] ?></a> <ul class="sub-menu children dropdown-menu features bg-list-color pl-md-0"> <form action="" class="font-small"> <?php echo $products ?> </form> </ul> </li> </ul> <div class="error filter_error"></div> </nav> <input class="btn btn-primary filterSubmit" type="button" value="<?php echo $lang['FILTER']?>"></input> </div> </div> </form> <!-- <div class="custom-toggle d-md-none d-block"> <i class="fa fa-bars mt-2 pt-1 btn btn-primary">Button</i> </div> --> </div> <!-- footer --> <?php include("footer.php"); ?> <script src="https://cdn.rawgit.com/botmonster/jquery-bootpag/master/lib/jquery.bootpag.min.js"></script> <!-- <script src="js/jquery.min.js"></script> --> <!-- <script src="js/jquery.pagination.min.js"></script> --> <!-- <script src="js/jquery.min.js"></script> --> <!-- <script src="js/jquery.pagination.min.js"></script> --> <!----> <script> var filterInput = 1; let $ = jQuery; var total_count; total_count= <?php echo $totalCount ?>; var page_count=Math.ceil(total_count/5); function initPagination(){ $('#pagination-here').bootpag({ total:page_count, page:1, maxVisible: page_count, leaps: true, // href: "#result-page-{{number}}", }) var prev='<?php echo $lang['PREV']; ?>'; var next='<?php echo $lang['NEXT']; ?>'; $( ".prev a" ).replaceWith(prev); $( ".next a" ).replaceWith(next); } $(document).ready(function () { $('.daysCount1').hide(); $('.palletData1').hide(); $('.searchData1').hide(); }); $(document).on('click', '.stortype2', function() { if( $(".stortype2").prop('checked') == true ) { // $('.daysCount1').show(); $('.palletData1').show(); $('.palletSearch').val(''); $('.searchDay').val(''); } else if($(".stortype2").prop('checked') == false) { // $('.daysCount1').hide(); $('.palletData1').hide(); $('.palletSearch').val(''); $('.searchDay').val(''); } }); $(document).on('click', '.stortype3', function() { if( $(".stortype3").prop('checked') == true ) { // $('.daysCount1').show(); $('.searchData1').show(); $('.spaceSearch').val(''); $('.searchDay').val(''); } else if($(".stortype3").prop('checked') == false ) { // $('.daysCount1').hide(); $('.searchData1').hide(); $('.spaceSearch').val(''); $('.searchDay').val(''); } }); $(".stortype2, .stortype3").click(function(){ if( ($(".stortype2").prop('checked') == true) || ($(".stortype3").prop('checked') == true)) { $('.daysCount1').show(); } else { $('.daysCount1').hide(); } }); $(document).on('click', '.stype2', function() { if( $(".stype2").prop('checked') == true ) { $('.palletDetails').show(); } else if($(".stype2").prop('checked') == false) { $('.palletDetails').hide(); } }); $(document).on('click', '.stype3', function() { if( $(".stype3").prop('checked') == true ) { $('.spaceDetails').show(); } else if($(".stype3").prop('checked') == false ) { $('.spaceDetails').hide(); } }); $('.filterSubmit').click(function(){ var checkboxLength= $('.filterWareHouse:checked').length; var storageLength = $('.storageTypeClass:checked').length; var storageValue = $('.storageTypeClass:checked').val(); // var days = $('#searchDays').val(); if(checkboxLength==0){ $('.filter_error').html('<?php echo $lang['PLEASE_PROVIDE_INPUT']; ?>') } else{ Filter() $('.filter_error').html('') var x = document.getElementById("filterContent"); if (window.matchMedia("(max-device-width: 767px)").matches) { x.style.display="none"; } } }) $('.filterSearch').click(function(){ var searchInput= document.getElementById('searchValue').value; if(searchInput==''){ $('.search_error').html('<?php echo $lang['PLEASE_ENTER_NAME_LOCATION_TO_PROCEED_FURTHER']; ?>'); $('#searchValue').focus(); }else{ Filter() $('.search_error').html(''); $('#searchValue').focus(); } }) $(document).ready(function () { $("#featureTypeRadio1").click(function () { $(".featuresTypeClass").prop('checked', $(this).prop('checked')); filterInput = 0; }); $('.featuresTypeClass').click(function (){ if($(this).prop('checked')==false){ $('#featureTypeRadio1').prop('checked', false) filterInput = 1; } if($('.featuresTypeClass:checked').length==$('.featuresTypeClass').length){ $('#featureTypeRadio1').prop('checked', true) filterInput = 0; } }) }) function filterReset(e){ if(e==''){ Filter() initPagination() } } function Filter(){ var roleId=<?php echo $roleId ?>; var searchInput= document.getElementById('searchValue').value; var searchDays = document.getElementById('searchDays').value; var palletNum = document.getElementById('palletSearch').value; var spaceNum = document.getElementById('spaceSearch').value; if(searchInput == "" && searchDays == "" && palletNum == "") { filterInput = 1; } else { filterInput = 0; } jQuery.ajax({ type:"POST", url:'ajax.php', data:({action:'get_warehouses',feature_ids:featuresArray.toString(),storage_ids:storageArray.toString(),services_ids:servicesArray.toString(),deals_ids:productsArray.toString(),searchKey:searchInput,searchData:searchDays,palletData:palletNum,spaceData:spaceNum,minValue:0,maxValue:5,role_id:roleId,filterInput:filterInput}), success:function(data){ // console.log( JSON.parse(data)) data = JSON.parse(data) jQuery('.table-width').html(data.warehoseData); $('.search_error').html(''); // console.log(data.count); total_count=data.totalCount; page_count=Math.ceil(total_count/5); // console.log(page_count); // console.log(total_count) $("#pagination-here").show() if(total_count==0 && page_count==0){ $("#pagination-here").hide() } initPagination() } }) } $(document).on('keypress',function(e) { if(e.which == 13) { Filter() } }); // services checkboxes $(document).ready(function () { $("#servicesTypeRadio1").click(function () { $(".servicesTypeClass").prop('checked', $(this).prop('checked')); filterInput = 0; }); $('.servicesTypeClass').click(function (){ if($(this).prop('checked')==false){ $('#servicesTypeRadio1').prop('checked', false); filterInput = 1; } if($('.servicesTypeClass:checked').length==$('.servicesTypeClass').length){ $('#servicesTypeRadio1').prop('checked', true) filterInput = 0; } }) }) //product deals checkboxes $(document).ready(function () { $("#productDealsTypeRadio1").click(function () { $(".productsTypeClass").prop('checked', $(this).prop('checked')); filterInput = 0; }); $('.productsTypeClass').click(function (){ if($(this).prop('checked')==false){ $('#productDealsTypeRadio1').prop('checked', false); filterInput = 1; } if($('.productsTypeClass:checked').length==$('.productsTypeClass').length){ $('#productDealsTypeRadio1').prop('checked', true) filterInput = 0; } }) }) $(document).ready(function() { var toggle_customSidebar = false, custom_open = 0; if (!toggle_customSidebar) { var toggle = $('.custom-template .custom-toggle'); toggle.on('click', (function() { if (custom_open == 1) { $('.custom-template').removeClass('open'); toggle.removeClass('toggled'); custom_open = 0; } else { $('.custom-template').addClass('open'); toggle.addClass('toggled'); custom_open = 1; } })); toggle_customSidebar = true; } $('.nav-toggle').click(function () { var collapse_content_selector = $(this).attr('href'); var toggle_switch = $(this); $(collapse_content_selector).toggle(function () { if ($(this).css('display') == 'none') { toggle_switch.html('View All'); } else { toggle_switch.html('Hide'); } }); }); initPagination(); //page click action $('#pagination-here').on("page", function(event, num){ //show / hide content or pull via ajax etc // $("#content").html("Page " + num); // alert(num); var searchInput= document.getElementById('searchValue').value; var searchDays = document.getElementById('searchDays').value; var palletNum = document.getElementById('palletSearch').value; var spaceNum = document.getElementById('spaceSearch').value; if(searchInput == "" && searchDays == "" && palletNum == "") { filterInput = 1; } else { filterInput = 0; } var roleId=<?php echo $roleId ?>; var min=num*5-5; jQuery.ajax({ type:'post', url:'ajax.php', data:({action:'get_warehouses',feature_ids:featuresArray.toString(),storage_ids:storageArray.toString(),services_ids:servicesArray.toString(),deals_ids:productsArray.toString(),searchKey:searchInput,searchData:searchDays, palletData:palletNum,spaceData:spaceNum,minValue:min,maxValue:5,role_id:roleId,filterInput:filterInput}), success:function(data1){ data1 = JSON.parse(data1) // console.log(data1.warehoseData,'data1') jQuery('.table-width').html(data1.warehoseData); } }) }); if (window.matchMedia("(max-device-width: 767px)").matches) { // modify dom // alert("hello") var x = document.getElementById("filterContent"); x.style.display="none"; } }); //findwarehouse function // function filterWareHouse(id){ var featuresArray=[]; var servicesArray=[]; var storageArray=[]; var productsArray=[]; $('.filterWareHouse').change(function (){ if($(".filterWareHouse:checked").length == 0) { featuresArray = [] servicesArray = [] storageArray = [] productsArray = [] Filter() initPagination() } if($(this).hasClass('featuresTypeClass') || $(this).hasClass('featuresTypeClass1')) { if($(this).prop('checked')==true && $(this).val() ==1 ){ featuresArray.push("'"+1+"'") $('.featuresTypeClass').each(function () { featuresArray.push("'"+$(this).val()+"'") }) } else if($(this).prop('checked')==false && $(this).val() ==1 ){ featuresArray=[] } else if($(this).prop('checked')==true){ featuresArray.push("'"+$(this).val()+"'") } else if($(this).prop('checked')==false){ var indexVal= featuresArray.findIndex(element=>{ return element=="'"+$(this).val()+"'" }) featuresArray.splice(indexVal,1) } // console.log(featuresArray,"featuresArray") } else if($(this).hasClass('servicesTypeClass') || $(this).hasClass('servicesTypeClass1')){ if($(this).prop('checked')==true && $(this).val() ==1 ){ servicesArray.push("'"+1+"'") $('.servicesTypeClass').each(function () { servicesArray.push("'"+$(this).val()+"'") }) } else if($(this).prop('checked')==false && $(this).val() ==1 ){ servicesArray=[] } else if($(this).prop('checked')==true ){ servicesArray.push("'"+$(this).val()+"'") } else if($(this).prop('checked')==false){ var indexVal1= servicesArray.findIndex(element=>{ return element=="'"+$(this).val()+"'" }) servicesArray.splice(indexVal1,1) } // console.log(servicesArray,"servicesArray123") } else if($(this).hasClass('storageTypeClass')){ if($(this).prop('checked')==true){ storageArray.push("'"+$(this).val()+"'") } else if($(this).prop('checked')==false){ var indexVal1= storageArray.findIndex(element=>{ return element=="'"+$(this).val()+"'" }) storageArray.splice(indexVal1,1) } // console.log(storageArray,"storageArray") } else if($(this).hasClass('productsTypeClass') || $(this).hasClass('productsTypeClass1')){ if($(this).prop('checked')==true && $(this).val() ==1 ){ // alert(productsArray); productsArray.push("'"+1+"'") $('.productsTypeClass').each(function () { productsArray.push("'"+$(this).val()+"'") }) } else if($(this).prop('checked')==false && $(this).val() ==1 ){ productsArray=[] } else if($(this).prop('checked')==true ){ productsArray.push("'"+$(this).val()+"'") } else if($(this).prop('checked')==false){ var indexVal1= productsArray.findIndex(element=>{ return element=="'"+$(this).val()+"'" }) productsArray.splice(indexVal1,1) } // alert(productsArray); console.log(productsArray,"productsArray") } }) // $('.filterSearch').click(function(){ // var searchInput= document.getElementById('searchValue').value; // jQuery.ajax({ // type:"POST", // url:'ajax.php', // data:({action:'filterSearch',searchKey:searchInput}), // success:function(data){ // jQuery('.table-width').html(data); // } // }) // }) // } $('.card-horizontal').click(function(){ let warehouseId = $(this).closest('.card-horizontal').find(".warehouseId").val(); window.open('warehouseDetails.php?id='+warehouseId, '_self'); }) $('[data-star]').on('click', function(e) { e.preventDefault(); $(this).addClass('select'); $(this).prevAll('[data-star]').addClass('select'); $(this).nextAll('[data-star]').removeClass('select'); $(this).parent().find('input').val($(this).data('star')); }); $('[data-star]').on('mouseover', function(e) { e.preventDefault(); $(this).addClass('highlight'); $(this).prevAll('[data-star]').addClass('highlight'); $(this).nextAll('[data-star]').removeClass('highlight'); }); $('[data-star]').on('mouseout', function(e) { e.preventDefault(); $(this).removeClass('highlight'); $(this).prevAll('[data-star]').removeClass('highlight'); }); function ShowFilter(){ var x = document.getElementById("filterContent"); // console.log(x.style.display,"style") if (x.style.display ==="none") { x.style.display = "block"; } else { x.style.display = "none"; } } // function searchFilter(e){ // if(e==''){ // Filter() // initPagination() // } // } // function daysFilter(){ // var roleId=<?php echo $roleId ?>; // var searchInput= document.getElementById('searchDays').value; // jQuery.ajax({ // type:"POST", // url:'ajax.php', // data:({action:'get_warehousesdata',feature_ids:featuresArray.toString(),storage_ids:storageArray.toString(),services_ids:servicesArray.toString(),deals_ids:productsArray.toString(),searchKey:searchInput,minValue:0,maxValue:5,role_id:roleId}), // success:function(data){ // // console.log( JSON.parse(data)) // data = JSON.parse(data) // jQuery('.table-width').html(data.warehoseData); // // console.log(data.count); // total_count=data.totalCount; // page_count=Math.ceil(total_count/5); // // console.log(page_count); // // console.log(total_count) // $("#pagination-here").show() // if(total_count==0 && page_count==0){ // $("#pagination-here").hide() // } // initPagination() // } // }) // } if(performance.navigation.type == 2){ location.reload(true); } </script>