commision page and header user image
parent
3af87688c0
commit
01966257bc
|
@ -57,15 +57,7 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
|
||||
<!-- Mobile profile + welcome -->
|
||||
|
||||
<?php
|
||||
$imagePath = '';
|
||||
if(isset($_SESSION['profile_pic']) && !empty($_SESSION['profile_pic'])){
|
||||
$imagePath = "/CONTENT/ROOT_URI/Admin/".$_SESSION['profile_pic'];
|
||||
}else{
|
||||
$imagePath = "/CONTENT/ROOT_URI/Admin/default.svg";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<img class="mobile-profile"
|
||||
src="<?php echo $imagePath; ?>"
|
||||
|
@ -88,7 +80,7 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
<li><a href="/Admin/Add_group">Add New Group</a></li>
|
||||
<li><a href="/Admin/Trans_New">Transaction</a></li>
|
||||
<li><a href="/Admin/agent-targets">Agent Targets</a></li>
|
||||
<!-- <li><a href="/Admin/agent_View_report">Commission</a></li> -->
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<li><a href="/Admin/Report">Report</a></li>
|
||||
<li><a href="/Admin/Due">Deemand Sheet</a></li>
|
||||
|
@ -102,14 +94,14 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
<li><a href="/Admin/Add_group">Add New Group</a></li>
|
||||
<li><a href="/Admin/Trans_New">Transaction</a></li>
|
||||
<li><a href="/Admin/agent-targets">Agent Targets</a></li>
|
||||
<!-- <li><a href="/Admin/agent_View_report">Commission</a></li> -->
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php
|
||||
} elseif ($userType === 'agent') {
|
||||
?>
|
||||
<li><a href="/Admin/View_AC?Type=Recurring">View A/C</a></li>
|
||||
<li><a href="/Admin/Due">Deemand Sheet</a></li>
|
||||
<li><a href="/Admin/Report">Report</a></li>
|
||||
<!-- <li><a href="/Admin/agent_View_report">Commission</a></li> -->
|
||||
<li><a href="/Admin/agent_View_report">Commission</a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -121,7 +113,13 @@ date_default_timezone_set('Asia/Kolkata');
|
|||
<span class="welcome-text">Welcome! <?php echo htmlspecialchars($_SESSION['name'] ?? ''); ?></span>
|
||||
</li>
|
||||
<li class="desktop-profile">
|
||||
<img src="<?php echo $imagePath; ?>" width="40" height="40" style="border-radius:50%; object-fit:cover;" alt="Profile">
|
||||
<?php
|
||||
if(isset($_SESSION['profile_pic']) || !empty($_SESSION['profile_pic'])){
|
||||
echo '<img src="/CONTENT/ROOT_URI/Admin/'.$_SESSION['profile_pic'].'" width="40" height="40" style="border-radius:50%; object-fit:cover;" alt="Profile" />';
|
||||
}else{
|
||||
echo '<svg style="border-radius:50%; object-fit:cover; border: 1px solid #ffffff;" class="img-responsive" version="1.1" width="38px" height="38px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="#ffffff" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path fill="#ffffff" d="M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704l116.736-175.104zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0z"></path></g></svg>';
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<li><a href="/Admin/Signout">Signout</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<?php
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
|
||||
// $profile_pic = !empty($_SESSION['profile_pic']) ? "/CONTENT/ROOT_URI/Agent/" . htmlspecialchars($_SESSION['profile_pic']) : "/CONTENT/ROOT_URI/Agent/default.png"; // placeholder image
|
||||
?>
|
||||
<style>
|
||||
.agent-body {
|
||||
|
@ -42,10 +40,13 @@
|
|||
border: 2px solid #fff;
|
||||
}
|
||||
.agent-header-logout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-size: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
@ -100,12 +101,21 @@
|
|||
<!-- Top Header -->
|
||||
<div class="agent-header">
|
||||
<div class="agent-header-title">
|
||||
<!-- <img src="/CONTENT/ROOT_URI/Admin/<?php echo htmlspecialchars($_SESSION['profile_pic'] ?? 'default.svg'); ?>" alt="Profile"> -->
|
||||
|
||||
<?php
|
||||
if(isset($_SESSION['profile_pic']) || !empty($_SESSION['profile_pic'])){
|
||||
echo '<img src="/CONTENT/ROOT_URI/Admin/'.$_SESSION['profile_pic'].'" style="width: 35px; height: 35px; border-radius:50%; object-fit:cover;" alt="Profile" />';
|
||||
}else{
|
||||
echo '<svg style="border-radius:50%; object-fit:cover; border: 1px solid #ffffff;" class="img-responsive" version="1.1" width="28px" height="28px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="#ffffff" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path fill="#ffffff" d="M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704l116.736-175.104zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0z"></path></g></svg>';
|
||||
}
|
||||
?>
|
||||
<span>Agent Panel</span>
|
||||
</div>
|
||||
<?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
|
||||
<button onclick="window.location.href='/Agent/logout'" class="agent-header-logout">Logout</button>
|
||||
|
||||
<button onclick="window.location.href='/Agent/logout'" class="agent-header-logout">
|
||||
<svg width="22px" height="22px" viewBox="0 -0.5 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M11.75 9.874C11.75 10.2882 12.0858 10.624 12.5 10.624C12.9142 10.624 13.25 10.2882 13.25 9.874H11.75ZM13.25 4C13.25 3.58579 12.9142 3.25 12.5 3.25C12.0858 3.25 11.75 3.58579 11.75 4H13.25ZM9.81082 6.66156C10.1878 6.48991 10.3542 6.04515 10.1826 5.66818C10.0109 5.29121 9.56615 5.12478 9.18918 5.29644L9.81082 6.66156ZM5.5 12.16L4.7499 12.1561L4.75005 12.1687L5.5 12.16ZM12.5 19L12.5086 18.25C12.5029 18.25 12.4971 18.25 12.4914 18.25L12.5 19ZM19.5 12.16L20.2501 12.1687L20.25 12.1561L19.5 12.16ZM15.8108 5.29644C15.4338 5.12478 14.9891 5.29121 14.8174 5.66818C14.6458 6.04515 14.8122 6.48991 15.1892 6.66156L15.8108 5.29644ZM13.25 9.874V4H11.75V9.874H13.25ZM9.18918 5.29644C6.49843 6.52171 4.7655 9.19951 4.75001 12.1561L6.24999 12.1639C6.26242 9.79237 7.65246 7.6444 9.81082 6.66156L9.18918 5.29644ZM4.75005 12.1687C4.79935 16.4046 8.27278 19.7986 12.5086 19.75L12.4914 18.25C9.08384 18.2892 6.28961 15.5588 6.24995 12.1513L4.75005 12.1687ZM12.4914 19.75C16.7272 19.7986 20.2007 16.4046 20.2499 12.1687L18.7501 12.1513C18.7104 15.5588 15.9162 18.2892 12.5086 18.25L12.4914 19.75ZM20.25 12.1561C20.2345 9.19951 18.5016 6.52171 15.8108 5.29644L15.1892 6.66156C17.3475 7.6444 18.7376 9.79237 18.75 12.1639L20.25 12.1561Z" fill="currentColor"></path> </g></svg>
|
||||
<span>Logout</span>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
@ -115,26 +125,11 @@
|
|||
<!-- Bottom Navigation -->
|
||||
<?php if(isset($_SESSION) && !empty($_SESSION['user_id'])){ ?>
|
||||
<div class="agent-bottom-nav">
|
||||
<a href="/Agent/Dashboard" class="agent-bottom-link <?php echo ($current_page == 'Dashboard' || $current_page == 'Agent') ? 'active' : ''; ?>" data-page="Dashboard">
|
||||
<i class="fa-solid fa-house"></i>
|
||||
Home
|
||||
</a>
|
||||
<a href="/Agent/report" class="agent-bottom-link <?php echo ($current_page == 'report') ? 'active' : ''; ?>" data-page="report">
|
||||
<i class="fa-solid fa-chart-line"></i>
|
||||
Reports
|
||||
</a>
|
||||
<a href="/Agent/Receive" class="agent-bottom-link <?php echo ($current_page == 'Receive') ? 'active' : ''; ?>" data-page="Receive">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
Payment
|
||||
</a>
|
||||
<!-- <a href="/Agent/commission" class="agent-bottom-link">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
Commission
|
||||
</a> -->
|
||||
<a href="/Agent/transaction" class="agent-bottom-link <?php echo ($current_page == 'transaction') ? 'active' : ''; ?>" data-page="transaction">
|
||||
<i class="fa-solid fa-money-check-dollar"></i>
|
||||
Transaction
|
||||
</a>
|
||||
<a href="/Agent/Dashboard" class="agent-bottom-link <?php echo ($current_page == 'Dashboard' || $current_page == 'Agent') ? 'active' : ''; ?>" data-page="Dashboard"><i class="fa-solid fa-house"></i> Home</a>
|
||||
<a href="/Agent/report" class="agent-bottom-link <?php echo ($current_page == 'report') ? 'active' : ''; ?>" data-page="report"><i class="fa-solid fa-chart-line"></i> Reports</a>
|
||||
<a href="/Agent/Receive" class="agent-bottom-link <?php echo ($current_page == 'Receive') ? 'active' : ''; ?>" data-page="Receive"><i class="fa-solid fa-plus"></i> Payment</a>
|
||||
<!-- <a href="/Agent/commission" class="agent-bottom-link"><i class="fa-solid fa-plus"></i> Commission</a> -->
|
||||
<a href="/Agent/transaction" class="agent-bottom-link <?php echo ($current_page == 'transaction') ? 'active' : ''; ?>" data-page="transaction"><i class="fa-solid fa-money-check-dollar"></i> Transaction</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|||
if (empty($userId) || empty($password)) {
|
||||
$error = "Please fill in all fields.";
|
||||
} else {
|
||||
$stmt = $conn->prepare("SELECT * FROM $table_users WHERE user_id = ? AND type = 'agent'");
|
||||
$stmt = $conn->prepare("SELECT * FROM $table_users WHERE user_id = ?");
|
||||
if (!$stmt) {
|
||||
$error = "Internal server error.";
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue