Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
phphr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
phphr
Commits
7b9f7368
Commit
7b9f7368
authored
Apr 08, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 4 files via Son of Anton
parent
af73d3c0
Pipeline
#23
canceled with stage
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
663 additions
and
324 deletions
+663
-324
SSEController.php
engine/RealTime/SSEController.php
+228
-92
routes.php
modules/SSE/routes.php
+1
-0
app.js
public/assets/js/app.js
+352
-175
app.php
templates/layouts/app.php
+82
-57
No files found.
engine/RealTime/SSEController.php
View file @
7b9f7368
This diff is collapsed.
Click to expand it.
modules/SSE/routes.php
View file @
7b9f7368
...
@@ -5,5 +5,6 @@ use Engine\Core\Container;
...
@@ -5,5 +5,6 @@ use Engine\Core\Container;
$router
=
Container
::
getInstance
()
->
resolve
(
Engine\Core\Router
::
class
);
$router
=
Container
::
getInstance
()
->
resolve
(
Engine\Core\Router
::
class
);
// SSE stream — only auth middleware, NO CSRF, NO audit (would flood the audit trail)
$router
->
get
(
'/sse/stream'
,
Engine\RealTime\SSEController
::
class
,
'stream'
)
$router
->
get
(
'/sse/stream'
,
Engine\RealTime\SSEController
::
class
,
'stream'
)
->
middleware
([
Middleware\AuthenticationMiddleware
::
class
]);
->
middleware
([
Middleware\AuthenticationMiddleware
::
class
]);
\ No newline at end of file
public/assets/js/app.js
View file @
7b9f7368
This diff is collapsed.
Click to expand it.
templates/layouts/app.php
View file @
7b9f7368
<?php
/** @var array $user */
/** @var string $content */
$notifCount
=
$unread_count
??
0
;
?>
<!DOCTYPE html>
<!DOCTYPE html>
<html
lang=
"en"
data-theme=
"
<?=
$__engine
->
e
(
$user
[
'theme_preference'
]
??
'light'
)
?>
"
>
<html
lang=
"en"
data-theme=
"
<?=
htmlspecialchars
(
$user
[
'theme_preference'
]
??
'light'
)
?>
"
>
<head>
<head>
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
<?=
$__engine
->
yield
(
'title'
,
'AL-ARCADE HR Platform'
)
?>
</title>
<meta
name=
"csrf_token"
content=
"
<?=
htmlspecialchars
(
$_SESSION
[
'csrf_token'
]
??
''
)
?>
"
>
<?=
$__engine
->
csrfMeta
()
?>
<meta
name=
"user-id"
content=
"
<?=
(
int
)(
$user
[
'id'
]
??
0
)
?>
"
>
<title>
The Grind — AL-ARCADE HR
</title>
<link
rel=
"stylesheet"
href=
"/assets/css/app.css"
>
<link
rel=
"stylesheet"
href=
"/assets/css/app.css"
>
<
?=
$__engine
->
yield
(
'head'
)
?
>
<
link
rel=
"stylesheet"
href=
"/assets/css/dark-mode.css"
>
</head>
</head>
<body
class=
"
<?=
$__engine
->
yield
(
'body_class'
,
''
)
?>
"
>
<body
class=
"logged-in
<?=
(
$user
[
'theme_preference'
]
??
''
)
===
'dark'
?
'dark-mode'
:
''
?>
"
>
<?php
if
(
isset
(
$user
)
&&
$user
)
:
?>
<nav
class=
"top-nav"
>
<header
class=
"top-nav"
>
<div
class=
"nav-brand"
>
<div
class=
"nav-left"
>
<a
href=
"/dashboard"
>
🎮 The Grind
</a>
<a
href=
"/dashboard"
class=
"nav-brand"
>
🎮
<span>
The Grind
</span></a>
</div>
<div
class=
"search-bar"
>
<div
class=
"nav-search"
>
<input
type=
"text"
id=
"global-search"
placeholder=
"Search... (Ctrl+K)"
autocomplete=
"off"
>
<input
type=
"text"
id=
"global-search"
placeholder=
"Search... (Ctrl+K)"
autocomplete=
"off"
>
</div>
</div>
<div
class=
"nav-actions"
>
</div>
<button
class=
"nav-btn"
id=
"notif-bell"
title=
"Notifications"
>
<div
class=
"nav-right"
>
🔔
<span
class=
"badge"
id=
"notif-count"
style=
"display:none"
>
0
</span>
<a
href=
"/notifications"
class=
"nav-icon"
title=
"Notifications"
>
</button>
🔔
<a
href=
"/messages"
class=
"nav-btn"
title=
"Messages"
>
💬
</a>
<span
class=
"notification-badge notif-count"
style=
"
<?=
$notifCount
>
0
?
''
:
'display:none'
?>
"
>
<?=
$notifCount
?>
</span>
<div
class=
"nav-user"
>
</a>
<span>
<?=
$__engine
->
e
(
$user
[
'full_name_en'
])
?>
</span>
<a
href=
"/messages"
class=
"nav-icon"
title=
"Messages"
>
💬
</a>
<span
class=
"role-badge"
>
<?=
$__engine
->
e
(
ucfirst
(
str_replace
(
'_'
,
' '
,
$user
[
'role'
])))
?>
</span>
<div
class=
"nav-user"
>
</div>
<span
class=
"nav-user-name"
>
<?=
htmlspecialchars
(
$user
[
'full_name_en'
]
??
'User'
)
?>
</span>
<form
action=
"/logout"
method=
"POST"
style=
"display:inline"
>
<span
class=
"nav-user-role"
>
<?=
strtoupper
(
str_replace
(
'_'
,
' '
,
$user
[
'role'
]
??
''
))
?>
</span>
<input
type=
"hidden"
name=
"_csrf_token"
value=
"
<?=
$__engine
->
e
(
$_COOKIE
[
'csrf_token'
]
??
''
)
?>
"
>
<button
type=
"submit"
class=
"nav-btn"
title=
"Logout"
>
🚪
</button>
</form>
</div>
</nav>
<?php
if
(
isset
(
$user
[
'role'
])
&&
$user
[
'role'
]
===
'contractor'
&&
in_array
(
$user
[
'status'
]
??
''
,
[
'active'
,
'on_pip'
,
'suspended'
])
&&
isset
(
$hud
))
:
?>
<div
class=
"hud"
id=
"salary-hud"
data-color=
"
<?=
$__engine
->
e
(
$hud
[
'color_class'
]
??
'hud-healthy'
)
?>
"
>
<div
class=
"hud-primary"
>
<span
class=
"hud-month"
>
💰
<?=
$__engine
->
e
(
$hud
[
'month_label'
]
??
date
(
'F Y'
))
?>
</span>
<div
class=
"hud-bar-container"
>
<div
class=
"hud-bar"
style=
"width:
<?=
min
(
100
,
max
(
0
,
$hud
[
'retention_pct'
]
??
100
))
?>
%"
></div>
</div>
<span
class=
"hud-amount"
>
EGP
<?=
number_format
(
$hud
[
'live_salary'
]
??
0
,
0
)
?>
/
<?=
number_format
(
$hud
[
'actual_salary'
]
??
0
,
0
)
?>
</span>
</div>
</div>
<div
class=
"hud-secondary"
>
<a
href=
"/users/
<?=
(
int
)(
$user
[
'id'
]
??
0
)
?>
"
class=
"nav-avatar"
title=
"Profile"
>
<?php
if
((
$hud
[
'deduction_count'
]
??
0
)
>
0
)
:
?>
<?php
if
(
!
empty
(
$user
[
'profile_photo_id'
]))
:
?>
<span
class=
"hud-deductions"
>
▼
<?=
$hud
[
'deduction_count'
]
?>
deductions (-
<?=
number_format
(
$hud
[
'total_deductions'
]
??
0
,
0
)
?>
)
</span>
<img
src=
"/uploads/photos/
<?=
(
int
)
$user
[
'profile_photo_id'
]
?>
"
alt=
"Profile"
>
<?php
endif
;
?>
<?php
else
:
?>
<?php
if
((
$hud
[
'bounty_count'
]
??
0
)
>
0
)
:
?>
🧑
<span
class=
"hud-bounties"
>
▲
<?=
$hud
[
'bounty_count'
]
?>
bounties (+
<?=
number_format
(
$hud
[
'total_bounties'
]
??
0
,
0
)
?>
)
</span>
<?php
endif
;
?>
<?php
endif
;
?>
<span
class=
"hud-health"
>
<?=
$hud
[
'health'
][
'icon'
]
??
'🟢'
?>
<?=
$hud
[
'health'
][
'label'
]
??
'Healthy'
?>
</span>
</a>
</div>
</div>
</div>
<?php
endif
;
?>
</header>
<nav
class=
"sidebar"
>
<ul>
<li><a
href=
"/dashboard"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/dashboard'
)
===
0
?
'active'
:
''
?>
"
>
📊 Dashboard
</a></li>
<li><a
href=
"/boards"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/boards'
)
===
0
?
'active'
:
''
?>
"
>
📋 Boards
</a></li>
<li><a
href=
"/reports/submit"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/reports'
)
===
0
?
'active'
:
''
?>
"
>
📝 Reports
</a></li>
<li><a
href=
"/users"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/users'
)
===
0
?
'active'
:
''
?>
"
>
👥 Directory
</a></li>
<li><a
href=
"/messages"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/messages'
)
===
0
?
'active'
:
''
?>
"
>
💬 Messages
</a></li>
<li><a
href=
"/notifications"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/notifications'
)
===
0
?
'active'
:
''
?>
"
>
🔔 Notifications
</a></li>
<?php
if
(
in_array
(
$user
[
'role'
]
??
''
,
[
'super_admin'
,
'admin'
]))
:
?>
<li
class=
"sidebar-divider"
></li>
<li><a
href=
"/deductions"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/deductions'
)
===
0
?
'active'
:
''
?>
"
>
⚠️ Deductions
</a></li>
<li><a
href=
"/payroll"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/payroll'
)
===
0
?
'active'
:
''
?>
"
>
💰 Payroll
</a></li>
<li><a
href=
"/evaluations"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/evaluations'
)
===
0
?
'active'
:
''
?>
"
>
📊 Evaluations
</a></li>
<li><a
href=
"/pips"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/pips'
)
===
0
?
'active'
:
''
?>
"
>
📈 PIPs
</a></li>
<li><a
href=
"/invites"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/invites'
)
===
0
?
'active'
:
''
?>
"
>
📨 Invites
</a></li>
<li><a
href=
"/analytics"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/analytics'
)
===
0
?
'active'
:
''
?>
"
>
📈 Analytics
</a></li>
<?php
endif
;
?>
<?php
if
((
$user
[
'role'
]
??
''
)
===
'super_admin'
)
:
?>
<li
class=
"sidebar-divider"
></li>
<li><a
href=
"/control-panel"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/control-panel'
)
===
0
?
'active'
:
''
?>
"
>
⚙️ Control Panel
</a></li>
<li><a
href=
"/settings"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/settings'
)
===
0
?
'active'
:
''
?>
"
>
🔧 Settings
</a></li>
<li><a
href=
"/audit-trail"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/audit-trail'
)
===
0
?
'active'
:
''
?>
"
>
📜 Audit Trail
</a></li>
<li><a
href=
"/api-keys"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/api-keys'
)
===
0
?
'active'
:
''
?>
"
>
🔑 API Keys
</a></li>
<li><a
href=
"/webhooks"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/webhooks'
)
===
0
?
'active'
:
''
?>
"
>
🔗 Webhooks
</a></li>
<li><a
href=
"/system-health"
class=
"
<?=
strpos
(
$_SERVER
[
'REQUEST_URI'
]
??
''
,
'/system-health'
)
===
0
?
'active'
:
''
?>
"
>
🏥 System Health
</a></li>
<?php
endif
;
?>
<li
class=
"sidebar-divider"
></li>
<li>
<form
action=
"/logout"
method=
"POST"
style=
"margin:0"
>
<input
type=
"hidden"
name=
"csrf_token"
value=
"
<?=
htmlspecialchars
(
$_SESSION
[
'csrf_token'
]
??
''
)
?>
"
>
<button
type=
"submit"
class=
"sidebar-link-btn"
>
🚪 Logout
</button>
</form>
</li>
</ul>
</nav>
<main
class=
"main-content"
>
<main
class=
"main-content"
>
<?=
$__engine
->
content
()
?>
<?=
$content
??
''
?>
</main>
</main>
<?php
else
:
?>
<?=
$__engine
->
content
()
?>
<?php
endif
;
?>
<div
id=
"toast-container"
></div>
<div
id=
"toast-container"
></div>
<div
id=
"search-modal"
class=
"modal"
style=
"display:none"
></div>
<div
id=
"notif-dropdown"
class=
"dropdown"
style=
"display:none"
></div>
<script
src=
"/assets/js/app.js"
></script>
<script
src=
"/assets/js/app.js"
></script>
<?=
$__engine
->
yield
(
'scripts'
)
?>
<?php
if
(
isset
(
$extra_js
))
:
?>
<?php
foreach
((
array
)
$extra_js
as
$js
)
:
?>
<script
src=
"
<?=
htmlspecialchars
(
$js
)
?>
"
></script>
<?php
endforeach
;
?>
<?php
endif
;
?>
</body>
</body>
</html>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment