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
ea22df8a
Commit
ea22df8a
authored
May 18, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed serial duplication
parent
1be9b982
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
8 deletions
+66
-8
CoachController.php
app/Modules/SportsActivity/Controllers/CoachController.php
+2
-2
PlayerController.php
app/Modules/SportsActivity/Controllers/PlayerController.php
+14
-6
show.php
app/Modules/SportsActivity/Views/players/show.php
+50
-0
No files found.
app/Modules/SportsActivity/Controllers/CoachController.php
View file @
ea22df8a
...
...
@@ -129,7 +129,7 @@ class CoachController extends Controller
'hourly_rate'
=>
$hourlyRate
!==
''
?
(
float
)
$hourlyRate
:
null
,
'session_rate'
=>
$sessionRate
!==
''
?
(
float
)
$sessionRate
:
null
,
'monthly_rate'
=>
$monthlyRate
!==
''
?
(
float
)
$monthlyRate
:
null
,
'max_groups'
=>
$maxGroups
!==
''
?
(
int
)
$maxGroups
:
null
,
'max_groups'
=>
$maxGroups
!==
''
?
(
int
)
$maxGroups
:
10
,
'bio_ar'
=>
$bioAr
?:
null
,
'is_active'
=>
1
,
'branch_id'
=>
App
::
getInstance
()
->
session
()
->
get
(
'branch_id'
,
1
),
...
...
@@ -273,7 +273,7 @@ class CoachController extends Controller
'hourly_rate'
=>
$hourlyRate
!==
''
?
(
float
)
$hourlyRate
:
null
,
'session_rate'
=>
$sessionRate
!==
''
?
(
float
)
$sessionRate
:
null
,
'monthly_rate'
=>
$monthlyRate
!==
''
?
(
float
)
$monthlyRate
:
null
,
'max_groups'
=>
$maxGroups
!==
''
?
(
int
)
$maxGroups
:
null
,
'max_groups'
=>
$maxGroups
!==
''
?
(
int
)
$maxGroups
:
10
,
'bio_ar'
=>
$bioAr
?:
null
,
'updated_at'
=>
date
(
'Y-m-d H:i:s'
),
],
'`id` = ?'
,
[(
int
)
$id
]);
...
...
app/Modules/SportsActivity/Controllers/PlayerController.php
View file @
ea22df8a
...
...
@@ -123,12 +123,10 @@ class PlayerController extends Controller
}
// Generate registration serial
$lastSerial
=
$db
->
selectOne
(
"SELECT registration_serial FROM sa_players ORDER BY id DESC LIMIT 1"
);
$nextNum
=
1
;
if
(
$lastSerial
&&
!
empty
(
$lastSerial
[
'registration_serial'
]))
{
$parts
=
explode
(
'-'
,
$lastSerial
[
'registration_serial'
]);
$nextNum
=
(
int
)
end
(
$parts
)
+
1
;
}
$maxSerial
=
$db
->
selectOne
(
"SELECT MAX(CAST(SUBSTRING(registration_serial, 5) AS UNSIGNED)) as max_num FROM sa_players WHERE registration_serial LIKE 'SAP-%'"
);
$nextNum
=
((
int
)
(
$maxSerial
[
'max_num'
]
??
0
))
+
1
;
$serialNumber
=
'SAP-'
.
str_pad
((
string
)
$nextNum
,
5
,
'0'
,
STR_PAD_LEFT
);
$data
=
[
...
...
@@ -184,11 +182,21 @@ class PlayerController extends Controller
$employee
=
App
::
getInstance
()
->
currentEmployee
();
$canApproveMedical
=
$employee
&&
method_exists
(
$employee
,
'hasPermission'
)
&&
$employee
->
hasPermission
(
'sa.medical.approve'
);
$unpaidSubs
=
$db
->
select
(
"SELECT s.*, g.name_ar as group_name
FROM sa_subscriptions s
LEFT JOIN sa_groups g ON g.id = s.group_id
WHERE s.player_id = ? AND s.payment_status IN ('unpaid', 'overdue', 'partial')
ORDER BY s.period_start DESC"
,
[(
int
)
$id
]
);
return
$this
->
view
(
'SportsActivity.Views.players.show'
,
[
'player'
=>
$player
,
'documents'
=>
$documents
,
'medicalHistory'
=>
$medicalHistory
,
'canApproveMedical'
=>
$canApproveMedical
,
'unpaidSubs'
=>
$unpaidSubs
,
]);
}
...
...
app/Modules/SportsActivity/Views/players/show.php
View file @
ea22df8a
...
...
@@ -225,6 +225,56 @@ $relationLabels = ['father' => 'أب', 'mother' => 'أم', 'brother' => 'أخ',
<?php
endif
;
?>
</div>
<!-- Unpaid Subscriptions -->
<?php
if
(
!
empty
(
$unpaidSubs
))
:
?>
<div
class=
"card"
style=
"margin-bottom:20px;"
>
<div
style=
"padding:15px 20px;border-bottom:1px solid #E5E7EB;display:flex;justify-content:space-between;align-items:center;"
>
<h3
style=
"margin:0;font-size:16px;font-weight:600;"
>
<i
data-lucide=
"alert-circle"
style=
"width:18px;height:18px;vertical-align:middle;margin-left:6px;color:#DC2626;"
></i>
اشتراكات غير مدفوعة
<span
style=
"padding:2px 8px;border-radius:10px;font-size:12px;font-weight:700;background:#FEE2E2;color:#DC2626;margin-right:8px;"
>
<?=
count
(
$unpaidSubs
)
?>
</span>
</h3>
</div>
<div
class=
"table-responsive"
>
<table
class=
"data-table"
>
<thead>
<tr>
<th>
المجموعة
</th>
<th>
الفترة
</th>
<th>
المبلغ
</th>
<th>
الحالة
</th>
<th>
إجراء
</th>
</tr>
</thead>
<tbody>
<?php
$subStatusLabels
=
[
'unpaid'
=>
'غير مدفوع'
,
'overdue'
=>
'متأخر'
,
'partial'
=>
'جزئي'
];
$subStatusColors
=
[
'unpaid'
=>
'#D97706'
,
'overdue'
=>
'#DC2626'
,
'partial'
=>
'#1D4ED8'
];
?>
<?php
foreach
(
$unpaidSubs
as
$sub
)
:
?>
<?php
$sColor
=
$subStatusColors
[
$sub
[
'payment_status'
]
??
''
]
??
'#6B7280'
;
?>
<tr>
<td
style=
"font-weight:600;"
>
<?=
e
(
$sub
[
'group_name'
]
??
'—'
)
?>
</td>
<td
style=
"font-size:13px;"
>
<?=
e
(
$sub
[
'period_start'
]
??
''
)
?>
→
<?=
e
(
$sub
[
'period_end'
]
??
''
)
?>
</td>
<td
style=
"font-weight:600;color:#059669;"
>
<?=
money
((
float
)
(
$sub
[
'final_amount'
]
??
0
))
?>
</td>
<td>
<span
style=
"padding:2px 8px;border-radius:8px;font-size:11px;font-weight:600;background:
<?=
$sColor
?>
15;color:
<?=
$sColor
?>
;"
>
<?=
e
(
$subStatusLabels
[
$sub
[
'payment_status'
]
??
''
]
??
''
)
?>
</span>
</td>
<td>
<a
href=
"/sa/subscriptions/
<?=
(
int
)
$sub
[
'id'
]
?>
"
class=
"btn btn-sm btn-primary"
style=
"padding:4px 10px;font-size:11px;"
>
<i
data-lucide=
"banknote"
style=
"width:12px;height:12px;vertical-align:middle;margin-left:3px;"
></i>
ادفع
</a>
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</div>
</div>
<?php
endif
;
?>
<!-- Documents Section -->
<div
class=
"card"
>
<div
style=
"padding:15px 20px;border-bottom:1px solid #E5E7EB;display:flex;justify-content:space-between;align-items:center;"
>
...
...
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