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
048af80b
Commit
048af80b
authored
Apr 08, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 4 files via Son of Anton
parent
8ee666cd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
8 deletions
+40
-8
ChildController.php
app/Modules/Children/Controllers/ChildController.php
+3
-0
create.php
app/Modules/Children/Views/create.php
+11
-0
SpouseController.php
app/Modules/Spouses/Controllers/SpouseController.php
+16
-6
create.php
app/Modules/Spouses/Views/create.php
+10
-2
No files found.
app/Modules/Children/Controllers/ChildController.php
View file @
048af80b
...
...
@@ -22,9 +22,12 @@ class ChildController extends Controller
return
$this
->
redirect
(
'/members'
)
->
withError
(
'العضو غير موجود'
);
}
$countries
=
$db
->
select
(
"SELECT id, nationality_ar FROM countries WHERE is_active = 1 ORDER BY nationality_ar"
);
return
$this
->
view
(
'Children.Views.create'
,
[
'member'
=>
$member
,
'childOrder'
=>
Child
::
getNextOrder
((
int
)
$memberId
),
'countries'
=>
$countries
,
]);
}
...
...
app/Modules/Children/Views/create.php
View file @
048af80b
...
...
@@ -61,6 +61,17 @@
<option
value=
"female"
<?=
old
(
'gender'
)
===
'female'
?
'selected'
:
''
?>
>
أنثى
</option>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
الجنسية
<span
style=
"color:#DC2626;"
>
*
</span></label>
<select
name=
"nationality"
class=
"form-select"
required
>
<option
value=
"مصري"
<?=
(
old
(
'nationality'
,
'مصري'
)
===
'مصري'
)
?
'selected'
:
''
?>
>
مصري
</option>
<?php
foreach
(
$countries
as
$c
)
:
?>
<?php
if
(
$c
[
'nationality_ar'
]
!==
'مصري'
)
:
?>
<option
value=
"
<?=
e
(
$c
[
'nationality_ar'
])
?>
"
<?=
old
(
'nationality'
)
===
$c
[
'nationality_ar'
]
?
'selected'
:
''
?>
>
<?=
e
(
$c
[
'nationality_ar'
])
?>
</option>
<?php
endif
;
?>
<?php
endforeach
;
?>
</select>
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
الكلية / المدرسة
</label>
<input
type=
"text"
name=
"school_faculty"
value=
"
<?=
e
(
old
(
'school_faculty'
))
?>
"
class=
"form-input"
>
...
...
app/Modules/Spouses/Controllers/SpouseController.php
View file @
048af80b
...
...
@@ -33,11 +33,13 @@ class SpouseController extends Controller
}
$qualifications
=
$db
->
select
(
"SELECT id, name_ar FROM qualifications WHERE is_active = 1 ORDER BY sort_order"
);
$countries
=
$db
->
select
(
"SELECT id, nationality_ar FROM countries WHERE is_active = 1 ORDER BY nationality_ar"
);
return
$this
->
view
(
'Spouses.Views.create'
,
[
'member'
=>
$member
,
'spouseOrder'
=>
$currentCount
+
1
,
'qualifications'
=>
$qualifications
,
'countries'
=>
$countries
,
'requiredGender'
=>
Spouse
::
getRequiredSpouseGender
(
$member
[
'gender'
]),
'maxAllowed'
=>
$maxAllowed
,
'currentCount'
=>
$currentCount
,
...
...
@@ -131,9 +133,17 @@ class SpouseController extends Controller
return
$this
->
redirect
(
"/members/
{
$memberId
}
/spouses/create"
);
}
// ── Fee calculation ──
$spouseOrder
=
$currentCount
+
1
;
$feeCalc
=
SpouseFeeCalculator
::
calculate
((
int
)
$memberId
,
$spouseOrder
);
// ── Fee calculation — pass spouse data array ──
$feeCalc
=
SpouseFeeCalculator
::
calculate
((
int
)
$memberId
,
[
'nationality'
=>
$data
[
'nationality'
]
??
'مصري'
,
'marriage_date'
=>
$data
[
'marriage_date'
]
??
null
,
]);
if
(
!
empty
(
$feeCalc
[
'error'
]))
{
return
$this
->
redirect
(
"/members/
{
$memberId
}
/spouses/create"
)
->
withError
(
$feeCalc
[
'error'
]);
}
$spouseOrder
=
$feeCalc
[
'spouse_order'
]
??
(
$currentCount
+
1
);
$spouse
=
Spouse
::
create
([
'member_id'
=>
(
int
)
$memberId
,
...
...
@@ -156,7 +166,7 @@ class SpouseController extends Controller
'marriage_date'
=>
$data
[
'marriage_date'
],
'join_date'
=>
date
(
'Y-m-d'
),
'classification'
=>
'working'
,
'addition_fee'
=>
$feeCalc
[
'fee'
]
??
'0.00'
,
'addition_fee'
=>
$feeCalc
[
'
total_
fee'
]
??
'0.00'
,
'status'
=>
'active'
,
]);
...
...
@@ -164,12 +174,12 @@ class SpouseController extends Controller
'member_id'
=>
(
int
)
$memberId
,
'spouse_id'
=>
(
int
)
$spouse
->
id
,
'spouse_order'
=>
$spouseOrder
,
'fee'
=>
$feeCalc
[
'fee'
]
??
'0.00'
,
'fee'
=>
$feeCalc
[
'
total_
fee'
]
??
'0.00'
,
]);
$genderWord
=
$requiredGender
===
'male'
?
'الزوج'
:
'الزوجة'
;
return
$this
->
redirect
(
"/members/
{
$memberId
}
"
)
->
withSuccess
(
"تم إضافة
{
$genderWord
}
— الترتيب: #
{
$spouseOrder
}
— الرسوم: "
.
money
(
$feeCalc
[
'fee'
]
??
'0.00'
));
->
withSuccess
(
"تم إضافة
{
$genderWord
}
— الترتيب: #
{
$spouseOrder
}
— الرسوم: "
.
money
(
$feeCalc
[
'
total_
fee'
]
??
'0.00'
));
}
public
function
show
(
Request
$request
,
string
$memberId
,
string
$id
)
:
Response
...
...
app/Modules/Spouses/Views/create.php
View file @
048af80b
...
...
@@ -73,8 +73,16 @@ $genderValue = $requiredGender;
</div>
<div
class=
"form-group"
>
<label
class=
"form-label"
>
الجنسية
</label>
<input
type=
"text"
name=
"nationality"
value=
"
<?=
e
(
old
(
'nationality'
,
'مصري'
))
?>
"
class=
"form-input"
>
<label
class=
"form-label"
>
الجنسية
<span
style=
"color:#DC2626;"
>
*
</span></label>
<select
name=
"nationality"
class=
"form-select"
required
>
<option
value=
"مصري"
<?=
(
old
(
'nationality'
,
'مصري'
)
===
'مصري'
)
?
'selected'
:
''
?>
>
مصري
</option>
<?php
foreach
(
$countries
as
$c
)
:
?>
<?php
if
(
$c
[
'nationality_ar'
]
!==
'مصري'
)
:
?>
<option
value=
"
<?=
e
(
$c
[
'nationality_ar'
])
?>
"
<?=
old
(
'nationality'
)
===
$c
[
'nationality_ar'
]
?
'selected'
:
''
?>
>
<?=
e
(
$c
[
'nationality_ar'
])
?>
</option>
<?php
endif
;
?>
<?php
endforeach
;
?>
</select>
<small
style=
"color:#D97706;font-size:11px;"
>
⚠ الجنسية تؤثر على الرسوم — الأجنبي = 15% من قيمة العضوية
</small>
</div>
<div
class=
"form-group"
>
...
...
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