JezK
Edit File: header.php
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); include("app/adminObj.php"); if(!isset($_SESSION['user_id'])){ header("Location: ../owner_login.php"); } if((isset($_SESSION['user_id'])) && ($_SESSION['role']!='1' && $_SESSION['role']!='2')) { header("Location: ../owner_login.php"); } if(isset($_SESSION['user_id'])) { $userDetails=$wareHouseAdminObj->fetchLoginAdminDetails($_SESSION['user_id']); //~ echo $_SESSION['token']; $res = $wareHouseAdminObj->isValidApiKey($_SESSION['token']); //~ print_r($res); if($res == "" || !$res){ echo '<script>alert("Some one Login with your Account")</script>'; echo '<script>location.replace("../owner_login.php")</script>'; session_destroy(); } // if(isset($_REQUEST['action']) && $_REQUEST['action'] =='changelang') // { // $lang =$_REQUEST['lang']; // // echo $lang; // if($lang ==1) // { // $_SESSION['languageStatus'] =1; // } // if($lang ==2){ // $_SESSION['languageStatus'] =2; // } // } if($_SESSION['languageStatus'] ==2) { $_SESSION['languageStatus'] = 2; include('lang.ar.php'); $chcked = "checked"; $colorValue=2; } else{ $_SESSION['languageStatus'] = 1; include('lang.es.php'); $chcked = ""; $colorValue=1; } } ?> <!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="Uflexit"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="apple-touch-icon" href="apple-icon.png"> <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/buttons.dataTables.min.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,300;0,400;0,700;1,300&display=swap" rel="stylesheet"> <link rel="stylesheet" href="css/ownstyles.css" type="text/css"> <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'> </head> <?php $page =basename($_SERVER['PHP_SELF']); $d_act = $c_act = $u_act = $ef_act = $p_act = $t_act = $i_act = $w_act= $q_act= $s_act= $cc_act= $mywarehouse_act = $addWarehouse_act = $warehouse_act = $ep_act = ""; $d_image = "images/Dashboard.png"; $c_image = "images/user_management.png"; $ef_image = "images/Invoices.png"; $p_image = "images/Change_Password.png"; $w_image = "images/Warehouses.png"; $q_image = "images/QuotationList.png"; $t_image = "images/QuotationList.png"; $i_image = "images/QuotationList.png"; $s_image = "images/Coming_Shipment.png"; $cc_image = "images/Coming_Shipment.png"; $mywarehouse_img ="images/mywarehouse.png"; $addWarehouse_img ="images/addwarehouse.png"; $warehouse_img ="images/findwarehouse.png"; $ep_image ="images/Edit_Contact_Info.png"; if($page == "dashboard.php" || $page == "pending_warehouse.php" || $page == "rejected_warehouse.php") { $d_act = "active"; $d_image ="images/Dashboard_selected.png"; } if($page == "editcontact.php"|| $page =='addnew.php' || $page == 'subadminList.php') { $u_act = "active"; // $c_image ="images/Edit_Contact_Info_selected.png"; $c_image ="images/Usermanagement_selected.png"; } if($page == 'invoice.php') { $ef_act = "active"; $ef_image ="images/Invoices_selected.png"; } if($page == 'passwordGeneration.php' || $page=="change_password.php") { $p_act = "active"; $p_image ="images/Change_Password_selected.png"; } if($page == 'add-warehouse.php') { $w_act = "active"; $w_image ="images/Warehouses_selected.svg"; } if($page == 'myquotations.php') { $q_act = "active"; $q_image ="images/My_Quotation_List_selected.png"; } if($page == 'edittransactiondetails.php') { $t_act = "active"; $t_image ="images/My_Quotation_List_selected.png"; } if($page == 'comingshipment.php') { $s_act = "active"; $s_image ="images/Coming_Shipment_selected.png"; } if($page == 'companies.php' || $page == 'add-company.php' || $page == 'editCompany.php') { $cc_act = "active"; $cc_image ="images/Coming_Shipment_selected.png"; } if ( $page=='edit_profile.php' ) { $ep_act = "active"; $ep_image ="images/Edit_Contact_Info_selected.png"; } if($page == 'mywarehouse.php') { $w_act = "active"; $w_image ="images/mywarehouse_selected.png"; $mywarehouse_act = "active"; $mywarehouse_img ="images/mywarehouse_selected"; } if($page == 'warehouse.php') { $w_act = "active"; $w_image ="images/mywarehouse_selected.png"; $addWarehouse_act = "active"; $addWarehouse_img ="images/addwarehouse_selected.png"; } if($page == 'warehouse.php') { $w_act = "active"; $w_image ="images/mywarehouse_selected.png"; $warehouse_act = "active"; $warehouse_img ="images/findwarehouse_selected.png"; } if($page == 'receivedtranscation.php'){ $t_act = "active"; $t_image ="images/My_Quotation_List_selected.png"; } if($page == 'issuetranscation.php'){ $i_act = "active"; $i_image ="images/My_Quotation_List_selected.png"; } ?> <body class="loadingCls"> <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" 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 pt-1 pt-md-3" href="./dashboard.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"> <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 menu-item-has-children dropdown main mt-4 <?php echo $w_act;?>"> <a href="mywarehouse.php" class="dropdown-toggle list-item <?php echo $w_act;?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img src="<?php echo $w_image ;?>" class="img-padding"><?php echo $lang['WAREHOUSE_MANAGEMENT'];?></a> <ul class="sub-menu children dropdown-menu "> <li class="list-item mt-2 <?php echo $mywarehouse_act;?>"> <a href="mywarehouse.php"> <img src="<?php echo $mywarehouse_img ;?>" class="img-padding"><?php echo $lang['MY_WAREHOUSE'] ?></a> </li> <li class="list-item mt-2 <?php echo $addWarehouse_act;?>"> <a href="add-warehouse.php"> <img src="<?php echo $addWarehouse_img ;?>" class="img-padding"><?php echo $lang['ADD_WAREHOUSE'] ?></a> </li> <!-- <li class="list-item mt-2 <?php echo $warehouse_act;?>"> <a href="warehouse.php"> <img src="<?php echo $warehouse_img ;?>" class="img-padding">Find Warehouse</a> </li> --> </ul> </li> <li class="list-item mt-4 <?php echo $q_act;?>"> <a href="myquotations.php"><img src="<?php echo $q_image ;?>"><?php echo $lang['MY_QUOTATION_LIST'];?> </a> </li> <li class="list-item mt-4 <?php echo $s_act;?>"> <a href="comingshipment.php"><img src="<?php echo $s_image ;?>"><?php echo $lang['COMING_SHIPMENT'];?> </a> </li> <li class="list-item mt-4 <?php echo $u_act;?>"> <a href="subadminList.php"><img src="<?php echo $c_image ;?>"><?php echo $lang['USER_MANAGEMENT'];?> </a> </li> <li class="list-item mt-4 <?php echo $ef_act;?>"> <a href="invoice.php"><img src="<?php echo $ef_image ;?>"><?php echo $lang['INVOICES'];?> </a> </li> <li class="list-item mt-4 <?php echo $t_act;?>"> <!-- <a href="edittransactiondetails.php"><img src="<?php echo $t_image ;?>">Receiving Transaction</a> --> <a href="receivedtranscation.php"><img src="<?php echo $t_image ;?>"><?php echo $lang['RECEIVING_TRANSACTION'];?></a> </li> <li class="list-item mt-4 <?php echo $i_act;?>"> <a href="issuetranscation.php"><img src="<?php echo $i_image ;?>"><?php echo $lang['ISSUING_TRANSACTION'];?></a> </li> <li class="list-item mt-4 <?php echo $cc_act;?>"> <a href="editCompany.php"><img src="<?php echo $cc_image ;?>"><?php echo $lang['EDIT_COMPANY_INFORMATION'];?></a> </li> <li class="list-item mt-4 <?php echo $ep_act;?>"> <a href="edit_profile.php"><img src="<?php echo $ep_image ;?>"><?php echo $lang['EDIT_PROFILE'];?> </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> <?php /*<li class="list-item menu-item-has-children dropdown width-main d-none mt-4 <?php echo $w_act;?>"> <a href="mywarehouse.php" class="dropdown-toggle list-item <?php echo $w_act;?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img src="<?php echo $w_image ;?>" class="img-padding pr-1"> <i class="fa down-icon fa-angle-down" aria-hidden="true"></i></a> <ul id="subMenu-width" class="sub-menu children dropdown-menu position-relative <?php echo $w_act;?>"> <li class="list-item <?php echo $mywarehouse_act;?>"> <a href="mywarehouse.php"> <img src="<?php echo $mywarehouse_img ;?>" ></a> </li> <li class="list-item <?php echo $addWarehouse_act;?>"> <a href="add-warehouse.php"> <img src="<?php echo $addWarehouse_img ;?>" ></a> </li> <li class="list-item <?php echo $warehouse_act;?>"> <a href="warehouse.php"> <img src="<?php echo $warehouse_img ;?>" ></a> </li>header </ul> </li> */?> <li class="list-item mt-4 "> <a onclick="LogOut()"><img src="images/logout.png"><?php echo $lang['LOGOUT'];?> </a> </li> </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 d-flex align-items-center"> <div class="col-sm-4"> <a id="menuToggle" class="menutoggle pull-left"><i class="fa fa fa-chevron-left"></i></a> <?php if ($page=='quotations.php'){ ?> <a href="javascript:history.back(1)" class="pl-md-4 pl-0 pr-3 pr-md-0"><img src="images/back_main.png"></a> <?php } ?> </div> <div class="col-sm-5"> <div class="role-selector float-right"> <span class="" id="English" >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" >Arabic</span> </div> <!-- <span> English </span> <label class="switch"> <span><input type="checkbox"> <span class="slider round"></span> </span> </label> <span> Arabic</span> --> </div> <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 pt-3 pb-5 scroll-y notifications " aria-labelledby="notification"> </div> <div class="dropdown-menu" aria-labelledby="notification"> <p class="red">You have 0 Notification</p> <!-- <a class="dropdown-item media bg-flat-color-1" href=""> <i class="fa fa-check"></i> <p>Server #1 overloaded.</p> </a> <a class="dropdown-item media bg-flat-color-4" href="#"> <i class="fa fa-info"></i> <p>Server #2 overloaded.</p> </a> <a class="dropdown-item media bg-flat-color-5" href="#"> <i class="fa fa-warning"></i> <p>Server #3 overloaded.</p> </a>--> </div> </div> </div> <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="edit_profile.php" class="dropdown-toggle d-flex" > <?php $profilePic = 'images/profile.png'; if(isset($userDetails['upload_pic']) && $userDetails['upload_pic'] !='') { $profilePic = '../uploads/subadmin_photos/'.$userDetails['upload_pic']; } ?> <img class="user-avatar rounded-circle" style="float: left;" src=" <?php echo $profilePic ;?>" alt="User Avatar"> <span class="logged-in">●</span> <span class="pl-2 author-name"><?php if(isset($_SESSION['user_id'])) echo $_SESSION['name'] ;?></span> </a> <!-- <div class="user-menu dropdown-menu"> <a class="nav-link" href="edit_profile.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="logout.php"><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() { // console.log(document.getElementById('lang_val').value) // // alert() // if ($('#lang_val').is(':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") jQuery.ajax({ url:'ajax.php', type:'post', data:({action:'getNotifications', min:minVal }), success:function(response){ // console.log(response) var data=JSON.parse(response); var data1=data.result; $(".notifications").append(data1.notificationData); if(data1.count>0){ // console.log("hello") $("#count").addClass("bg-danger"); document.getElementById('count').innerHTML = data1.count; } // console.log(data1.length); } }) } jQuery(document).ready(function(){ notification(0) }); // 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; 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); } </script>