Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mileage-claim
Overview
Overview
Details
Activity
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
trainee
mileage-claim
Commits
7a6b8b75
Commit
7a6b8b75
authored
Aug 18, 2026
by
Muhammad Danial Bin Mohd Zaidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update download and print pdf
parent
8a10485b
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
362 additions
and
71 deletions
+362
-71
packages/portal/overtime/resources/views/overtime/overtimeclaim/edit.blade.php
+9
-6
packages/portal/overtime/resources/views/overtime/overtimeclaim/hod/view.blade.php
+9
-6
packages/portal/overtime/resources/views/overtime/overtimeclaim/pd/view.blade.php
+9
-6
packages/portal/overtime/resources/views/overtime/overtimeclaim/projectmanager/view.blade.php
+9
-6
packages/portal/overtime/resources/views/overtime/overtimeclaim/view_modal.blade.php
+13
-6
packages/portal/overtime/resources/views/overtime/overtimeclaim/view_modal_content.blade.php
+9
-3
packages/portal/overtime/resources/views/overtime/overtimerequest/hod/view.blade.php
+6
-4
packages/portal/overtime/resources/views/overtime/overtimerequest/pd/view.blade.php
+6
-4
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/edit.blade.php
+6
-4
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/view_modal.blade.php
+32
-4
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/view_modal_content.blade.php
+43
-0
packages/portal/overtime/routes/web.php
+1
-0
packages/portal/overtime/src/Data/Repo/OvertimeClaimHodRepo.php
+4
-2
packages/portal/overtime/src/Http/Controllers/OvertimeClaimController.php
+44
-6
packages/portal/overtime/src/Http/Controllers/OvertimeClaimHodController.php
+15
-0
packages/portal/overtime/src/Http/Controllers/OvertimeClaimPdController.php
+15
-0
packages/portal/overtime/src/Http/Controllers/OvertimeHodController.php
+12
-2
packages/portal/overtime/src/Http/Controllers/OvertimePdController.php
+12
-2
packages/portal/overtime/src/Http/Controllers/OvertimeProjectManagerController.php
+16
-0
packages/portal/overtime/src/Http/Controllers/OvertimeRequestController.php
+92
-10
No files found.
packages/portal/overtime/resources/views/overtime/overtimeclaim/edit.blade.php
View file @
7a6b8b75
...
...
@@ -43,14 +43,17 @@
@endphp
<div class="
ot
-
summary
">
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Department: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$data->ocm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Division: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Month/Year: <strong>{{
$monthLabel
}}</strong></div>
<div class="
meta
-
line
">Status: <strong>{{
$statusLabel
}}</strong></div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div></div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Verified by: <strong>{{
$data->ocm_verified_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Verified Date: <strong>{{
$data->ocm_verified_date
? \Carbon\Carbon::parse(
$data->ocm_verified_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
" style="
margin
-
top
:.
7
rem
;
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div></div></div>
</div>
<div class="
ot
-
card
">
...
...
packages/portal/overtime/resources/views/overtime/overtimeclaim/hod/view.blade.php
View file @
7a6b8b75
...
...
@@ -26,17 +26,20 @@
<div id="
error
-
msg
" class="
ui
negative
message
" style="
display
:
none
;
margin
-
bottom
:.
75
rem
;
"><p id="
error
-
text
"></p></div>
<div class="
rf
-
summary
">
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Department: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$data->ocm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Division: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Month/Year: <strong>{{
$data->ocm_month
&&
$data->ocm_year
? \Carbon\Carbon::createFromDate(
$data->ocm_year
,
$data->ocm_month
, 1)->format('F Y') : '-' }}</strong></div>
<div class="
meta
-
line
">
Status:
<span class="
ui
label
" style="
font
-
size
:.
78
rem
;
">{{
$statuses[$data->ocm_status]
->description ?? '-' }}</span>
</div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div></div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Verified by: <strong>{{
$data->ocm_verified_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Verified Date: <strong>{{
$data->ocm_verified_date
? \Carbon\Carbon::parse(
$data->ocm_verified_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
" style="
margin
-
top
:.
7
rem
;
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div></div></div>
</div>
<div style="
overflow
-
x
:
auto
;
margin
-
bottom
:
1.3
rem
;
">
...
...
packages/portal/overtime/resources/views/overtime/overtimeclaim/pd/view.blade.php
View file @
7a6b8b75
...
...
@@ -26,17 +26,20 @@
<div id="
error
-
msg
" class="
ui
negative
message
" style="
display
:
none
;
margin
-
bottom
:.
75
rem
;
"><p id="
error
-
text
"></p></div>
<div class="
rf
-
summary
">
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Department: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$data->ocm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$data->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$data->ocm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Division: <strong>{{
$data->ocm_division_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Month/Year: <strong>{{
$data->ocm_month
&&
$data->ocm_year
? \Carbon\Carbon::createFromDate(
$data->ocm_year
,
$data->ocm_month
, 1)->format('F Y') : '-' }}</strong></div>
<div class="
meta
-
line
">
Status:
<span class="
ui
label
" style="
font
-
size
:.
78
rem
;
">{{
$statuses[$data->ocm_status]
->description ?? '-' }}</span>
</div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$data->ocm_submit_date
? \Carbon\Carbon::parse(
$data->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div></div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Verified by: <strong>{{
$data->ocm_verified_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Verified Date: <strong>{{
$data->ocm_verified_date
? \Carbon\Carbon::parse(
$data->ocm_verified_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
" style="
margin
-
top
:.
7
rem
;
">Approved by: <strong>{{
$data->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->ocm_approved_date
? \Carbon\Carbon::parse(
$data->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div></div></div>
</div>
<div style="
overflow
-
x
:
auto
;
margin
-
bottom
:
1.3
rem
;
">
...
...
packages/portal/overtime/resources/views/overtime/overtimeclaim/projectmanager/view.blade.php
View file @
7a6b8b75
...
...
@@ -81,16 +81,19 @@
@endphp
<div class="
ot
-
summary
">
<div class="
apply
-
no
">{{
$main->ocm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$main->ocm_staff_name
}}</strong></div>
<div class="
meta
-
line
">Department: <strong>{{
$main->ocm_division_label
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$main->ocm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$main->ocm_staff_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$main->ocm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Division: <strong>{{
$main->ocm_division_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Month/Year: <strong>{{
$monthLabel
}}</strong></div>
<div class="
meta
-
line
">
Status: <span class="
ui
label
" style="
font
-
size
:.
78
rem
;
">{{
$statuses[$main->ocm_status]
->description ?? '-' }}</span>
</div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$main->ocm_submit_date
? \Carbon\Carbon::parse(
$main->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved by: <strong>{{
$main->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->ocm_approved_date
? \Carbon\Carbon::parse(
$main->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Claim Date: <strong>{{
$main->ocm_submit_date
? \Carbon\Carbon::parse(
$main->ocm_submit_date
)->format('d/m/Y') : '-' }}</strong></div></div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Verified by: <strong>{{
$main->ocm_verified_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Verified Date: <strong>{{
$main->ocm_verified_date
? \Carbon\Carbon::parse(
$main->ocm_verified_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
" style="
margin
-
top
:.
7
rem
;
">Approved by: <strong>{{
$main->ocm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->ocm_approved_date
? \Carbon\Carbon::parse(
$main->ocm_approved_date
)->format('d/m/Y') : '-' }}</strong></div></div></div>
</div>
<div class="
ot
-
card
">
...
...
packages/portal/overtime/resources/views/overtime/overtimeclaim/view_modal.blade.php
View file @
7a6b8b75
...
...
@@ -9,6 +9,9 @@
}
#modalViewTuntutan
.vm-summary
.apply-no
{
font-size
:
1.05rem
;
font-weight
:
700
;
color
:
#1a56a0
;
}
#modalViewTuntutan
.vm-summary
.meta-line
{
font-size
:
.88rem
;
color
:
#333
;
}
#modalViewTuntutan
.vm-summary-columns
{
display
:
flex
;
justify-content
:
space-between
;
gap
:
2rem
;
}
#modalViewTuntutan
.vm-summary-primary
{
flex
:
1
;
}
#modalViewTuntutan
.vm-summary-approval
{
min-width
:
240px
;
margin-left
:
auto
;
}
#modalViewTuntutan
.vm-tbl
{
width
:
100%
;
border-collapse
:
collapse
;
font-size
:
.83rem
;
}
#modalViewTuntutan
.vm-tbl
th
,
...
...
@@ -143,14 +146,19 @@ function vcmBuildHtml(main, details) {
var
html
=
'<div class="vm-summary">'
+
'<div class="apply-no">'
+
vcmEsc
(
main
.
ocm_apply_no
||
'-'
)
+
'</div>'
+
'<div class="meta-line">Request by: <strong>'
+
vcmEsc
(
main
.
ocm_staff_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Department: <strong>'
+
vcmEsc
(
main
.
ocm_division_label
||
'-'
)
+
'</strong></div>'
+
'<div class="vm-summary-columns"><div class="vm-summary-primary">'
+
'<div class="meta-line">Name: <strong>'
+
vcmEsc
(
main
.
ocm_staff_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Staff ID: <strong>'
+
vcmEsc
(
main
.
ocm_staff_id
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Division: <strong>'
+
vcmEsc
(
main
.
ocm_division_label
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Month/Year: <strong>'
+
monthName
+
'</strong></div>'
+
'<div class="meta-line">Status: '
+
badge
+
'</div>'
+
'<div class="meta-line">Claim Date: <strong>'
+
vcmFmtDate
(
main
.
ocm_submit_date
)
+
'</strong></div>'
+
'<div class="meta-line">Approved by: <strong>'
+
vcmEsc
(
main
.
ocm_approved_by_name
||
'-'
)
+
'</strong></div>'
+
'</div><div class="vm-summary-approval">'
+
'<div class="meta-line">Verified by: <strong>'
+
vcmEsc
(
main
.
ocm_verified_by_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Verified Date: <strong>'
+
vcmFmtDate
(
main
.
ocm_verified_date
)
+
'</strong></div>'
+
'<div class="meta-line" style="margin-top:.7rem;">Approved by: <strong>'
+
vcmEsc
(
main
.
ocm_approved_by_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Approved Date: <strong>'
+
vcmFmtDate
(
main
.
ocm_approved_date
)
+
'</strong></div>'
html
+=
'
</div>'
;
+
'</div></div>
</div>'
;
html
+=
'<div style="overflow-x:auto;">'
+
'<table class="vm-tbl"><thead>'
...
...
@@ -222,4 +230,4 @@ function vcmBuildHtml(main, details) {
return
html
;
}
</script>
\ No newline at end of file
</script>
packages/portal/overtime/resources/views/overtime/overtimeclaim/view_modal_content.blade.php
View file @
7a6b8b75
...
...
@@ -38,13 +38,19 @@
<div
class=
"vm-summary"
>
<div
class=
"apply-no"
>
{{ $escape($main['ocm_apply_no'] ?? '-') }}
</div>
<div
class=
"meta-line"
>
Request by:
<strong>
{{ $escape($main['ocm_staff_name'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Department:
<strong>
{{ $escape($main['ocm_division_label'] ?? '-') }}
</strong></div>
<div
class=
"vm-summary-columns"
><div
class=
"vm-summary-primary"
>
<div
class=
"meta-line"
>
Name:
<strong>
{{ $escape($main['ocm_staff_name'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Staff ID:
<strong>
{{ $escape($main['ocm_staff_id'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Division:
<strong>
{{ $escape($main['ocm_division_label'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Month/Year:
<strong>
{{ $escape($monthName) }}
</strong></div>
<div
class=
"meta-line"
>
Status: {!! $badge !!}
</div>
<div
class=
"meta-line"
>
Claim Date:
<strong>
{{ $formatDate($main['ocm_submit_date'] ?? null) }}
</strong></div>
<div
class=
"meta-line"
>
Approved by:
<strong>
{{ $escape($main['ocm_approved_by_name'] ?? '-') }}
</strong></div>
</div><div
class=
"vm-summary-approval"
>
<div
class=
"meta-line"
>
Verified by:
<strong>
{{ $escape($main['ocm_verified_by_name'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Verified Date:
<strong>
{{ $formatDate($main['ocm_verified_date'] ?? null) }}
</strong></div>
<div
class=
"meta-line"
style=
"margin-top:8px;"
>
Approved by:
<strong>
{{ $escape($main['ocm_approved_by_name'] ?? '-') }}
</strong></div>
<div
class=
"meta-line"
>
Approved Date:
<strong>
{{ $formatDate($main['ocm_approved_date'] ?? null) }}
</strong></div>
</div></div>
</div>
<div
style=
"overflow-x:auto;"
>
...
...
packages/portal/overtime/resources/views/overtime/overtimerequest/hod/view.blade.php
View file @
7a6b8b75
...
...
@@ -52,14 +52,16 @@
</div>
<div class="
rf
-
summary
">
<div class="
apply
-
no
">{{
$main->orm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$main->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$main->orm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$main->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$main->orm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Position: <strong>{{
$main->orm_position_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Project: <strong>{{
$project->p_project_description
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
epartment
: <strong>{{
$main->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
ivision
: <strong>{{
$main->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Request Date: <strong>{{
$main->orm_requested_date
? \Carbon\Carbon::parse(
$main->orm_requested_date
)->format('d/m/Y') : '-' }}</strong></div>
</div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Approve by: <strong>{{
$main->orm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->orm_approved_date
? \Carbon\Carbon::parse(
$main->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->orm_approved_date
? \Carbon\Carbon::parse(
$main->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
</div></div>
<div class="
meta
-
line
">Status: <span class="
ui
label
" style="
font
-
size
:.
78
rem
;
">{{
$statuses[$main->orm_status]
->description ?? '-' }}</span></div>
</div>
...
...
packages/portal/overtime/resources/views/overtime/overtimerequest/pd/view.blade.php
View file @
7a6b8b75
...
...
@@ -52,14 +52,16 @@
</div>
<div class="
rf
-
summary
">
<div class="
apply
-
no
">{{
$main->orm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$main->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$main->orm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$main->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$main->orm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Position: <strong>{{
$main->orm_position_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Project: <strong>{{
$project->p_project_description
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
epartment
: <strong>{{
$main->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
ivision
: <strong>{{
$main->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Request Date: <strong>{{
$main->orm_requested_date
? \Carbon\Carbon::parse(
$main->orm_requested_date
)->format('d/m/Y') : '-' }}</strong></div>
</div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Approved by: <strong>{{
$main->orm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->orm_approved_date
? \Carbon\Carbon::parse(
$main->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$main->orm_approved_date
? \Carbon\Carbon::parse(
$main->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
</div></div>
<div class="
meta
-
line
">Status: <span class="
ui
label
" style="
font
-
size
:.
78
rem
;
">{{
$statuses[$main->orm_status]
->description ?? '-' }}</span></div>
</div>
...
...
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/edit.blade.php
View file @
7a6b8b75
...
...
@@ -41,14 +41,16 @@
@endphp
<div class="
rf
-
summary
">
<div class="
apply
-
no
">{{
$data->orm_apply_no
}}</div>
<div class="
meta
-
line
">Request by: <strong>{{
$data->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
apply
-
no
">{{
$data->orm_apply_no
}}</div><div style="
display
:
flex
;
justify
-
content
:
space
-
between
;
gap
:
2
rem
;
"><div style="
flex
:
1
;
">
<div class="
meta
-
line
">Name: <strong>{{
$data->orm_requested_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$data->orm_staff_id
?? '-' }}</strong></div>
<div class="
meta
-
line
">Position: <strong>{{
$data->orm_position_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Project: <strong>{{
$project->p_project_description
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
epartment
: <strong>{{
$data->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">D
ivision
: <strong>{{
$data->orm_department_label
?? '-' }}</strong></div>
<div class="
meta
-
line
">Request Date: <strong>{{
$data->orm_requested_date
? \Carbon\Carbon::parse(
$data->orm_requested_date
)->format('d/m/Y') : '-' }}</strong></div>
</div><div style="
min
-
width
:
240
px
;
margin
-
left
:
auto
;
">
<div class="
meta
-
line
">Approve by: <strong>{{
$data->orm_approved_by_name
?? '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->orm_approved_date
? \Carbon\Carbon::parse(
$data->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$data->orm_approved_date
? \Carbon\Carbon::parse(
$data->orm_approved_date
)->format('d/m/Y') : '-' }}</strong></div>
</div></div>
<div class="
meta
-
line
">Status: <strong>{{
$statusLabel
}}</strong></div>
</div>
...
...
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/view_modal.blade.php
View file @
7a6b8b75
...
...
@@ -9,6 +9,9 @@
}
#modalViewRequestForm
.vm-summary
.apply-no
{
font-size
:
1.05rem
;
font-weight
:
700
;
color
:
#1a56a0
;
}
#modalViewRequestForm
.vm-summary
.meta-line
{
font-size
:
.88rem
;
color
:
#333
;
}
#modalViewRequestForm
.vm-summary-columns
{
display
:
flex
;
justify-content
:
space-between
;
gap
:
2rem
;
}
#modalViewRequestForm
.vm-summary-primary
{
flex
:
1
;
}
#modalViewRequestForm
.vm-summary-approval
{
min-width
:
240px
;
margin-left
:
auto
;
}
#modalViewRequestForm
.vm-tbl
{
width
:
100%
;
border-collapse
:
collapse
;
font-size
:
.83rem
;
}
#modalViewRequestForm
.vm-tbl
th
,
...
...
@@ -40,6 +43,12 @@
</div>
<div
class=
"actions"
>
<button
class=
"ui teal button"
type=
"button"
id=
"btn-vrf-download"
disabled
>
<i
class=
"download icon"
></i>
Download
</button>
<button
class=
"ui blue button"
type=
"button"
id=
"btn-vrf-print"
disabled
>
<i
class=
"print icon"
></i>
Print
</button>
<button
class=
"ui grey button"
onclick=
"$('#modalViewRequestForm').modal('hide');"
>
<i
class=
"times icon"
></i>
Close
</button>
...
...
@@ -49,6 +58,18 @@
<script>
var
VRF_MONTHS
=
[
'Jan'
,
'Feb'
,
'Mac'
,
'Apr'
,
'Mei'
,
'Jun'
,
'Jul'
,
'Ogos'
,
'Sep'
,
'Okt'
,
'Nov'
,
'Dis'
];
function
vrfDownload
()
{
var
id
=
$
(
'#vrf-content'
).
data
(
'request-id'
);
if
(
id
)
window
.
location
.
href
=
"{{ url('overtime/request') }}/"
+
id
+
"/pdf"
;
}
function
vrfPrint
()
{
var
id
=
$
(
'#vrf-content'
).
data
(
'request-id'
);
var
requestNumber
=
$
(
'#vrf-content'
).
data
(
'request-number'
);
if
(
id
&&
requestNumber
)
window
.
open
(
"{{ url('overtime/request') }}/"
+
id
+
"/pdf/"
+
encodeURIComponent
(
requestNumber
)
+
"?inline=1"
,
'_blank'
);
}
$
(
document
).
on
(
'click'
,
'#btn-vrf-download'
,
vrfDownload
);
$
(
document
).
on
(
'click'
,
'#btn-vrf-print'
,
vrfPrint
);
function
vrfEsc
(
s
)
{
if
(
s
===
null
||
s
===
undefined
)
return
''
;
return
String
(
s
)
...
...
@@ -69,6 +90,8 @@ function vrfFmtMonth(str) {
}
function
viewRequestForm
(
id
)
{
$
(
'#btn-vrf-download, #btn-vrf-print'
).
prop
(
'disabled'
,
true
);
$
(
'#vrf-content'
).
removeAttr
(
'data-request-id data-request-number'
);
$
(
'#vrf-content'
).
html
(
'<div class="vm-loading"><i class="spinner loading icon"></i> Loading data…</div>'
);
...
...
@@ -79,7 +102,9 @@ function viewRequestForm(id) {
method
:
'GET'
,
success
:
function
(
res
)
{
if
(
res
.
success
)
{
$
(
'#vrf-content'
).
attr
(
'data-request-id'
,
res
.
data
.
main
.
id
).
attr
(
'data-request-number'
,
res
.
data
.
main
.
orm_apply_no
);
$
(
'#vrf-content'
).
html
(
vrfBuildHtml
(
res
.
data
.
main
,
res
.
data
.
details
));
$
(
'#btn-vrf-download, #btn-vrf-print'
).
prop
(
'disabled'
,
Number
(
res
.
data
.
main
.
orm_status
)
!==
9
);
}
else
{
$
(
'#vrf-content'
).
html
(
'<div class="ui negative message"><p>'
...
...
@@ -101,15 +126,18 @@ function vrfBuildHtml(main, details) {
var
html
=
'<div class="vm-summary">'
+
'<div class="apply-no">'
+
vrfEsc
(
main
.
orm_apply_no
||
'-'
)
+
'</div>'
+
'<div class="meta-line">Request by: <strong>'
+
vrfEsc
(
main
.
orm_requested_by_name
||
'-'
)
+
'</strong></div>'
+
'<div class="vm-summary-columns"><div class="vm-summary-primary">'
+
'<div class="meta-line">Name: <strong>'
+
vrfEsc
(
main
.
orm_requested_by_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Staff ID: <strong>'
+
vrfEsc
(
main
.
orm_staff_id
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Position: <strong>'
+
vrfEsc
(
main
.
orm_position_label
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Project: <strong>'
+
vrfEsc
(
main
.
orm_project_label
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">D
epartment
: <strong>'
+
vrfEsc
(
main
.
orm_department_label
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">D
ivision
: <strong>'
+
vrfEsc
(
main
.
orm_department_label
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Request Date: <strong>'
+
vrfFmtDate
(
main
.
orm_requested_date
||
main
.
orm_date
)
+
'</strong></div>'
+
'<div class="meta-line">Status: '
+
badge
+
'</div>'
+
'</div><div class="vm-summary-approval">'
+
'<div class="meta-line">Approved by: <strong>'
+
vrfEsc
(
main
.
orm_approved_by_name
||
'-'
)
+
'</strong></div>'
+
'<div class="meta-line">Approved Date: <strong>'
+
vrfFmtDate
(
main
.
orm_approved_date
)
+
'</strong></div>'
+
'<div class="meta-line">Status: '
+
badge
+
'</div>'
+
'</div>'
;
+
'</div></div>'
;
html
+=
'<div style="overflow-x:auto;">'
+
'<table class="vm-tbl"><thead><tr>'
...
...
packages/portal/overtime/resources/views/overtime/overtimerequest/pm/view_modal_content.blade.php
0 → 100644
View file @
7a6b8b75
@
php
$formatDate
=
function
(
$value
)
{
if
(
empty
(
$value
))
return
'-'
;
try
{
return
(
$value
instanceof
\DateTimeInterface
?
$value
:
\Carbon\Carbon
::
parse
(
$value
))
->
format
(
'd/m/Y'
);
}
catch
(
\Throwable
$e
)
{
return
'-'
;
}
};
$escape
=
fn
(
$value
)
=>
htmlspecialchars
((
string
)
(
$value
??
'-'
),
ENT_QUOTES
,
'UTF-8'
);
$grandTotal
=
0
;
@
endphp
<
div
class
="
vm
-
summary
">
<div class="
apply
-
no
">{{
$escape
(
$main['orm_apply_no']
) }}</div>
<div class="
vm
-
summary
-
columns
"><div class="
vm
-
summary
-
primary
">
<div class="
meta
-
line
">Name: <strong>{{
$escape
(
$main['orm_requested_by_name']
) }}</strong></div>
<div class="
meta
-
line
">Staff ID: <strong>{{
$escape
(
$main['orm_staff_id']
) }}</strong></div>
<div class="
meta
-
line
">Position: <strong>{{
$escape
(
$main['orm_position_label']
) }}</strong></div>
<div class="
meta
-
line
">Project: <strong>{{
$escape
(
$main['orm_project_label']
) }}</strong></div>
<div class="
meta
-
line
">Division: <strong>{{
$escape
(
$main['orm_department_label']
) }}</strong></div>
<div class="
meta
-
line
">Request Date: <strong>{{
$formatDate
(
$main['orm_requested_date']
) }}</strong></div>
<div class="
meta
-
line
">Status: <strong>{{
$escape
(
$main['orm_status_label']
) }}</strong></div>
</div><div class="
vm
-
summary
-
approval
">
<div class="
meta
-
line
">Approved by: <strong>{{
$escape
(
$main['orm_approved_by_name']
) }}</strong></div>
<div class="
meta
-
line
">Approved Date: <strong>{{
$formatDate
(
$main['orm_approved_date']
) }}</strong></div>
</div></div>
<table class="
vm
-
tbl
">
<thead><tr><th>No</th><th>Name</th><th>Overtime Month</th><th>Budgeted</th><th>Utilised to Date</th><th>Planned OT Hour</th><th>Balance</th><th>Reason</th></tr></thead>
<tbody>
@forelse (
$details
as
$i
=>
$detail
)
@php
$hours
= (float) (
$detail->ord_planned_ot_hour
?? 0);
$grandTotal
+=
$hours
; @endphp
<tr>
<td>{{
$i
+ 1 }}</td><td class="
left
">{{
$escape
(
$detail->ord_name
) }}</td>
<td>{{
$formatDate
(
$detail->ord_month_of_overtime
) }}</td>
<td>{{ number_format((float) (
$detail->ord_budgeted
?? 0), 2) }}</td>
<td>{{ number_format((float) (
$detail->ord_utilised_to_date
?? 0), 2) }}</td>
<td>{{ number_format(
$hours
, 2) }}</td>
<td>{{ number_format((float) (
$detail->ord_balance
?? 0), 2) }}</td>
<td class="
left
">{{
$escape
(
$detail->ord_reason
) }}</td>
</tr>
@empty
<tr><td colspan="
8
">No additional details.</td></tr>
@endforelse
</tbody>
<tfoot><tr><td colspan="
5
"></td><td>Total Planned OT Hours</td><td>{{ number_format(
$grandTotal
, 2) }}</td><td></td></tr></tfoot>
</table>
packages/portal/overtime/routes/web.php
View file @
7a6b8b75
...
...
@@ -72,6 +72,7 @@ function () {
Route
::
post
(
'request/{id}/batal'
,
[
'uses'
=>
'OvertimeRequestController@batalOvertimeRequest'
,
'as'
=>
'overtime.batalovertimerequest'
]);
Route
::
post
(
'request/{id}/delete'
,
[
'uses'
=>
'OvertimeRequestController@deleteOvertimeRequest'
,
'as'
=>
'overtime.deleteovertimerequest'
]);
Route
::
get
(
'request/{id}/view'
,
[
'uses'
=>
'OvertimeRequestController@viewOvertimeRequest'
,
'as'
=>
'overtime.viewovertimerequest'
]);
Route
::
get
(
'request/{id}/pdf/{filename?}'
,
[
'uses'
=>
'OvertimeRequestController@downloadOvertimeRequest'
,
'as'
=>
'overtime.downloadovertimerequest'
]);
Route
::
post
(
'request/{id}/detail/add'
,
[
'uses'
=>
'OvertimeRequestController@addOvertimeRequestDetail'
,
'as'
=>
'overtime.addovertimerequestdetail'
]);
Route
::
post
(
'request/detail/{id}/update'
,
[
'uses'
=>
'OvertimeRequestController@updateOvertimeRequestDetail'
,
'as'
=>
'overtime.updateovertimerequestdetail'
]);
Route
::
post
(
'request/detail/{id}/remove'
,
[
'uses'
=>
'OvertimeRequestController@removeOvertimeRequestDetail'
,
'as'
=>
'overtime.removeovertimerequestdetail'
]);
...
...
packages/portal/overtime/src/Data/Repo/OvertimeClaimHodRepo.php
View file @
7a6b8b75
...
...
@@ -146,8 +146,10 @@ public function sokongClaim($request, int $claimId): OvertimeClaimMain
}
$claim
->
update
([
'ocm_status'
=>
7
,
// Disokong Oleh HOD
'updated_by'
=>
Auth
::
id
(),
'ocm_status'
=>
7
,
// Disokong Oleh HOD
'ocm_verified_by'
=>
Auth
::
id
(),
'ocm_verified_date'
=>
now
(),
'updated_by'
=>
Auth
::
id
(),
]);
$this
->
logAudit
(
'SUPPORT'
,
$claim
->
id
,
null
,
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeClaimController.php
View file @
7a6b8b75
...
...
@@ -130,15 +130,27 @@ public function viewOvertimeClaim(Request $request, int $id): JsonResponse
:
null
;
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$main
->
ocm_division
;
$divisionLabel
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'
description
'
)
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'
code
'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
for
(
$i
=
0
;
$i
<
3
;
$i
++
)
{
$decodedDivisionLabel
=
html_entity_decode
(
$divisionLabel
,
ENT_QUOTES
|
ENT_HTML5
,
'UTF-8'
);
if
(
$decodedDivisionLabel
===
$divisionLabel
)
{
break
;
}
$divisionLabel
=
$decodedDivisionLabel
;
}
$approvedByName
=
$main
->
ocm_approved_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
ocm_approved_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_approved_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$verifiedByName
=
$main
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$NO_PROJECT_ID
=
110
;
$pmReviewed
=
$details
->
filter
(
function
(
$d
)
use
(
$NO_PROJECT_ID
)
{
...
...
@@ -163,6 +175,7 @@ public function viewOvertimeClaim(Request $request, int $id): JsonResponse
'id'
=>
$main
->
id
,
'ocm_apply_no'
=>
$main
->
ocm_apply_no
,
'ocm_staff_name'
=>
$main
->
ocm_staff_name
,
'ocm_staff_id'
=>
$staffInfo
->
staff_id
??
$main
->
ocm_staff_employee_code
??
'-'
,
'ocm_division_label'
=>
$divisionLabel
,
'ocm_status'
=>
$main
->
ocm_status
,
'ocm_status_label'
=>
$statusRow
->
description
??
'-'
,
...
...
@@ -171,6 +184,8 @@ public function viewOvertimeClaim(Request $request, int $id): JsonResponse
'ocm_submit_date'
=>
$main
->
ocm_submit_date
?->
format
(
'Y-m-d'
),
'ocm_approved_by_name'
=>
$approvedByName
,
'ocm_approved_date'
=>
$main
->
ocm_approved_date
?->
format
(
'Y-m-d'
),
'ocm_verified_by_name'
=>
$verifiedByName
,
'ocm_verified_date'
=>
$main
->
ocm_verified_date
?->
format
(
'Y-m-d'
),
'pm_reviewed'
=>
$pmReviewed
,
'pm_pending_review_cnt'
=>
$pendingPmReviews
,
],
...
...
@@ -219,14 +234,23 @@ public function downloadOvertimeClaim(Request $request, int $id, ?string $filena
->
value
(
'description'
);
$staffInfo
=
DB
::
table
(
'staff_info'
)
->
where
(
'id'
,
$main
->
fk_lkp_staff_info
)
->
first
();
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$main
->
ocm_division
;
$divisionLabel
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
for
(
$i
=
0
;
$i
<
3
;
$i
++
)
{
$decodedDivisionLabel
=
html_entity_decode
(
$divisionLabel
,
ENT_QUOTES
|
ENT_HTML5
,
'UTF-8'
);
if
(
$decodedDivisionLabel
===
$divisionLabel
)
{
break
;
}
$divisionLabel
=
$decodedDivisionLabel
;
}
$mainData
=
[
'ocm_apply_no'
=>
$main
->
ocm_apply_no
,
'ocm_staff_name'
=>
$main
->
ocm_staff_name
,
'ocm_division_label'
=>
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
,
'ocm_staff_id'
=>
$staffInfo
->
staff_id
??
$main
->
ocm_staff_employee_code
??
'-'
,
'ocm_division_label'
=>
$divisionLabel
,
'ocm_status_label'
=>
$statusLabel
?:
'-'
,
'ocm_month'
=>
$main
->
ocm_month
,
'ocm_year'
=>
$main
->
ocm_year
,
...
...
@@ -236,6 +260,11 @@ public function downloadOvertimeClaim(Request $request, int $id, ?string $filena
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_approved_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
,
'ocm_approved_date'
=>
$main
->
ocm_approved_date
,
'ocm_verified_by_name'
=>
$main
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
,
'ocm_verified_date'
=>
$main
->
ocm_verified_date
,
];
$detailData
=
$details
->
map
(
fn
(
$detail
)
=>
[
'ocd_date'
=>
$detail
->
ocd_date
,
...
...
@@ -261,6 +290,9 @@ public function downloadOvertimeClaim(Request $request, int $id, ?string $filena
.vm-summary { background: #ddeeff; border-radius: 6px; padding: 8px 11px; margin-bottom: 10px; line-height: 1.75; }
.vm-summary .apply-no { font-size: 12px; font-weight: 700; color: #1a56a0; }
.vm-summary .meta-line { font-size: 9px; color: #333; }
.vm-summary-columns { display: table; width: 100%; }
.vm-summary-primary { display: table-cell; width: 65%; vertical-align: top; }
.vm-summary-approval { display: table-cell; width: 35%; vertical-align: top; }
.vm-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8px; }
.vm-tbl th, .vm-tbl td { border: 1px solid #cfd8e3; padding: 5px 4px; min-width: 0 !important; vertical-align: middle; text-align: center; word-wrap: break-word; }
.vm-tbl thead tr.grp th { background: #2185d0; color: #fff; font-weight: 600; }
...
...
@@ -322,10 +354,16 @@ public function editOvertimeClaim(Request $request, int $id)
:
null
;
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$data
->
ocm_division
;
$data
->
ocm_division_label
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'
description
'
)
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'
code
'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_staff_id
=
$staffInfo
->
staff_id
??
$data
->
ocm_staff_employee_code
??
'-'
;
$data
->
ocm_verified_by_name
=
$data
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_approved_by_name
=
$data
->
ocm_approved_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_approved_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_approved_by
)
->
value
(
'name'
)
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeClaimHodController.php
View file @
7a6b8b75
...
...
@@ -35,6 +35,21 @@ public function viewClaim(Request $request, int $id)
$data
=
$this
->
repos
->
findClaim
(
$id
);
$details
=
$this
->
repos
->
findClaimDetails
(
$id
);
$statuses
=
$this
->
repos
->
getOtStatuses
();
$staffInfo
=
DB
::
table
(
'staff_info'
)
->
where
(
'id'
,
$data
->
fk_lkp_staff_info
)
->
first
();
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$data
->
ocm_division
;
$data
->
ocm_staff_id
=
$staffInfo
->
staff_id
??
$data
->
ocm_staff_employee_code
??
'-'
;
$data
->
ocm_division_label
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_verified_by_name
=
$data
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_approved_by_name
=
$data
->
ocm_approved_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_approved_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_approved_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$latestKueri
=
$this
->
repos
->
findLatestKueri
(
$id
);
$queryHistory
=
$this
->
repos
->
findQueryHistory
(
$id
);
$pendingPmReviews
=
$this
->
repos
->
countPendingPmReviews
(
$id
);
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeClaimPdController.php
View file @
7a6b8b75
...
...
@@ -35,6 +35,21 @@ public function viewClaim(Request $request, int $id)
$data
=
$this
->
repos
->
findClaim
(
$id
);
$details
=
$this
->
repos
->
findClaimDetails
(
$id
);
$statuses
=
$this
->
repos
->
getOtStatuses
();
$staffInfo
=
DB
::
table
(
'staff_info'
)
->
where
(
'id'
,
$data
->
fk_lkp_staff_info
)
->
first
();
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$data
->
ocm_division
;
$data
->
ocm_staff_id
=
$staffInfo
->
staff_id
??
$data
->
ocm_staff_employee_code
??
'-'
;
$data
->
ocm_division_label
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_verified_by_name
=
$data
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$data
->
ocm_approved_by_name
=
$data
->
ocm_approved_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
ocm_approved_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
ocm_approved_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$latestKueri
=
$this
->
repos
->
findLatestKueri
(
$id
);
$queryHistory
=
$this
->
repos
->
findQueryHistory
(
$id
);
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeHodController.php
View file @
7a6b8b75
...
...
@@ -47,12 +47,22 @@ public function viewRequestForm(Request $request, int $id)
$staffInfoForMain
=
$main
->
orm_name
&&
is_numeric
((
string
)
$main
->
orm_name
)
?
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
(
int
)
$main
->
orm_name
)
->
first
()
:
null
;
if
(
!
$staffInfoForMain
&&
$main
->
orm_name
)
{
$staffInfoForMain
=
DB
::
table
(
'staff_info'
)
->
where
(
function
(
$query
)
use
(
$main
)
{
$query
->
where
(
'fullname'
,
$main
->
orm_name
)
->
orWhere
(
'user_name'
,
$main
->
orm_name
)
->
orWhere
(
'staff_id'
,
$main
->
orm_name
);
})
->
first
();
}
$main
->
orm_position_label
=
$main
->
orm_position
?
(
DB
::
table
(
'project_role'
)
->
where
(
'id'
,
$main
->
orm_position
)
->
value
(
'role'
)
?:
(
string
)
$main
->
orm_position
)
:
'-'
;
$main
->
orm_department_label
=
$staffInfoForMain
&&
$staffInfoForMain
->
fk_lkp_department
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
$main
->
orm_staff_id
=
$staffInfoForMain
->
staff_id
??
$main
->
orm_name
??
'-'
;
$main
->
orm_approved_by_name
=
$main
->
orm_approved_by_id
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
orm_approved_by_id
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
orm_approved_by_id
)
->
value
(
'name'
)
...
...
packages/portal/overtime/src/Http/Controllers/OvertimePdController.php
View file @
7a6b8b75
...
...
@@ -55,12 +55,22 @@ public function viewRequestForm(Request $request, int $id)
$staffInfoForMain
=
$main
->
orm_name
&&
is_numeric
((
string
)
$main
->
orm_name
)
?
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
(
int
)
$main
->
orm_name
)
->
first
()
:
null
;
if
(
!
$staffInfoForMain
&&
$main
->
orm_name
)
{
$staffInfoForMain
=
DB
::
table
(
'staff_info'
)
->
where
(
function
(
$query
)
use
(
$main
)
{
$query
->
where
(
'fullname'
,
$main
->
orm_name
)
->
orWhere
(
'user_name'
,
$main
->
orm_name
)
->
orWhere
(
'staff_id'
,
$main
->
orm_name
);
})
->
first
();
}
$main
->
orm_position_label
=
$main
->
orm_position
?
(
DB
::
table
(
'project_role'
)
->
where
(
'id'
,
$main
->
orm_position
)
->
value
(
'role'
)
?:
(
string
)
$main
->
orm_position
)
:
'-'
;
$main
->
orm_department_label
=
$staffInfoForMain
&&
$staffInfoForMain
->
fk_lkp_department
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
$main
->
orm_staff_id
=
$staffInfoForMain
->
staff_id
??
$main
->
orm_name
??
'-'
;
$main
->
orm_approved_by_name
=
$main
->
orm_approved_by_id
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
orm_approved_by_id
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
orm_approved_by_id
)
->
value
(
'name'
)
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeProjectManagerController.php
View file @
7a6b8b75
...
...
@@ -35,6 +35,22 @@ public function viewClaim(Request $request, int $id)
{
$data
=
$this
->
repos
->
findClaimWithDetails
(
$id
);
$statuses
=
$this
->
repos
->
getOtStatuses
();
$main
=
$data
[
'main'
];
$staffInfo
=
DB
::
table
(
'staff_info'
)
->
where
(
'id'
,
$main
->
fk_lkp_staff_info
)
->
first
();
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$main
->
ocm_division
;
$main
->
ocm_staff_id
=
$staffInfo
->
staff_id
??
$main
->
ocm_staff_employee_code
??
'-'
;
$main
->
ocm_division_label
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$main
->
ocm_verified_by_name
=
$main
->
ocm_verified_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
ocm_verified_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_verified_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$main
->
ocm_approved_by_name
=
$main
->
ocm_approved_by
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
ocm_approved_by
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
ocm_approved_by
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$selectionData
=
$this
->
repos
->
getRequestFormSelectionData
(
$data
[
'main'
]);
$NO_PROJECT_ID
=
110
;
$pmPendingCount
=
$data
[
'details'
]
...
...
packages/portal/overtime/src/Http/Controllers/OvertimeRequestController.php
View file @
7a6b8b75
...
...
@@ -6,6 +6,7 @@
use
Illuminate\Http\Request
;
use
Illuminate\Routing\Controller
;
use
Illuminate\Support\Facades\DB
;
use
Barryvdh\DomPDF\Facade\Pdf
;
use
Portal\Overtime\Data\Repo\OvertimeRequestRepo
;
class
OvertimeRequestController
extends
Controller
...
...
@@ -96,15 +97,14 @@ public function editOvertimeRequest(Request $request, int $id)
?
(
DB
::
table
(
'project_team'
)
->
where
(
'id'
,
$data
->
orm_requested_by_id
)
->
value
(
'pt_team'
)
?:
(
$this
->
repos
->
resolveApplicantName
(
$data
->
orm_name
)
?:
'-'
))
:
(
$this
->
repos
->
resolveApplicantName
(
$data
->
orm_name
)
?:
'-'
);
$staffInfoForData
=
$data
->
orm_name
&&
is_numeric
((
string
)
$data
->
orm_name
)
?
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
(
int
)
$data
->
orm_name
)
->
first
()
:
null
;
$staffInfoForData
=
$this
->
findRequestStaffInfo
(
$data
->
orm_name
);
$data
->
orm_position_label
=
$data
->
orm_position
?
(
DB
::
table
(
'project_role'
)
->
where
(
'id'
,
$data
->
orm_position
)
->
value
(
'role'
)
?:
(
string
)
$data
->
orm_position
)
:
'-'
;
$data
->
orm_department_label
=
$staffInfoForData
&&
$staffInfoForData
->
fk_lkp_department
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForData
->
fk_lkp_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForData
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$data
->
orm_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$data
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForData
->
fk_lkp_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForData
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$data
->
orm_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$data
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
$data
->
orm_staff_id
=
$staffInfoForData
->
staff_id
??
$data
->
orm_name
??
'-'
;
$data
->
orm_approved_by_name
=
$data
->
orm_approved_by_id
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$data
->
orm_approved_by_id
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$data
->
orm_approved_by_id
)
->
value
(
'name'
)
...
...
@@ -251,16 +251,15 @@ public function viewOvertimeRequest(Request $request, int $id): JsonResponse
?
(
DB
::
table
(
'project_team'
)
->
where
(
'id'
,
$main
->
orm_requested_by_id
)
->
value
(
'pt_team'
)
?:
(
$this
->
repos
->
resolveApplicantName
(
$main
->
orm_name
)
?:
'-'
))
:
(
$this
->
repos
->
resolveApplicantName
(
$main
->
orm_name
)
?:
'-'
);
$staffInfoForMain
=
$main
->
orm_name
&&
is_numeric
((
string
)
$main
->
orm_name
)
?
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
(
int
)
$main
->
orm_name
)
->
first
()
:
null
;
$staffInfoForMain
=
$this
->
findRequestStaffInfo
(
$main
->
orm_name
);
$main
->
orm_position_label
=
$main
->
orm_position
?
(
DB
::
table
(
'project_role'
)
->
where
(
'id'
,
$main
->
orm_position
)
->
value
(
'role'
)
?:
(
string
)
$main
->
orm_position
)
:
'-'
;
$main
->
orm_project_label
=
DB
::
table
(
'lkp_project'
)
->
where
(
'id'
,
$main
->
orm_project
)
->
value
(
'p_project_description'
)
?:
'-'
;
$main
->
orm_department_label
=
$staffInfoForMain
&&
$staffInfoForMain
->
fk_lkp_department
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'description'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$staffInfoForMain
->
fk_lkp_department
)
->
value
(
'name'
)
?:
'-'
)
:
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$main
->
orm_department
)
->
value
(
'name'
)
?:
'-'
);
$main
->
orm_staff_id
=
$staffInfoForMain
->
staff_id
??
$main
->
orm_name
??
'-'
;
$main
->
orm_approved_by_name
=
$main
->
orm_approved_by_id
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
orm_approved_by_id
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
orm_approved_by_id
)
->
value
(
'name'
)
...
...
@@ -276,10 +275,93 @@ public function viewOvertimeRequest(Request $request, int $id): JsonResponse
]);
}
public
function
downloadOvertimeRequest
(
Request
$request
,
int
$id
,
?
string
$filename
=
null
)
{
$main
=
$this
->
repos
->
findRequestForm
(
$id
);
abort_unless
((
int
)
$main
->
orm_status
===
9
,
404
);
$details
=
$this
->
repos
->
findRequestFormDetails
(
$id
);
$statusLabel
=
DB
::
table
(
'lkp_status'
)
->
where
(
'module'
,
'ot'
)
->
where
(
'ref_id'
,
$main
->
orm_status
)
->
value
(
'description'
)
?:
'-'
;
$staffInfo
=
$this
->
findRequestStaffInfo
(
$main
->
orm_name
);
$departmentId
=
$staffInfo
->
fk_lkp_department
??
$main
->
orm_department
;
$divisionLabel
=
$departmentId
?
(
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'code'
)
?:
DB
::
table
(
'lkp_department'
)
->
where
(
'id'
,
$departmentId
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
;
$mainData
=
[
'id'
=>
$main
->
id
,
'orm_apply_no'
=>
$main
->
orm_apply_no
,
'orm_requested_by_name'
=>
$main
->
orm_requested_by_id
?
(
DB
::
table
(
'project_team'
)
->
where
(
'id'
,
$main
->
orm_requested_by_id
)
->
value
(
'pt_team'
)
?:
'-'
)
:
(
$staffInfo
->
fullname
??
$main
->
orm_name
??
'-'
),
'orm_staff_id'
=>
$staffInfo
->
staff_id
??
$main
->
orm_name
??
'-'
,
'orm_position_label'
=>
$main
->
orm_position
?
(
DB
::
table
(
'project_role'
)
->
where
(
'id'
,
$main
->
orm_position
)
->
value
(
'role'
)
?:
$main
->
orm_position
)
:
'-'
,
'orm_project_label'
=>
DB
::
table
(
'lkp_project'
)
->
where
(
'id'
,
$main
->
orm_project
)
->
value
(
'p_project_description'
)
?:
'-'
,
'orm_department_label'
=>
$divisionLabel
,
'orm_requested_date'
=>
$main
->
orm_requested_date
,
'orm_approved_by_name'
=>
$main
->
orm_approved_by_id
?
(
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
$main
->
orm_approved_by_id
)
->
value
(
'fullname'
)
?:
DB
::
table
(
'users'
)
->
where
(
'id'
,
$main
->
orm_approved_by_id
)
->
value
(
'name'
)
?:
'-'
)
:
'-'
,
'orm_approved_date'
=>
$main
->
orm_approved_date
,
'orm_status_label'
=>
$statusLabel
,
];
$pdfStyles
=
<<<'CSS'
@page { size: A4 landscape; margin: 10mm; }
body { font-family: DejaVu Sans, sans-serif; color: #222; margin: 0; font-size: 9px; }
.vm-summary { background: #ddeeff; padding: 8px 11px; margin-bottom: 10px; line-height: 1.75; }
.apply-no { font-size: 12px; font-weight: 700; color: #1a56a0; }
.meta-line { font-size: 9px; color: #333; }
.vm-summary-columns { display: table; width: 100%; }
.vm-summary-primary { display: table-cell; width: 65%; vertical-align: top; }
.vm-summary-approval { display: table-cell; width: 35%; vertical-align: top; }
.vm-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8px; }
.vm-tbl th, .vm-tbl td { border: 1px solid #cfd8e3; padding: 5px 4px; text-align: center; word-wrap: break-word; }
.vm-tbl thead th { background: #2185d0; color: #fff; }
.vm-tbl tbody td.left { text-align: left; }
.vm-tbl tfoot td { background: #ddeeff; font-weight: 700; color: #1a56a0; }
CSS;
$content
=
view
(
'overtime::overtime.overtimerequest.pm.view_modal_content'
,
[
'main'
=>
$mainData
,
'details'
=>
$details
,
])
->
render
();
$pdf
=
Pdf
::
loadHTML
(
'<!doctype html><html><head><meta charset="utf-8"><style>'
.
$pdfStyles
.
'</style></head><body>'
.
$content
.
'</body></html>'
)
->
setPaper
(
'a4'
,
'landscape'
);
$pdfFilename
=
(
$main
->
orm_apply_no
?:
'overtime-request'
)
.
'.pdf'
;
return
response
(
$pdf
->
output
(),
200
,
[
'Content-Type'
=>
'application/pdf'
,
'Content-Disposition'
=>
(
$request
->
boolean
(
'inline'
)
?
'inline'
:
'attachment'
)
.
'; filename="'
.
$pdfFilename
.
'"'
,
]);
}
// =========================================================================
// PRIVATE HELPERS
// =========================================================================
private
function
findRequestStaffInfo
(
$ormName
)
{
$value
=
trim
((
string
)
(
$ormName
??
''
));
if
(
$value
===
''
)
{
return
null
;
}
if
(
is_numeric
(
$value
))
{
$staffInfo
=
DB
::
table
(
'staff_info'
)
->
where
(
'fk_users'
,
(
int
)
$value
)
->
first
();
if
(
$staffInfo
)
{
return
$staffInfo
;
}
}
return
DB
::
table
(
'staff_info'
)
->
where
(
function
(
$query
)
use
(
$value
)
{
$query
->
where
(
'fullname'
,
$value
)
->
orWhere
(
'user_name'
,
$value
)
->
orWhere
(
'staff_id'
,
$value
);
})
->
first
();
}
private
function
withTransaction
(
callable
$callback
)
:
JsonResponse
{
try
{
...
...
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