Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
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
Clubphp
Commits
01cb0797
Commit
01cb0797
authored
Apr 08, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 3 files via Son of Anton
parent
220b3994
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
45 deletions
+62
-45
alerts.php
app/Shared/Components/alerts.php
+19
-43
auth.php
app/Shared/Layout/auth.php
+21
-1
main.php
app/Shared/Layout/main.php
+22
-1
No files found.
app/Shared/Components/alerts.php
View file @
01cb0797
<?php
<?php
/**
/**
* Flash alert messages component.
* Alerts component — reads flash alerts from session and displays them.
* Bulletproof: will never crash, never kill the page.
*/
*/
$session
=
\App\Core\App
::
getInstance
()
->
session
();
$__alertList
=
[];
$alerts
=
$session
->
getAlerts
();
try
{
if
(
isset
(
$_SESSION
[
'_flash'
][
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_flash'
][
'_alerts'
]))
{
if
(
empty
(
$alerts
))
{
$__alertList
=
$_SESSION
[
'_flash'
][
'_alerts'
];
return
;
unset
(
$_SESSION
[
'_flash'
][
'_alerts'
]);
}
elseif
(
isset
(
$_SESSION
[
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_alerts'
]))
{
$__alertList
=
$_SESSION
[
'_alerts'
];
unset
(
$_SESSION
[
'_alerts'
]);
}
}
catch
(
\Throwable
$__e
)
{
$__alertList
=
[];
}
}
foreach
(
$__alertList
as
$__a
)
:
$__type
=
$__a
[
'type'
]
??
'info'
;
$__msg
=
$__a
[
'message'
]
??
''
;
if
(
$__msg
===
''
)
continue
;
?>
?>
<?php
foreach
(
$alerts
as
$alert
)
:
?>
<div
class=
"alert alert-
<?=
e
(
$__type
)
?>
"
>
<?=
e
(
$__msg
)
?>
</div>
<?php
$type
=
$alert
[
'type'
]
??
'info'
;
$message
=
$alert
[
'message'
]
??
''
;
$bgColor
=
match
(
$type
)
{
'success'
=>
'#F0FDF4'
,
'error'
=>
'#FEF2F2'
,
'warning'
=>
'#FFF7ED'
,
'info'
=>
'#EFF6FF'
,
default
=>
'#F9FAFB'
,
};
$textColor
=
match
(
$type
)
{
'success'
=>
'#059669'
,
'error'
=>
'#DC2626'
,
'warning'
=>
'#D97706'
,
'info'
=>
'#0284C7'
,
default
=>
'#6B7280'
,
};
$borderColor
=
match
(
$type
)
{
'success'
=>
'#BBF7D0'
,
'error'
=>
'#FECACA'
,
'warning'
=>
'#FED7AA'
,
'info'
=>
'#BFDBFE'
,
default
=>
'#E5E7EB'
,
};
$icon
=
match
(
$type
)
{
'success'
=>
'✓'
,
'error'
=>
'✗'
,
'warning'
=>
'⚠'
,
'info'
=>
'ℹ'
,
default
=>
''
,
};
?>
<div
class=
"alert alert-
<?=
$type
?>
"
style=
"background:
<?=
$bgColor
?>
;color:
<?=
$textColor
?>
;border:1px solid
<?=
$borderColor
?>
;padding:12px 20px;border-radius:8px;margin:0 25px 15px;font-size:14px;display:flex;justify-content:space-between;align-items:center;"
>
<span>
<?=
$icon
?>
<?=
e
(
$message
)
?>
</span>
<button
onclick=
"this.parentElement.remove()"
style=
"background:none;border:none;cursor:pointer;font-size:18px;color:
<?=
$textColor
?>
;opacity:0.6;padding:0 5px;"
>
×
</button>
</div>
<?php
endforeach
;
?>
<?php
endforeach
;
?>
\ No newline at end of file
app/Shared/Layout/auth.php
View file @
01cb0797
...
@@ -25,7 +25,27 @@
...
@@ -25,7 +25,27 @@
<h1>
🏛️ THE CLUB
</h1>
<h1>
🏛️ THE CLUB
</h1>
<p>
نادي النادي شيراتون — Sports City
</p>
<p>
نادي النادي شيراتون — Sports City
</p>
</div>
</div>
<?php
try
{
$__template
->
include
(
'Shared.Components.alerts'
);
}
catch
(
\Throwable
$e
)
{}
?>
<?php
// Inline alert reading — no includes, no method calls that can crash
$__alertList
=
[];
try
{
if
(
isset
(
$_SESSION
[
'_flash'
][
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_flash'
][
'_alerts'
]))
{
$__alertList
=
$_SESSION
[
'_flash'
][
'_alerts'
];
unset
(
$_SESSION
[
'_flash'
][
'_alerts'
]);
}
elseif
(
isset
(
$_SESSION
[
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_alerts'
]))
{
$__alertList
=
$_SESSION
[
'_alerts'
];
unset
(
$_SESSION
[
'_alerts'
]);
}
}
catch
(
\Throwable
$__e
)
{}
foreach
(
$__alertList
as
$__a
)
:
$__type
=
$__a
[
'type'
]
??
'info'
;
$__msg
=
$__a
[
'message'
]
??
''
;
if
(
$__msg
===
''
)
continue
;
?>
<div
class=
"alert alert-
<?=
e
(
$__type
)
?>
"
style=
"margin-bottom:15px;"
>
<?=
e
(
$__msg
)
?>
</div>
<?php
endforeach
;
?>
<?php
$__template
->
yield
(
'content'
);
?>
<?php
$__template
->
yield
(
'content'
);
?>
</div>
</div>
</body>
</body>
...
...
app/Shared/Layout/main.php
View file @
01cb0797
...
@@ -35,9 +35,30 @@
...
@@ -35,9 +35,30 @@
</div>
</div>
</header>
</header>
<?php
// Inline alert reading — direct $_SESSION access, zero method calls
$__alertList
=
[];
try
{
if
(
isset
(
$_SESSION
[
'_flash'
][
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_flash'
][
'_alerts'
]))
{
$__alertList
=
$_SESSION
[
'_flash'
][
'_alerts'
];
unset
(
$_SESSION
[
'_flash'
][
'_alerts'
]);
}
elseif
(
isset
(
$_SESSION
[
'_alerts'
])
&&
is_array
(
$_SESSION
[
'_alerts'
]))
{
$__alertList
=
$_SESSION
[
'_alerts'
];
unset
(
$_SESSION
[
'_alerts'
]);
}
}
catch
(
\Throwable
$__e
)
{}
if
(
!
empty
(
$__alertList
))
:
?>
<div
style=
"padding:15px 25px 0;"
>
<div
style=
"padding:15px 25px 0;"
>
<?php
try
{
$__template
->
include
(
'Shared.Components.alerts'
);
}
catch
(
\Throwable
$e
)
{}
?>
<?php
foreach
(
$__alertList
as
$__a
)
:
$__type
=
$__a
[
'type'
]
??
'info'
;
$__msg
=
$__a
[
'message'
]
??
''
;
if
(
$__msg
===
''
)
continue
;
?>
<div
class=
"alert alert-
<?=
e
(
$__type
)
?>
"
>
<?=
e
(
$__msg
)
?>
</div>
<?php
endforeach
;
?>
</div>
</div>
<?php
endif
;
?>
<main
class=
"main-content"
>
<main
class=
"main-content"
>
<?php
$__template
->
yield
(
'content'
);
?>
<?php
$__template
->
yield
(
'content'
);
?>
...
...
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