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
416672cb
Commit
416672cb
authored
Jul 26, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add others option in notes
parent
fdada6dc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletions
+55
-1
packages/portal/timesheet/resources/views/form/penambahannote.blade.php
+1
-0
packages/portal/timesheet/src/Http/Controllers/FormController.php
+54
-1
No files found.
packages/portal/timesheet/resources/views/form/penambahannote.blade.php
View file @
416672cb
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
@foreach(
$task
as
$key
=>
$value
)
@foreach(
$task
as
$key
=>
$value
)
<option value="
{{
$value
->
id
}}
">
{
{$value->o_overhead_desc}
}
</option>
<option value="
{{
$value
->
id
}}
">
{
{$value->o_overhead_desc}
}
</option>
@endforeach
@endforeach
<option value="
0
">Others</option>
</select>
</select>
</div>
</div>
</div>
</div>
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
416672cb
...
@@ -806,7 +806,58 @@ class FormController extends Controller
...
@@ -806,7 +806,58 @@ class FormController extends Controller
$userId
=
Users
::
find
(
Auth
::
id
())
$userId
=
Users
::
find
(
Auth
::
id
())
->
u_staffID
;
->
u_staffID
;
// dd($request);
$day
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$request
->
date
)
->
day
;
$month
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$request
->
date
)
->
month
;
$year
=
Carbon
::
createFromFormat
(
'Y-m-d'
,
$request
->
date
)
->
year
;
if
(
$day
<
15
)
{
$phase
=
1
;
}
else
{
$phase
=
2
;
}
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
$checkOthers
=
Ts_detail
::
where
(
'td_date'
,
$request
->
date
)
->
where
(
'fk_tm_id'
,
$check
->
id
)
->
where
(
'fk_o_id'
,
0
)
->
first
();
if
(
$request
->
task
==
0
)
{
if
(
$checkOthers
)
{
$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
();
}
else
{
$data
=
new
Ts_detail
;
$data
->
td_date
=
$request
->
date
;
$data
->
fk_tm_id
=
$check
->
id
;
$data
->
tm_staff_id
=
$userId
;
$data
->
tm_month
=
$month
;
$data
->
tm_year
=
$year
;
$data
->
tm_phase
=
$phase
;
$data
->
td_project_type
=
$overhead
;
$data
->
fk_o_id
=
$request
->
task
;
$data
->
td_overhead_desc
=
"OTHERS"
;
$data
->
td_overhead_note
=
$request
->
description
;
$data
->
save
();
}
}
else
{
$data
=
Ts_detail
::
where
(
'tm_staff_id'
,
$userId
)
$data
=
Ts_detail
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'td_project_type'
,
$overhead
)
->
where
(
'td_project_type'
,
$overhead
)
...
@@ -817,6 +868,8 @@ class FormController extends Controller
...
@@ -817,6 +868,8 @@ class FormController extends Controller
$data
->
td_overhead_note
=
$request
->
description
;
$data
->
td_overhead_note
=
$request
->
description
;
$data
->
update
();
$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'
);;
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'
);;
}
}
...
...
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