Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
3
3f-timesheet
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
dockers
3f-timesheet
Commits
17a5877a
Commit
17a5877a
authored
Oct 25, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard HOD PM bezakan section PM dan Project
Bahagian timesheet kepada 2 section. Section PMS Selain PMS
parent
90a64481
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
230 additions
and
10 deletions
+230
-10
packages/portal/timesheet/resources/views/dashboard/dashboardpmhod.blade.php
+223
-9
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+2
-1
packages/portal/timesheet/src/Model/VwChargeableVerification.php
+5
-0
No files found.
packages/portal/timesheet/resources/views/dashboard/dashboardpmhod.blade.php
View file @
17a5877a
...
...
@@ -2,16 +2,229 @@
@section('content')
<div
class=
"ui segment"
>
<?php
// $pms = $others =;
foreach
(
$profile
as
$key
=>
$value
)
{
// dd($value);
if
(
data_get
(
$value
,
'dept'
)
==
4
)
{
$pms
=
$value
;
}
else
{
$others
=
$value
;
}
}
?>
@if($pms)
<div
class=
"ui segment"
>
<div
class=
"ui purple left ribbon label"
>
PMS
</div>
<br>
<br>
<div
class=
"ui styled fluid accordion"
>
<?php
$page
=
1
;
$project
=
$checksts
=
0
;
$pmss
=
$profile
->
where
(
'dept'
,
4
);
?>
@foreach($pmss as $key => $staff)
<?php
$project
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
));
$checksts
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
)
->
where
(
'tp_timesheet_sts'
,
3
));
?>
@endforeach
@if($project == $checksts)
<table
class=
"ui unstackable celled table"
>
<thead>
<tr>
<th
class=
"text-center"
>
All timesheet has been verified
</th>
</tr>
</thead>
</table>
@endif
@foreach($pmss as $key => $staff)
<?php
$project
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
));
$checksts
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
)
->
where
(
'tp_timesheet_sts'
,
3
));
?>
@if($project == $checksts)
@else
<div
class=
"title"
>
<table
class=
"ui unstackable celled table"
>
<thead>
<tr>
<th
style=
"width: 40%;"
><i
class=
"dropdown icon"
></i>
{{ data_get($staff,'fullname') }}
</th>
<th
style=
"width: 20%"
class=
"text-center"
>
{{ data_get($staff,'year') }} - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - Phase {{ data_get($staff,'phase') }}
</th>
<th
style=
"width: 15%;"
class=
"center aligned"
>
<?php
// dd($pmss);
$status
=
$staff
->
status
;
$verified
=
count
(
data_get
(
$pmss
[
$key
],
'countchargeable'
)
->
where
(
'tp_timesheet_sts'
,
3
));
$allproject
=
count
(
data_get
(
$pmss
[
$key
],
'countchargeable'
));
?>
@if($status == 1 || $status == null) In Preparation
@elseif($verified == $allproject)
<i
class=
"green check icon"
></i>
Verified by PM
@elseif($status == 2)
<i
class=
"red attention icon"
></i>
Submitted
@elseif($status == 4)
<i
class=
"green check icon"
></i>
Verified by PD
@elseif($status == 5)
<i
class=
"red attention icon"
></i>
Dissaproved by PD
@elseif($status == 6)
<i
class=
"red attention icon"
></i>
Rejected by PM
@elseif($status == 7)
<i
class=
"red attention icon"
></i>
Rejected by HR
@endif
</th>
<th
style=
"width: 13%"
class=
"text-center"
>
Submitted on: {{data_get($staff,'submission')}}
</th>
<th
style=
"width: 12%"
class=
"text-center"
>
<button
class=
"center aligned ui blue icon button"
onclick=
"window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}';"
target=
'_blank'
>
View
</button>
</th>
</tr>
</thead>
</table>
</div>
<div
class=
"content"
style=
"padding-top: 0px;"
>
<table
class=
"ui unstackable celled table"
>
<thead>
<tr>
<th
style=
"width: 10%;"
>
Project Code
</th>
<th
style=
"width: 15;"
>
Project Name
</th>
<th
style=
"width: 10%;"
class=
"center aligned"
>
Total Hours
</th>
<th
style=
"width: 10%;"
class=
"center aligned"
>
Total Days
</th>
<th
style=
"width: 30%"
>
Remarks
</th>
<th
style=
"width: 13%"
class=
"text-center"
>
Status
</th>
<th
style=
"width: 12%;"
class=
"text-center"
>
Action
</th>
</tr>
</thead>
@foreach($details as $key => $detail)
@if(data_get($detail,'fk_tm_id') == data_get($staff, 'tmid'))
<tr>
<td
style=
"width: 10%;"
>
{{data_get($detail, 'project.p_project_code')}}
</td>
<td
style=
"width: 15;"
>
{{data_get($detail, 'project.p_project_description')}}
</td>
<td
style=
"width: 10%;"
class=
"center aligned"
>
{{data_get($detail, 'tp_hours')}}
</td>
<td
style=
"width: 10%;"
class=
"center aligned"
>
{{ number_format(data_get($detail, 'tp_hours')/8, 1, '.', '') }}
</td>
<td
style=
"width: 30%"
>
{{data_get($detail, 'verifier_remark')}}
</td>
<td
style=
"width: 13%"
class=
"text-center"
>
@if(data_get($detail, 'tp_timesheet_sts') == 1 || data_get($detail, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($detail, 'tp_timesheet_sts') == 2)
<i
class=
"red attention icon"
></i>
Submitted
@elseif(data_get($detail, 'tp_timesheet_sts') == 3)
<i
class=
"green check icon"
></i>
Verified by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 4)
<i
class=
"green check icon"
></i>
Verified by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 5)
<i
class=
"red attention icon"
></i>
Dissaproved by PD
@elseif(data_get($detail, 'tp_timesheet_sts') == 6)
<i
class=
"red attention icon"
></i>
Rejected by PM
@elseif(data_get($detail, 'tp_timesheet_sts') == 7)
<i
class=
"red attention icon"
></i>
Rejected by HR
@endif
</td>
<td
style=
"width: 12%;"
class=
"text-center"
>
@if(data_get($detail, 'tp_timesheet_sts') == 2)
<button
class=
"center aligned ui green icon button"
onclick=
"window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';"
>
Verify | Reject
</button>
@else
<button
class=
"center aligned ui green icon button disabled"
>
Verify | Reject
</button>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<?php
$overhead
=
$overheads
->
where
(
'staffid'
,
$staff
->
staff_id
);
$checkoverhead
=
$overheads
->
where
(
'staffid'
,
$staff
->
staff_id
)
->
first
();
?>
@if($checkoverhead)
<table
class=
"ui unstackable celled table"
>
<thead>
<tr>
<th
style=
"width: 25%;"
>
Overhead
</th>
<th
style=
"width: 10%;"
class=
"center aligned"
>
Total Hours
</th>
<th
style=
"width: 10%;"
class=
"center aligned"
>
Total Days
</th>
<th
style=
"width: 30%"
>
Remarks
</th>
<th
style=
"width: 13%"
class=
"text-center"
>
Status
</th>
<th
style=
"width: 12%;"
class=
"text-center"
>
Action
</th>
</tr>
</thead>
@foreach($overheads as $key => $tp)
@if(data_get($staff, 'tmid') == data_get($tp, 'fk_tm_id'))
<tr>
<td
style=
"width: 25;"
>
{{data_get($tp, 'tp_project_name')}}
</td>
<td
style=
"width: 10%;"
class=
"center aligned"
>
{{data_get($tp, 'tp_hours')}}
</td>
<td
style=
"width: 10%;"
class=
"center aligned"
>
{{ number_format(data_get($tp, 'tp_hours')/8, 1, '.', '') }}
</td>
<td
style=
"width: 30%"
>
{{data_get($tp, 'verifier_remark')}}
</td>
<td
style=
"width: 13%"
class=
"text-center"
>
@if(data_get($tp, 'tp_timesheet_sts') == 1 || data_get($tp, 'tp_timesheet_sts') == null) In Preparation
@elseif(data_get($tp, 'tp_timesheet_sts') == 2)
<i
class=
"red attention icon"
></i>
Submitted
@elseif(data_get($tp, 'tp_timesheet_sts') == 3)
<i
class=
"green check icon"
></i>
Verified by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 4)
<i
class=
"green check icon"
></i>
Verified by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 5)
<i
class=
"red attention icon"
></i>
Dissaproved by BOD
@elseif(data_get($tp, 'tp_timesheet_sts') == 6)
<i
class=
"red attention icon"
></i>
Rejected by HOD/HOU
@elseif(data_get($tp, 'tp_timesheet_sts') == 7)
<i
class=
"red attention icon"
></i>
Rejected by HR
@endif
</td>
<td
style=
"width: 12%;"
class=
"text-center"
>
@if(data_get($tp, 'tp_timesheet_sts') == 2)
<button
class=
"center aligned ui green icon button"
onclick=
"window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';"
>
Verify | Reject
</button>
@else
<button
class=
"center aligned ui green icon button disabled"
>
Verify | Reject
</button>
@endif
</td>
</tr>
@endif
@endforeach
</table>
<table
class=
"ui unstackable celled table"
>
<thead>
<tr>
<th
style=
"width: 10%"
class=
"center aligned"
>
Date
</th>
<th
style=
"width: 15%"
class=
"single line"
>
Overhead Description
</th>
<th
class=
"center aligned"
>
Notes
</th>
</tr>
</thead>
@foreach($overheads as $key => $overhead)
@if(data_get($staff,'staff_id') == data_get($overhead, 'staffid'))
@foreach(data_get($overhead,'notes') as $key => $value)
@if(data_get($value,'td_hours'))
<tr>
<td
style=
"width: 10%"
class=
"center aligned"
>
{{data_get($value, 'td_date')}}
</td>
<td
style=
"width: 15%"
class=
"single line"
>
{{data_get($value, 'td_overhead_desc')}}
</td>
<td>
{{data_get($value, 'td_overhead_note')}}
</td>
</tr>
@endif
@endforeach
@endif
@endforeach
</table>
@endif
</div>
@endif
@endforeach
</div>
</div>
@endif
@if($others)
<div
class=
"ui segment"
>
<div
class=
"ui blue left ribbon label"
>
Dashboard
Other Departments
</div>
<br>
<br>
<div
class=
"ui styled fluid accordion"
>
<?php
$page
=
1
;
$project
=
$checksts
=
0
;
?>
@foreach($profile as $key => $staff)
<?php
$page
=
1
;
$project
=
$checksts
=
0
;
$notpms
=
$profile
->
where
(
'dept'
,
'<>'
,
4
);
?>
@foreach($notpms as $key => $staff)
<?php
$project
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
));
$checksts
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
)
->
where
(
'tp_timesheet_sts'
,
3
));
...
...
@@ -27,7 +240,7 @@
</table>
@endif
@foreach($profile
as $key => $staff)
@foreach($notpms
as $key => $staff)
<?php
$project
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
));
$checksts
=
count
(
data_get
(
$staff
,
'countchargeable'
)
->
where
(
'tp_pm'
,
$verifier
->
u_staffID
)
->
where
(
'tp_timesheet_sts'
,
3
));
...
...
@@ -43,10 +256,10 @@
<th
style=
"width: 20%"
class=
"text-center"
>
{{ data_get($staff,'year') }} - {{ date("F", mktime(0, 0, 0, data_get($staff,'month'), 10)) }} - Phase {{ data_get($staff,'phase') }}
</th>
<th
style=
"width: 15%;"
class=
"center aligned"
>
<?php
// dd($profile
);
// dd($notpms
);
$status
=
$staff
->
status
;
$verified
=
count
(
data_get
(
$profile
[
$key
],
'countchargeable'
)
->
where
(
'tp_timesheet_sts'
,
3
));
$allproject
=
count
(
data_get
(
$profile
[
$key
],
'countchargeable'
));
$verified
=
count
(
data_get
(
$notpms
[
$key
],
'countchargeable'
)
->
where
(
'tp_timesheet_sts'
,
3
));
$allproject
=
count
(
data_get
(
$notpms
[
$key
],
'countchargeable'
));
?>
@if($status == 1 || $status == null) In Preparation
@elseif($verified == $allproject)
<i
class=
"green check icon"
></i>
Verified by PM
...
...
@@ -188,7 +401,8 @@
@endif
@endforeach
</div>
</div>
</div>
@endif
@endsection
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
17a5877a
...
...
@@ -144,12 +144,13 @@ class DashboardController extends Controller
$verifier
=
Users
::
find
(
Auth
::
id
());
$profile
=
VwChargeableVerification
::
select
(
'tmid'
,
'staff_id'
,
'year'
,
'month'
,
'phase'
,
'status'
,
'submission'
,
'fullname'
,
'roleid'
,
'pmstaffid'
)
$profile
=
VwChargeableVerification
::
select
(
'tmid'
,
'staff_id'
,
'year'
,
'month'
,
'phase'
,
'status'
,
'submission'
,
'fullname'
,
'roleid'
,
'pmstaffid'
,
'dept'
)
->
where
(
'pmstaffid'
,
$verifier
->
u_staffID
)
->
where
(
'status'
,
2
)
->
distinct
(
'staff_id'
)
->
orderby
(
'roleid'
)
->
with
(
'countchargeable'
)
// ->with('department')
->
get
();
// dd($profile);
...
...
packages/portal/timesheet/src/Model/VwChargeableVerification.php
View file @
17a5877a
...
...
@@ -28,6 +28,11 @@ class VwChargeableVerification extends Model
return
$this
->
hasMany
(
'Portal\Timesheet\Model\Tproject'
,
'fk_tm_id'
,
'tmid'
)
->
where
(
'tp_project_type'
,
1
);
}
// public function department()
// {
// return $this->hasOne('Portal\Timesheet\Model\Staff_info','staff_id','staff_id');
// }
public
function
info
()
{
...
...
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