|
Server : LiteSpeed System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : outerorb ( 1091) PHP Version : 8.1.34 Disable Function : mail Directory : /home2/outerorb/emp.outerorbittech.in/admin/ | |
|
Path: /home2/outerorb/emp.outerorbittech.in/admin/report-recruitment.php
Size: 7.07 KB
Permissions: 0666
<?php
require __DIR__ . '/../includes/helpers.php';
require_admin();
ensure_notifications_table();
$admin = current_admin();
$pdo = db();
$recruitmentStats = get_recruitment_report();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Recruitment Report - HRMS</title>
<link rel="stylesheet" href="../assets/css/style.css" /> <link rel="stylesheet" href="../assets/css/polish.css" /> <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<script src="../assets/js/app.js"></script>
</head>
<body class="dashboard-layout">
<div class="app-wrapper">
<!-- SIDEBAR -->
<aside class="sidebar-wrapper" id="sidebar">
<div class="sidebar-header">
<div class="sidebar-logo">HR</div>
<div class="sidebar-company">
<div class="sidebar-company-name">Recruitment<br/>Report</div>
<div class="sidebar-company-role">Admin</div>
</div>
</div>
<nav class="sidebar-menu">
<div class="sidebar-section">
<div class="sidebar-section-title">๐ Reports</div>
<div class="sidebar-item">
<a href="reports.php" class="sidebar-link">๐ Overview</a>
</div>
<div class="sidebar-item">
<a href="report-recruitment.php" class="sidebar-link active">๐ค Recruitment</a>
</div>
</div>
</nav>
</aside>
<!-- MAIN CONTENT -->
<div class="main-content">
<!-- Top Bar -->
<div class="top-bar">
<div class="top-bar-left">
<button class="sidebar-toggle" id="sidebarToggle" aria-label="Toggle sidebar">รขหยฐ</button>
<div>
<h1 class="page-title">Recruitment Report</h1>
<div class="breadcrumb-nav">
<span>Reports</span> / <span>Recruitment</span>
</div>
</div>
</div>
<div class="top-bar-right">
<button class="notification-bell" title="Notifications">
<i class="fas fa-bell"></i>
<?php
$unreadCount = get_unread_notification_count($admin['id']);
if ($unreadCount > 0):
?>
<span class="notification-badge"><?php echo $unreadCount; ?></span>
<?php endif; ?>
</button>
<a href="logout.php" style="color: #cbd5e1; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;">รขโ ย Logout</a>
</div>
</div>
<!-- Main Content -->
<div class="dashboard-container">
<!-- KPI Cards -->
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px;">
<?php foreach ($recruitmentStats as $stat): ?>
<div class="kpi-card">
<div class="kpi-header">
<div class="kpi-title"><?php echo htmlspecialchars($stat['metric'], ENT_QUOTES, 'UTF-8'); ?></div>
</div>
<div class="kpi-value"><?php echo (int)$stat['count']; ?></div>
</div>
<?php endforeach; ?>
</div>
<!-- Recruitment Pipeline Chart -->
<div class="chart-card">
<div class="chart-header">Recruitment Pipeline</div>
<canvas id="recruitmentChart" height="80"></canvas>
</div>
<!-- Detailed Stats Table -->
<div class="chart-card" style="margin-top: 24px;">
<div class="chart-header">Pipeline Breakdown</div>
<div class="table-wrapper">
<table class="table">
<thead>
<tr>
<th>Status</th>
<th class="cell-nowrap">Count</th>
<th class="cell-nowrap">Percentage</th>
</tr>
</thead>
<tbody>
<?php
$total = array_sum(array_column($recruitmentStats, 'count'));
foreach ($recruitmentStats as $stat):
$percentage = $total > 0 ? round(($stat['count'] / $total) * 100, 1) : 0;
?>
<tr>
<td><?php echo htmlspecialchars($stat['metric'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="cell-nowrap"><strong><?php echo (int)$stat['count']; ?></strong></td>
<td class="cell-nowrap">
<div style="display: flex; align-items: center; gap: 8px;">
<div style="width: 150px; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden;">
<div style="height: 100%; width: <?php echo $percentage; ?>%; background: #2563eb;"></div>
</div>
<span style="color: #9ca3af; font-size: 12px;"><?php echo $percentage; ?>%</span>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
const sidebar = document.getElementById('sidebar');
const sidebarToggle = document.getElementById('sidebarToggle');
sidebarToggle?.addEventListener('click', () => {
sidebar.classList.toggle('open');
});
document.addEventListener('click', (e) => {
if (!sidebar.contains(e.target) && !sidebarToggle.contains(e.target)) {
sidebar.classList.remove('open');
}
});
// Recruitment Chart
new Chart(document.getElementById('recruitmentChart'), {
type: 'bar',
data: {
labels: <?php echo json_encode(array_column($recruitmentStats, 'metric')); ?>,
datasets: [{
label: 'Count',
data: <?php echo json_encode(array_column($recruitmentStats, 'count')); ?>,
backgroundColor: ['#3b82f6', '#60a5fa', '#93c5fd', '#dbeafe', '#eff6ff'],
borderRadius: 6,
}]
},
options: {
indexAxis: 'y',
responsive: true,
plugins: { legend: { display: false } },
scales: { x: { beginAtZero: true, ticks: { precision: 0 } } }
}
});
</script>
</body>
</html>