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
89c1ae9a
Commit
89c1ae9a
authored
Jul 20, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add notes as overhead description
parent
e5d26e5a
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
291 additions
and
112 deletions
+291
-112
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+76
-2
packages/portal/timesheet/resources/views/form/notelist.blade.php
+51
-0
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
+7
-43
packages/portal/timesheet/resources/views/form/penambahannote.blade.php
+31
-0
packages/portal/timesheet/routes/web.php
+3
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+49
-1
packages/portal/timesheet/src/Http/Controllers/FormController.php
+74
-66
No files found.
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
89c1ae9a
...
...
@@ -136,7 +136,6 @@
@endif
@endfor
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
...
...
@@ -207,10 +206,79 @@
@endif
<td>Total Hours</td>
</tr>
@foreach(
$nonchargeablelist
as
$key
=>
$projectnonchargeable
)
<?php
$total
= 0; ?>
<tr>
<td style="
width
:
3
%
;
"></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();
$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>
20
</th>
<th>
@if(
$totalnonchargehrs
){{
$totalnonchargehrs
}}@else 0 @endif
</th>
</tfoot>
</table>
</div>
...
...
@@ -327,6 +395,12 @@
<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>
...
...
packages/portal/timesheet/resources/views/form/notelist.blade.php
0 → 100644
View file @
89c1ae9a
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
unstackable
segment
">
<a class="
ui
blue
left
ribbon
label
">Senarai Notes</a>
<a href="
{{
route
(
'timesheet::form.penambahannote'
)
}}
" class="
ui
right
floated
small
primary
labeled
icon
button
">
<i class="
plus
icon
"></i>Add New Project
</a><br>
<table class="
ui
celled
padded
table
">
<thead>
<tr>
<th style="
width
:
3
%
;
">No</th>
<th style="
width
:
10
%
;
">Date</th>
<th style="
width
:
20
%
;
">Task</th>
<th>Description</th>
</tr>
</thead>
<tbody>
@foreach(
$notes
as
$key
=>
$value
)
<tr>
<td>
{
{$key+1}
}
</td>
<td>{{ data_get(
$value
,'td_date') }} </td>
<td>{{ data_get(
$value
,'td_overhead_desc') }} </td>
<td>{{ data_get(
$value
,'td_overhead_note') }} </td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
<div class="
ui
right
floated
pagination
menu
">
<a class="
icon
item
">
<i class="
left
chevron
icon
"></i>
</a>
<a class="
item
">1</a>
<a class="
item
">2</a>
<a class="
item
">3</a>
<a class="
item
">4</a>
<a class="
icon
item
">
<i class="
right
chevron
icon
"></i>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
</div>
@endsection
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
View file @
89c1ae9a
...
...
@@ -26,7 +26,7 @@ input[type=number] {
Overhead Description
</div>
<div class="
content
">
<form class="
ui
form
" action="
{{
route
(
'timesheet::form.addOverheadDescription'
)
}}
" method="
POST
">
<form class="
ui
form
" action="
{{
route
(
'timesheet::form.addOverheadDescription'
)
}}
" method="
POST
">
{
{csrf_field()}
}
<input type="
hidden
" name="
userId
" value="
{{
$userId
}}
">
<input type="
hidden
" name="
year
" value="
{{
$year
}}
">
...
...
@@ -86,6 +86,11 @@ input[type=number] {
Description
</button>
<button class="
center
aligned
ui
yellow
compact
labeled
icon
button
" id="
notes
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
form
.
notelist
', ['
year
'=> $year, '
month
'=> $month, '
phase
'=> $phase, '
fk_tm_id
'=> $check->id] ) }} '
;
">
<i class="
plus
icon
"></i>
Notes
</button>
<form class="
ui
form
" action="
{{
route
(
'timesheet::form.saveoverheadhours'
)}}
" method="
POST
">
{
{csrf_field()}
}
<input type="
hidden
" name="
userId
" value="
{{
$userId
}}
">
...
...
@@ -97,7 +102,7 @@ input[type=number] {
<thead>
<tr>
<th>Overhead</th>
<th colspan="
@
if
(
$phase
==
1
)
1
6
@
else
{{
$daymonth
-
14
}}
@
endif
" class="
center
aligned
">Date</th>
<th colspan="
@
if
(
$phase
==
1
)
1
5
@
else
{{
$daymonth
-
15
}}
@
endif
" class="
center
aligned
">Date</th>
<th>
<button type="
submit
" class="
fluid
center
aligned
ui
blue
compact
labeled
icon
button
">
<i class="
save
icon
"></i>
...
...
@@ -113,12 +118,10 @@ input[type=number] {
<th>
{
{$i+1}
}
</th>
@endfor
@else
{{
$daymonth
}}
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<th>
{
{$i+1}
}
</th>
@endfor
@endif
<th>Description</th>
<th>Total Hours</th>
</tr>
</thead>
...
...
@@ -155,26 +158,6 @@ input[type=number] {
</td>
@endfor
<?php
if (
$hour
) {
$note
=
$hour->where
('td_overhead_desc',
$project['td_project_name']
)
->where('tm_phase',
$phase
)
->where('td_overhead_note', '!=', null)
->first();
} else {
$note
= null;
}
?>
<td class="
ui
center
aligned
">
@if(
$note
)
<i class="
bordered
green
eye
icon
view_button
" data-overheadid="
{{
$project
[
'td_project'
]
}}
" data-month="
{{
$month
}}
" data-year="
{{
$year
}}
" data-tmstaffid="
{{
$userId
}}
" data-phase="
{{
$phase
}}
"></i>
@else
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
@endif
</td>
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
...
...
@@ -198,25 +181,6 @@ input[type=number] {
</td>
@endfor
<?php
if (
$hour
) {
$note
=
$hour->where
('td_overhead_desc',
$project['td_project_name']
)
->where('tm_phase',
$phase
)
->where('td_overhead_note', '!=', null)
->first();
} else {
$note
= null;
}
?>
<td class="
ui
center
aligned
">
@if(
$note
)
<i class="
bordered
green
eye
icon
view_button
" data-overheadid="
{{
$project
[
'td_project'
]
}}
" data-month="
{{
$month
}}
" data-year="
{{
$year
}}
" data-tmstaffid="
{{
$userId
}}
"></i>
@else
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
@endif
</td>
@endif
<td>
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
total
-
{{
$project
[
'td_project'
]}}
" id="
total
-
{{
$project
[
'td_project'
]}}
" style="
padding
-
right
:
4
px
;
padding
-
left
:
4
px
;
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
" readonly="" value=
{
{$total}
}
>
...
...
packages/portal/timesheet/resources/views/form/penambahannote.blade.php
0 → 100644
View file @
89c1ae9a
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Penambahan Note</a>
<br><br>
<form class="
ui
form
" action="
{{
route
(
'timesheet::form.addnote'
)
}}
" method="
POST
">
{
{csrf_field()}
}
<div class="
two
fields
">
<div class="
three
wide
field
">
<label>Date</label>
<input type="
Date
" name="
date
">
</div>
<div class="
three
wide
field
">
<label>Task</label>
<select name="
task
" class="
ui
fluid
dropdown
">
@foreach(
$task
as
$key
=>
$value
)
<option value="
{{
$value
->
id
}}
">
{
{$value->o_overhead_desc}
}
</option>
@endforeach
</select>
</div>
</div>
<div class="
field
">
<label>Description</label>
<textarea name="
description
" cols="
30
" rows="
10
"></textarea>
</div>
<button class="
ui
button
" type="
submit
">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/routes/web.php
View file @
89c1ae9a
...
...
@@ -47,6 +47,9 @@ Route::group(
Route
::
post
(
'savenonchargeablehours'
,[
'uses'
=>
'FormController@savenonchargeablehours'
,
'as'
=>
'form.savenonchargeablehours'
]);
Route
::
post
(
'saveoverheadhours'
,[
'uses'
=>
'FormController@saveoverheadhours'
,
'as'
=>
'form.saveoverheadhours'
]);
Route
::
post
(
'addOverheadDescription'
,[
'uses'
=>
'FormController@addOverheadDescription'
,
'as'
=>
'form.addOverheadDescription'
]);
Route
::
get
(
'notelist'
,[
'uses'
=>
'FormController@notelist'
,
'as'
=>
'form.notelist'
]);
Route
::
get
(
'penambahannote'
,[
'uses'
=>
'FormController@penambahannote'
,
'as'
=>
'form.penambahannote'
]);
Route
::
post
(
'addnote'
,
[
'uses'
=>
'FormController@addnote'
,
'as'
=>
'form.addnote'
]);
// nonChargeableForm
Route
::
post
(
'addnonchargeabletask'
,[
'uses'
=>
'FormController@addnonchargeabletask'
,
'as'
=>
'form.addnonchargeabletask'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
89c1ae9a
...
...
@@ -135,10 +135,17 @@ class DashboardController extends Controller
->
where
(
'pt_project_type'
,
$chargeable
)
->
get
();
$nonchargeableproject
=
Pteam
::
where
(
'pt_staff_id'
,
$user
->
staff_id
)
->
where
(
'pt_project_type'
,
$nonchargeable
)
->
get
();
$overheadproject
=
Overhead
::
where
(
'o_overhead_sts'
,
1
)
->
get
();
$chargeablelist
=
[];
$nonchargeablelist
=
[];
$overheadlist
=
[];
foreach
(
$chargeableproject
as
$key
=>
$value
)
{
...
...
@@ -153,6 +160,17 @@ class DashboardController extends Controller
}
foreach
(
$nonchargeableproject
as
$key
=>
$value
)
{
$nonchargeablelist
[]
=
[
'pid'
=>
$value
->
fk_project_id
,
'pname'
=>
$value
->
toProject
->
p_project_description
,
];
}
foreach
(
$overheadproject
as
$key
=>
$value
)
{
$overheadlist
[]
=
[
...
...
@@ -175,14 +193,34 @@ class DashboardController extends Controller
$chargehour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$chargeable
)
// ->where('td_hours', '!=', 0)
->
get
();
$nonchargehour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$nonchargeable
)
// ->where('td_hours', '!=', 0)
->
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
)
->
where
(
'td_project_type'
,
$overhead
)
// ->where('td_hours', '!=', 0)
->
get
();
}
...
...
@@ -198,7 +236,17 @@ class DashboardController extends Controller
$totalnonchargehrs
=
$check
->
tm_nonchargeable_hrs
;
$totaloverheadhrs
=
$check
->
tm_overhead_hrs
;
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'user'
,
'dept'
,
'hod'
,
'phase'
,
'month'
,
'year'
,
'day'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'overheadlist'
,
'chargehour'
,
'totalchargehrs'
,
'totalnonchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
));
$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'
,
$user
->
staff_id
)
->
where
(
'td_project_type'
,
$overhead
)
->
whereNotNull
(
'td_overhead_note'
)
->
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'
));
}
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
89c1ae9a
...
...
@@ -33,16 +33,12 @@ class FormController extends Controller
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
// dd($userId);
$project
=
Pteam
::
where
(
'pt_staff_id'
,
$userId
)
->
where
(
'pt_project_type'
,
$chargeable
)
->
get
();
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
$projectlist
[]
=
[
...
...
@@ -55,13 +51,17 @@ class FormController extends Controller
}
//sample dulu
$phase
=
1
;
$month
=
date
(
'n'
);
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
if
(
$day
<
16
)
{
$phase
=
1
;
}
else
{
$phase
=
2
;
}
if
(
isset
(
$request
->
phase
))
{
$phase
=
$request
->
phase
;
...
...
@@ -79,25 +79,17 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
//kalau ada, dia gi ke edit
if
(
$check
)
{
$hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
// ->with('project:p_project_code')
->
get
();
// dd($hour);
}
//klu xde g create.php
else
{
$hour
=
null
;
...
...
@@ -108,27 +100,21 @@ class FormController extends Controller
public
function
savechargeablehours
(
Request
$request
)
{
// chargeable, project type 1.
$chargeable
=
1
;
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
// check table master. untuk total chargeable hours.
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if
(
$check
)
{
}
// kalau takda, save() baru.
else
{
$check
=
new
Ts_master
;
...
...
@@ -137,16 +123,11 @@ class FormController extends Controller
$check
->
tm_month
=
$request
->
month
;
$check
->
tm_phase
=
$request
->
phase
;
$check
->
updated_by
=
$userId
;
// $check ->tm_chargeable_hrs = ;
$check
->
save
();
}
$tmasterid
=
$check
->
id
;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail
=
$request
->
hour
;
...
...
@@ -171,16 +152,15 @@ class FormController extends Controller
if
(
$checkTimesheetDetail
)
{
//update hours to null
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
update
();
}
//kalau takde, isi semua.
}
else
{
//isi semua
$tmdetail
=
new
Ts_detail
;
$tmdetail
->
td_date
=
$date
;
$tmdetail
->
td_project
=
$projectid
;
...
...
@@ -199,11 +179,6 @@ class FormController extends Controller
$tmdetail
->
updated_by
=
$userId
;
$tmdetail
->
save
();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
...
...
@@ -222,8 +197,6 @@ class FormController extends Controller
$checktotalhours
->
tm_chargeable_days
=
$sumdetailhour
/
8.0
;
$checktotalhours
->
update
();
// return redirect::to('mobile/profile');
return
redirect
()
->
route
(
'timesheet::form.chargeableForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
,
'year'
,
$request
->
year
])
->
with
(
'success'
,
'Timesheet Updated'
);
}
...
...
@@ -242,7 +215,6 @@ class FormController extends Controller
->
get
();
$projectlist
=
[];
// nanti project code query dari table project:
foreach
(
$project
as
$key
=>
$value
)
{
...
...
@@ -255,13 +227,17 @@ class FormController extends Controller
}
//sample dulu
$phase
=
1
;
$month
=
date
(
'n'
);
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
if
(
$day
<
16
)
{
$phase
=
1
;
}
else
{
$phase
=
2
;
}
if
(
isset
(
$request
->
phase
))
{
$phase
=
$request
->
phase
;
...
...
@@ -279,30 +255,23 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
//kalau ada, dia gi ke edit
if
(
$check
)
{
$hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'td_project_type'
,
$nonchargeable
)
// ->with('project:p_project_code')
->
get
();
// dd($hour);
}
//klu xde g create.php
else
{
$hour
=
null
;
}
return
view
(
'timesheet::form.nonChargeableForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'nonchargeables'
));
}
...
...
@@ -315,7 +284,7 @@ class FormController extends Controller
if
(
$request
->
chargeableProject
!=
null
&&
$request
->
nonChargeableProject
==
null
)
{
// dd('select only');
$project
=
Project
::
where
(
'id'
,
$request
->
chargeableProject
)
->
first
();
...
...
@@ -330,7 +299,7 @@ class FormController extends Controller
$data
->
save
();
}
else
if
(
$request
->
chargeableProject
!=
null
&&
$request
->
nonChargeableProject
!=
null
)
{
// dd('select and input');
$project
=
Project
::
where
(
'id'
,
$request
->
chargeableProject
)
->
first
();
...
...
@@ -556,6 +525,12 @@ class FormController extends Controller
$year
=
date
(
'Y'
);
$day
=
date
(
'j'
);
if
(
$day
<
16
)
{
$phase
=
1
;
}
else
{
$phase
=
2
;
}
if
(
isset
(
$request
->
phase
))
{
$phase
=
$request
->
phase
;
...
...
@@ -573,9 +548,6 @@ class FormController extends Controller
$daymonth
=
cal_days_in_month
(
CAL_GREGORIAN
,
$month
,
$year
);
//check dlam db, kalau dah ada detail hours, kuar form edit, kalau belum, kuar form create
// check timesheet master
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
...
...
@@ -595,7 +567,9 @@ class FormController extends Controller
$hour
=
null
;
}
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
));
// dd($check->id);
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
,
'check'
));
}
public
function
saveoverheadhours
(
Request
$request
)
...
...
@@ -716,8 +690,6 @@ class FormController extends Controller
$checktotalhours
->
tm_overhead_days
=
$sumdetailhour
/
8.0
;
$checktotalhours
->
update
();
// return redirect::to('mobile/profile');
return
redirect
()
->
route
(
'timesheet::form.overheadForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
,
'year'
,
$request
->
year
])
->
with
(
'success'
,
'Timesheet Updated'
);
}
...
...
@@ -785,12 +757,6 @@ class FormController extends Controller
}
return
redirect
()
->
route
(
'timesheet::form.overheadForm'
)
->
with
(
'success'
,
'Timesheet Updated'
);
// $data = Ts_detail::where('td_date', $request->date)
// ->where('')
// $data = new ODesc;
}
// public function loadnotes(Request $request)
...
...
@@ -804,13 +770,54 @@ class FormController extends Controller
->
where
(
'tm_staff_id'
,
$staffid
)
->
paginate
(
8
);
// foreach ($Desc as $key => $value) {
// dd($key);
// $viewDesc = $value;
// }
return
view
(
'timesheet::ajax.senarainotes'
,
compact
(
'viewDesc'
));
}
public
function
notelist
(
Request
$request
)
{
$overhead
=
3
;
return
view
(
'timesheet::ajax.senarainotes'
,
compact
(
'viewDesc'
));
$userId
=
Users
::
find
(
Auth
::
id
())
->
u_staffID
;
$notes
=
Ts_detail
::
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'fk_tm_id'
,
$request
->
fk_tm_id
)
->
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'td_project_type'
,
$overhead
)
->
whereNotNull
(
'td_overhead_note'
)
->
orderby
(
'td_date'
)
->
get
();
return
view
(
'timesheet::form.notelist'
,
compact
(
'notes'
));
}
public
function
penambahannote
()
{
$task
=
Overhead
::
where
(
'o_overhead_sts'
,
1
)
->
get
();
// dd($task);
return
view
(
'timesheet::form.penambahannote'
,
compact
(
'task'
));
}
public
function
addnote
(
Request
$request
)
{
$overhead
=
3
;
$userId
=
Users
::
find
(
Auth
::
id
())
->
u_staffID
;
// dd($request);
$data
=
Ts_detail
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'td_project_type'
,
$overhead
)
->
where
(
'fk_o_id'
,
$request
->
task
)
->
where
(
'td_date'
,
$request
->
date
)
->
first
();
$data
->
td_overhead_note
=
$request
->
description
;
$data
->
update
();
return
redirect
()
->
route
(
'timesheet::form.notelist'
,
[
'year'
=>
$data
->
tm_year
,
'month'
=>
$data
->
tm_month
,
'phase'
=>
$data
->
tm_phase
,
'fk_tm_id'
=>
$data
->
fk_tm_id
])
->
with
(
'success'
,
'Note Added'
);;
}
}
\ No newline at end of file
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