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
57937b94
Commit
57937b94
authored
Jun 08, 2022
by
fezrul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update edit / display
parent
926b586a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
19 deletions
+30
-19
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
+11
-5
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+18
-13
packages/portal/timesheet/src/Model/ts_master.php
+1
-1
No files found.
packages/portal/timesheet/resources/views/dashboard/borangBolehCaj.blade.php
View file @
57937b94
...
...
@@ -77,12 +77,18 @@ input[type=number] {
</td>
@if(
$phase
== 1)
@for(
$i
= 0;
$i
< 15 ;
$i
++)
<?php
$date
=
$year
.'-'.sprintf('%02d',
$month
).'-'.sprintf('%02d',
$i
+1);
$valuehour
=
$hour->where
('td_date','=',
$date
)->where('td_project',
$project['td_project']
)
->where('tm_phase',
$phase
)
->first();
?>
<td >
@if(
$project['td_date']
==
$i
+1)
<input type="
text
" onkeypress="
onlynumber
(
event
)
" name="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" id="
hour
[{{
$project
[
'td_project'
]}}][{{
$i
+
1
}}]
" value="
{{
$project
[
'td_hours'
]}}
" min="
0
" max="
24
" style="
padding
:
2
px
;
margin
:
unset
;
color
:
#A0A0A0;" onchange="limiter(this,'{{$project['td_project']}}');" readonly="readonly">
@
else
<
input
type
=
"text"
onkeypress
=
"onlynumber(event)"
id
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
name
=
"hour[
{
{$project['td_project']}}][{{$i+1}
}
]"
value
=
""
min
=
"0"
max
=
"24"
style
=
"padding:2px;margin:unset"
onchange
=
"limiter(this,'
{
{$project['td_project']}
}
');"
>
@
endif
<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
@else
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
57937b94
...
...
@@ -79,6 +79,7 @@ class DashboardController extends Controller
public
function
borangBolehCaj
(
Request
$request
)
{
$userId
=
Auth
::
id
();
$user
=
users
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$projectcode
=
'Project Code'
;
$projectname
=
'Project Name'
;
...
...
@@ -179,18 +180,19 @@ class DashboardController extends Controller
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
whereNotNull
(
'tm_chargeable_hrs'
)
->
first
();
// dd($check);
//kalau ada, dia gi ke edit
if
(
$check
)
{
$
data
=
Ts_master
::
where
(
'id'
,
$request
->
id
)
->
firs
t
();
$
hour
=
Ts_detail
::
where
(
'fk_tm_id'
,
$check
->
id
)
->
ge
t
();
}
//klu xde g create.php
else
{
$
data
=
[]
;
$
hour
=
null
;
}
//kalau ada juga = bawak data details
...
...
@@ -216,8 +218,8 @@ class DashboardController extends Controller
// }
// dd($checkTimesheetDetail);
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'userId'
,
'projectcode'
,
'projectname'
,
'month'
,
'phase'
,
'samplequery'
,
'daymonth'
,
'year'
,
'sampleTimesheet_dtl'
,
'day'
,
'
data
'
));
// dd($hour);
return
view
(
'timesheet::dashboard.borangBolehCaj'
,
compact
(
'userId'
,
'projectcode'
,
'projectname'
,
'month'
,
'phase'
,
'samplequery'
,
'daymonth'
,
'year'
,
'sampleTimesheet_dtl'
,
'day'
,
'
hour
'
));
}
public
function
kalendarCharge
()
...
...
@@ -292,15 +294,17 @@ class DashboardController extends Controller
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
if
(
$checkTimesheetDetail
)
{
//update hours to null
$valuehour
=
$day
;
if
(
$valuehour
==
null
)
{
$valuehour
=
0
;
}
if
(
$checkTimesheetDetail
)
{
//update hours to null
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
update
();
...
...
@@ -321,7 +325,7 @@ class DashboardController extends Controller
$project
=
Project
::
where
(
'id'
,
$projectid
)
->
first
();
$tmdetail
->
td_project_name
=
$project
->
p_project_description
;
$tmdetail
->
td_hours
=
$
day
;
$tmdetail
->
td_hours
=
$
valuehour
;
$tmdetail
->
save
();
//$tmdetail -> kjhdiwhdf;
...
...
@@ -342,11 +346,12 @@ class DashboardController extends Controller
// ->where('td_date', $date)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
sum
(
'td_hours'
);
dd
(
$sumdetailhour
);
// dd($sumdetailhour);
// checktotalhours
$checktotalhours
=
Ts_master
::
where
(
'id'
,
$tmasterid
)
->
where
(
'tm_chargeable_hrs'
,
$sumdetailhour
)
->
update
();
$checktotalhours
=
Ts_master
::
where
(
'id'
,
$tmasterid
)
->
first
();
$checktotalhours
->
tm_chargeable_hrs
=
$sumdetailhour
;
$checktotalhours
->
update
();
// return redirect::to('mobile/profile');
...
...
packages/portal/timesheet/src/Model/ts_master.php
View file @
57937b94
...
...
@@ -15,7 +15,7 @@ class Ts_master extends Model
public
function
Details
()
{
return
$this
->
hasMany
(
'
App\Models\Ts_detail'
,
'
tm_id'
,
'id'
);
return
$this
->
hasMany
(
'
Portal\Timesheet\Model\Ts_detail'
,
'fk_
tm_id'
,
'id'
);
}
/**
...
...
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