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
48f027ec
Commit
48f027ec
authored
Jan 03, 2023
by
Azhan Hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard hod -> comment display current year, display status 2,3,5,6
parent
706be7a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
261 additions
and
20 deletions
+261
-20
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
+1
-1
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+260
-19
No files found.
packages/portal/timesheet/resources/views/dashboard/dashboardhod.blade.php
View file @
48f027ec
...
...
@@ -69,7 +69,7 @@
<?php
$chargeable
=
$projects->where
('tp_project_type', 1)->where('fk_tm_id', data_get(
$time
,'id'));
$overhead
=
$projects->where
('tp_project_type', 3)->where('fk_tm_id', data_get(
$time
,'id'));
// dd(
$
overhead
);
// dd(
$
projects
);
?>
<div class="
content
" style="
padding
-
top
:
0
px
;
">
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
48f027ec
...
...
@@ -63,7 +63,7 @@ class DashboardController extends Controller
$verifier
=
Users
::
find
(
Auth
::
id
());
$profile
=
VwReviewProfile
::
where
(
'hod_id'
,
$verifier
->
id
)
->
whereIn
(
'status'
,
[
2
,
3
])
->
whereIn
(
'status'
,
[
2
,
3
,
5
,
6
])
->
with
(
'overheads'
)
->
orderby
(
'tm_year'
,
'desc'
)
->
orderby
(
'tm_month'
,
'desc'
)
...
...
@@ -71,19 +71,19 @@ class DashboardController extends Controller
->
get
();
$staffnotes
=
Tproject
::
where
(
'tp_project_type'
,
3
)
->
where
(
'tp_timesheet_sts'
,
'<>'
,
1
)
->
where
In
(
'tp_timesheet_sts'
,
[
2
,
3
,
5
,
6
]
)
->
where
(
'staffid'
,
$verifier
->
u_staffID
)
->
where
(
'tp_year'
,
date
(
'Y'
))
//
->where('tp_year', date('Y'))
->
with
(
'notes'
)
->
get
();
$details
=
Tproject
::
where
(
'tp_project_type'
,
3
)
->
where
(
'tp_timesheet_sts'
,
'<>'
,
1
)
->
where
In
(
'tp_timesheet_sts'
,
[
2
,
3
,
5
,
6
]
)
->
where
(
'tp_pm'
,
$verifier
->
id
)
->
with
(
'notes'
)
->
get
();
$checkts
=
Ts_master
::
whereIn
(
'tm_timesheet_master_sts'
,
[
2
,
3
,
6
])
$checkts
=
Ts_master
::
whereIn
(
'tm_timesheet_master_sts'
,
[
2
,
3
,
5
,
6
])
->
with
(
'attachement'
)
->
get
();
...
...
@@ -92,20 +92,21 @@ class DashboardController extends Controller
->
u_staffID
;
$timesheet
=
Ts_master
::
where
(
'tm_staff_id'
,
$staffid
)
->
where
(
'tm_timesheet_master_sts'
,
'<>'
,
1
)
->
orderby
(
'tm_year'
)
->
where
In
(
'tm_timesheet_master_sts'
,
[
2
,
3
,
5
,
6
]
)
//
->orderby('tm_year')
->
orderby
(
'tm_month'
,
'DESC'
)
->
orderby
(
'tm_phase'
,
'DESC'
)
->
get
();
$projects
=
Tproject
::
where
(
'staffid'
,
$staffid
)
->
where
(
'tp_year'
,
date
(
'Y'
))
->
where
(
'tp_timesheet_sts'
,
'<>'
,
1
)
//
->where('tp_year', date('Y'))
->
where
In
(
'tp_timesheet_sts'
,
[
2
,
3
,
5
,
6
]
)
->
with
(
'project'
)
->
with
(
'overhead'
)
->
with
(
'hod'
)
->
with
(
'bod'
)
->
get
();
// dd($projects);
return
view
(
'timesheet::dashboard.dashboardhod'
,
compact
(
'profile'
,
'details'
,
'checkts'
,
'verifier'
,
'timesheet'
,
'projects'
,
'staffnotes'
));
...
...
@@ -623,8 +624,8 @@ class DashboardController extends Controller
public
function
revaction
(
Request
$request
)
{
$page
=
data_get
(
$request
,
'page'
);
// dd($request);
$page
=
data_get
(
$request
,
'page'
);
$hod
=
Users
::
find
(
Auth
::
id
());
$profile
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
...
...
@@ -1030,17 +1031,29 @@ class DashboardController extends Controller
$data_email
=
[
'subject'
=>
'Timesheet Project: Timesheet Project has been rejected'
,
'sender_name'
=>
'3fetimesheet@gmail.com'
,
'pcode'
=>
data_get
(
$profile
,
'project.p_project_code'
),
'projectmanager'
=>
data_get
(
$profile
,
'pm.fullname'
),
'projectdirector'
=>
data_get
(
$profile
,
'bod.fullname'
),
'projectname'
=>
data_get
(
$profile
,
'tp_project_name'
),
'status'
=>
data_get
(
$profile
,
'tp_timesheet_sts'
),
'remarks'
=>
data_get
(
$request
,
'remarks'
),
'staffname'
=>
data_get
(
$profile
,
'team.fullname'
),
];
Mail
::
to
(
$mailTo
)
->
send
(
new
PmRejectProject
(
$data_email
,
$data_timesheet
));
// return new PmRejectProject($data_email, $data_timesheet);
$detailprojects
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
->
with
(
'team'
)
->
with
(
'pm'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
get
();
// dd($detailprojects);
$data_project
=
[];
foreach
(
$detailprojects
as
$key
=>
$project
)
{
$data_project
[
$key
][
'pcode'
]
=
data_get
(
$project
,
'project.p_project_code'
);
$data_project
[
$key
][
'projectname'
]
=
data_get
(
$project
,
'tp_project_name'
);
$data_project
[
$key
][
'projectdirector'
]
=
data_get
(
$project
,
'bod.fullname'
);
$data_project
[
$key
][
'projectmanager'
]
=
data_get
(
$project
,
'pm.fullname'
);
$data_project
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
Mail
::
to
(
$mailTo
)
->
send
(
new
PmRejectProject
(
$data_email
,
$data_timesheet
,
$data_project
));
// return new PmRejectProject($data_email, $data_timesheet, $data_project);
// dd($data_email);
...
...
@@ -1075,6 +1088,7 @@ class DashboardController extends Controller
public
function
verifyoverhead
(
Request
$request
)
{
// dd($request);
if
(
$request
->
action
==
2
&&
$request
->
remarks
==
null
)
{
// dd('reject & tak komen');
...
...
@@ -1147,6 +1161,7 @@ class DashboardController extends Controller
}
else
{
// dd('haa');
$profile
->
tp_timesheet_sts
=
6
;
$profile
->
tp_verified_by
=
$request
->
verifier
;
$profile
->
tp_verified_at
=
$today
;
...
...
@@ -1172,6 +1187,88 @@ class DashboardController extends Controller
'hod_rejected_at'
=>
$today
,
]);
}
// email start
$profile
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
->
with
(
'team'
)
->
first
();
$tmid
=
$profile
->
fk_tm_id
;
if
(
env
(
'EMAIL_ENV'
)
==
'local'
)
{
$mailTo
=
'143hannan@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'DEVELOPMENT'
)
{
$mailTo
=
'3fetimesheet@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'PRODUCTION'
)
{
$mailTo
=
data_get
(
$profile
,
'team.email'
);
}
// dd($request);
$detailmaster
=
Ts_master
::
where
(
'id'
,
$tmid
)
->
first
();
// dd($detailmaster);
$data_timesheet
=
[
'year'
=>
data_get
(
$detailmaster
,
'tm_year'
),
'month'
=>
data_get
(
$detailmaster
,
'tm_month'
),
'phase'
=>
data_get
(
$detailmaster
,
'tm_phase'
),
'submissionDate'
=>
data_get
(
$detailmaster
,
'tm_submission_at'
),
];
$data_email
=
[
'subject'
=>
'Timesheet Project: Timesheet Project has been rejected'
,
'sender_name'
=>
'3fetimesheet@gmail.com'
,
'remarks'
=>
data_get
(
$request
,
'remarks'
),
'staffname'
=>
data_get
(
$profile
,
'team.fullname'
),
];
$detailprojects
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
->
with
(
'team'
)
->
with
(
'pm'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
where
(
'tp_project_type'
,
1
)
->
get
();
$detailoverheads
=
Tproject
::
where
(
'id'
,
$request
->
tpid
)
->
with
(
'team'
)
->
with
(
'hod'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
where
(
'tp_project_type'
,
3
)
->
get
();
// dd($detailoverheads);
$data_project
=
[];
foreach
(
$detailprojects
as
$key
=>
$project
)
{
$data_project
[
$key
][
'pcode'
]
=
data_get
(
$project
,
'project.p_project_code'
);
$data_project
[
$key
][
'projectname'
]
=
data_get
(
$project
,
'tp_project_name'
);
$data_project
[
$key
][
'projectdirector'
]
=
data_get
(
$project
,
'bod.fullname'
);
$data_project
[
$key
][
'projectmanager'
]
=
data_get
(
$project
,
'pm.fullname'
);
$data_project
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
$data_overheads
=
[];
foreach
(
$detailoverheads
as
$key
=>
$overhead
)
{
$data_overheads
[
$key
][
'pcode'
]
=
data_get
(
$overhead
,
'project.p_project_code'
);
$data_overheads
[
$key
][
'projectname'
]
=
data_get
(
$overhead
,
'tp_project_name'
);
$data_overheads
[
$key
][
'projectdirector'
]
=
data_get
(
$overhead
,
'bod.fullname'
);
$data_overheads
[
$key
][
'hod'
]
=
data_get
(
$overhead
,
'hod.fullname'
);
$data_overheads
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
Mail
::
to
(
$mailTo
)
->
send
(
new
PmRejectProject
(
$data_email
,
$data_timesheet
,
$data_project
,
$data_overheads
));
// return new PmRejectProject($data_email, $data_timesheet, $data_project, $data_overheads);
// dd($data_overheads);
// dd($data_project);
// email end
// if(data_get($request,'page') == 1){
return
redirect
()
->
route
(
'timesheet::dashboard.index'
)
->
withSuccess
(
'Staff overhead has been rejected'
);
// }
...
...
@@ -2956,7 +3053,8 @@ class DashboardController extends Controller
}
public
function
verificationselected
(
Request
$request
)
{
{
// dd($request);
$user
=
Staff_info
::
where
(
'id'
,
Auth
::
id
())
->
first
();
$pid
=
[];
...
...
@@ -3013,7 +3111,8 @@ class DashboardController extends Controller
}
}
if
(
$request
->
action
==
2
)
{
if
(
$request
->
action
==
2
)
{
$projects
=
Tproject
::
whereIn
(
'id'
,
$pid
)
->
update
([
'tp_timesheet_sts'
=>
6
,
...
...
@@ -3033,6 +3132,85 @@ class DashboardController extends Controller
'tm_timesheet_master_sts'
=>
6
,
]);
}
// email start
$profile
=
Tproject
::
whereIn
(
'id'
,
$pid
)
->
with
(
'team'
)
->
first
();
// dd($profile->team->email);
if
(
env
(
'EMAIL_ENV'
)
==
'local'
)
{
$mailTo
=
'143hannan@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'DEVELOPMENT'
)
{
$mailTo
=
'3fetimesheet@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'PRODUCTION'
)
{
$mailTo
=
data_get
(
$profile
,
'team.email'
);
}
$detailmaster
=
Ts_master
::
where
(
'id'
,
$request
->
tmid
)
->
first
();
// dd($detailmaster);
$data_timesheet
=
[
'year'
=>
data_get
(
$detailmaster
,
'tm_year'
),
'month'
=>
data_get
(
$detailmaster
,
'tm_month'
),
'phase'
=>
data_get
(
$detailmaster
,
'tm_phase'
),
'submissionDate'
=>
data_get
(
$detailmaster
,
'tm_submission_at'
),
];
$data_email
=
[
'subject'
=>
'Timesheet Project: Timesheet Project has been rejected'
,
'sender_name'
=>
'3fetimesheet@gmail.com'
,
'remarks'
=>
data_get
(
$request
,
'remarks'
),
'staffname'
=>
data_get
(
$profile
,
'team.fullname'
),
];
$detailprojects
=
Tproject
::
whereIn
(
'id'
,
$pid
)
->
with
(
'team'
)
->
with
(
'pm'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
where
(
'tp_project_type'
,
1
)
->
get
();
$detailoverheads
=
Tproject
::
whereIn
(
'id'
,
$pid
)
->
with
(
'hod'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
where
(
'tp_project_type'
,
3
)
->
get
();
$data_project
=
[];
foreach
(
$detailprojects
as
$key
=>
$project
)
{
$data_project
[
$key
][
'pcode'
]
=
data_get
(
$project
,
'project.p_project_code'
);
$data_project
[
$key
][
'projectname'
]
=
data_get
(
$project
,
'tp_project_name'
);
$data_project
[
$key
][
'projectdirector'
]
=
data_get
(
$project
,
'bod.fullname'
);
$data_project
[
$key
][
'projectmanager'
]
=
data_get
(
$project
,
'pm.fullname'
);
$data_project
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
// dd($data_project);
$data_overheads
=
[];
foreach
(
$detailoverheads
as
$key
=>
$overhead
)
{
$data_overheads
[
$key
][
'projectname'
]
=
data_get
(
$overhead
,
'tp_project_name'
);
$data_overheads
[
$key
][
'projectdirector'
]
=
data_get
(
$overhead
,
'bod.fullname'
);
$data_overheads
[
$key
][
'hod'
]
=
data_get
(
$overhead
,
'hod.fullname'
);
$data_overheads
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
// dd($data_overheads);
// Mail::to($mailTo)->send(new PmRejectProject($data_email, $data_timesheet, $data_project));
return
new
PmRejectProject
(
$data_email
,
$data_timesheet
,
$data_project
,
$data_overheads
);
// dd($data_project);
// email end
if
(
count
(
$pid
)
==
1
)
{
...
...
@@ -3552,6 +3730,8 @@ class DashboardController extends Controller
$cpid
[]
=
data_get
(
$data
,
'td_project'
);
}
}
// dd($cid);
if
(
data_get
(
$request
,
'oid'
))
{
$oid
=
[];
...
...
@@ -3666,6 +3846,67 @@ class DashboardController extends Controller
'tm_timesheet_master_sts'
=>
6
,
]);
}
// email start
$profile
=
Tproject
::
whereIn
(
'id'
,
$cid
)
->
with
(
'team'
)
->
first
();
// dd($profile->team->email);
if
(
env
(
'EMAIL_ENV'
)
==
'local'
)
{
$mailTo
=
'143hannan@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'DEVELOPMENT'
)
{
$mailTo
=
'3fetimesheet@gmail.com'
;
}
elseif
(
env
(
'EMAIL_ENV'
)
==
'PRODUCTION'
)
{
$mailTo
=
data_get
(
$profile
,
'team.email'
);
}
$detailmaster
=
Ts_master
::
where
(
'id'
,
$request
->
tmid
)
->
first
();
// dd($detailmaster);
$data_timesheet
=
[
'year'
=>
data_get
(
$detailmaster
,
'tm_year'
),
'month'
=>
data_get
(
$detailmaster
,
'tm_month'
),
'phase'
=>
data_get
(
$detailmaster
,
'tm_phase'
),
'submissionDate'
=>
data_get
(
$detailmaster
,
'tm_submission_at'
),
];
$data_email
=
[
'subject'
=>
'Timesheet Project: Timesheet Project has been rejected'
,
'sender_name'
=>
'3fetimesheet@gmail.com'
,
'remarks'
=>
data_get
(
$request
,
'remarks'
),
'staffname'
=>
data_get
(
$profile
,
'team.fullname'
),
];
$detailprojects
=
Tproject
::
whereIn
(
'id'
,
$cid
)
->
with
(
'team'
)
->
with
(
'pm'
)
->
with
(
'project'
)
->
with
(
'bod'
)
->
get
();
$data_project
=
[];
foreach
(
$detailprojects
as
$key
=>
$project
)
{
$data_project
[
$key
][
'pcode'
]
=
data_get
(
$project
,
'project.p_project_code'
);
$data_project
[
$key
][
'projectname'
]
=
data_get
(
$project
,
'tp_project_name'
);
$data_project
[
$key
][
'projectdirector'
]
=
data_get
(
$project
,
'bod.fullname'
);
$data_project
[
$key
][
'projectmanager'
]
=
data_get
(
$project
,
'pm.fullname'
);
$data_project
[
$key
][
'remarks'
]
=
data_get
(
$request
,
'remarks'
);
}
// dd($data_project);
Mail
::
to
(
$mailTo
)
->
send
(
new
PmRejectProject
(
$data_email
,
$data_timesheet
,
$data_project
));
// return new PmRejectProject($data_email, $data_timesheet, $data_project);
// dd($data_project);
// email end
return
redirect
()
->
route
(
'timesheet::dashboard.index'
)
->
withSuccess
(
'The project has been rejected successfully'
);
}
}
...
...
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