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
e750f24c
Commit
e750f24c
authored
Jun 08, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reset to fezrul changes
parent
8c12b1b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
20 deletions
+25
-20
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+25
-20
No files found.
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
e750f24c
...
...
@@ -27,10 +27,10 @@ class DashboardController extends Controller
{
$items
=
array
();
$events
=
array
();
$events
=
array
();
$keyword
=
request
(
'search'
);
// $staff = $this->stafrepo->info(\Auth::user()->employeeCode);
// $staff = $this->stafrepo->info(\Auth::user()->employeeCode);
$now
=
Carbon
::
now
();
...
...
@@ -40,7 +40,7 @@ class DashboardController extends Controller
if
(
$roleid
==
'1'
)
{
return
view
(
'timesheet::dashboard.admin'
);
return
view
(
'timesheet::dashboard.admin'
);
}
if
((
$roleid
==
'2'
)
OR
(
$roleid
==
'5'
))
{
...
...
@@ -51,17 +51,17 @@ class DashboardController extends Controller
}
)
->
paginate
(
4
);
return
view
(
'timesheet::dashboard.staff'
,
compact
(
'user'
));
return
view
(
'timesheet::dashboard.staff'
,
compact
(
'user'
));
}
if
(
$roleid
==
'3'
)
{
return
view
(
'timesheet::dashboard.verifier'
);
return
view
(
'timesheet::dashboard.verifier'
);
}
if
(
$roleid
==
'4'
)
{
return
view
(
'timesheet::dashboard.approval'
);
return
view
(
'timesheet::dashboard.approval'
);
}
}
...
...
@@ -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'
;
...
...
@@ -135,7 +136,7 @@ class DashboardController extends Controller
];
// dd($sampleTimesheet_dtl[0]['td_date']);
...
...
@@ -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,14 +294,16 @@ class DashboardController extends Controller
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
$valuehour
=
$day
;
if
(
$valuehour
==
null
)
{
$valuehour
=
0
;
}
if
(
$checkTimesheetDetail
)
{
//update hours to null
$valuehour
=
$day
;
if
(
$valuehour
==
null
)
{
$valuehour
=
0
;
}
$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;
...
...
@@ -343,9 +347,10 @@ class DashboardController extends Controller
->
where
(
'tm_phase'
,
$request
->
phase
)
->
sum
(
'td_hours'
);
// dd($sumdetailhour);
// checktotalhours
$checktotalhours
=
Ts_master
::
where
(
'id'
,
$tmasterid
)
->
first
();
$checktotalhours
->
where
(
'tm_chargeable_hrs'
,
$sumdetailhour
)
;
$checktotalhours
->
tm_chargeable_hrs
=
$sumdetailhour
;
$checktotalhours
->
update
();
// return redirect::to('mobile/profile');
...
...
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