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
fb69f16c
Commit
fb69f16c
authored
Jul 26, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display day in timesheet viewer, chargeable, nonchargeable and overhead form
parent
416672cb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
176 additions
and
96 deletions
+176
-96
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+73
-69
packages/portal/timesheet/resources/views/form/chargeableForm.blade.php
+17
-4
packages/portal/timesheet/resources/views/form/nonChargeableForm.blade.php
+17
-4
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
+16
-4
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+20
-12
packages/portal/timesheet/src/Http/Controllers/FormController.php
+33
-3
No files found.
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
fb69f16c
...
...
@@ -36,45 +36,10 @@
<tr>
<td>Month</td>
<td>:</td>
<td>
<div class="
ui
form
">
<div class="
field
">
<select class="
ui
search
dropdown
">
<option value="" selected="">
{
{$strMonth}
}
</option>
<option value="
1
">January</option>
<option value="
2
">February</option>
<option value="
3
">March</option>
<option value="
4
">April</option>
<option value="
5
">May</option>
<option value="
6
">June</option>
<option value="
7
">July</option>
<option value="
8
">August</option>
<option value="
9
">September</option>
<option value="
10
">October</option>
<option value="
11
">November</option>
<option value="
12
">December</option>
</select>
</div>
</div>
</td>
<td>{{
$strMonth
}}</td>
<td>Phase</td>
<td>:</td>
<td>
<div class="
ui
form
">
<div class="
field
">
<select class="
ui
search
dropdown
">
@if(
$phase
== 1)
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
<option value="
2
">2</option>
@else
<option value="
{{
$phase
}}
">{{
$phase
}}</option>
<option value="
1
">1</option>
@endif
</select>
</div>
</div>
</td>
</td>
<td>{{
$phase
}}</td>
</tr>
</tbody>
</table>
...
...
@@ -83,30 +48,43 @@
<table id="
printtable2
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
3
">Chargeable</th>
<th colspan="
3
"
rowspan="
2
" class="
center
aligned
"
>Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
">Total</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Total</th>
</tr>
</thead>
<tbody>
<tr>
<td style="
width
:
4
%
;
"></td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
13
%
;
">Project Name</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<t
d>
{
{$i+1}
}
</td
>
<t
h>
{
{$i+1}
}
</th
>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<t
d>
{
{$i+1}
}
</td
>
<t
h>
{
{$i+1}
}
</th
>
@endfor
@endif
<td>Hours</td>
<td>Days</td>
</tr>
<tr>
<th style="
width
:
4
%
;
"></th>
<th style="
width
:
10
%
;
">Project Code</th>
<th style="
width
:
13
%
;
">Project Name</th>
@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(
$chargeablelist
as
$key
=>
$projectchargeable
)
<?php
$totalcharge
= 0; ?>
<tr>
...
...
@@ -220,29 +198,42 @@
<table id="
printtable3
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Non-Chargeable</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Non-Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
">Total</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Total</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>
<th>
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
<th style="
width
:
4
%
;
"></th>
<th style="
width
:
23
%
;
">Task</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$strdays[$i]}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<t
d>
{
{$i+1}
}
</td
>
<t
h>
{
{$strdays[$i]}
}
</th
>
@endfor
@endif
<t
d>Hours</td
>
<t
d>Days</td
>
<t
h>Hours</th
>
<t
h>Days</th
>
</tr>
</thead>
<tbody>
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
<?php
$totalnoncharge
= 0; ?>
...
...
@@ -356,29 +347,42 @@
<table id="
printtable4
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Overhead</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
2
">Total</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Total</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
++)
<t
d>
{
{$i+1}
}
</td
>
<t
h>
{
{$i+1}
}
</th
>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<t
d>
{
{$i+1}
}
</td
>
<t
h>
{
{$i+1}
}
</th
>
@endfor
@endif
<td>Hours</td>
<td>Days</td>
</tr>
<tr>
<th style="
width
:
4
%
;
"></th>
<th style="
width
:
23
%
;
">Overhead</th>
@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>
...
...
@@ -489,7 +493,7 @@
<table id="
printtable5
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
"
>Note:
</th>
<th colspan="
2
"
class="
center
aligned
">Note
</th>
</tr>
</thead>
<tbody>
...
...
packages/portal/timesheet/resources/views/form/chargeableForm.blade.php
View file @
fb69f16c
...
...
@@ -48,26 +48,39 @@ input[type=number] {
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th colspan="
2
">Chargeable</th>
<th colspan="
2
"
rowspan="
2
" class="
center
aligned
"
>Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<th
rowspan="
2
"
>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
Save
</button>
</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
<th class="
single
line
">Project Code</th>
<th class="
single
line
">Project Name</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@endif
...
...
packages/portal/timesheet/resources/views/form/nonChargeableForm.blade.php
View file @
fb69f16c
...
...
@@ -101,25 +101,38 @@ input[type=number] {
<table class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th
class="
single
line
">Non-Chargeable</th>
<th
rowspan="
2
" class="
single
line
" class="
center
aligned
">Non-Chargeable</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<th
rowspan="
2
"
>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
Save
</button>
</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
<th class="
single
line
">Project Name</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@endif
...
...
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
View file @
fb69f16c
...
...
@@ -101,25 +101,37 @@ input[type=number] {
<table class="
ui
celled
structured
unstackable
table
" >
<thead>
<tr>
<th>Overhead</th>
<th
rowspan="
2
" class="
center
aligned
"
>Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
15
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<th
rowspan="
2
"
>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
Save
</button>
</th>
</tr>
<tr>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
</tr>
<tr>
<th>Task</th>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{
$i+1
}
}
</th>
<th>{{
$strdays[$i]
}}</th>
@endfor
@endif
<th>Total Hours</th>
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
fb69f16c
...
...
@@ -110,12 +110,6 @@ class DashboardController extends Controller
$phase
=
2
;
}
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$myDate
=
$month
.
'/'
.
$day
.
'/'
.
$year
;
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$strMonth
=
$date
->
format
(
'F'
);
if
(
isset
(
$request
->
phase
))
{
$phase
=
$request
->
phase
;
...
...
@@ -129,6 +123,24 @@ class DashboardController extends Controller
{
$year
=
$request
->
year
;
}
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$myDate
=
$month
.
'/'
.
$day
.
'/'
.
$year
;
$date
=
Carbon
::
createFromFormat
(
'm/d/Y'
,
$myDate
);
$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
);
}
$strMonth
=
$date
->
format
(
'F'
);
$chargeable
=
1
;
$nonchargeable
=
2
;
...
...
@@ -140,11 +152,7 @@ class DashboardController extends Controller
$nonchargeableproject
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
staff_id
)
->
where
(
'pt_project_type'
,
$nonchargeable
)
->
get
();
// $overheadproject = Overhead::where('o_overhead_sts',1)
// ->get();
->
get
();
$chargeablelist
=
[];
$nonchargeablelist
=
[];
...
...
@@ -246,7 +254,7 @@ class DashboardController extends Controller
->
orderby
(
'td_date'
)
->
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'
,
'check'
));
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'
,
'strdays'
));
}
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
fb69f16c
...
...
@@ -79,6 +79,16 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$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
);
}
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
...
...
@@ -95,7 +105,7 @@ class FormController extends Controller
$hour
=
null
;
}
return
view
(
'timesheet::form.chargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
));
return
view
(
'timesheet::form.chargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'strdays'
));
}
public
function
savechargeablehours
(
Request
$request
)
...
...
@@ -255,6 +265,16 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$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
);
}
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
...
...
@@ -272,7 +292,7 @@ class FormController extends Controller
$hour
=
null
;
}
return
view
(
'timesheet::form.nonChargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'nonchargeables'
));
return
view
(
'timesheet::form.nonChargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'nonchargeables'
,
'strdays'
));
}
public
function
addnonchargeabletask
(
Request
$request
)
...
...
@@ -548,6 +568,16 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
$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
);
}
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
...
...
@@ -569,7 +599,7 @@ class FormController extends Controller
// dd($check->id);
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
,
'check'
));
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
,
'check'
,
'strdays'
));
}
public
function
saveoverheadhours
(
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