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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
480 additions
and
77 deletions
+480
-77
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+390
-39
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+37
-37
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,7 +8,9 @@
...
@@ -8,7 +8,9 @@
</div>
</div>
<br><br>
<br><br>
<table class="
ui
unstackable
collapsing
table
">
<div id="
print_div
">
<table id="
printtable1
" class="
ui
unstackable
collapsing
table
">
<tbody>
<tbody>
<tr>
<tr>
<td rowspan="
3
">
<td rowspan="
3
">
...
@@ -78,7 +80,7 @@
...
@@ -78,7 +80,7 @@
</table>
</table>
<div class="
ui
segment
">
<div class="
ui
segment
">
<table
class="
ui
celled
structured
table
unstackable
">
<table id="
printtable2
"
class="
ui
celled
structured
table
unstackable
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
3
">Chargeable</th>
<th colspan="
3
">Chargeable</th>
...
@@ -88,7 +90,7 @@
...
@@ -88,7 +90,7 @@
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
13
%
;
">Project Name</td>
<td style="
width
:
13
%
;
">Project Name</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -105,9 +107,9 @@
...
@@ -105,9 +107,9 @@
<td>Total Hours</td>
<td>Total Hours</td>
</tr>
</tr>
@foreach(
$chargeablelist
as
$key
=>
$projectchargeable
)
@foreach(
$chargeablelist
as
$key
=>
$projectchargeable
)
<?php
$total
= 0; ?>
<?php
$totalcharge
= 0; ?>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
10
%
;
">{{
$projectchargeable['pcode']
}}</td>
<td style="
width
:
10
%
;
">{{
$projectchargeable['pcode']
}}</td>
<td style="
width
:
13
%
;
">{{
$projectchargeable['pname']
}}</td>
<td style="
width
:
13
%
;
">{{
$projectchargeable['pname']
}}</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -125,14 +127,14 @@
...
@@ -125,14 +127,14 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valchargehour
,'td_hours');
$totalcharge
+= data_get(
$valchargehour
,'td_hours');
}
}
?>
?>
@if(
$valchargehour
)
@if(
$valchargehour
)
<td
>{{
$valchargehour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valchargehour->td_hours
}}</td>
@else
@else
<td
></td>
<td style="
width
:
4
%
;
"
></td>
@endif
@endif
@endfor
@endfor
...
@@ -150,21 +152,21 @@
...
@@ -150,21 +152,21 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valchargehour
,'td_hours');
$totalcharge
+= data_get(
$valchargehour
,'td_hours');
}
}
?>
?>
@if(
$valchargehour
)
@if(
$valchargehour
)
<td
>{{
$valchargehour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valchargehour->td_hours
}}</td>
@else
@else
<td
></td>
<td style="
width
:
4
%
;
"
></td>
@endif
@endif
@endfor
@endfor
@endif
@endif
@if(
$valchargehour
)
@if(
$valchargehour
)
<td>{{
$total
}}</td>
<td>{{
$totalcharge
}}</td>
@else
@else
<td>0</td>
<td>0</td>
@endif
@endif
...
@@ -174,14 +176,44 @@
...
@@ -174,14 +176,44 @@
</tbody>
</tbody>
<tfoot>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
18
@
else
{{
$daymonth
-
12
}}
@
endif
">Total</th>
<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>
<th>@if(
$totalchargehrs
){{
$totalchargehrs
}}@else 0 @endif</th>
</tfoot>
</tfoot>
</table>
</table>
</div>
</div>
<div class="
ui
segment
">
<div class="
ui
segment
">
<table
class="
ui
celled
structured
table
unstackable
">
<table id="
printtable3
"
class="
ui
celled
structured
table
unstackable
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
2
">Non-Chargeable</th>
<th colspan="
2
">Non-Chargeable</th>
...
@@ -191,7 +223,7 @@
...
@@ -191,7 +223,7 @@
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Task</td>
<td style="
width
:
23
%
;
">Task</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -208,9 +240,9 @@
...
@@ -208,9 +240,9 @@
</tr>
</tr>
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
<?php
$total
= 0; ?>
<?php
$totalnoncharge
= 0; ?>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">{{
$projectnonchargeable['pname']
}}</td>
<td style="
width
:
23
%
;
">{{
$projectnonchargeable['pname']
}}</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -228,14 +260,14 @@
...
@@ -228,14 +260,14 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valnonchargehour
,'td_hours');
$totalnoncharge
+= data_get(
$valnonchargehour
,'td_hours');
}
}
?>
?>
@if(
$valnonchargehour
)
@if(
$valnonchargehour
)
<td
>{{
$valnonchargehour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valnonchargehour->td_hours
}}</td>
@else
@else
<td
></td>
<td style="
width
:
4
%
;
"
></td>
@endif
@endif
@endfor
@endfor
...
@@ -254,21 +286,21 @@
...
@@ -254,21 +286,21 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valnonchargehour
,'td_hours');
$totalnoncharge
+= data_get(
$valnonchargehour
,'td_hours');
}
}
?>
?>
@if(
$valnonchargehour
)
@if(
$valnonchargehour
)
<td
>{{
$valnonchargehour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valnonchargehour->td_hours
}}</td>
@else
@else
<td
></td>
<td style="
width
:
4
%
;
"
></td>
@endif
@endif
@endfor
@endfor
@endif
@endif
@if(
$valnonchargehour
)
@if(
$valnonchargehour
)
<td>{{
$total
}}</td>
<td>{{
$totalnoncharge
}}</td>
@else
@else
<td>0</td>
<td>0</td>
@endif
@endif
...
@@ -277,14 +309,43 @@
...
@@ -277,14 +309,43 @@
</tbody>
</tbody>
<tfoot>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
17
@
else
{{
$daymonth
-
13
}}
@
endif
">Total</th>
<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>
<th>@if(
$totalnonchargehrs
){{
$totalnonchargehrs
}}@else 0 @endif</th>
</tfoot>
</tfoot>
</table>
</table>
</div>
</div>
<div class="
ui
segment
">
<div class="
ui
segment
">
<table
class="
ui
celled
structured
table
unstackable
">
<table id="
printtable4
"
class="
ui
celled
structured
table
unstackable
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
2
">Overhead</th>
<th colspan="
2
">Overhead</th>
...
@@ -294,7 +355,7 @@
...
@@ -294,7 +355,7 @@
</thead>
</thead>
<tbody>
<tbody>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
23
%
;
">Overhead</td>
<td style="
width
:
23
%
;
">Overhead</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
...
@@ -310,10 +371,10 @@
...
@@ -310,10 +371,10 @@
<td>Total Hours</td>
<td>Total Hours</td>
</tr>
</tr>
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
@foreach(
$overheadlist
as
$key
=>
$projectoverhead
)
<?php
$total
= 0; ?>
<?php
$totaloverhead
= 0; ?>
<tr>
<tr>
<td style="
width
:
3
%
;
"></td>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
10
%
;
">{{
$projectoverhead['pname']
}}</td>
<td style="
width
:
23
%
;
">{{
$projectoverhead['pname']
}}</td>
@if(
$phase
== 1)
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
...
@@ -329,14 +390,14 @@
...
@@ -329,14 +390,14 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valoverheadhour
,'td_hours');
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
}
?>
?>
@if(
$valoverheadhour
)
@if(
$valoverheadhour
)
<td
>{{
$valoverheadhour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valoverheadhour->td_hours
}}</td>
@else
@else
<td>
</td>
<td style="
width
:
4
%
;
">0
</td>
@endif
@endif
@endfor
@endfor
...
@@ -354,21 +415,21 @@
...
@@ -354,21 +415,21 @@
->where('tm_phase',
$phase
)
->where('tm_phase',
$phase
)
->first();
->first();
$total
+= data_get(
$valoverheadhour
,'td_hours');
$totaloverhead
+= data_get(
$valoverheadhour
,'td_hours');
}
}
?>
?>
@if(
$valoverheadhour
)
@if(
$valoverheadhour
)
<td
>{{
$valoverheadhour->td_hours
}}</td>
<td style="
width
:
4
%
;
"
>{{
$valoverheadhour->td_hours
}}</td>
@else
@else
<td>
</td>
<td style="
width
:
4
%
;
">0
</td>
@endif
@endif
@endfor
@endfor
@endif
@endif
@if(
$valchargehour
)
@if(
$valchargehour
)
<td>{{
$total
}}</td>
<td>{{
$totaloverhead
}}</td>
@else
@else
<td>0</td>
<td>0</td>
@endif
@endif
...
@@ -377,14 +438,43 @@
...
@@ -377,14 +438,43 @@
@endforeach
@endforeach
</tbody>
</tbody>
<tfoot>
<tfoot>
<th colspan="
@
if
(
$phase
==
1
)
17
@
else
{{
$daymonth
-
13
}}
@
endif
">Total</th>
<th colspan="
2
">Total (C)</th>
@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>
<th>@if(
$totaloverheadhrs
) {{
$totaloverheadhrs
}} @else 0 @endif</th>
</tfoot>
</tfoot>
</table>
</table>
</div>
</div>
<div class="
ui
segment
">
<div class="
ui
segment
">
<table
class="
ui
celled
structured
table
unstackable
">
<table id="
printtable5
"
class="
ui
celled
structured
table
unstackable
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
2
">Note:</th>
<th colspan="
2
">Note:</th>
...
@@ -404,6 +494,266 @@
...
@@ -404,6 +494,266 @@
</tbody>
</tbody>
</table>
</table>
</div>
</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>
</div>
<br>
<button type="
button
" onclick="
printdiv
(
'print_div'
)
"> print</button>
</div>
</div>
@endsection
@endsection
@push('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
-
fly
");
// el.style.fontSize = "
10
px
!
important
;
background
-
color
:
white
!
important
";
document.getElementById(printpage).style.width = "
100
%
";
document.getElementById("
printtable1
").style.width = "
100
%
";
document.getElementById("
printtable1
").style.fontSize = "
10
px
";
document.getElementById("
printtable2
").style.width = "
100
%
";
document.getElementById("
printtable2
").style.fontSize = "
10
px
";
document.getElementById("
printtable3
").style.width = "
100
%
";
document.getElementById("
printtable3
").style.fontSize = "
10
px
";
document.getElementById("
printtable4
").style.width = "
100
%
";
document.getElementById("
printtable4
").style.fontSize = "
10
px
";
document.getElementById("
printtable5
").style.width = "
100
%
";
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