This commit is contained in:
ns77@siliconpin.com
2025-09-03 14:44:42 +00:00
parent 9c700687c2
commit 2c82868373

View File

@@ -1,134 +1,115 @@
<?php
date_default_timezone_set('Asia/Kolkata');
?>
<style> <style>
body { .agent-body {
margin: 0; margin: 0;
font-family: Arial, sans-serif; padding: 0;
} margin-bottom: 0px;
font-family: Arial, sans-serif;
overflow-y: hidden;
}
/* ===== Header ===== */ /* ===== Header/Navbar ===== */
.agent-header { .agent-header {
position: fixed; background: #e95420;
top: 0; color: #fff;
left: 0; padding: 30px 15px 12px 15px;
right: 0; display: flex;
height: 60px; justify-content: space-between;
background: #e95420; align-items: center;
color: #fff; font-size: 18px;
display: flex; font-weight: bold;
align-items: center; position: fixed;
justify-content: space-between; top: 0;
padding: 0 15px; left: 0;
font-size: 18px; right: 0;
font-weight: bold; z-index: 999;
z-index: 1000; }
} .agent-header-title {
margin: 0;
}
.agent-header-logout {
background: transparent;
border: none;
color: #fff;
font-size: 16px;
cursor: pointer;
}
/* ===== Page Content ===== */ /* ===== Bottom Navigation ===== */
.agent-body { .agent-bottom-nav {
margin-top: 60px; /* header height */ position: fixed;
padding: 15px; bottom: 0;
padding-bottom: 100px; /* reserve space for nav */ left: 0;
box-sizing: border-box; right: 0;
min-height: 100vh; height: 55px;
} background: #e95420;
display: flex;
/* ===== Bottom Navigation ===== */ justify-content: space-around;
.agent-bottom-nav { align-items: center;
position: fixed; border-top: 1px solid rgba(255,255,255,0.2);
left: 0; z-index: 999;
right: 0; }
height: 55px; .agent-bottom-link {
background: #e95420; color: #fff;
display: flex; text-align: center;
justify-content: space-around; font-size: 14px;
align-items: center; text-decoration: none;
border-top: 1px solid rgba(255,255,255,0.2); flex: 1;
z-index: 999; padding: 5px 0;
}
bottom: 0; /* JS দ্বারা adjust হবে */ .agent-bottom-link i {
} display: block;
font-size: 15px;
.agent-bottom-link { margin-bottom: 2px;
color: #fff; }
text-align: center; .agent-bottom-link.active {
font-size: 14px; background: rgba(255,255,255,0.2);
text-decoration: none; border-radius: 5px;
flex: 1; }
padding: 5px 0;
}
.agent-bottom-link i {
display: block;
font-size: 15px;
margin-bottom: 2px;
}
.agent-bottom-link.active {
background: rgba(255, 255, 255, 0.2);
border-radius: 8px;
}
</style> </style>
<!-- ===== Header ===== -->
<div class="agent-header">
<div>Agent Panel</div>
<?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
<button onclick="window.location.href='/Agent/logout'"
style="background:none;border:none;color:#fff;font-size:16px;cursor:pointer;">
Logout
</button>
<?php } ?>
</div>
<!-- ===== Content ===== -->
<div class="agent-body"> <div class="agent-body">
<h2>Dashboard Content</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Scroll down to test bottom nav spacing...</p>
<p style="margin-bottom:1000px;">Dummy long content...</p>
</div>
<!-- ===== Bottom Navigation ===== --> <!-- Top Header -->
<?php if (isset($_SESSION) && !empty($_SESSION['user_id'])) { ?> <div class="agent-header">
<div class="agent-bottom-nav" id="bottomNav"> <div class="agent-header-title">Agent Panel</div>
<a href="/Agent/Dashboard" class="agent-bottom-link active"> <?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
<i class="fa-solid fa-house"></i> <button onclick="window.location.href='/Agent/logout'" class="agent-header-logout">Logout</button>
Home <?php } ?>
</a>
<a href="/Agent/report" class="agent-bottom-link">
<i class="fa-solid fa-chart-line"></i>
Reports
</a>
<a href="/Agent/Receive" class="agent-bottom-link">
<i class="fa-solid fa-plus"></i>
Payment
</a>
<a href="/Agent/transaction" class="agent-bottom-link">
<i class="fa-solid fa-money-check-dollar"></i>
Transaction
</a>
</div> </div>
<?php } ?>
<!-- ===== JS Fix for Android Devices ===== --> <!-- Some content -->
<script> <div style="margin-top:20px; padding:15px;">
function fixBottomNav() { <!-- Dashboard Content -->
const nav = document.getElementById("bottomNav"); </div>
if (!nav) return;
// পুরো window height (system bar সহ) <!-- Bottom Navigation -->
let vh = window.innerHeight; <?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
<div class="agent-bottom-nav">
<a href="/Agent/Dashboard" class="agent-bottom-link active">
<i class="fa-solid fa-house"></i>
Home
</a>
<a href="/Agent/report" class="agent-bottom-link">
<i class="fa-solid fa-chart-line"></i>
Reports
</a>
<a href="/Agent/Receive" class="agent-bottom-link" style="">
<i class="fa-solid fa-plus"></i>
Payment
</a>
<a href="/Agent/transaction" class="agent-bottom-link">
<i class="fa-solid fa-money-check-dollar"></i>
Transaction
</a>
<!-- <a href="javascript:void(0)" onclick="window.location.reload();" class="agent-bottom-link">
<i class="fa-solid fa-rotate-right"></i>
Reload
</a> -->
</div>
// visual viewport height (system bar বাদে) <?php } ?>
let realVH = window.visualViewport ? window.visualViewport.height : vh;
// ফারাক </div>
let diff = vh - realVH;
if (diff > 0) {
nav.style.bottom = diff + "px"; // system nav bar এর উপরে উঠবে
} else {
nav.style.bottom = "0px";
}
}
window.addEventListener("resize", fixBottomNav);
window.addEventListener("load", fixBottomNav);
</script>