-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics.html
More file actions
233 lines (221 loc) · 10.7 KB
/
analytics.html
File metadata and controls
233 lines (221 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Analytics — Simpatico HR</title>
<link rel="stylesheet" href="/hr-modules.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js"></script>
<style>
.chart-card {
background: var(--hr-bg-card); border: 1px solid var(--hr-border);
border-radius: var(--hr-radius-lg); padding: 20px;
}
.chart-card h3 {
font-family: var(--hr-font-display); font-size: 14px; font-weight: 600;
margin-bottom: 16px; color: var(--hr-text-primary);
}
.chart-container { position: relative; }
.metric-row {
display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 16px;
margin-bottom: 28px;
}
.metric-tile {
background: var(--hr-bg-card); border: 1px solid var(--hr-border);
border-radius: var(--hr-radius-lg); padding: 18px; text-align: center;
}
.metric-tile .mt-value {
font-family: var(--hr-font-display); font-size: 28px; font-weight: 800;
color: var(--hr-text-primary); line-height: 1;
}
.metric-tile .mt-label {
font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
color: var(--hr-text-muted); margin-top: 6px;
}
.metric-tile .mt-change {
font-size: 12px; margin-top: 6px;
}
</style>
<script>
// Hide shell when loaded inside dashboard iframe
if (window.self !== window.top) {
document.addEventListener("DOMContentLoaded", function() {
var shell = document.querySelector(".hr-shell");
if (shell) {
shell.style.gridTemplateColumns = "1fr";
shell.style.gridTemplateRows = "1fr";
}
var topbar = document.querySelector(".hr-topbar");
if (topbar) topbar.style.display = "none";
var sidebar = document.querySelector(".hr-sidebar");
if (sidebar) sidebar.style.display = "none";
var main = document.querySelector(".hr-main");
if (main) {
main.style.gridColumn = "1";
main.style.padding = "20px";
}
});
}
</script></head>
<body class="hr-module">
<div class="hr-shell">
<header class="hr-topbar">
<a href="/dashboard/hr.html" class="hr-topbar-brand">
<img src="favicon-96x96.png" style="width:24px;height:24px;margin-right:10px;border-radius:4px">Simpatico<span>HR</span>
</a>
<div class="hr-topbar-right">
<select class="hr-select" id="period-selector" onchange="changePeriod()" style="width:auto;min-width:130px">
<option value="30">Last 30 days</option>
<option value="90" selected>Last 90 days</option>
<option value="180">Last 180 days</option>
<option value="365">Last year</option>
</select>
<button class="hr-btn hr-btn-secondary hr-btn-sm" onclick="exportReport()">Export Report</button>
<div class="hr-avatar" id="user-avatar">U</div>
</div>
</header>
<nav class="hr-sidebar">
<div class="hr-nav-section">Core HR</div>
<a class="hr-nav-item" href="/employees.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/></svg>Employees</a>
<a class="hr-nav-item" href="/onboarding.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/></svg>Onboarding</a>
<a class="hr-nav-item" href="/training.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>Training</a>
<a class="hr-nav-item" href="/performance.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>Performance</a>
<div class="hr-nav-section" style="margin-top:8px">Operations</div>
<a class="hr-nav-item" href="/hr-ops.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="20" height="14" rx="2"/></svg>HR Ops</a>
<a class="hr-nav-item" href="/payroll.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>Payroll</a>
<div class="hr-nav-section" style="margin-top:8px">Intelligence</div>
<a class="hr-nav-item active" href="/analytics.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/></svg>Analytics</a>
<a class="hr-nav-item" href="/ai-assistant.html"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>AI Assistant</a>
<div class="hr-nav-section" style="margin-top:8px">Automation</div>
<a class="hr-nav-item" href="hr-automation.html">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>
HR Rules
</a>
<a class="hr-nav-item" href="ats-automation.html">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 8v4l3 3"/></svg>
ATS Engine
</a>
</nav>
<main class="hr-main">
<div class="hr-page-header">
<div class="hr-page-title">Analytics
<small>Workforce intelligence and HR metrics dashboard</small>
</div>
</div>
<!-- Key Metrics -->
<div class="metric-row" id="metrics-row">
<div class="metric-tile">
<div class="mt-value" id="m-headcount"></div>
<div class="mt-label">Total Headcount</div>
<div class="mt-change" id="m-headcount-c" style="color:var(--hr-success)"></div>
</div>
<div class="metric-tile">
<div class="mt-value" id="m-turnover"><span style="font-size:16px">%</span></div>
<div class="mt-label">Turnover Rate</div>
<div class="mt-change" id="m-turnover-c" style="color:var(--hr-warning)"></div>
</div>
<div class="metric-tile">
<div class="mt-value" id="m-time-to-hire"><span style="font-size:16px">d</span></div>
<div class="mt-label">Avg Time to Hire</div>
<div class="mt-change" id="m-hire-c" style="color:var(--hr-primary)"></div>
</div>
<div class="metric-tile">
<div class="mt-value" id="m-absentee"><span style="font-size:16px">%</span></div>
<div class="mt-label">Absenteeism Rate</div>
<div class="mt-change" id="m-abs-c" style="color:var(--hr-text-muted)"></div>
</div>
<div class="metric-tile">
<div class="mt-value" id="m-perf-score"></div>
<div class="mt-label">Avg Perf Score</div>
<div class="mt-change" id="m-perf-c" style="color:var(--hr-success)"></div>
</div>
<div class="metric-tile">
<div class="mt-value" id="m-training"><span style="font-size:16px">%</span></div>
<div class="mt-label">Training Completion</div>
<div class="mt-change" id="m-training-c" style="color:var(--hr-primary)"></div>
</div>
</div>
<!-- Predictive AI Insights -->
<div class="hr-grid-1" style="margin-bottom:20px">
<div class="chart-card" style="border-color:var(--hr-warning);">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;">
<h3 style="margin:0;color:var(--hr-warning);display:flex;align-items:center;gap:8px;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:18px;height:18px"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>
AI Predictive Flight Risk
</h3>
<span style="font-size:12px;color:var(--hr-text-muted)">Employees with high probability of attrition based on engagement, tenure, and performance trends</span>
</div>
<div class="hr-table-wrap">
<table class="hr-table" style="background:transparent;">
<thead><tr><th>Employee</th><th>Department</th><th>Risk Level</th><th>Primary Factors (AI Analysis)</th><th>Recommended Action</th></tr></thead>
<tbody id="ai-flight-risk-tbody"></tbody>
</table>
</div>
</div>
</div>
<!-- Charts Row 1 -->
<div class="hr-grid-2" style="margin-bottom:20px">
<div class="chart-card">
<h3>Headcount Over Time</h3>
<div class="chart-container" style="height:220px">
<canvas id="headcount-chart"></canvas>
</div>
</div>
<div class="chart-card">
<h3>Employees by Department</h3>
<div class="chart-container" style="height:220px">
<canvas id="dept-chart"></canvas>
</div>
</div>
</div>
<!-- Charts Row 2 -->
<div class="hr-grid-2" style="margin-bottom:20px">
<div class="chart-card">
<h3>Payroll Trend (Monthly)</h3>
<div class="chart-container" style="height:220px">
<canvas id="payroll-chart"></canvas>
</div>
</div>
<div class="chart-card">
<h3>Leave Distribution by Type</h3>
<div class="chart-container" style="height:220px">
<canvas id="leave-chart"></canvas>
</div>
</div>
</div>
<!-- Charts Row 3 -->
<div class="hr-grid-2" style="margin-bottom:20px">
<div class="chart-card">
<h3>Performance Score Distribution</h3>
<div class="chart-container" style="height:220px">
<canvas id="perf-dist-chart"></canvas>
</div>
</div>
<div class="chart-card">
<h3>Hiring Funnel (Last 90 days)</h3>
<div class="chart-container" style="height:220px">
<canvas id="hiring-chart"></canvas>
</div>
</div>
</div>
<!-- Dept breakdown table -->
<div class="hr-table-wrap">
<div class="hr-table-header">
<span class="hr-table-title">Department Breakdown</span>
</div>
<table class="hr-table">
<thead><tr><th>Department</th><th>Headcount</th><th>Avg Salary</th><th>Avg Tenure</th><th>Turnover</th><th>Perf Score</th></tr></thead>
<tbody id="dept-breakdown-tbody"></tbody>
</table>
</div>
</main>
</div>
<div class="hr-toast-container" id="toasts"></div>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<script src="/js/hr-config.js"></script>
<script src="/js/shared-utils.js"></script>
<script src="/js/supabase-client.js"></script>
<script src="/js/app.js"></script>
<script src="/js/analytics.js"></script>
</body>
</html>