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
ec18097c
Commit
ec18097c
authored
Jul 25, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calculate hours and print timesheet review
parent
89c1ae9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
818 additions
and
416 deletions
+818
-416
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+727
-377
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+38
-38
resources/views/vendor/ui/layouts/base.blade.php
+53
-1
No files found.
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
ec18097c
...
@@ -8,402 +8,752 @@
...
@@ -8,402 +8,752 @@
</div>
</div>
<br><br>
<br><br>
<table class="
ui
unstackable
collapsing
table
">
<div id="
print_div
">
<tbody>
<tr>
<table id="
printtable1
" class="
ui
unstackable
collapsing
table
">
<td rowspan="
3
">
<tbody>
<img src="
https
://
www
.
3
fresources
.
com
/
app
/
themes
/
3
f
/
images
/
3
f
-
logo
.
svg
" height="
126
" width="
126
" alt="
3
f
-
logo
">
<tr>
</td>
<td rowspan="
3
">
<td>Name</td>
<img src="
https
://
www
.
3
fresources
.
com
/
app
/
themes
/
3
f
/
images
/
3
f
-
logo
.
svg
" height="
126
" width="
126
" alt="
3
f
-
logo
">
<td>:</td>
</td>
<td>{{
$user->fullname
}}</td>
<td>Name</td>
<td rowspan="
3
"></td>
<td>:</td>
<td>Department</td>
<td>{{
$user->fullname
}}</td>
<td>:</td>
<td rowspan="
3
"></td>
<td>{{
$dept->description
}}</td>
<td>Department</td>
<td rowspan="
3
"></td>
<td>:</td>
</tr>
<td>{{
$dept->description
}}</td>
<tr>
<td rowspan="
3
"></td>
<td>Staff No</td>
</tr>
<td>:</td>
<tr>
<td>{{
$user->staff_id
}}</td>
<td>Staff No</td>
<td>Reporting Manager</td>
<td>:</td>
<td>:</td>
<td>{{
$user->staff_id
}}</td>
<td>{{
$hod
}}</td>
<td>Reporting Manager</td>
</tr>
<td>:</td>
<tr>
<td>{{
$hod
}}</td>
<td>Month</td>
</tr>
<td>:</td>
<tr>
<td>
<td>Month</td>
<div class="
ui
form
">
<td>:</td>
<div class="
field
">
<td>
<select class="
ui
search
dropdown
">
<div class="
ui
form
">
<option value="" selected="">
{
{$strMonth}
}
</option>
<div class="
field
">
<option value="
1
">January</option>
<select class="
ui
search
dropdown
">
<option value="
2
">February</option>
<option value="" selected="">
{
{$strMonth}
}
</option>
<option value="
3
">March</option>
<option value="
1
">January</option>
<option value="
4
">April</option>
<option value="
2
">February</option>
<option value="
5
">May</option>
<option value="
3
">March</option>
<option value="
6
">June</option>
<option value="
4
">April</option>
<option value="
7
">July</option>
<option value="
5
">May</option>
<option value="
8
">August</option>
<option value="
6
">June</option>
<option value="
9
">September</option>
<option value="
7
">July</option>
<option value="
10
">October</option>
<option value="
8
">August</option>
<option value="
11
">November</option>
<option value="
9
">September</option>
<option value="
12
">December</option>
<option value="
10
">October</option>
</select>
<option value="
11
">November</option>
</div>
<option value="
12
">December</option>
</div>
</select>
</td>
</div>
<td>Phase</td>
</div>
<td>:</td>
</td>
<td>
<td>Phase</td>
<div class="
ui
form
">
<td>:</td>
<div class="
field
">
<td>
<select class="
ui
search
dropdown
">
<div class="
ui
form
">
@if(
$phase
== 1)
<div class="
field
">
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
<select class="
ui
search
dropdown
">
<option value="
2
">2</option>
@if(
$phase
== 1)
@else
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
<option value="
2
">2</option>
<option value="
1
">1</option>
@else
@endif
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
</select>
<option value="
1
">1</option>
</div>
@endif
</div>
</select>
</td>
</div>
</td>
</div>
</tr>
</td>
</tbody>
</td>
</table>
</tr>
</tbody>
<div class="
ui
segment
">
</table>
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<div class="
ui
segment
">
<tr>
<table id="
printtable2
" class="
ui
celled
structured
table
unstackable
">
<th colspan="
3
">Chargeable</th>
<thead>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<tr>
<th></th>
<th colspan="
3
">Chargeable</th>
</tr>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
</thead>
<th></th>
<tbody>
</tr>
<tr>
</thead>
<td style="
width
:
3
%
;
"></td>
<tbody>
<td style="
width
:
10
%
;
">Project Code</td>
<tr>
<td style="
width
:
13
%
;
">Project Name</td>
<td style="
width
:
4
%
;
"></td>
@if(
$phase
== 1)
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
13
%
;
">Project Name</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@endif
<td>Total Hours</td>
</tr>
@foreach(
$chargeablelist
as
$key
=>
$projectchargeable
)
<?php
$totalcharge
= 0; ?>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
10
%
;
">{{
$projectchargeable['pcode']
}}</td>
<td style="
width
:
13
%
;
">{{
$projectchargeable['pname']
}}</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valchargehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$chargehour
)
{
$valchargehour
=
$chargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
@for(
$i
= 0;
$i
< 15 ;
$i
++)
$totalcharge
+= data_get(
$valchargehour
,'td_hours');
<td>
{
{$i+1}
}
</td>
}
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@endif
<td>Total Hours</td>
</tr>
@foreach(
$chargeablelist
as
$key
=>
$projectchargeable
)
<?php
$total
= 0; ?>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
10
%
;
">{{
$projectchargeable['pcode']
}}</td>
<td style="
width
:
13
%
;
">{{
$projectchargeable['pname']
}}</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
?>
<?php
@if(
$valchargehour
)
<td style="
width
:
4
%
;
">{{
$valchargehour->td_hours
}}</td>
$valchargehour
= '';
@else
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
<td style="
width
:
4
%
;
"></td>
@endif
if(
$chargehour
)
{
$valchargehour
=
$chargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valchargehour
,'td_hours');
}
?>
@if(
$valchargehour
)
<td>{{
$valchargehour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valchargehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$chargehour
)
{
$valchargehour
=
$chargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valchargehour
,'td_hours');
}
?>
@if(
$valchargehour
)
<td>{{
$valchargehour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
@endif
@if(
$valchargehour
)
<td>{{
$total
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
18
@
else
{{
$daymonth
-
12
}}
@
endif
">Total</th>
<th>@if(
$totalchargehrs
){{
$totalchargehrs
}}@else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="
ui
segment
">
@endfor
<table class="
ui
celled
structured
table
unstackable
">
@else
<thead>
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<tr>
<?php
<th colspan="
2
">Non-Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
$valchargehour
= '';
<th></th>
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
</tr>
</thead>
if(
$chargehour
)
<tbody>
{
<tr>
$valchargehour
=
$chargehour->where
('td_date','=',
$date
)
<td style="
width
:
3
%
;
"></td>
->where('td_project',
$projectchargeable['pid']
)
<td style="
width
:
23
%
;
">Task</td>
->where('tm_phase',
$phase
)
@if(
$phase
== 1)
->first();
@for(
$i
= 0;
$i
< 15 ;
$i
++)
$totalcharge
+= data_get(
$valchargehour
,'td_hours');
<td>
{
{$i+1}
}
</td>
}
@endfor
@else
?>
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
@if(
$valchargehour
)
<td>
{
{$i+1}
}
</td>
<td style="
width
:
4
%
;
">{{
$valchargehour->td_hours
}}</td>
@endfor
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@endif
@if(
$valchargehour
)
<td>{{
$totalcharge
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
3
">Total (A)</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$totalcbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valcbyday
=
$chargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valcbyday
as
$key
=>
$value
) {
$totalcbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totalcbyday
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$totalcbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valcbyday
=
$chargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valcbyday
as
$key
=>
$value
) {
$totalcbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totalcbyday
}}</th>
@endfor
@endif
<th>@if(
$totalchargehrs
){{
$totalchargehrs
}}@else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="
ui
segment
">
<table id="
printtable3
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Non-Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Task</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@endif
<td>Total Hours</td>
</tr>
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
<?php
$totalnoncharge
= 0; ?>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectnonchargeable['pname']
}}</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valnonchargehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$nonchargehour
)
{
$valnonchargehour
=
$nonchargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectnonchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$totalnoncharge
+= data_get(
$valnonchargehour
,'td_hours');
}
?>
@if(
$valnonchargehour
)
<td style="
width
:
4
%
;
">{{
$valnonchargehour->td_hours
}}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@endif
@else
<td>Total Hours</td>
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
</tr>
<?php
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
$valnonchargehour
= '';
<?php
$total
= 0; ?>
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectnonchargeable['pname']
}}</td>
if(
$nonchargehour
)
{
$valnonchargehour
=
$nonchargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectnonchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$totalnoncharge
+= data_get(
$valnonchargehour
,'td_hours');
}
?>
@if(
$valnonchargehour
)
<td style="
width
:
4
%
;
">{{
$valnonchargehour->td_hours
}}</td>
@else
<td style="
width
:
4
%
;
"></td>
@endif
@endfor
@endif
@if(
$valnonchargehour
)
<td>{{
$totalnoncharge
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
2
">Total (B)</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$totalncbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totalncbyday
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$totalncbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totalncbyday
}}</th>
@endfor
@endif
<th>@if(
$totalnonchargehrs
){{
$totalnonchargehrs
}}@else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="
ui
segment
">
<table id="
printtable4
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Overhead</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@endif
<td>Total Hours</td>
</tr>
@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
)
{
$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
%
;
">{{
$valoverheadhour->td_hours
}}</td>
@else
<td style="
width
:
4
%
;
">0</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
%
;
">{{
$valoverheadhour->td_hours
}}</td>
@else
<td style="
width
:
4
%
;
">0</td>
@endif
@endfor
@endif
@if(
$valchargehour
)
<td>{{
$totaloverhead
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
2
">Total (C)</th>
@if(
$phase
== 1)
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totaloverheadbyday
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
?>
<th>{{
$totaloverheadbyday
}}</th>
@endfor
@endif
<th>@if(
$totaloverheadhrs
) {{
$totaloverheadhrs
}} @else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="
ui
segment
">
<table id="
printtable5
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Note:</th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
13.5
%
;
">Date</td>
<td>Description</td>
</tr>
@foreach(
$notes
as
$key
=>
$value
)
<tr>
<td>{{
$value->td_date
}}</td>
<td>{{
$value->td_overhead_note
}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="
ui
segment
">
<table id="
printtabl6
" class="
ui
celled
structured
table
unstackable
">
<thead>
<th colspan="
@
if
(
$phase
==
1
)
17
@
else
{{
$daymonth
-
13
}}
@
endif
"></th>
<th>Total hours</th>
<th>Total days</th>
</thead>
<tbody>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Total (B) + (C) Non Chargeable</td>
@if(
$phase
== 1 )
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$bc
= 0;
$totalncbyday
= 0;
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
$bc
=
$totalncbyday
+
$totaloverheadbyday
;
?>
<td style="
width
:
4
%
;
">{{
$bc
}}</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$bc
= 0;
$totalncbyday
= 0;
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
$bc
=
$totalncbyday
+
$totaloverheadbyday
;
?>
<td style="
width
:
4
%
;
">{{
$bc
}}</td>
@endfor
@endif
<td> @if(
$check
) {{ (
$totalnonchargehrs
+
$totaloverheadhrs
) }} @else 0 @endif </td>
<td> {{ (
$totalnonchargehrs
+
$totaloverheadhrs
)/8 }} </td>
</tr>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Total (A+B+C) - 8 Overtime</td>
<?php
$totalot
= 0; ?>
@if(
$phase
== 1 )
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$ot
= 0;
$bc
= 0;
$totalcbyday
= 0;
$totalncbyday
= 0;
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valcbyday
=
$chargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valcbyday
as
$key
=>
$value
) {
$totalcbyday
+=
$value->td_hours
;
}
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
$ot
= (
$totalcbyday
+
$totalncbyday
+
$totaloverheadbyday
)-8;
if(
$ot
>= 0)
$totalot
+=
$ot
;
?>
<td style="
width
:
4
%
;
">
@if(
$ot
> 0)
{{
$ot
}}
@else
0
@endif
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$ot
= 0;
$bc
= 0;
$totalcbyday
= 0;
$totalncbyday
= 0;
$totaloverheadbyday
= 0;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valcbyday
=
$chargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valncbyday
=
$nonchargehour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
$valoverheadbyday
=
$overheadhour->where
('td_date','=',
$date
)
->where('tm_phase',
$phase
);
foreach(
$valcbyday
as
$key
=>
$value
) {
$totalcbyday
+=
$value->td_hours
;
}
foreach(
$valncbyday
as
$key
=>
$value
) {
$totalncbyday
+=
$value->td_hours
;
}
foreach(
$valoverheadbyday
as
$key
=>
$value
) {
$totaloverheadbyday
+=
$value->td_hours
;
}
$ot
= (
$totalcbyday
+
$totalncbyday
+
$totaloverheadbyday
)-8;
if(
$ot
>= 0)
$totalot
+=
$ot
;
?>
<td style="
width
:
4
%
;
">
@if(
$ot
> 0)
{{
$ot
}}
@else
0
@endif
</td>
@endfor
@endif
<td>
@if(
$check
)
{{
$totalot
}}
@else
0
@endif
</td>
<td>{{
$totalot
/8 }}</td>
</tr>
</tbody>
</table>
</div>
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valnonchargehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$nonchargehour
)
{
$valnonchargehour
=
$nonchargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectnonchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valnonchargehour
,'td_hours');
}
?>
@if(
$valnonchargehour
)
<td>{{
$valnonchargehour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valnonchargehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$nonchargehour
)
{
$valnonchargehour
=
$nonchargehour->where
('td_date','=',
$date
)
->where('td_project',
$projectnonchargeable['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valnonchargehour
,'td_hours');
}
?>
@if(
$valnonchargehour
)
<td>{{
$valnonchargehour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
@endif
@if(
$valnonchargehour
)
<td>{{
$total
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
17
@
else
{{
$daymonth
-
13
}}
@
endif
">Total</th>
<th>@if(
$totalnonchargehrs
){{
$totalnonchargehrs
}}@else 0 @endif</th>
</tfoot>
</table>
</div>
</div>
<br>
<button type="
button
" onclick="
printdiv
(
'print_div'
)
"> print</button>
<div class="
ui
segment
">
</div>
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
23
%
;
">Overhead</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
@endsection
<td>
{
{$i+1}
}
</td>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<td>
{
{$i+1}
}
</td>
@endfor
@endif
<td>Total Hours</td>
</tr>
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
<?php
$total
= 0; ?>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
10
%
;
">{{
$projectoverhead['pname']
}}</td>
@if(
$phase
== 1)
@push('script')
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valoverheadhour
= '';
<!-- <script type="
text
/
javascript
">
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
function printdiv(printpage)
{
if(
$overheadhour
)
{
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valoverheadhour
,'td_hours');
// var oldstr = document.body.innerHTML;
}
// var el = document.getElementById("
body1
");
// el.classList.remove("
on
-
the
-
fly
-
behavior
");
// el.classList.add("
print
-
fly
");
// el.style.fontSize = "
10
px
!
important
;
background
-
color
:
white
!
important
";
?>
document.getElementById(printpage).style.width = "
100
%
";
@if(
$valoverheadhour
)
<td>{{
$valoverheadhour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
document.getElementById("
printtable1
").style.width = "
100
%
";
@else
document.getElementById("
printtable1
").style.fontSize = "
10
px
";
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
$valoverheadhour
= ''
;
document.getElementById("
printtable2
").style.width = "
100
%
"
;
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1)
;
document.getElementById("
printtable2
").style.fontSize = "
10
px
"
;
if(
$overheadhour
)
document.getElementById("
printtable3
").style.width = "
100
%
";
{
document.getElementById("
printtable3
").style.fontSize = "
10
px
";
$valoverheadhour
=
$overheadhour->where
('td_date','=',
$date
)
->where('fk_o_id',
$projectoverhead['pid']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valoverheadhour
,'td_hours');
document.getElementById("
printtable4
").style.width = "
100
%
";
}
document.getElementById("
printtable4
").style.fontSize = "
10
px
";
?>
@if(
$valoverheadhour
)
<td>{{
$valoverheadhour->td_hours
}}</td>
@else
<td></td>
@endif
@endfor
@endif
@if(
$valchargehour
)
<td>{{
$total
}}</td>
@else
<td>0</td>
@endif
</tr>
@endforeach
</tbody>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
17
@
else
{{
$daymonth
-
13
}}
@
endif
">Total</th>
<th>@if(
$totaloverheadhrs
) {{
$totaloverheadhrs
}} @else 0 @endif</th>
</tfoot>
</table>
</div>
<div class="
ui
segment
">
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Note:</th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
13.5
%
;
">Date</td>
<td>Description</td>
</tr>
@foreach(
$notes
as
$key
=>
$value
)
<tr>
<td>{{
$value->td_date
}}</td>
<td>{{
$value->td_overhead_note
}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
document.getElementById("
printtable5
").style.width = "
100
%
";
\ No newline at end of file
document.getElementById("
printtable5
").style.fontSize = "
10
px
";
document.getElementById("
printtable6
").style.width = "
100
%
";
document.getElementById("
printtable6
").style.fontSize = "
10
px
";
var headstr = "
<
html
><
head
><
title
></
title
></
head
><
body
style
=
'background-color: white;font-size:10px;margin-left:50px;margin-right:50px'
>
";
var footstr = "
</
body
>
";
var newstr = document.all.item(printpage).innerHTML;
var winPrint = window.open('', '', 'left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
winPrint.document.write(headstr+newstr+footstr);
winPrint.document.close();
winPrint.focus();
setTimeout(function()
{
winPrint.print();
winPrint.close();
}, 1000);
}
</script> -->
<script type="
text
/
javascript
">
function printdiv(printpage)
{
var oldstr = document.body.innerHTML;
var el = document.getElementById("
body1
");
el.classList.remove("
on
-
the
-
fly
-
behavior
");
el.classList.add("
print
-
flys
");
var headstr = "
<
html
><
head
><
title
></
title
></
head
><
body
>
";
var footstr = "
</
body
>
";
var newstr = document.all.item(printpage).innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
el.classList.remove("
print
-
flys
");
el.classList.add("
on
-
the
-
fly
-
behavior
");
document.body.innerHTML = oldstr;
$('#cpsurat').html();
return false;
}
</script>
@endpush
\ No newline at end of file
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
ec18097c
...
@@ -96,9 +96,13 @@ class DashboardController extends Controller
...
@@ -96,9 +96,13 @@ class DashboardController extends Controller
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
->
fullname
;
->
fullname
;
$month
=
date
(
'n'
);
// $month = date('n');
$year
=
date
(
'Y'
);
// $year = date('Y');
$day
=
date
(
'j'
);
// $day = date('j');
$month
=
7
;
$year
=
2022
;
$day
=
2
;
if
(
$day
<
16
)
{
if
(
$day
<
16
)
{
$phase
=
1
;
$phase
=
1
;
...
@@ -116,7 +120,6 @@ class DashboardController extends Controller
...
@@ -116,7 +120,6 @@ class DashboardController extends Controller
{
{
$phase
=
$request
->
phase
;
$phase
=
$request
->
phase
;
}
}
if
(
isset
(
$request
->
month
))
if
(
isset
(
$request
->
month
))
{
{
$month
=
$request
->
month
;
$month
=
$request
->
month
;
...
@@ -139,9 +142,8 @@ class DashboardController extends Controller
...
@@ -139,9 +142,8 @@ class DashboardController extends Controller
->
where
(
'pt_project_type'
,
$nonchargeable
)
->
where
(
'pt_project_type'
,
$nonchargeable
)
->
get
();
->
get
();
$overheadproject
=
Overhead
::
where
(
'o_overhead_sts'
,
1
)
// $overheadproject = Overhead::where('o_overhead_sts',1)
->
get
();
// ->get();
$chargeablelist
=
[];
$chargeablelist
=
[];
...
@@ -171,17 +173,6 @@ class DashboardController extends Controller
...
@@ -171,17 +173,6 @@ class DashboardController extends Controller
}
}
foreach
(
$overheadproject
as
$key
=>
$value
)
{
$overheadlist
[]
=
[
'pid'
=>
$value
->
id
,
'pname'
=>
$value
->
o_overhead_desc
,
];
}
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$user
->
staff_id
)
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$user
->
staff_id
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_month'
,
$month
)
...
@@ -201,27 +192,36 @@ class DashboardController extends Controller
...
@@ -201,27 +192,36 @@ class DashboardController extends Controller
// ->where('td_hours', '!=', 0)
// ->where('td_hours', '!=', 0)
->
get
();
->
get
();
// $filledoverhead = Ts_detail::where('fk_tm_id',$check->id)
// ->where('td_project_type', $overhead)
// // ->where('td_hours', '!=', 0)
// ->get();
// foreach ($filledoverhead as $key => $value) {
// $temp[$key] =
// if($overheadlist[$key] != $overheadlist[$key+1]) {
// $overheadlist[] = [
// 'pid' => $value->fk_o_id,
// 'pname' => $value->td_overhead_desc,
// ];
// }
// }
// dd($overheadlist);
$overheadhour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
$overheadhour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$overhead
)
->
where
(
'td_project_type'
,
$overhead
)
// ->where('td_hours', '!=', 0)
->
where
(
'td_hours'
,
'!='
,
0
)
->
get
();
->
get
();
$tempOverhead
=
[];
$tempOverheadid
=
[];
$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
;
}
}
foreach
(
$tempOverhead
as
$key
=>
$value
)
{
$overheadlist
[]
=
[
'pid'
=>
$tempOverheadid
[
$key
],
'pname'
=>
$tempOverhead
[
$key
],
];
}
}
}
else
else
...
@@ -246,7 +246,7 @@ class DashboardController extends Controller
...
@@ -246,7 +246,7 @@ class DashboardController extends Controller
->
orderby
(
'td_date'
)
->
orderby
(
'td_date'
)
->
get
();
->
get
();
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'user'
,
'dept'
,
'hod'
,
'phase'
,
'month'
,
'year'
,
'day'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'nonchargeablelist'
,
'overheadlist'
,
'chargehour'
,
'nonchargehour'
,
'totalchargehrs'
,
'totalnonchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
));
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'user'
,
'dept'
,
'hod'
,
'phase'
,
'month'
,
'year'
,
'day'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'nonchargeablelist'
,
'overheadlist'
,
'chargehour'
,
'nonchargehour'
,
'totalchargehrs'
,
'totalnonchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
,
'check'
));
}
}
...
...
resources/views/vendor/ui/layouts/base.blade.php
View file @
ec18097c
...
@@ -19,7 +19,59 @@
...
@@ -19,7 +19,59 @@
</head>
</head>
<body
data-theme=
"{{ config('laravolt.ui.sidebar_theme') }}"
class=
"{{ $bodyClass ?? '' }}"
>
<body
data-theme=
"{{ config('laravolt.ui.sidebar_theme') }}"
class=
"on-the-fly-behavior {{ $bodyClass ?? '' }}"
id=
"body1"
>
<style
scoped
>
.print-fly
{
background-color
:
white
;
font-size
:
10px
;
}
.print-flys
{
background-color
:
white
;
width
:
auto
;
}
.on-the-fly-behavior
{
background-image
:
url('{{ asset('assets/images/bg.png')
}
}
');
background-repeat:no-repeat;
background-size: contain;
}
.langdisp
{
background-color: darkmagenta;
border-radius: 20px;
margin-right: 10px;
margin-top: 20px !important;
padding-top: 10px;
padding-bottom: 14px;
padding-right: 20px;
padding-left: 20px;"
}
@media (max-width: 1200px)
{
.on-the-fly-behavior {
background-image: url('
{
{
asset('assets/images/bg.png')
}
}'
);
background-repeat
:no-repeat
;
background-size
:
unset
;
}
.langdisp
{
background-color
:
unset
!important
;
border-radius
:
unset
!important
;
margin
:
unset
!important
;
padding
:
unset
!important
;
}
}
</style>
@yield('body')
@yield('body')
...
...
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