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
410b316d
Commit
410b316d
authored
Jul 01, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using suitable table to display overhead notes
parent
dcd3e5d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
25 deletions
+83
-25
packages/portal/timesheet/resources/views/dashboard/staff.blade.php
+1
-0
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
+63
-7
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+1
-1
packages/portal/timesheet/src/Http/Controllers/FormController.php
+18
-17
No files found.
packages/portal/timesheet/resources/views/dashboard/staff.blade.php
View file @
410b316d
...
...
@@ -39,6 +39,7 @@
<a class="
ui
blue
left
ribbon
label
">Pengguna</a>
<br>
<br>
{!!
Suitable::source(
$user
)
->title(__('Senarai Pengguna'))
...
...
packages/portal/timesheet/resources/views/form/overheadForm.blade.php
View file @
410b316d
...
...
@@ -16,6 +16,21 @@ input[type=number] {
}
</
style
>
<
div
class
="
ui
small
modal
view
">
{!!
Suitable::source(
$viewDesc
)
->title(__('View Overhead Description'))
->columns([
new \Laravolt\Suitable\Columns\Numbering(__('No')),
['header' => __('date'), 'field' => 'td_date'],
['header' => __('task'), 'field' => 'td_overhead_desc'],
['header' => __('notes'), 'field' => 'td_overhead_note'],
['header' => __('action'), ]
])
->render()
!!}
</div>
<div class="
ui
tiny
modal
description
">
<div class="
header
">
Overhead Description
...
...
@@ -30,7 +45,7 @@ input[type=number] {
<div class="
two
fields
">
<div class="
six
wide
field
">
<label>Task</label>
<select class="
ui
search
dropdown
" name="
task
" required="
required
">
<select class="" name="
task
" required="
required
">
<option value="">Task</option>
@foreach(
$project
as
$key
=>
$value
)
<option value="
{{
$value
->
o_overhead_desc
}}
">
{
{$value->o_overhead_desc}
}
</option>
...
...
@@ -129,25 +144,50 @@ input[type=number] {
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$valuehour
= '';
$valuehour
= '';
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
if(
$hour
)
{
$valuehour
=
$hour->where
('td_date','=',
$date
)
->where('fk_o_id',
$project['td_project']
)
->where('tm_phase',
$phase
)
->first();
$total
+= data_get(
$valuehour
,'td_hours');
}
}
?>
<td >
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
"
size="
2
"
style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
</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();
# code...
} else {
$note
= null;
}
// dd(
$note
);
?>
<td class="
ui
center
aligned
">
@if(
$note
)
<i class="
bordered
green
eye
icon
" id="
view
"></i>
<i class="
bordered
yellow
pencil
icon
"></i>
@else
<i class="
bordered
disabled
red
eye
slash
icon
"></i>
@endif
</td>
@else
@for(
$i
= 15;
$i
<
$daymonth
;
$i
++)
<?php
...
...
@@ -169,11 +209,10 @@ input[type=number] {
<input type="
text
" onkeypress="
onlynumber
(
event
)
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
@
if
(
$valuehour
){{
$valuehour
->
td_hours
}}
@
else
@
endif
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
" onchange="
limiter
(
this
,
'{{$project['
td_project
']}}'
);
">
</td>
@endfor
@endif
<td>
<div >
</div>
display desc phase 2
</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}
}
>
</td>
...
...
@@ -203,6 +242,23 @@ input[type=number] {
<script>
$(function(){
$("
#view").click(function()
{
$
(
".view"
)
.
modal
(
'show'
);
});
$
(
".view"
)
.
modal
(
{
closable
:
true
});
$
(
".view"
)
.
modal
(
'attach events'
,
'.close.button'
);
});
</
script
>
<
script
>
$
(
function
(){
$
(
"#description"
)
.
click
(
function
()
{
$
(
".description"
)
.
modal
(
'show'
);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
410b316d
...
...
@@ -54,7 +54,7 @@ class DashboardController extends Controller
function
(
$query
)
use
(
$keyword
)
{
$query
->
where
(
'email'
,
'like'
,
'%'
.
$keyword
.
'%'
);
}
)
->
paginate
(
4
);
)
->
paginate
(
15
);
return
view
(
'timesheet::dashboard.staff'
,
compact
(
'user'
));
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
410b316d
...
...
@@ -595,7 +595,11 @@ class FormController extends Controller
{
$hour
=
null
;
}
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
));
$viewDesc
=
Ts_detail
::
where
(
'td_overhead_note'
,
'!='
,
null
)
->
paginate
(
8
);
return
view
(
'timesheet::form.overheadForm'
,
compact
(
'projectlist'
,
'userId'
,
'month'
,
'phase'
,
'daymonth'
,
'year'
,
'day'
,
'hour'
,
'project'
,
'viewDesc'
));
}
public
function
saveoverheadhours
(
Request
$request
)
...
...
@@ -700,6 +704,7 @@ class FormController extends Controller
// /lepas save ();
}
}
}
...
...
@@ -750,44 +755,40 @@ class FormController extends Controller
$checkTimesheetDetail
=
Ts_detail
::
where
(
'td_date'
,
$request
->
date
)
->
where
(
'td_overhead_desc'
,
$request
->
task
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
//
->where('tm_year', $request->year)
//
->where('tm_month', $request->month)
//
->where('tm_phase', $request->phase)
->
where
(
'tm_staff_id'
,
$userId
)
->
first
();
if
(
$checkTimesheetDetail
){
dd
(
'ada, update column'
);
$checkTimesheetDetail
->
td_overhead_note
=
$request
->
description
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
update
();
}
else
{
$pname
=
Overhead
::
where
(
'o_overhead_desc'
,
$request
->
description
)
$pname
=
Overhead
::
where
(
'o_overhead_desc'
,
$request
->
task
)
->
first
();
dd
(
$pname
);
// dd($request);
$data
=
new
Ts_detail
;
$data
->
td_date
=
$request
->
date
;
$data
->
fk_o_id
=
$pname
->
id
;
$data
->
fk_tm_id
=
$tmasterid
;
$data
->
tm_staff_id
=
$userId
;
$data
->
tm_month
=
$request
->
tm_
month
;
$data
->
tm_year
=
$request
->
tm_
year
;
$data
->
tm_phase
=
$request
->
tm_
phase
;
$data
->
tm_month
=
$request
->
month
;
$data
->
tm_year
=
$request
->
year
;
$data
->
tm_phase
=
$request
->
phase
;
$data
->
td_project_type
=
$overhead
;
$data
->
updated_by
=
$userId
;
$data
->
td_overhead_desc
=
$request
->
description
;
$data
->
td_overhead_note
=
$request
->
description
;
$data
->
td_overhead_desc
=
$request
->
task
;
$data
->
save
();
}
return
redirect
()
->
route
(
'timesheet::form.overheadForm'
)
->
with
(
'success'
,
'Timesheet Updated'
);
// $data = Ts_detail::where('td_date', $request->date)
// ->where('')
...
...
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