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
d63df4a2
Commit
d63df4a2
authored
May 22, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
total overdose
parent
e0231db7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
FacilityController.php
...Modules/SportsActivity/Controllers/FacilityController.php
+19
-0
LockerRentalController.php
...les/SportsActivity/Controllers/LockerRentalController.php
+1
-1
PlayerController.php
app/Modules/SportsActivity/Controllers/PlayerController.php
+5
-5
No files found.
app/Modules/SportsActivity/Controllers/FacilityController.php
View file @
d63df4a2
...
@@ -379,6 +379,25 @@ class FacilityController extends Controller
...
@@ -379,6 +379,25 @@ class FacilityController extends Controller
$errors
[]
=
'يجب اختيار يوم واحد على الأقل'
;
$errors
[]
=
'يجب اختيار يوم واحد على الأقل'
;
}
}
if
(
empty
(
$errors
)
&&
!
empty
(
$daysOfWeek
)
&&
$startTime
!==
''
&&
$endTime
!==
''
)
{
$db
=
App
::
getInstance
()
->
db
();
$existing
=
$db
->
select
(
"SELECT id, name_ar, start_time, end_time, days_of_week_json
FROM sa_time_brackets
WHERE facility_id = ? AND is_active = 1"
,
[(
int
)
$fid
]
);
$newDays
=
array_map
(
'intval'
,
(
array
)
$daysOfWeek
);
foreach
(
$existing
as
$bracket
)
{
$existingDays
=
json_decode
(
$bracket
[
'days_of_week_json'
],
true
)
?:
[];
$sharedDays
=
array_intersect
(
$newDays
,
$existingDays
);
if
(
!
empty
(
$sharedDays
)
&&
$startTime
<
$bracket
[
'end_time'
]
&&
$endTime
>
$bracket
[
'start_time'
])
{
$errors
[]
=
"تتعارض هذه الفترة مع فترة
\"
{
$bracket
[
'name_ar'
]
}
\"
في نفس الأيام والأوقات"
;
break
;
}
}
}
if
(
!
empty
(
$errors
))
{
if
(
!
empty
(
$errors
))
{
$session
=
App
::
getInstance
()
->
session
();
$session
=
App
::
getInstance
()
->
session
();
$session
->
flash
(
'_old_input'
,
$_POST
);
$session
->
flash
(
'_old_input'
,
$_POST
);
...
...
app/Modules/SportsActivity/Controllers/LockerRentalController.php
View file @
d63df4a2
...
@@ -200,7 +200,7 @@ class LockerRentalController extends Controller
...
@@ -200,7 +200,7 @@ class LockerRentalController extends Controller
$db
=
App
::
getInstance
()
->
db
();
$db
=
App
::
getInstance
()
->
db
();
$rental
=
$db
->
selectOne
(
$rental
=
$db
->
selectOne
(
"SELECT lr.*, p.full_name_ar as player_name, p.
code
as player_code,
"SELECT lr.*, p.full_name_ar as player_name, p.
registration_serial
as player_code,
l.code as locker_code, l.name_ar as locker_name, l.locker_type,
l.code as locker_code, l.name_ar as locker_name, l.locker_type,
e.full_name_ar as eviction_by_name
e.full_name_ar as eviction_by_name
FROM sa_locker_rentals lr
FROM sa_locker_rentals lr
...
...
app/Modules/SportsActivity/Controllers/PlayerController.php
View file @
d63df4a2
...
@@ -254,7 +254,7 @@ class PlayerController extends Controller
...
@@ -254,7 +254,7 @@ class PlayerController extends Controller
);
);
$enrolledGroups
=
$db
->
select
(
$enrolledGroups
=
$db
->
select
(
"SELECT gp.status as enrollment_status, gp.joined_at,
"SELECT gp.status as enrollment_status, gp.
enrolled_at as
joined_at,
g.id as group_id, g.name_ar as group_name, g.code as group_code,
g.id as group_id, g.name_ar as group_name, g.code as group_code,
p.name_ar as program_name, c.full_name_ar as coach_name
p.name_ar as program_name, c.full_name_ar as coach_name
FROM sa_group_players gp
FROM sa_group_players gp
...
@@ -262,7 +262,7 @@ class PlayerController extends Controller
...
@@ -262,7 +262,7 @@ class PlayerController extends Controller
LEFT JOIN sa_programs p ON p.id = g.program_id
LEFT JOIN sa_programs p ON p.id = g.program_id
LEFT JOIN sa_coaches c ON c.id = g.coach_id
LEFT JOIN sa_coaches c ON c.id = g.coach_id
WHERE gp.player_id = ? AND gp.status IN ('active', 'pending_payment')
WHERE gp.player_id = ? AND gp.status IN ('active', 'pending_payment')
ORDER BY gp.
join
ed_at DESC"
,
ORDER BY gp.
enroll
ed_at DESC"
,
[(
int
)
$id
]
[(
int
)
$id
]
);
);
...
@@ -272,17 +272,17 @@ class PlayerController extends Controller
...
@@ -272,17 +272,17 @@ class PlayerController extends Controller
FROM sa_bookings b
FROM sa_bookings b
INNER JOIN sa_facility_units fu ON fu.id = b.facility_unit_id
INNER JOIN sa_facility_units fu ON fu.id = b.facility_unit_id
INNER JOIN sa_facilities f ON f.id = fu.facility_id
INNER JOIN sa_facilities f ON f.id = fu.facility_id
WHERE b.
player_id = ?
WHERE b.
booker_id = ? AND b.booker_type = 'player'
ORDER BY b.booking_date DESC, b.start_time DESC
ORDER BY b.booking_date DESC, b.start_time DESC
LIMIT 20"
,
LIMIT 20"
,
[(
int
)
$id
]
[(
int
)
$id
]
);
);
$gateHistory
=
$db
->
select
(
$gateHistory
=
$db
->
select
(
"SELECT ga.
scan_time, ga.access_granted, ga.
gate_name, ga.denial_reason
"SELECT ga.
recorded_at as scan_time, ga.granted as access_granted, ga.access_point as
gate_name, ga.denial_reason
FROM sa_gate_access_log ga
FROM sa_gate_access_log ga
WHERE ga.player_id = ?
WHERE ga.player_id = ?
ORDER BY ga.
scan_time
DESC
ORDER BY ga.
recorded_at
DESC
LIMIT 20"
,
LIMIT 20"
,
[(
int
)
$id
]
[(
int
)
$id
]
);
);
...
...
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