JezK
Edit File: header.php
<!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Uflexit</title> <meta name="description" content="Uflext"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@100;200;300;400;500&display=swap" rel="stylesheet"> <link rel="icon" href="images/fav.png" type="image/gif" sizes="16x16"> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"> <link rel="stylesheet" href="css/font-awesome.css" type="text/css"> <link rel="stylesheet" href="css/themify-icons.css" type="text/css"> <link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css" type="text/css"> <link rel="stylesheet" href="css/style.css" type="text/css"> <link rel="stylesheet" href="css/header.css" type="text/css"> <link rel="stylesheet" href="css/jquery.dataTables.min.css" type="text/css" /> <link rel="stylesheet" href="css/ownstyles.css" type="text/css"> <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@100&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;1,300&display=swap" rel="stylesheet"> <script src="js/validations.js"></script> <style> .checkbox1 { position: absolute; top: 2px; left: 5px; height: 20px; width: 20px; background-color: #eee; border-radius:12px; cursor:pointer; } :hover input ~ .checkbox1 { background-color: #ccc; } /* When the checkbox is checked, add a blue background */ input[type="checkbox"]:checked ~ .checkbox1 { background-color: #2196F3; } /* Create the checkmark/indicator (hidden when not checked) */ .checkbox1:after { content: ""; position: absolute; display: none; } /* Show the checkmark when checked */ input[type="checkbox"]:checked ~ .checkbox1:after { display: block; } /* Style the checkmark/indicator */ .checkbox1:after { left: 8px; top: 5px; width: 5px; height: 10px; border: solid white; border-width: 0 3px 3px 0; -webkit-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); } .storageCheckbox { font-size:small; } .modColor { color:#3663c8; font-weight: 500; } /* .requWare { background: linear-gradient(90deg, #00C6FF 0%, #0072FF 100%); border-radius: 5px; width: 188px; } */ .tag_line { font-size: 12px; padding-top: 5px; font-weight: bold; color: #CECECE; margin:0 !important; line-height:18px !important; } </style> </head> <?php // print_r($_SESSION); // exit; // language translation logic include("app/adminObj.php"); if($_SESSION['customer_languageStatus'] ==2) { $_SESSION['customer_languageStatus'] = 2; include('lang.ar.php'); $chcked = "checked"; $colorValue=2; } else{ $_SESSION['customer_languageStatus'] = 1; include('lang.es.php'); $chcked = ""; $colorValue=1; } if(isset($_SESSION['customer_token'])){ $res = $customerObj->isValidApiKey($_SESSION['customer_token']); if($res == "" || !$res){ echo '<script>alert("Some one Login with your Account")</script>'; echo '<script>location.replace("./login.php")</script>'; session_destroy(); } } $countryList=$customerObj->getCountryList(); $optionData=''; foreach($countryList as $val) { $optionData.= '<option class="text-capitalize" value='.$val['country_id'].' class="text-capitalize">'.$val['display_name'].'</option>'; } $id =1; if (isset($_REQUEST['id'])) { $id=$_REQUEST['id']; } $storage = $dealsCheckboxes =""; $warehouseStorage=$customerObj->warehouseStorageType(); // print_r($warehouseStorage);exit; foreach($warehouseStorage as $storageType) { $storage.= '<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>'; } $dealsData=$customerObj->getWareHouseDeals(); if(isset($dealsData) && count($dealsData)>0) { foreach($dealsData as $prodType) { $activeClass=''; if($prodType['deal_id']==1) { $id='productsDealCheckboxall'; $className='productsDealTypeClass1'; } else $className='productsDealTypeClass'; if(isset($whmetadata) && count($whmetadata)>0 && in_array($v['deal_id'],$eproductwareHouseDeals)) { $activeClass="checked"; } $dealsCheckboxes.='<div class="col-lg-4 col-md-6 col-sm-12 mt-2 pl-4"> <label class="form-check-label ml-2" for="productType'.$prodType['deal_id'].'"> <input type="checkbox" class="form-check-input requestWareHouse '.$className.'" id="productType'.$prodType['deal_id'].'" name="productreqwareHouseDeals[]" value='.$prodType['deal_id'].'> '.$lang[$prodType['lang_variables']].' <span class="checkbox1"></span> </label> </div>'; } } //~ print_r($res); // if(isset($_SESSION['lang']) && $_SESSION['lang']!=''){ // $lang=$_SESSION['lang']; // } // else{ // $lang='en'; // } // switch ($lang) { // case 'en': // $lang_file = 'lang.es.php'; // break; // case 'ar': // $lang_file = 'lang.ar.php'; // break; // default: // $lang_file = 'lang.es.php'; // } // echo $_SESSION['customer_languageStatus']; // if(isset($_REQUEST['action']) && $_REQUEST['action'] =='changelang') // { // $lang =$_REQUEST['lang']; // // echo $lang; // if($lang ==1) // { // $_SESSION['customer_languageStatus'] =1; // } // if($lang ==2){ // $_SESSION['customer_languageStatus'] =2; // } // } // include_once $lang_file; // echo $lang['BUSINESS_LOGIN']; if(!isset($_SESSION['customer_user_id'])){ header("Location: ./login.php"); } if((isset($_SESSION['customer_user_id']) && ($_SESSION['customer_role']!='3' && $_SESSION['customer_role']!='4' )) ) { header("Location: ./login.php"); } if(isset($_SESSION['customer_token'])){ $res = $customerObj->isValidApiKey($_SESSION['customer_token']); if($res == "" || !$res){ echo '<script>alert('.$lang['SOME_ONE_LOGIN_WITH_YOUR_ACCOUNT'].')</script>'; echo '<script>location.replace("./login.php")</script>'; session_destroy(); } } $userId=0; // print_r($_SESSION);exit; if(isset($_SESSION['customer_user_id']) && $_SESSION['customer_user_id']!=''){ $userId=$_SESSION['customer_user_id']; } $page=basename($_SERVER['PHP_SELF']); $w_act = $d_act = $a_act= $u_act = $q_act = $r_act = $p_act = ""; $d_image = "images/Customer_croppings/Dashboard.png"; $w_image ="images/Customer_croppings/Warehouses.png"; $a_image = "images/Customer_croppings/ASN.png"; $u_image = "images/Customer_croppings/Usermanagement.png"; $q_image ="images/Customer_croppings/QuotationList.png"; $r_image = "images/Customer_croppings/Ratings.png"; $p_image = "images/Customer_croppings/Change_Password.png"; if($page =='warehouse.php') { $w_act = "active"; $w_image ="images/Customer_croppings/Warehouses_selected.png"; } if($page =='dashboard.php' || $page =='yourstock.php' || $page =='invoice.php' || $page =='shipment.php') { $d_act = "active"; $d_image ="images/Customer_croppings/Dashboard_selected.png"; } if($page =='quotelist.php') { $q_act = "active"; $q_image ="images/Customer_croppings/Quotationlist_selected.png"; } if($page =='asn.php') { $a_act = "active"; $a_image ="images/Customer_croppings/ASN_selected.png"; } if($page =='usermng.php') { $u_act = "active"; $u_image ="images/Customer_croppings/Usermanagement_selected.png"; } if($page =='ratings.php') { $r_act = "active"; $r_image ="images/Customer_croppings/Ratings_selected.png"; } if( $page=="change_password.php") { $p_act = "active"; $p_image ="images/Customer_croppings/Change_Password_selected.png"; } ?> <body> <form action="app/setsession.php" method="POST" id="langchangeform"> <input type="hidden" name="lang" id="langValue"> <input type="hidden" name="action" value ="changelang" > </form> <div class="preloader"> <div id="preloderstatus"> </div> </div> <!-- Left Panel --> <aside id="left-panel" class="left-panel"> <nav class="navbar navbar-expand-sm navbar-default"> <div class="navbar-header"> <button class="navbar-toggler ipadMenu" type="button" data-toggle="collapse" data-target="#main-menu" aria-controls="main-menu" aria-expanded="false" aria-label="Toggle navigation"> <i class="fa fa-bars"></i> </button> <a class="navbar-brand" href="./warehouse.php"> <img src="images/loginlogo.png" alt="Logo" class="d-md-block d-none"> <img src="images/mobile_logo.png" alt="Logo" class="d-md-none d-block"> </a> <a class="navbar-brand hidden" href="#"><img src="images/loginlogo.png" alt="Logo"></a> </div> <div id="main-menu" class="main-menu collapse navbar-collapse w-100"> <ul class="nav navbar-nav w-100"> <?php if(isset($_SESSION['customer_user_id']) && (int)$_SESSION['customer_user_id']){?> <li class="list-item mt-4 <?php echo $w_act;?>"> <!-- <a href="warehouse.php"> --> <a href="warehouse.php"> <img class="" src="<?php echo $w_image ;?>"><?php echo $lang['WAREHOUSES'];?> </a> </li> <li class="list-item mt-4 <?php echo $d_act;?>"> <a href="dashboard.php"><img src="<?php echo $d_image ;?>"><?php echo $lang['DASHBOARD']; ?> </a> </li> <li class="list-item mt-4 <?php echo $q_act;?>"> <a href="quotelist.php"><img src="<?php echo $q_image ;?>"><?php echo $lang['QUOTATION_LIST']; ?> </a> </li> <li class="list-item mt-4 <?php echo $a_act;?>"> <a href="asn.php"><img src="<?php echo $a_image ;?>"> <?php echo $lang['ASN']; ?> </a> </li> <li class="list-item mt-4 <?php echo $u_act;?>"> <a href="usermng.php"><img src="<?php echo $u_image ;?>"> <?php echo $lang['USER_MANAGEMENT']; ?> </a> </li> <li class="list-item mt-4 <?php echo $p_act;?>"> <a href="change_password.php"><img src="<?php echo $p_image ;?>"> <?php echo $lang['CHANGE_PASSWORD']; ?> </a> </li> <li class="list-item mt-4 <?php echo $r_act;?>"> <a href="ratings.php"> <img class="" src="<?php echo $r_image ;?>"> <?php echo $lang['RATING']; ?> </a> </li> <li class="list-item mt-4"> <a onclick="LogOut()"><img src="images/Customer_croppings/logout.png"> <?php echo $lang['LOGOUT']; ?> </a> </li> <?php } ?> </ul> </div><!-- /.navbar-collapse --> </nav> </aside><!-- /#left-panel --> <!-- Left Panel --> <!-- Right Panel --> <div id="right-panel" class="right-panel"> <!-- Header--> <header id="header" class="header"> <div class="header-menu align-items-center"> <div class="col-sm-2"> <a id="menuToggle" class="menutoggle pull-left"><i class="fa fa fa-chevron-left"></i></a> <?php if ($page=='yourstock.php' || $page=='invoice.php' || $page=='shipment.php'){ ?> <a href="dashboard.php" class="pl-md-4 pl-0 pr-3 pr-md-0 position-relative" style="z-index:9"><img src="images/Customer_croppings/back_main.png"></a> <?php } ?> </div> <div class="col-sm-7 reqWare text-right" > <!-- <div class="col-sm-6"> <button type="button" class="btn btn-primary requWare" data-toggle="modal" data-target="#exampleModalCenter"> Request for warehouse </button> <p class="tag_line">(if you cannot find your warehouse,<br>please request Uflexit to help you)</p> </div> --> <div class="role-selector"> <span class="" id="English" style="color: blue;">English </span> <label class="switch"> <input type="checkbox" id="lang_val" value="" <?php echo $chcked; ?>> <span class="slider round"></span> </label> <span class="" id="Arabic" style="color: grey;">Arabic </span> </div> </div> <?php if(isset($_SESSION['customer_user_id']) && (int)$_SESSION['customer_user_id']){?> <div class="col-sm-1 px-md-0 px-3 b-right header-left d-flex justify-space"> <div class="dropdown for-notification"> <button class="btn btn-secondary dropdown-toggle" type="button" id="notification" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img src="images/notifications.png"> <span class="count " id="count"></span> </button> <div class="dropdown-menu bg-white scroll-y notifications" aria-labelledby="notification"> </div> </div> </div> <?php } ?> <div class="col-sm-2 pl-md-3 header-left d-flex justify-content-md-start pl-3 "> <div class="user-area dropdown "> <a href="usermng.php" class="dropdown-toggle d-flex"> <?php if (isset($_SESSION['customer_user_id']) && (int)$_SESSION['customer_user_id']) { ?> <img class="user-avatar rounded-circle" src="<?php if(isset($_SESSION['customer_image']) && !empty($_SESSION['customer_image'])) echo 'uploads/subadmin_photos/'.$_SESSION['customer_image']; else echo 'images/userIcon.jpg';?>" alt="User"> <span class="logged-in">●</span> <span class="pl-2 author-name" id="author-name"><?php echo $_SESSION['customer_name'];?></span> <?php } else {/* ?> <img class="user-avatar rounded-circle" src="images/profile.png" alt="User Avatar"> <span class="logged-in">●</span> <span class="pl-2 author-name">Thomas</span> <?php */ } ?> </a> <!-- <div class="user-menu dropdown-menu"> <a class="nav-link" href="usermng.php"><i class="fa fa-user"></i> My Profile</a> <a class="nav-link" href="notifications.php"><i class="fa fa-user"></i> Notifications <span class="count">13</span></a> <a class="nav-link" href="settings.php"><i class="fa fa-cog"></i> Settings</a> <a class="nav-link" href="#"><i class="fa fa-power-off"></i> Logout</a> </div> --> </div> </div> </div> </header><!-- /header --> <!-- Header--> <script src="js/jquery.min.js" type="text/javascript"></script> <script> var langColor=<?php echo $colorValue; ?>; if(langColor==2){ $('#Arabic').addClass('arabicColor') }else if(langColor==1){ $('#English').addClass('englishColor') } // function checkYesNo(event) { // if (document.getElementById('toggle').checked) { // document.getElementById('Arabic').style.color = 'blue'; // document.getElementById('English').style.color = 'grey'; // } else { // document.getElementById('English').style.color = 'blue'; // document.getElementById('Arabic').style.color = 'grey'; // } // } function notification(minVal) { // alert("hello") var userId = <?php echo $userId?>; jQuery.ajax({ url: 'ajax.php', type: 'post', data: ({ action: 'getNotifications', userid: userId, min:minVal }), success: function(response) { var data = JSON.stringify(response); // console.log(data.count); $(".notifications").append(data.notificationData); if(data.count>0){ $("#count").addClass("bg-danger"); document.getElementById('count').innerHTML = data.count; } // console.log(data1.length); } }) } $(document).ready(function() { notification(0); $('.palletDetails').hide(); $('.spaceDetails').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(); } }); // var interval = 1000 * 5; // setInterval(function(){ // notification(0)}, interval); function myfunction(id){ jQuery.ajax({ url:'ajax.php', type:'post', data:({action:'notificationStatusUpdate',data:id}), success:function(response){ } }) // alert(id) } $(function() { $('.notifications').scroll(function() { if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { var limitStart = $(".cardLength").length; console.log(limitStart) notification(limitStart) } }) }) function LogOut(){ if(confirm("<?php echo $lang['ARE_YOU_SURE_WANT_TO_LOGOUT'] ?>")){ window.location.href ="logout.php"; } } /* function for automatic logout after 90 min */ var timeSinceLastMove = 0; $(document).mousemove(function() { timeSinceLastMove = 0; }); $(document).keyup(function() { timeSinceLastMove = 0; }); checkTime(); function checkTime() { timeSinceLastMove++; if (timeSinceLastMove > 90 * 60) { window.location = "app/logout.php"; } setTimeout(checkTime, 1000); } function getcity(country_id){ jQuery.ajax({ type: "POST", url: 'ajax.php', data: ({action:'get_cities',country_id:country_id}), success: function(data) { jQuery('#city').html(data); } }); } $ = jQuery; //product deals checkboxes $(document).ready(function () { $("#productType1").click(function () { $(".productsDealTypeClass").prop('checked', $(this).prop('checked')); }); $('.productsDealTypeClass').click(function (){ if($(this).prop('checked')==false){ $('#productType1').prop('checked', false) } if($('.productsDealTypeClass:checked').length == $('.productsDealTypeClass').length){ $('#productType1').prop('checked', true) } }) }) $(document).ready(function(){ $(function () { $('#fromdatepicker').datetimepicker({ format:'MM-DD-YYYY', locale: 'en', minDate:new Date(), }); }) }) $(document).ready(function(){ $(function () { $('#todatepicker').datetimepicker({ format: 'MM-DD-YYYY', minDate:new Date(), }).on('dp.change',function(e){ $('.Fromdatereq').html(''); date = moment($('#fromdatepicker').val(), 'MM-DD-YYYY') $('#todatepicker').data("DateTimePicker").minDate(date); // $('#todatepicker').val(''); }); }) }) $('.requestWareHouse').change(function (){ if($(".requestWareHouse:checked").length == 0) { storageArray = [] productDealArray = [] } if($(this).hasClass('storageTypeClass1')){ 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") } if($(this).hasClass('productsDealTypeClass') || $(this).hasClass('productsDealTypeClass')){ if($(this).prop('checked')==true && $(this).val() ==1 ){ productDealArray.push("'"+1+"'") $('.productsDealTypeClass').each(function () { productDealArray.push("'"+$(this).val()+"'") }) } else if($(this).prop('checked')==false && $(this).val() ==1 ){ productDealArray=[] } else if($(this).prop('checked')==true ){ // alert($(this).val()); productDealArray.push("'"+$(this).val()+"'") } else if($(this).prop('checked')==false){ var indexVal1= productDealArray.findIndex(element=>{ return element=="'"+$(this).val()+"'" }) productDealArray.splice(indexVal1,1) } // console.log(productDealArray,"productDealArray1") } }) </script>