File "userm_detail.php"
Full path: /home/atrmarke/public_html/atrdemolive.site/if/pages/userm_detail.php
File
size: 0.01 KB (13.05 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
include("db/cn.php");
ob_start();
if(isset($_SESSION['user_name']) && isset($_SESSION['user_role'])&& isset($_SESSION['outlet_name'])
&& isset($_SESSION['outlet_address'])) {
$userName = $_SESSION['user_name'];
$userRole = $_SESSION['user_role'];
$outlet_address = $_SESSION['outlet_address'];
$outlet_name = $_SESSION['outlet_name'];
}
@$booker_name = $_GET["booker_name"];
ob_end_flush();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Whole Sale Retail</title>
<!-- Custom fonts for this template-->
<link href="../vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<!-- Custom styles for this template-->
<link href="../css/sb-admin-2.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<style>
body {
font-family: 'Quicksand', sans-serif;
}
.chart-container {
position: relative;
background: rgba(255, 255, 255, 0.9);
border-radius: 10px;
padding: 15px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
canvas {
max-width: 100%;
height: auto;
}
.bg-gradient-primary{
background:#0A4657;
color:#fff;
}
.btn-primary{
background:#0A4657;
color:#fff;
border:1px #0A4657 solid;
}
.btn-primary:hover{
background:#fff;
border:1px #0A4657 solid;
color:#0A4657;
}
.chart-container {
position: relative;
background: rgba(255, 255, 255, 0.9);
border-radius: 10px;
padding: 15px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
canvas {
max-width: 100%;
height: auto;
}
.fa-download:hover{
color:#953E39;
}
label{
font-weight:700;
color:#000;
}
</style>
<body id="page-top">
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<?php
include("common/sd.php");
?>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
<!-- Sidebar Toggle (Topbar) -->
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
<i class="fa fa-bars"></i>
</button>
<!-- Topbar Search -->
<?php include('common/log.php'); ?>
<!-- Topbar Navbar -->
</nav>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="main-content">
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3 style="color:#212529; padding:10px; background:#0A4657;color:#fff;text-align:center; border-radius:10px;"> User Detail</h3>
</div>
<div class="col-sm-5"></div>
<div class="col-sm-3" style="color:#212529; padding:10px; background:#0A4657;color:#fff;text-align:center; border-radius:10px; font-size:18px; font-weight:600;" >
<?php echo 'Booker Name : '.$booker_name; ?>
</div>
</div>
</div>
<!--Blocks-->
<?php
$booker = mysqli_query($connection,"select * from booker where name = '$booker_name'");
$fetch_b = mysqli_fetch_array($booker);
$shop = mysqli_query($connection,"select * from shop_u");
$route = mysqli_query($connection,"select * from u_route");
?>
<div class="container">
<br />
<div class="row">
<div class="col-sm-10">
<table class="table table-bordered table-sm text-center bg-white">
<tr style="background:#0A4657; color:#fff; font-weight:700;">
<td style="background:#0A4657;color:#fff;">Date</td>
<td style="background:#0A4657;color:#fff;" >Name</td>
<td style="background:#0A4657;color:#fff;" >Assign Shop</td>
<td style="background:#0A4657;color:#fff;">Assign Route</td>
</tr>
<?php
$booker = mysqli_query($connection,"select * from booker where name = '$booker_name'");
$fetch_b = mysqli_fetch_array($booker);
$route_assign = mysqli_query($connection,"select * from credit_note where booker = '$booker_name'");
while($assign_get = mysqli_fetch_array($route_assign)){
?>
<tr style="color:#000; font-weight:700;">
<td><?php echo $assign_get["date_time"]; ?></td>
<td><?php echo $assign_get["booker"]; ?></td>
<td><?php echo $assign_get["shop_name"]; ?></td>
<td><?php echo $assign_get["route"]; ?></td>
</tr>
<?php
}
?>
</table>
</div>
<div class="col-sm-2">
<a href="userm.php"><button type="button" class="btn btn-dark btn-sm"><i class="fas fa-arrow-left fa-1x"></i></button></a>
<a href="bookings.php?booker_name=<?php echo $fetch_b["name"]; ?> "><button type="button" class="btn btn-dark btn-sm form-control" style="margin-top:12px;">Bookings</button></a>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
</div>
<br><br>
<!-- End of Main Content -->
<!-- Footer -->
<?php include("common/main_ft.php"); ?>
<!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Select "Logout" below if you are ready to end your current session.</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<a class="btn btn-primary" href="">Logout</a>
</div>
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
var sidebar = document.getElementById("sidebar");
var overlay = document.createElement("div");
overlay.classList.add("overlay");
document.body.appendChild(overlay);
function toggleSidebar() {
sidebar.classList.toggle("hide");
overlay.classList.toggle("hide");
var mainContent = document.querySelector(".main-content");
if (sidebar.classList.contains("hide")) {
mainContent.style.marginLeft = "0";
} else {
mainContent.style.marginLeft = "100px"; // Width of the sidebar
}
}
overlay.addEventListener("click", function () {
toggleSidebar();
});
// Add toggle functionality to navbar toggler
var navbarToggler = document.querySelector(".navbar-toggler");
navbarToggler.addEventListener("click", function () {
toggleSidebar();
});
// Automatically hide sidebar on all screen sizes
// sidebar.classList.add("hide");
// overlay.classList.add("hide");
// Add class to body to prevent scrolling when sidebar is open
// document.body.classList.add("noscroll");
// Check if screen size is larger than a certain threshold (e.g., 768px for desktop screens)
function checkScreenSize() {
if (window.innerWidth > 768) {
sidebar.classList.remove("hide");
overlay.classList.remove("hide");
} else {
sidebar.classList.add("hide");
overlay.classList.add("hide");
}
}
// Check screen size on initial load and whenever the window is resized
checkScreenSize();
window.addEventListener("resize", checkScreenSize);
});
document.addEventListener("DOMContentLoaded", function () {
const products = document.querySelectorAll('.product-row');
let currentIndex = -1;
// Function to handle up and down arrow keys
document.addEventListener("keydown", function(event) {
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
event.preventDefault();
if (currentIndex === -1) {
currentIndex = 0;
} else {
currentIndex += event.key === "ArrowDown" ? 1 : -1;
}
if (currentIndex < 0) currentIndex = 0;
if (currentIndex >= products.length) currentIndex = products.length - 1;
products[currentIndex].focus();
products[currentIndex].scrollIntoView({ behavior: 'smooth', block: 'center' });
}
});
// Set tabindex and index for each row
products.forEach((row, index) => {
row.setAttribute('tabindex', '0');
row.dataset.index = index;
row.addEventListener('focus', function() {
currentIndex = parseInt(row.dataset.index);
});
});
});
document.addEventListener("DOMContentLoaded", function () {
const categories = <?php echo json_encode($categories); ?>;
const searchInput = document.getElementById('searchInput');
const searchResults = document.getElementById('searchResults');
const products = document.querySelectorAll('.product-row');
searchInput.addEventListener('input', function () {
const query = this.value.trim().toLowerCase();
if (query === '') {
searchResults.style.display = 'none';
showAllProducts();
return;
}
const filteredCategories = categories.filter(category => category.toLowerCase().includes(query));
renderResults(filteredCategories);
filterProducts(filteredCategories);
});
searchInput.addEventListener('blur', function () {
setTimeout(() => {
searchResults.style.display = 'none';
}, 200); // Delay hiding dropdown to allow click event on dropdown items
});
function renderResults(results) {
let html = '';
results.forEach(result => {
html += `<div>${result}</div>`;
});
searchResults.innerHTML = html;
searchResults.style.display = 'block';
}
function filterProducts(filteredCategories) {
products.forEach(function (product) {
const category = product.getAttribute('data-category');
if (!filteredCategories.includes(category)) {
product.style.display = 'none';
} else {
product.style.display = 'table-row';
}
});
}
function showAllProducts() {
products.forEach(function (product) {
product.style.display = 'table-row';
});
}
searchResults.addEventListener('click', function (event) {
const clickedItem = event.target;
if (clickedItem.tagName === 'DIV') {
searchInput.value = clickedItem.innerText;
searchResults.style.display = 'none';
filterProducts([clickedItem.innerText]);
}
});
});
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("search-input").addEventListener("input", function() {
var searchText = this.value.toLowerCase();
var rows = document.querySelectorAll(".product-row");
rows.forEach(function(row) {
var productName = row.querySelector("td:nth-child(3)").textContent.toLowerCase();
if (productName.includes(searchText)) {
row.style.display = "table-row";
} else {
row.style.display = "none";
}
});
});
});
// Function to toggle submenu
function toggleSubMenu(element) {
$(element).next('.sub-menu').slideToggle();
}
</script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.10.2/dist/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript-->
<script src="../vendor/jquery/jquery.min.js"></script>
<script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="../vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for all pages-->
<script src="../js/sb-admin-2.min.js"></script>
</body>
</html>