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
5ee38e76
Commit
5ee38e76
authored
Oct 28, 2022
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applied same features to hod verfication screen
parent
867ecb15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
359 additions
and
55 deletions
+359
-55
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
+41
-27
packages/portal/timesheet/resources/views/dashboard/dashboardpm.blade.php
+1
-1
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
+189
-25
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+128
-2
No files found.
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
View file @
5ee38e76
...
...
@@ -28,20 +28,22 @@
if(data_get(
$value
,'staffid') == data_get(
$staff
,'staff_id') && data_get(
$value
,'tp_timesheet_sts') == 3)
$over
+= 1;
}
// dump(
$over
);
// dump(data_get(
$staff
,'status'));
?>
@if(
$staff->status
== 7) <i class="
red
attention
icon
"></i>Rejected by HR
@elseif(
$staff->status
== 6) <i class="
red
attention
icon
"></i>Rejected by HOD/HOU
@elseif(
$staff->status
== 5) <i class="
red
attention
icon
"></i>Dissaproved by BOD
@elseif(
$staff->status
== 4) <i class="
green
check
icon
"></i>Verified by BOD
@elseif(
$over
== count(data_get(
$staff
,'overheads'))) <i class="
green
check
icon
"></i> Verified by HOD/HOU
@elseif(
$over
> 0 &&
$over
== count(data_get(
$staff
,'overheads'))) <i class="
green
check
icon
"></i> Verified by HOD/HOU
@elseif(
$over
!= count(data_get(
$staff
,'overheads')) ||
$staff->status
== 2) <i class="
red
attention
icon
"></i> Submitted
@elseif(
$staff->status
== 1 ||
$staff->status
== null) In Preparation
@endif
</th>
<th style="
width
:
13
%
" class="
text
-
center
">Submitted on: {{ date("
d
/
m
/
Y
", strtotime(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,'
tm_phase
'), '
month
' => data_get($staff,'
tm_month
'), '
year
' => data_get($staff,'
tm_year
') ]) }}'
;
" target='_blank'>View
</button>
<button class="
center
aligned
ui
blue
icon
button
"
>View Details
</button>
</th>
</tr>
</thead>
...
...
@@ -66,7 +68,7 @@
</tr>
</thead>
@foreach(
$detail
s
as
$key
=>
$tp
)
@foreach(
$detail
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>
...
...
@@ -85,40 +87,52 @@
@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
">
<td style="
width
:
12
%
;
" class="
text
-
center
single
line
">
@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
'), '
page
'=>$page ]) }}'
;
">Verify | Reject</button>
@else
<button class="
center
aligned
ui
green
icon
button
disabled
">Verify | Reject</button>
@endif
<a href="
{{
route
(
'timesheet::dashboard.timesheetViewer'
,
[
'user'
=>
data_get
(
$staff
,
'staff_id'
)
,
'phase'
=>
data_get
(
$staff
,
'tm_phase'
),
'month'
=>
data_get
(
$staff
,
'tm_month'
),
'year'
=>
data_get
(
$staff
,
'tm_year'
)
])
}}
" class="
center
aligned
ui
blue
icon
button
" target='_blank'>View</a>
</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(
$details
as
$key
=>
$detail
)
@if(data_get(
$staff
,'tmid') == data_get(
$detail
, 'fk_tm_id'))
@foreach(data_get(
$detail
,'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>
<?php
$n
= null; ?>
@foreach(
$details
as
$key
=>
$detail
)
@if(data_get(
$staff
,'tmid') == data_get(
$detail
, 'fk_tm_id'))
@foreach(data_get(
$detail
,'notes') as
$key
=>
$value
)
<?php
$n
=
$value
; ?>
@endforeach
@endif
@endforeach
@if(
$n
)
<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(
$details
as
$key
=>
$detail
)
@if(data_get(
$staff
,'tmid') == data_get(
$detail
, 'fk_tm_id'))
@foreach(data_get(
$detail
,'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
@foreach (
$ts
as
$key
=>
$value
)
@if(data_get(
$value
,'attachement'))
...
...
packages/portal/timesheet/resources/views/dashboard/dashboardpm.blade.php
View file @
5ee38e76
...
...
@@ -91,7 +91,7 @@
@else
<button
class=
"center aligned ui green icon button disabled"
>
Verify | Reject
</button>
@endif
<
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,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}', '_blank';"
>
View
</button
>
<
a
class=
"center aligned ui blue icon button"
href=
"{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}"
target=
"_blank"
>
View
</a
>
</td>
</tr>
@endif
...
...
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
View file @
5ee38e76
...
...
@@ -4,40 +4,204 @@
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Overhead Verification</a>
<br><br>
<br>
<table class="
ui
unstackable
collapsing
table
" style="
width
:
100
%
">
<tbody>
<tr>
<td rowspan="
3
">
<img src="
{{
url
(
'img/3f-logo.svg'
)
}}
" height="
126
" width="
126
" alt="
3
f
-
logo
">
</td>
<td>Name</td>
<td>:</td>
<td>{{ data_get(
$staff
,'STAFF_NAME') }}</td>
<td rowspan="
3
"></td>
<td>Department</td>
<td>:</td>
<td>{{ data_get(
$staff
,'DEPARTMENT') }}</td>
<td rowspan="
3
"></td>
</tr>
<tr>
<td>Staff No</td>
<td>:</td>
<td>{{ data_get(
$staff
,'STAFF_ID') }}</td>
<td>Reporting Manager</td>
<td>:</td>
<td>{{ data_get(
$staff
,'HOD_NAME') }}</td>
</tr>
<tr>
<td>Month</td>
<td>:</td>
<td>{{
$strMonth
}}</td>
<td>Phase</td>
<td>:</td>
<td>
@if(
$phase
== 1) 1st Half-month
@else 2nd Half-month
@endif
</td>
</tr>
</tbody>
</table>
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
" rowspan="
3
" class="
center
aligned
" style="
width
:
27
%
;
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
" rowspan="
2
" class="
center
aligned
">Total</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th style="
width
:
4
%
;
">
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@endif
<th>Hours</th>
<th>Days</th>
</tr>
</thead>
<tbody>
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
<?php
$totaloverhead
= 0; ?>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectoverhead['pname']
}}</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valoverheadhour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$overheadhour
)
{
// dd('masuk');
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
?>
@if(
$valoverheadhour
)
<td style="
width
:
4
%
;
">{{ data_get(
$valoverheadhour
,'td_hours') }}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valoverheadhour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$overheadhour
)
{
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
?>
@if(
$valoverheadhour
)
<td style="
width
:
4
%
;
">{{ data_get(
$valoverheadhour
,'td_hours') }}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@endif
@if(
$totaloverhead
)
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
, 1, '.', '') }}</td>
<td style="
width
:
5
%
">{{ number_format(
$totaloverhead
/8, 1, '.', '') }}</td>
@else
<td style="
width
:
5
%
">0</td>
<td style="
width
:
5
%
">0</td>
@endif
</tr>
@endforeach
</tbody>
<!-- <tfoot>
<th colspan="
2
">Total (B)</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if (
$overheadhour
) {
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+= data_get(
$value
,'td_hours');
}
}
?>
<th style="
width
:
4
%
">{{
$totaloverheadbyday
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if (
$overheadhour
) {
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+= data_get(
$value
,'td_hours');
}
}
?>
<th style="
width
:
4
%
">{{
$totaloverheadbyday
}}</th>
@endfor
@endif
<th style="
width
:
5
%
">@if(
$totaloverheadhrs
) {{ number_format(
$totaloverheadhrs
, 1, '.', '') }} @else 0 @endif</th>
<th style="
width
:
5
%
">@if(
$totaloverheadhrs
) {{ number_format(
$totaloverheadhrs
/8, 1, '.', '') }} @else 0 @endif</th>
</tfoot> -->
</table>
<form action="
{{
route
(
'timesheet::dashboard.verifyoverhead'
)
}}
" method="
POST
" class="
ui
form
">
{
{csrf_field()}
}
<input type="
hidden
" name="
tpid
" value="
{{
data_get
(
$profile
,
'id'
)
}}
">
<input type="
hidden
" name="
page
" value="
{{
$page
}}
">
<div class="
six
wide
field
">
<label>Staff Name</label>
<input type="
text
" readonly="
readonly
" value="
{{
data_get
(
$profile
,
'team.fullname'
)}}
">
</div>
<div class="
three
fields
">
<div class="
two
wide
field
">
<label>Year</label>
<input type="
text
" readonly="
readonly
" value="
{{
data_get
(
$profile
,
'tp_year'
)
}}
">
</div>
<div class="
two
wide
field
">
<label>Month</label>
<input type="
text
" readonly="
readonly
" value="
{{
data_get
(
$profile
,
'tp_month'
)
}}
">
</div>
<div class="
two
wide
field
">
<label>Phase</label>
<input type="
text
" readonly="
readonly
" value="
{{
data_get
(
$profile
,
'tp_phase'
)
}}
">
</div>
</div>
<div class="
two
fields
">
<div class="
six
wide
field
">
<div class="
field
">
<input type="
hidden
" name="
verifier
" value="
{{
data_get
(
$hod
,
'id'
)
}}
">
<label>Head of Department</label>
<input type="
text
" readonly="
readonly
" value="
{{
data_get
(
$hod
,
'name'
)
}}
">
</div>
<div class="
three
wide
field
">
<div class="
field
">
<label>Action</label>
<select class="
ui
fluid
dropdown
" name="
action
">
<option value="
1
">Verify</option>
...
...
@@ -47,7 +211,7 @@
</div>
<div class="
field
">
<label>Remarks</label>
<textarea name="
remarks
"></textarea>
<textarea
rows="
3
"
name="
remarks
"></textarea>
</div>
<button class="
ui
primary
button
" type="
submit
">Submit</button>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
5ee38e76
...
...
@@ -475,8 +475,134 @@ class DashboardController extends Controller
// ->where('tmid', $request->tmid)
// ->first();
$phase
=
$profile
->
tp_phase
;
$month
=
$profile
->
tp_month
;
$year
=
$profile
->
tp_year
;
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$myDate
=
$month
.
'/'
.
'1'
.
'/'
.
$year
;
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$staff
=
VwViewer
::
where
(
'STAFF_ID'
,
$profile
->
staffid
)
->
first
();
$strMonth
=
$date
->
format
(
'F'
);
$strdays
=
[];
for
(
$i
=
0
;
$i
<
$daymonth
;
$i
++
)
{
$tempdate
=
$year
.
'-'
.
sprintf
(
'%02d'
,
$month
)
.
'-'
.
sprintf
(
'%02d'
,
$i
+
1
);
$strday
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$tempdate
)
->
format
(
'l'
);
$strdays
[
$i
]
=
substr
(
$strday
,
0
,
3
);
}
// dd($staff);
$chargeable
=
1
;
$overhead
=
3
;
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$profile
->
staffid
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
with
(
'attachement'
)
->
first
();
$chargeableproject
=
Tproject
::
where
(
'fk_tm_id'
,
data_get
(
$check
,
'id'
))
->
where
(
'tp_project_type'
,
1
)
->
with
(
'project'
)
->
get
();
$chargeablelist
=
[];
$overheadlist
=
[];
foreach
(
$chargeableproject
as
$key
=>
$value
)
{
$chargeablelist
[]
=
[
'pid'
=>
$value
->
td_project
,
'pcode'
=>
$value
->
project
->
p_project_code
,
'pname'
=>
$value
->
project
->
p_project_description
,
];
}
if
(
$check
)
{
$chargehour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$chargeable
)
// ->where('td_hours', '!=', 0)
->
get
();
$overheadhour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$profile
->
fk_tm_id
)
->
where
(
'td_project_type'
,
$overhead
)
->
where
(
'td_hours'
,
'!='
,
0
)
->
get
();
// dd($overheadhour);
$tempOverhead
[
0
]
=
""
;
$tempOverheadid
[
0
]
=
0
;
if
(
isset
(
$overheadhour
[
0
]))
{
// dd('sini ke?');
$tempOverhead
[
0
]
=
$overheadhour
[
0
]
->
td_overhead_desc
;
$tempOverheadid
[
0
]
=
$overheadhour
[
0
]
->
fk_o_id
;
$j
=
0
;
for
(
$i
=
0
;
$i
<
count
(
$overheadhour
);
$i
++
)
{
if
(
$tempOverhead
[
$j
]
==
$overheadhour
[
$i
]
->
td_overhead_desc
)
{
}
else
{
$j
++
;
$tempOverhead
[
$j
]
=
$overheadhour
[
$i
]
->
td_overhead_desc
;
$tempOverheadid
[
$j
]
=
$overheadhour
[
$i
]
->
fk_o_id
;
}
}
$overheadlist
[]
=
[
'pid'
=>
$profile
->
fk_o_id
,
'pname'
=>
$profile
->
tp_project_name
,
];
}
else
{
// dd('ke sini?');
}
$totalchargehrs
=
$check
->
tm_chargeable_hrs
;
$totaloverheadhrs
=
$check
->
tm_overhead_hrs
;
$notes
=
Ts_detail
::
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'tm_staff_id'
,
$profile
->
staffid
)
->
where
(
'td_project_type'
,
$overhead
)
->
whereNotNull
(
'td_hours'
)
->
orderby
(
'td_date'
)
->
get
();
}
else
{
$chargehour
=
null
;
$overheadhour
=
null
;
$totalchargehrs
=
null
;
$totaloverheadhrs
=
null
;
$notes
=
null
;
$check
=
null
;
}
return
view
(
'timesheet::dashboard.revaction'
,
compact
(
'profile'
,
'hod'
,
'page'
));
// dd($overheadlist);
return
view
(
'timesheet::dashboard.revaction'
,
compact
(
'profile'
,
'hod'
,
'page'
,
'staff'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'totalchargehrs'
,
'daymonth'
,
'overheadlist'
,
'overheadhour'
,
'totaloverheadhrs'
));
}
public
function
projectaction
(
Request
$request
)
...
...
@@ -623,7 +749,7 @@ class DashboardController extends Controller
$pm
=
Users
::
find
(
Auth
::
id
());
return
view
(
'timesheet::dashboard.projectaction'
,
compact
(
'profile'
,
'pm'
,
'page'
,
'staff'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'totalchargehrs'
));
return
view
(
'timesheet::dashboard.projectaction'
,
compact
(
'profile'
,
'pm'
,
'page'
,
'staff'
,
'strMonth'
,
'year'
,
'month'
,
'phase'
,
'strdays'
,
'chargeablelist'
,
'chargehour'
,
'
daymonth'
,
'
totalchargehrs'
));
}
public
function
verify
(
Request
$request
)
...
...
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