ESH/techsyn_emp_header.php
2024-10-23 18:28:06 +05:30

365 lines
15 KiB
PHP

<?php
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/html; charset=utf-8');
clearstatcache();
error_reporting(0);
shell_exec('2>&1 svn update G:/xampp/htdocs/sajjan/ --non-interactive');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Mulish:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000&display=swap" rel="stylesheet">
<?php
include('log_entry.php');
include('constants.php');
include('includes/config/config.php');
include_once("includes/functions.php");
include_once("includes/cached_functions.php");
$__currentPage = $_SERVER['REQUEST_URI'];
$__currentPage = substr($__currentPage, strripos($__currentPage, "/") + 1, strlen($__currentPage));
$top_user = $_SESSION['username'];
$sql_menu_exists = "select menu_id from menu_master where upper(menu_url)=upper('" . $__currentPage . "')";
$result_menu_exists = mysqli_query($conn, $sql_menu_exists);
$countAccessibleMenuPages_exists = mysqli_num_rows($result_menu_exists);
$sql_menu = "select menu_id from menu_master where upper(menu_url)=upper('" . $__currentPage . "') and menu_id in(select menu_id from assign_menu where role_id='" . $_SESSION['RoleId'] . "')";
$result_menu = mysqli_query($conn, $sql_menu);
$countAccessibleMenuPages = mysqli_num_rows($result_menu);
if ($countAccessibleMenuPages_exists != 0 && $countAccessibleMenuPages == 0) {
error_log("Invalid Access Attempt to a page by $top_user to the page : $__currentPage");
echo "<script>location.href='error.php'</script>";
}
if ($row_menu = mysqli_fetch_array($result_menu)) {
if (isset($row_menu['menu_id']) && $row_menu['menu_id'] != '') {
$_SESSION['menu_key'] = $row_menu['menu_id'];
}
}
$_SESSION['menu_current_page'] = $__currentPage;
include_once('access.php');
// echo "top_user:".$top_user.":Manoj";
if ($top_user == null || $top_user = '') {
session_start();
session_unset();
session_destroy();
header("location:index.php");
exit();
}
?>
<head>
<title>OHCTech | Occupational Health System</title>
<script src="includes/css-js/functions.js"></script>
<!-- bootstrap & fontawesome -->
<!-- <link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-dialog.min.css" />
<link href="css/flexigrid.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap-datepicker.css" />
<link rel="stylesheet" href="adminLte/bower_components/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="adminLte/bower_components/jvectormap/jquery-jvectormap.css">
<link rel="stylesheet"
href="https://demos.creative-tim.com/material-bootstrap-wizard/assets/js/material-bootstrap-wizard.js"> -->
<!-- page specific plugin styles -->
<!-- text fonts -->
<!-- <link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" /> -->
<!-- ace styles -->
<script src="assets/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
if ('ontouchstart' in document.documentElement)
document.write("<script src='assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- page specific plugin scripts -->
<script src="assets/js/jquery-ui.custom.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="assets/js/jquery.easypiechart.min.js"></script>
<script src="assets/js/jquery.sparkline.index.min.js"></script>
<script src="assets/js/jquery.flot.min.js"></script>
<script src="assets/js/jquery.flot.pie.min.js"></script>
<script src="assets/js/jquery.flot.resize.min.js"></script>
<script src="assets/js/autosize.min.js"></script>
<!-- ace scripts -->
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript" src="js/bootstrap-filestyle.min.js" />
</script>
<script type="text/javascript" src="js/bootstrap-dialog.min.js" />
</script>
<script type="text/javascript" src="js/bootstrap-datepicker.js" />
</script>
<script type="text/javascript" src="js/jquery.dataTables.min.js" />
</script>
<!-- ace settings handler -->
<script src="assets/js/ace-extra.min.js"></script>
<!--online css-->
<script src="js/jquery-migrate.js"></script>
<script src="js/flexigrid.js" langugage="Javascript" />
</script>
<script src="js/ohctech.js"></script>
<link rel="stylesheet" href="css/select2.min.css">
<script src="js/select2.full.min.js"></script>
<link rel="stylesheet" href="assets/css/jquery.dataTables.css" />
<script src="assets/js/jquery.dataTables.js"></script>
<script src="https://kit.fontawesome.com/91736d5d58.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<style>
* {
font-family: 'Mulish', sans-serif;
}
.nav-user-photo {
width: 40px;
height: 40px;
margin: 0px;
padding: 0px;
}
#back-img-div:before {
content: "";
position: absolute;
top: -10px;
width: 100%;
height: 200%;
z-index: -1;
background-image: url('./images/banner-bg.jpg');
/* background-position: center; */
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body>
<div id="back-img-div">
<?php
$sql = "select * from company_profile ";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
?>
<nav class="navbar navbar-expand-lg fixed-top bg-white" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;">
<div class="container-fluid row my-0">
<div class="" style="width: 33.33%;">
<a class="navbar-brand" href="#">
<?php if (isset($row['company_logo']) && $row['company_logo'] != null) { ?>
<img src="data:<?= $row['image_type'] ?>;base64,<?= base64_encode($row['company_logo']) ?>" width="100" height="60">
<?php } else if (isset($row['right_com_logo']) && $row['right_com_logo'] != null) { ?>
<img src="data:<?= $row['right_image_type'] ?>;base64,<?= base64_encode($row['right_com_logo']) ?>" width="100" height="60">
<?php } else { ?>
<img src="images/logo.jpg" width="100" height="60">
<?php } ?>
</a>
</div>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="text-center" style="width:33.33%">
<h4><b>Occupational Health Centre</b>
</h4>
</div>
<div class="text-end" style="width:33.33%;">
<div style="float: right;">
<?php
$sql = "select * from patient_master where id = '" . $_SESSION['logged_user_empid'] . "' ";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_array($result);
?>
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
<?= $_SESSION['username'] ?>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="techsyn_chpass.php"><i class="ace-icon fa fa-key"></i> Change Password</a>
<a class="dropdown-item" href="docs/OHCTECH_Manual_v1.docx"><i class="ace-icon fa fa-book"></i>
Read Manual</a>
<hr class="dropdown-divider">
<a class="dropdown-item" href="logout.php"><i class="ace-icon fa fa-power-off"></i>
Logout</a>
</div>
</li>
<li class="nav-item">
<?php if (isset($row['photo']) && $row['photo'] != null) { ?>
<img class="nav-user-photo" src="data:<?= $row['image_type'] ?>;base64,<?= base64_encode($row['photo']) ?>" alt=" <?php echo ($_SESSION['username']) ?>'s Photo" />
<?php
} else {
$gender = $row['gender'];
if ($gender == 'F') {
?>
<img class="nav-user-photo" src="images/female-profile.png" style='border-radius: 50px;' alt=" <?php echo ($_SESSION['username']) ?>'s Photo" />
<?php } else { ?>
<img class="nav-user-photo" src="images/male-profile.png" alt=" <?php echo ($_SESSION['username']) ?>'s Photo" />
<?php }
} ?>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<!-- /.navbar-container -->
<!-- <nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav> -->
<script>
// $(document).ready(function() {
// $("input[type=text]").keyup(function() {
// $(this).val($(this).val().toUpperCase());
// });
// $("textarea").keyup(function() {
// $(this).val($(this).val().replace(/\r\n|\r|\n/g, "\n"));
// $(this).val($(this).val().toUpperCase());
// });
// });
<?php
$unitMap = getKeyValueMap('unit_master', 'unit_id', 'unit_name');
//echo "unit Map: ". $unitMap['1'];
?>
var unitMap = $.parseJSON('<?php echo json_encode($unitMap) ?>');
function getUnitForChildItem(field_id, item_value, count) {
var item_id = item_value;
$.ajax({
url: 'getUnitByItemId.php',
method: 'POST',
data: {
item_id: item_id
},
dataType: 'json',
success: function(data) {
if (data != null && data != "") {
$("#" + field_id + count).html(data.unit_name);
}
},
error: function(data) {
}
});
}
function getUnitForItem(item_value) {
var item_id = item_value;
var unit_name = "";
$.ajax({
url: 'getUnitByItemId.php',
method: 'POST',
data: {
item_id: item_id
},
async: false,
dataType: 'json',
success: function(data) {
if (data != null && data != "") {
unit_name = data.unit_name;
}
},
error: function(data) {
}
});
return unit_name;
}
</script>