One Hat Cyber Team
Your IP :
216.73.216.55
Server IP :
5.189.175.239
Server :
Linux panel.gemx-ai.com 5.14.0-570.19.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 4 04:00:24 EDT 2025 x86_64
Server Software :
LiteSpeed
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
farmersapp
/
loans.farmersapp.store
/
includes
/
View File Name :
header.php
<?php /** * Header Template * Farmers Loan Management System */ // Start output buffering ob_start(); // Set default page title if not defined if (!isset($page_title)) { $page_title = APP_NAME; } // Get current user info $current_user = getCurrentUser(); $current_role_name = getCurrentUserRole(); $unread_notifications = getUnreadNotificationCount($_SESSION['user_id'] ?? 0); ?> <!DOCTYPE html> <html lang="en" data-theme="<?php echo isset($_COOKIE['theme']) ? $_COOKIE['theme'] : 'light'; ?>"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo htmlspecialchars($page_title) . ' - ' . APP_NAME; ?></title> <!-- Favicon --> <link rel="icon" type="image/x-icon" href="<?php echo ASSETS_URL; ?>/images/favicon.ico"> <!-- Bootstrap 5 CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <!-- Custom CSS --> <link rel="stylesheet" href="<?php echo ASSETS_URL; ?>/css/style.css"> <link rel="stylesheet" href="<?php echo ASSETS_URL; ?>/css/components.css"> <link rel="stylesheet" href="<?php echo ASSETS_URL; ?>/css/layout.css"> <link rel="stylesheet" href="<?php echo ASSETS_URL; ?>/css/responsive.css"> <!-- DataTables CSS --> <link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css"> <!-- Select2 CSS --> <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" /> <!-- Flatpickr CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css"> <!-- jQuery --> <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script> <!-- CSRF Token for AJAX --> <meta name="csrf-token" content="<?php echo (new Security())->generateCsrfToken(); ?>"> <!-- Additional meta tags --> <meta name="description" content="Farmers Loan Management System - Streamline your microfinance operations"> <meta name="author" content="<?php echo APP_AUTHOR; ?>"> <meta name="keywords" content="loan management, microfinance, farmers, agriculture, finance"> <!-- Theme color --> <meta name="theme-color" content="#4e73df"> <?php if (defined('ENVIRONMENT') && ENVIRONMENT === 'production'): ?> <!-- Google Analytics (example) --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-XXXXX-Y'); </script> <?php endif; ?> </head> <body> <!-- Loading Overlay --> <div id="loadingOverlay" class="loading-overlay" style="display: none;"> <div class="spinner-border text-primary" role="status"> <span class="visually-hidden">Loading...</span> </div> </div> <!-- Toast Container --> <div class="toast-container position-fixed top-0 end-0 p-3" style="z-index: 9999"></div> <?php if (isLoggedIn()): ?> <!-- Main Wrapper --> <div id="wrapper"> <!-- Sidebar --> <nav id="sidebar" class="sidebar"> <div class="sidebar-header"> <h3> <i class="fas fa-hand-holding-usd me-2"></i> <?php echo APP_NAME; ?> </h3> <strong><i class="fas fa-hand-holding-usd"></i></strong> </div> <!-- User Profile --> <div class="sidebar-user p-3 text-center"> <div class="avatar-circle-lg bg-primary mb-2 mx-auto"> <?php $initials = strtoupper( substr($current_user['first_name'] ?? '', 0, 1) . substr($current_user['last_name'] ?? '', 0, 1) ); echo $initials ?: 'U'; ?> </div> <h6 class="mb-1"><?php echo htmlspecialchars($current_user['first_name'] . ' ' . $current_user['last_name']); ?></h6> <p class="text-muted small mb-2"><?php echo $current_role_name; ?></p> <div class="badge bg-success">Active</div> </div> <!-- Sidebar Menu --> <ul class="sidebar-menu list-unstyled"> <!-- Dashboard --> <li class="sidebar-menu-item <?php echo isRoute('/dashboard') ? 'active' : ''; ?>"> <a href="/dashboard" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-tachometer-alt"></i> Dashboard </a> </li> <!-- Borrower Management --> <li class="sidebar-menu-item <?php echo strpos($_SERVER['REQUEST_URI'], '/borrowers') !== false ? 'active' : ''; ?>"> <a href="/borrowers" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-users"></i> Borrowers </a> </li> <!-- Loan Management --> <li class="sidebar-menu-item <?php echo strpos($_SERVER['REQUEST_URI'], '/loans') !== false ? 'active' : ''; ?>"> <a href="/loans" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-hand-holding-usd"></i> Loans <?php $pending_loans = 0; // You would query this from database if ($pending_loans > 0): ?> <span class="badge bg-danger float-end"><?php echo $pending_loans; ?></span> <?php endif; ?> </a> </li> <!-- Repayments --> <li class="sidebar-menu-item <?php echo strpos($_SERVER['REQUEST_URI'], '/repayments') !== false ? 'active' : ''; ?>"> <a href="/repayments" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-cash-register"></i> Repayments </a> </li> <!-- Reports --> <?php if (hasPermission(PERMISSION_VIEW_REPORTS)): ?> <li class="sidebar-menu-item <?php echo strpos($_SERVER['REQUEST_URI'], '/reports') !== false ? 'active' : ''; ?>"> <a href="/reports" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-chart-bar"></i> Reports </a> </li> <?php endif; ?> <!-- Settings (Admin Only) --> <?php if (hasRole(ROLE_ADMIN)): ?> <li class="sidebar-menu-item <?php echo strpos($_SERVER['REQUEST_URI'], '/settings') !== false ? 'active' : ''; ?>"> <a href="/settings" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-cog"></i> Settings </a> </li> <?php endif; ?> <!-- Divider --> <li class="sidebar-divider"></li> <!-- User Menu --> <li class="sidebar-menu-item"> <a href="/profile" class="sidebar-menu-link"> <i class="sidebar-menu-icon fas fa-user"></i> My Profile </a> </li> <li class="sidebar-menu-item"> <a href="/logout" class="sidebar-menu-link text-danger"> <i class="sidebar-menu-icon fas fa-sign-out-alt"></i> Logout </a> </li> </ul> <!-- Sidebar Footer --> <div class="sidebar-footer text-center p-3"> <small class="text-muted"> Version <?php echo APP_VERSION; ?><br> © <?php echo date('Y'); ?> </small> </div> </nav> <!-- Page Content --> <div id="content"> <!-- Top Navigation --> <nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom"> <div class="container-fluid"> <!-- Sidebar Toggle --> <button type="button" id="sidebarToggle" class="btn btn-outline-secondary me-2"> <i class="fas fa-bars"></i> </button> <!-- Breadcrumb --> <nav aria-label="breadcrumb" class="me-auto"> <ol class="breadcrumb mb-0"> <li class="breadcrumb-item"><a href="/dashboard">Home</a></li> <li class="breadcrumb-item active"><?php echo $page_title; ?></li> </ol> </nav> <!-- Right Navigation --> <div class="d-flex align-items-center"> <!-- Theme Toggle --> <button class="btn btn-outline-secondary me-2 theme-toggle" title="Toggle theme"> <i class="fas fa-moon"></i> </button> <!-- Notifications --> <div class="dropdown me-2"> <button class="btn btn-outline-secondary position-relative" type="button" data-bs-toggle="dropdown"> <i class="fas fa-bell"></i> <?php if ($unread_notifications > 0): ?> <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger"> <?php echo $unread_notifications; ?> <span class="visually-hidden">unread notifications</span> </span> <?php endif; ?> </button> <div class="dropdown-menu dropdown-menu-end notification-panel"> <h6 class="dropdown-header">Notifications</h6> <?php if ($unread_notifications > 0): ?> <div class="notification-list"> <!-- Notifications will be loaded here --> </div> <div class="dropdown-divider"></div> <a class="dropdown-item text-center" href="/notifications"> View all notifications </a> <?php else: ?> <div class="text-center p-3 text-muted"> No new notifications </div> <?php endif; ?> </div> </div> <!-- User Dropdown --> <div class="dropdown"> <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown"> <i class="fas fa-user me-1"></i> <?php echo htmlspecialchars($current_user['first_name']); ?> </button> <ul class="dropdown-menu dropdown-menu-end"> <li> <a class="dropdown-item" href="/profile"> <i class="fas fa-user me-2"></i> My Profile </a> </li> <li> <a class="dropdown-item" href="/settings"> <i class="fas fa-cog me-2"></i> Settings </a> </li> <li><hr class="dropdown-divider"></li> <li> <a class="dropdown-item text-danger" href="/logout"> <i class="fas fa-sign-out-alt me-2"></i> Logout </a> </li> </ul> </div> </div> </div> </nav> <!-- Main Content --> <main class="container-fluid py-4"> <!-- Flash Messages --> <?php echo displayFlashMessages(); ?> <!-- Page Content will be inserted here --> <?php // Content will be inserted by individual pages ?> <?php else: ?> <!-- Public Layout (for login, forgot password, etc.) --> <div class="public-layout"> <!-- Public content will be inserted here --> <?php endif; ?>