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
669116e2
Commit
669116e2
authored
May 18, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CREATED
parent
ea22df8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
10 deletions
+48
-10
GroupController.php
app/Modules/SportsActivity/Controllers/GroupController.php
+6
-3
Group.php
app/Modules/SportsActivity/Models/Group.php
+7
-1
show.php
app/Modules/SportsActivity/Views/groups/show.php
+35
-6
No files found.
app/Modules/SportsActivity/Controllers/GroupController.php
View file @
669116e2
...
...
@@ -181,11 +181,14 @@ class GroupController extends Controller
// Available players for enrollment (not already in this group)
$availablePlayers
=
$db
->
select
(
"SELECT id, full_name_ar as name_ar, registration_serial as code FROM sa_players
WHERE is_archived = 0 AND id NOT IN (
"SELECT p.id, p.full_name_ar as name_ar, p.registration_serial as code,
(SELECT COUNT(*) FROM sa_subscriptions s
WHERE s.player_id = p.id AND s.payment_status IN ('unpaid','overdue','partial')) as unpaid_count
FROM sa_players p
WHERE p.is_archived = 0 AND p.id NOT IN (
SELECT player_id FROM sa_group_players WHERE group_id = ? AND status = 'active'
)
ORDER BY full_name_ar ASC LIMIT 100"
,
ORDER BY
p.
full_name_ar ASC LIMIT 100"
,
[(
int
)
$id
]
);
...
...
app/Modules/SportsActivity/Models/Group.php
View file @
669116e2
...
...
@@ -48,7 +48,13 @@ class Group extends Model
{
$db
=
App
::
getInstance
()
->
db
();
return
$db
->
select
(
"SELECT gp.*, p.full_name_ar as player_name, p.registration_serial as player_code, p.phone
"SELECT gp.*, p.full_name_ar as player_name, p.registration_serial as player_code, p.phone,
(SELECT COUNT(*) FROM sa_subscriptions s
WHERE s.player_id = gp.player_id AND s.group_id = gp.group_id
AND s.payment_status IN ('unpaid','overdue','partial')) as unpaid_count,
(SELECT SUM(s2.final_amount) FROM sa_subscriptions s2
WHERE s2.player_id = gp.player_id AND s2.group_id = gp.group_id
AND s2.payment_status IN ('unpaid','overdue','partial')) as unpaid_total
FROM sa_group_players gp
JOIN sa_players p ON p.id = gp.player_id
WHERE gp.group_id = ? AND gp.status = 'active'
...
...
app/Modules/SportsActivity/Views/groups/show.php
View file @
669116e2
...
...
@@ -81,14 +81,16 @@ $st = $group['status'] ?? 'active';
<!-- Enroll Form -->
<?php
if
((
int
)
$group
[
'current_count'
]
<
(
int
)
$group
[
'max_capacity'
])
:
?>
<div
style=
"padding:15px 20px;background:#F9FAFB;border-bottom:1px solid #E5E7EB;"
>
<form
method=
"POST"
action=
"/sa/groups/
<?=
(
int
)
$group
[
'id'
]
?>
/enroll"
style=
"display:flex;gap:10px;align-items:end;"
>
<form
method=
"POST"
action=
"/sa/groups/
<?=
(
int
)
$group
[
'id'
]
?>
/enroll"
style=
"display:flex;gap:10px;align-items:end;"
id=
"enrollForm"
>
<?=
csrf_field
()
?>
<div
style=
"flex:1;"
>
<label
class=
"form-label"
style=
"font-size:12px;"
>
تسجيل لاعب جديد
</label>
<select
name=
"player_id"
class=
"form-select"
required
>
<option
value=
""
>
-- اختر لاعب --
</option>
<select
name=
"player_id"
class=
"form-select"
required
id=
"enrollPlayerSelect"
>
<option
value=
""
data-unpaid=
"0"
>
-- اختر لاعب --
</option>
<?php
foreach
(
$availablePlayers
as
$ap
)
:
?>
<option
value=
"
<?=
(
int
)
$ap
[
'id'
]
?>
"
>
<?=
e
(
$ap
[
'name_ar'
])
?>
(
<?=
e
(
$ap
[
'code'
])
?>
)
</option>
<option
value=
"
<?=
(
int
)
$ap
[
'id'
]
?>
"
data-unpaid=
"
<?=
(
int
)
(
$ap
[
'unpaid_count'
]
??
0
)
?>
"
>
<?=
e
(
$ap
[
'name_ar'
])
?>
(
<?=
e
(
$ap
[
'code'
])
?>
)
<?=
(
int
)(
$ap
[
'unpaid_count'
]
??
0
)
>
0
?
' ⚠️ '
.
(
int
)
$ap
[
'unpaid_count'
]
.
' اشتراك غير مدفوع'
:
''
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
...
...
@@ -106,6 +108,7 @@ $st = $group['status'] ?? 'active';
<th>
الكود
</th>
<th>
الاسم
</th>
<th>
الهاتف
</th>
<th>
المستحقات
</th>
<th>
تاريخ التسجيل
</th>
<th>
إجراءات
</th>
</tr>
...
...
@@ -115,8 +118,19 @@ $st = $group['status'] ?? 'active';
<?php
foreach
(
$players
as
$pl
)
:
?>
<tr>
<td><code
style=
"font-size:11px;background:#F3F4F6;padding:2px 6px;border-radius:4px;"
>
<?=
e
(
$pl
[
'player_code'
]
??
''
)
?>
</code></td>
<td
style=
"font-weight:600;"
>
<?=
e
(
$pl
[
'player_name'
])
?>
</td>
<td
style=
"font-weight:600;"
>
<a
href=
"/sa/players/
<?=
(
int
)
$pl
[
'player_id'
]
?>
"
style=
"color:inherit;text-decoration:none;"
>
<?=
e
(
$pl
[
'player_name'
])
?>
</a>
</td>
<td
style=
"direction:ltr;text-align:right;"
>
<?=
e
(
$pl
[
'phone'
]
??
'—'
)
?>
</td>
<td>
<?php
if
((
int
)
(
$pl
[
'unpaid_count'
]
??
0
)
>
0
)
:
?>
<span
style=
"padding:3px 8px;border-radius:8px;font-size:11px;font-weight:700;background:#FEE2E2;color:#DC2626;"
>
<?=
(
int
)
$pl
[
'unpaid_count'
]
?>
غير مدفوع —
<?=
money
((
float
)
(
$pl
[
'unpaid_total'
]
??
0
))
?>
</span>
<?php
else
:
?>
<span
style=
"padding:3px 8px;border-radius:8px;font-size:11px;font-weight:600;background:#ECFDF5;color:#059669;"
>
سدد الكل
</span>
<?php
endif
;
?>
</td>
<td>
<?=
e
(
$pl
[
'enrolled_at'
]
??
''
)
?>
</td>
<td>
<form
method=
"POST"
action=
"/sa/groups/
<?=
(
int
)
$group
[
'id'
]
?>
/remove-player"
style=
"display:inline;"
onsubmit=
"return confirm('هل تريد سحب هذا اللاعب من المجموعة؟');"
>
...
...
@@ -131,7 +145,7 @@ $st = $group['status'] ?? 'active';
<?php
endforeach
;
?>
<?php
else
:
?>
<tr>
<td
colspan=
"
5
"
style=
"text-align:center;padding:30px;color:#6B7280;"
>
لا يوجد لاعبون مسجلون بعد
</td>
<td
colspan=
"
6
"
style=
"text-align:center;padding:30px;color:#6B7280;"
>
لا يوجد لاعبون مسجلون بعد
</td>
</tr>
<?php
endif
;
?>
</tbody>
...
...
@@ -229,6 +243,21 @@ $st = $group['status'] ?? 'active';
document
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
if
(
typeof
lucide
!==
'undefined'
)
lucide
.
createIcons
();
// Enrollment payment warning
var
enrollForm
=
document
.
getElementById
(
'enrollForm'
);
if
(
enrollForm
)
{
enrollForm
.
addEventListener
(
'submit'
,
function
(
e
)
{
var
sel
=
document
.
getElementById
(
'enrollPlayerSelect'
);
var
opt
=
sel
.
options
[
sel
.
selectedIndex
];
var
unpaid
=
parseInt
(
opt
.
getAttribute
(
'data-unpaid'
)
||
'0'
,
10
);
if
(
unpaid
>
0
)
{
if
(
!
confirm
(
'تنبيه: هذا اللاعب لديه '
+
unpaid
+
' اشتراك غير مدفوع!
\
nهل تريد تسجيله رغم ذلك؟'
))
{
e
.
preventDefault
();
}
}
});
}
var
dayNames
=
<?=
json_encode
(
$dayNames
)
?>
;
var
facilityUnits
=
<?=
json_encode
(
$facilityUnits
)
?>
;
...
...
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