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
3b2235dd
Commit
3b2235dd
authored
Aug 10, 2022
by
hannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes
parent
d9bc3526
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
643 additions
and
325 deletions
+643
-325
database/migrations/2022_08_05_115307_add_tm_submission_at_column_in_timesheet_master.php
+32
-0
database/migrations/2022_08_05_120022_create_timesheet_prj_table.php
+47
-0
packages/portal/timesheet/resources/views/dashboard/dashboardstaff.blade.php
+6
-4
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
+57
-0
packages/portal/timesheet/resources/views/dashboard/timesheetReview.blade.php
+149
-154
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
+41
-56
packages/portal/timesheet/resources/views/dashboard/vwviewer.blade.php
+38
-0
packages/portal/timesheet/resources/views/form/filterNotes.blade.php
+6
-0
packages/portal/timesheet/resources/views/form/notelist.blade.php
+4
-18
packages/portal/timesheet/routes/web.php
+5
-0
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
+77
-20
packages/portal/timesheet/src/Http/Controllers/FormController.php
+81
-73
packages/portal/timesheet/src/Model/Tproject.php
+29
-0
packages/portal/timesheet/src/Model/VwReviewProfile.php
+31
-0
packages/portal/timesheet/src/Model/VwViewer.php
+31
-0
packages/portal/timesheet/src/ServiceProvider.php
+9
-0
No files found.
database/migrations/2022_08_05_115307_add_tm_submission_at_column_in_timesheet_master.php
0 → 100644
View file @
3b2235dd
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
AddTmSubmissionAtColumnInTimesheetMaster
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'timesheet_master'
,
function
(
Blueprint
$table
)
{
$table
->
date
(
'tm_submission_at'
)
->
after
(
'tm_total_days'
)
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
table
(
'timesheet_master'
,
function
(
Blueprint
$table
)
{
$table
->
dropColumn
(
'tm_submission_at'
);
});
}
}
database/migrations/2022_08_05_120022_create_timesheet_prj_table.php
0 → 100644
View file @
3b2235dd
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
CreateTimesheetPrjTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'timesheet_prj'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'td_project'
,
10
)
->
nullable
();
$table
->
integer
(
'fk_td_id'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'fk_tm_id'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_year'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_month'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_phase'
)
->
unsigned
()
->
nullable
();
$table
->
string
(
'tp_project_name'
,
50
)
->
nullable
();
$table
->
integer
(
'tp_hours'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_timesheet_sts'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_pm'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_pm_flag'
)
->
unsigned
()
->
nullable
();
$table
->
integer
(
'tp_pm_remark'
)
->
unsigned
()
->
nullable
();
$table
->
timestamps
();
$table
->
integer
(
'updated_by'
)
->
nullable
();
$table
->
softDeletes
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'timesheet_prj'
);
}
}
packages/portal/timesheet/resources/views/dashboard/dashboardstaff.blade.php
View file @
3b2235dd
...
@@ -45,8 +45,9 @@
...
@@ -45,8 +45,9 @@
<th>Phase</th>
<th>Phase</th>
<th>Status</th>
<th>Status</th>
<th>Action</th>
<th>Action</th>
<th>Review Remark</th>
<th>Submission Date</th>
<th>Approval Remark</th>
<th>Verified Date</th>
<th>Approval Date</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -77,8 +78,9 @@
...
@@ -77,8 +78,9 @@
@elseif(
$value->tm_timesheet_master_sts
== 8) Revised the timesheet
@elseif(
$value->tm_timesheet_master_sts
== 8) Revised the timesheet
@endif
@endif
</td>
</td>
<td>{{
$value->tm_year
}}</td>
<td>{{
$value->tm_submission_at
}}</td>
<td>{{
$value->tm_year
}}</td>
<td>{{
$value->tm_verified_at
}}</td>
<td>{{
$value->tm_approval_at
}}</td>
</tr>
</tr>
@endforeach
@endforeach
</tbody>
</tbody>
...
...
packages/portal/timesheet/resources/views/dashboard/revaction.blade.php
0 → 100644
View file @
3b2235dd
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<a class="
ui
blue
left
ribbon
label
">Staff Timesheet Approve / Reject</a>
<br><br>
<form action="
{{
route
(
'timesheet::dashboard.verify'
)
}}
" method="
POST
" class="
ui
form
">
{
{csrf_field()}
}
<input type="
hidden
" name="
tmid
" value="
{{
$profile
->
tmid
}}
">
<div class="
six
wide
field
">
<label>Staff Name</label>
<input type="
text
" readonly="
readonly
" value="
{{
$profile
->
fullname
}}
">
</div>
<div class="
three
fields
">
<div class="
two
wide
field
">
<label>Year</label>
<input type="
text
" readonly="
readonly
" value="
{{
$profile
->
tm_year
}}
">
</div>
<div class="
two
wide
field
">
<label>Month</label>
<input type="
text
" readonly="
readonly
" value="
{{
$profile
->
tm_month
}}
">
</div>
<div class="
two
wide
field
">
<label>Phase</label>
<input type="
text
" readonly="
readonly
" value="
{{
$profile
->
tm_phase
}}
">
</div>
</div>
<div class="
two
fields
">
<div class="
six
wide
field
">
<input type="
hidden
" name="
verifier
" value="
{{
$hod
->
id
}}
">
<label>Head of Department</label>
<input type="
text
" readonly="
readonly
" value="
{{
$hod
->
name
}}
">
</div>
<div class="
three
wide
field
">
<label>Action</label>
<select class="
ui
fluid
dropdown
" name="
action
">
<option value="
1
">Approve</option>
<option value="
2
">Reject</option>
</select>
</div>
</div>
<div class="
field
">
<label>Remarks</label>
<textarea name="
remarks
"></textarea>
</div>
<button class="
ui
button
" type="
submit
">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/timesheetReview.blade.php
View file @
3b2235dd
...
@@ -10,38 +10,36 @@
...
@@ -10,38 +10,36 @@
<br>
<br>
<div class="
ui
styled
fluid
accordion
">
<div class="
ui
styled
fluid
accordion
">
<!-- {{
$checkts
}} -->
@foreach(
$staffs
as
$key
=>
$staff
)
@foreach(
$profile
as
$key
=>
$staff
)
<?php
$chargeable
=
$nonchargeable
=
$overhead
=
$totalhrs
=
$overtime
=
$totaldays
= 0;
$ts
=
$checkts->where
('tm_staff_id',
$staff->staff_id
);
if(
$ts
) {
foreach (
$ts
as
$key
=>
$value
) {
$chargeable
=
$value->tm_chargeable_hrs
;
$nonchargeable
=
$value->tm_nonchargeable_hrs
;
$overhead
=
$value->tm_overhead_hrs
;
$overtime
=
$value->tm_overtime_hrs
;
$totalhrs
=
$value->tm_total_hours
;
$totaldays
=
$value->tm_total_days
;
}
}
?>
<div class="
title
">
<div class="
title
">
<table class="
ui
unstackable
celled
table
">
<table class="
ui
unstackable
celled
table
">
<thead>
<thead>
<tr>
<tr>
<th colspan="
3
" style="
width
:
60
%
;
"><i class="
dropdown
icon
"></i>
{
{$staff->fullname}
}
</th>
<th colspan="
3
" style="
width
:
60
%
;
"><i class="
dropdown
icon
"></i>
{
{$staff->fullname}
}
</th>
<th style="
width
:
15
%
;
" class="
center
aligned
">Status</th>
<th style="
width
:
15
%
;
" class="
center
aligned
">
<th class="
right
aligned
">Approve | Reject | View</th>
@if(
$staff->status
== 1 ||
$staff->status
== null) In Preparation
@elseif(
$staff->status
== 2) Submitted
@elseif(
$staff->status
== 3) Verified by HOD
@elseif(
$staff->status
== 4) Verified by BOD
@endif
</th>
<th class="
right
aligned
">
@if(
$staff->status
< 3)
<button class="
center
aligned
ui
green
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
revaction
', [ '
tmid
'=>$staff->tmid ]) }}'
;
">Approve | Reject</button>
@else
<button class="
center
aligned
ui
green
icon
button
disabled
">Approve | Reject</button>
@endif
<button class="
center
aligned
ui
blue
icon
button
">View</button>
</th>
</tr>
</tr>
<tr>
<tr>
<td style="
width
:
20
%
;
">Chargeable
:
{
{$
chargeable}
}
</td>
<td style="
width
:
20
%
;
">Chargeable
(A) :
{
{$staff->
chargeable}
}
</td>
<td style="
width
:
20
%
;
">Nonchargeable
:
{
{$
nonchargeable}
}
</td>
<td style="
width
:
20
%
;
">Nonchargeable
(B) :
{
{$staff->
nonchargeable}
}
</td>
<td style="
width
:
20
%
;
">Overhead
:
{
{$
overhead}
}
</td>
<td style="
width
:
20
%
;
">Overhead
(C) :
{
{$staff->
overhead}
}
</td>
<td style="
width
:
15
%
;
">Overtime:
{
{$overtime}
}
</td>
<td style="
width
:
15
%
;
">Overtime:
{
{$
staff->
overtime}
}
</td>
<td class="
right
aligned
">Total Hours/Days: {{$
totalhrs."
hours
/
".
$
totaldays
."
days
"}}</td>
<td class="
right
aligned
">Total Hours/Days: {{$
staff->totalhrs."
hours
/
".
$staff->
totaldays
."
days
"}}</td>
</tr>
</tr>
</thead>
</thead>
</table>
</table>
...
@@ -50,133 +48,141 @@
...
@@ -50,133 +48,141 @@
<?php
<?php
$cptype
= "
A
";
$cptype
= "
A
";
$ncptype
= "
B
";
$ncptype
= "
B
";
$pcode
=
$pname
= "";
$otype
= "
C
";
$td
=
$checktd->where
('tm_staff_id',
$staff->staff_id
);
$pcode
=
$pname
=
$pm
="";
$td
=
$checktd->where
('tm_staff_id',
$staff->staff_id
);
$checkcpt
=
$cpt->where
('pt_staff_id',
$staff->staff_id
);
$checkcpt
=
$cpt->where
('pt_staff_id',
$staff->staff_id
);
$checkncpt
=
$ncpt->where
('pt_staff_id',
$staff->staff_id
);
// dump(
$checkcpt
);
if(
$checkcpt
)
{
foreach (
$checkcpt
as
$key
=>
$cptval
)
{
if(
$cptval->pt_staff_id
==
$staff->staff_id
)
$pname
=
$cptval->pt_project_description
;
foreach (
$cp
as
$key
=>
$cpvalue
)
{
if(
$cpvalue->p_project_description
==
$pname
)
{
$pcode
=
$cpvalue->p_project_code
;
}
foreach (
$pmname
as
$key
=>
$pmvalue
)
{
if(
$pmvalue->staff_id
==
$cpvalue->p_project_task_team
)
{
$pm
=
$pmvalue->fullname
;
}
}
}
}
}
if(
$td
) {
foreach (
$td
as
$key
=>
$value
) {
}
}
?>
?>
<div class="
content
" style="
padding
-
top
:
0
px
;
">
<div class="
content
" style="
padding
-
top
:
0
px
;
">
<table class="
ui
unstackable
celled
table
">
<table class="
ui
unstackable
celled
table
">
@if(
$checkcpt
)
<thead>
<tr>
<tr>
<td style="
width
:
5
%
;
" class="
center
aligned
">{{
$cptype
}}</td>
<th style="
width
:
5
%
;
" class="
center
aligned
">Type</th>
<td style="
width
:
15
%
;
">{{
$pcode
}}</td>
<th style="
width
:
15
%
;
">Project Code</th>
<td style="
width
:
20
%
;
">{{
$pname
}}</td>
<th style="
width
:
20
%
;
">Project Name</th>
<td style="
width
:
20
%
;
">{{
$pm
}}</td>
<th style="
width
:
20
%
;
">Project Manager</th>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Hours</td>
<th style="
width
:
7.5
%
;
" class="
center
aligned
">Total Hours</th>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Days</td>
<th style="
width
:
7.5
%
;
" class="
center
aligned
">Total Days</th>
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
<th style="
width
:
25
%
;
" class="
center
aligned
">Remarks</th>
</tr>
</tr>
@endif
</thead>
<tr>
@if(
$checkcpt
)
<td style="
width
:
5
%
;
" class="
center
aligned
">B</td>
@foreach (
$checkcpt
as
$key
=>
$cptval
)
<td style="
width
:
15
%
;
">Project Code</td>
@if(
$cptval->pt_staff_id
==
$staff->staff_id
)
<td style="
width
:
20
%
;
">Project Name</td>
<?php
$pname
=
$cptval->pt_project_description
; ?>
<td style="
width
:
20
%
;
">Project Manager</td>
@endif
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Hours</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Days</td>
@foreach (
$cp
as
$key
=>
$cpvalue
)
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
</tr>
@if(
$cpvalue->p_project_description
==
$pname
)
<tr>
<?php
$pcode
=
$cpvalue->p_project_code
; ?>
<td style="
width
:
5
%
;
" class="
center
aligned
">C</td>
@endif
<td style="
width
:
15
%
;
">Project Code</td>
<td style="
width
:
20
%
;
">Project Name</td>
@endforeach
<td style="
width
:
20
%
;
">Project Manager</td>
<tr>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Hours</td>
<td style="
width
:
5
%
;
" class="
center
aligned
">{{
$cptype
}}</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">Days</td>
<td style="
width
:
15
%
;
">{{
$pcode
}}</td>
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
<td style="
width
:
20
%
;
">{{
$pname
}}</td>
</tr>
<td style="
width
:
20
%
;
">
@foreach (
$cp
as
$key
=>
$cpvalue
)
@if(
$cpvalue->p_project_description
==
$pname
)
@foreach (
$pmname
as
$key
=>
$pmvalue
)
@if(
$pmvalue->staff_id
==
$cpvalue->p_project_task_team
)
<?php
$pm
=
$pmvalue->fullname
; ?>
{{
$pm
}}
@endif
@endforeach
@endif
@endforeach
</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">
<?php
$totalc
=0; ?>
@foreach(
$td
as
$key
=>
$tdvalues
)
@if(
$cptval->fk_project_id
==
$tdvalues->td_project
)
<?php
$totalc
+=
$tdvalues->td_hours
;?>
@endif
@endforeach
{{
$totalc
}}
</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">{{
$totalc
/8 }}</td>
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
</tr>
@endforeach
@endif
@if(
$checkncpt
)
@foreach (
$checkncpt
as
$key
=>
$ncptval
)
<tr>
<td style="
width
:
5
%
;
" class="
center
aligned
">{{
$ncptype
}}</td>
<td style="
width
:
15
%
;
"> - </td>
<td style="
width
:
20
%
;
">{{
$ncptval->pt_project_description
}}</td>
<td style="
width
:
20
%
;
"> - </td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">
<?php
$totalnc
=0; ?>
@foreach(
$td
as
$key
=>
$tdval
)
@if(
$tdval->td_project
==
$ncptval->fk_project_id
)
<?php
$totalnc
+=
$tdval->td_hours
; ?>
@endif
@endforeach
{{
$totalnc
}}
</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">{{
$totalnc
/8 }}</td>
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
</tr>
@endforeach
@endif
<?php
$ovhd
=
$td->where
('td_project_type', 3); ?>
<?php
$overheadtemp[0]
=
$overheadtask[0]
= ""; ?>
@if(
$ovhd
)
@foreach(
$ovhd
as
$key
=>
$overhead
)
<tr>
<td style="
width
:
5
%
;
" class="
center
aligned
">{{
$otype
}}</td>
<td style="
width
:
15
%
;
"> - </td>
<td style="
width
:
20
%
;
">{{
$overhead->td_overhead_desc
}}</td>
<td style="
width
:
20
%
;
"> - </td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">{{
$overhead->td_hours
}}</td>
<td style="
width
:
7.5
%
;
" class="
center
aligned
">{{
$overhead->td_hours
/8 }}</td>
<td style="
width
:
25
%
;
" class="
center
aligned
">Remarks</td>
</tr>
@endforeach
@endif
</table>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
15
%
" class="
center
aligned
">Date</th>
<th class="
center
aligned
">Notes</th>
</tr>
</thead>
@if(
$td
)
@foreach(
$td
as
$key
=>
$value
)
@if(
$value->td_overhead_note
)
<tr>
<td style="
width
:
15
%
" class="
center
aligned
">{{
$value->td_date
}}</td>
<td>{{
$value->td_overhead_note
}}</td>
</tr>
@endif
@endforeach
@endif
</table>
</table>
</div>
</div>
@endforeach
@endforeach
<!-- <div class="
title
">
<p>Example Screen</p>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th colspan="
3
" style="
width
:
60
%
;
"><i class="
dropdown
icon
"></i>STATUS</th>
<th style="
width
:
15
%
;
">Status</th>
<th class="
right
aligned
">Approve | Reject | View</th>
</tr>
<tr>
<td style="
width
:
20
%
;
">Chargeable</td>
<td style="
width
:
20
%
;
">Nonchargeable</td>
<td style="
width
:
20
%
;
">Overhead</td>
<td style="
width
:
15
%
;
">Overtime</td>
<td class="
right
aligned
">Total Hours/Days</td>
</tr>
</thead>
</table>
</div>
<div class="
content
" style="
padding
-
top
:
0
px
;
">
<table class="
ui
unstackable
celled
table
">
<tr>
<td style="
width
:
10
%
;
">Date</td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
20
%
;
">Project Name</td>
<td style="
width
:
20
%
;
">Project Manager</td>
<td style="
width
:
7.5
%
;
">Hours</td>
<td style="
width
:
7.5
%
;
">Days</td>
<td style="
width
:
15
%
;
">Remarks</td>
<td style="
width
:
10
%
;
">Status</td>
</tr>
<tr>
<td style="
width
:
10
%
;
">Date</td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
20
%
;
">Project Name</td>
<td style="
width
:
20
%
;
">Project Manager</td>
<td style="
width
:
7.5
%
;
">Hours</td>
<td style="
width
:
7.5
%
;
">Days</td>
<td style="
width
:
15
%
;
">Remarks</td>
<td style="
width
:
10
%
;
">Status</td>
</tr>
<tr>
<td style="
width
:
10
%
;
">Date</td>
<td style="
width
:
10
%
;
">Project Code</td>
<td style="
width
:
20
%
;
">Project Name</td>
<td style="
width
:
20
%
;
">Project Manager</td>
<td style="
width
:
7.5
%
;
">Hours</td>
<td style="
width
:
7.5
%
;
">Days</td>
<td style="
width
:
15
%
;
">Remarks</td>
<td style="
width
:
10
%
;
">Status</td>
</tr>
</table>
</div> -->
</div>
</div>
</div>
</div>
...
@@ -186,14 +192,4 @@
...
@@ -186,14 +192,4 @@
<script>
<script>
$('.ui.accordion').accordion();
$('.ui.accordion').accordion();
</script>
</script>
<!-- <script>
$('.trigger.example .accordion')
.accordion({
selector: {
trigger: '.title .icon'
}
})
;
</script> -->
@endpush
@endpush
\ No newline at end of file
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
3b2235dd
...
@@ -18,20 +18,20 @@
...
@@ -18,20 +18,20 @@
</td>
</td>
<td>Name</td>
<td>Name</td>
<td>:</td>
<td>:</td>
<td>{{
$
user->fullname
}}</td>
<td>{{
$
profile->STAFF_NAME
}}</td>
<td rowspan="
3
"></td>
<td rowspan="
3
"></td>
<td>Department</td>
<td>Department</td>
<td>:</td>
<td>:</td>
<td>{{
$
dept->description
}}</td>
<td>{{
$
profile->DEPARTMENT
}}</td>
<td rowspan="
3
"></td>
<td rowspan="
3
"></td>
</tr>
</tr>
<tr>
<tr>
<td>Staff No</td>
<td>Staff No</td>
<td>:</td>
<td>:</td>
<td>{{
$
user->staff_id
}}</td>
<td>{{
$
profile->STAFF_ID
}}</td>
<td>Reporting Manager</td>
<td>Reporting Manager</td>
<td>:</td>
<td>:</td>
<td>{{
$
hod
}}</td>
<td>{{
$
profile->HOD_NAME
}}</td>
</tr>
</tr>
<tr>
<tr>
<td>Month</td>
<td>Month</td>
...
@@ -714,11 +714,47 @@
...
@@ -714,11 +714,47 @@
</table>
</table>
</div>
</div>
<div class="
ui
segment
">
<table id="
printtable7
" class="
ui
celled
structured
table
unstackable
">
<thead>
<tr>
<th class="
center
aligned
">Submitted at</th>
<th class="
center
aligned
">Verified by</th>
<th class="
center
aligned
">Verified at</th>
<th class="
center
aligned
">Approved by</th>
<th class="
center
aligned
">Approved at</th>
</tr>
</thead>
<tbody>
<tr>
<?php
$verifiername
=
$approvalname
= ""; ?>
<td class="
center
aligned
">@if(
$check
){{
$check->tm_submission_at
}}@endif</td>
<td class="
center
aligned
">@if(
$check
){{
$profile->HOD_NAME
}}@endif</td>
<td class="
center
aligned
">@if(
$check
){{
$check->tm_verified_at
}}@endif</td>
<td class="
center
aligned
">
@if(
$check
)
<?php
foreach (
$bod
as
$key
=>
$value
) {
if (
$check->tm_approved_by
==
$value->id
) {
$approvalname
=
$value->fullname
;
}
}
?>
{
{$approvalname}
}
@endif
</td>
<td class="
center
aligned
">@if(
$check
)
{
{$check->tm_approved_at}
}
@endif</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<br>
<button type="
button
" class="
ui
primary
button
" onclick="
printdiv
(
'print_div'
)
">Print</button>
<button type="
button
" class="
ui
primary
button
" onclick="
printdiv
(
'print_div'
)
">Print</button>
@if(
$check
!= null)
@if(
$check
!= null)
<button type="
button
" class="
ui
green
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
tsubmit
',
[ '
tid
'=> $check->id
]) }}'
;
">Submit</button>
<button type="
button
" class="
ui
green
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
tsubmit
',
[ '
tid
'=> $check->id, '
totalot
'=> $totalot, '
totalchargehrs
'=>$totalchargehrs, '
totalnonchargehrs
'=> $totalnonchargehrs, '
totaloverheadhrs
'=>$totaloverheadhrs
]) }}'
;
">Submit</button>
@else
@else
<button type="
button
" class="
ui
disabled
green
button
">Submit</button>
<button type="
button
" class="
ui
disabled
green
button
">Submit</button>
@endif
@endif
...
@@ -729,57 +765,6 @@
...
@@ -729,57 +765,6 @@
@push('script')
@push('script')
<!-- <script type="
text
/
javascript
">
function printdiv(printpage)
{
// var oldstr = document.body.innerHTML;
// var el = document.getElementById("
body1
");
// el.classList.remove("
on
-
the
-
fly
-
behavior
");
// el.classList.add("
print
-
fly
");
// el.style.fontSize = "
10
px
!
important
;
background
-
color
:
white
!
important
";
document.getElementById(printpage).style.width = "
100
%
";
document.getElementById("
printtable1
").style.width = "
100
%
";
document.getElementById("
printtable1
").style.fontSize = "
10
px
";
document.getElementById("
printtable2
").style.width = "
100
%
";
document.getElementById("
printtable2
").style.fontSize = "
10
px
";
document.getElementById("
printtable3
").style.width = "
100
%
";
document.getElementById("
printtable3
").style.fontSize = "
10
px
";
document.getElementById("
printtable4
").style.width = "
100
%
";
document.getElementById("
printtable4
").style.fontSize = "
10
px
";
document.getElementById("
printtable5
").style.width = "
100
%
";
document.getElementById("
printtable5
").style.fontSize = "
10
px
";
document.getElementById("
printtable6
").style.width = "
100
%
";
document.getElementById("
printtable6
").style.fontSize = "
10
px
";
var headstr = "
<
html
><
head
><
title
></
title
></
head
><
body
style
=
'background-color: white;font-size:10px;margin-left:50px;margin-right:50px'
>
";
var footstr = "
</
body
>
";
var newstr = document.all.item(printpage).innerHTML;
var winPrint = window.open('', '', 'left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
winPrint.document.write(headstr+newstr+footstr);
winPrint.document.close();
winPrint.focus();
setTimeout(function()
{
winPrint.print();
winPrint.close();
}, 1000);
}
</script> -->
<script type="
text
/
javascript
">
<script type="
text
/
javascript
">
function printdiv(printpage)
function printdiv(printpage)
{
{
...
...
packages/portal/timesheet/resources/views/dashboard/vwviewer.blade.php
0 → 100644
View file @
3b2235dd
@
extends
(
'ui::layouts.app'
)
@
section
(
'content'
)
<
div
class
="
ui
segment
">
<div class="
ui
blue
left
ribbon
label
">
vm viewer
</div>
<br>
<br>
<table class="
ui
unstackable
celled
table
">
<thead>
<tr>
<th style="
width
:
5
%
" class="
center
aligned
">No</th>
<th class="
center
aligned
">Staff Name</th>
<th class="
center
aligned
">Department</th>
<th style="
width
:
15
%
" class="
center
aligned
">Staff ID</th>
<th class="
center
aligned
">HOD Name</th>
<th class="
center
aligned
">BOD Name</th>
</tr>
</thead>
<tbody>
@foreach(
$data
as
$key
=>
$value
)
<tr>
<td>
{
{$key+1}
}
</td>
<td>{{data_get(
$value
, 'STAFF_NAME')}}</td>
<td>{{data_get(
$value
, 'DEPARTMENT')}}</td>
<td>{{data_get(
$value
, 'STAFF_ID')}}</td>
<td>{{data_get(
$value
, 'HOD_NAME')}}</td>
<td>{{data_get(
$value
, 'BOD_NAME')}}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/form/filterNotes.blade.php
0 → 100644
View file @
3b2235dd
@
extends
(
'timesheet::layouts.filtermonthphase'
)
@
section
(
'action'
)
<
form
class
="
ui
form
" action="
{{
route
(
'timesheet::form.noteselectmonthphase'
)
}}
" method="
POST
">
@endsection
\ No newline at end of file
packages/portal/timesheet/resources/views/form/notelist.blade.php
View file @
3b2235dd
...
@@ -27,29 +27,15 @@
...
@@ -27,29 +27,15 @@
</tr>
</tr>
@endforeach
@endforeach
</tbody>
</tbody>
<tfoot>
<tr>
<th colspan="
6
">
<div class="
ui
right
floated
pagination
menu
">
<a class="
icon
item
">
<i class="
left
chevron
icon
"></i>
</a>
<a class="
item
">1</a>
<a class="
item
">2</a>
<a class="
item
">3</a>
<a class="
item
">4</a>
<a class="
icon
item
">
<i class="
right
chevron
icon
"></i>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
</table>
<button class="
center
aligned
ui
teal
compact
labeled
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
form
.
overheadForm
', ['
phase
' => $phase, '
month
' => $month]) }}'
;
">
<button class="
center
aligned
ui
teal
compact
labeled
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
form
.
overheadForm
', ['
phase
' => $phase, '
month
' => $month]) }}'
;
">
<i class="
angle
double
left
icon
"></i>
<i class="
angle
double
left
icon
"></i>
Back
Back
</button>
</button>
<button class="
center
aligned
ui
green
compact
right
labeled
icon
button
" onclick="
window
.
location
.
href
=
'{{ route('
timesheet
::
dashboard
.
timesheetViewer
', ['
phase
' => $phase, '
month
' => $month, '
year
' => $year]) }}'
;
">
<i class="
angle
double
right
icon
"></i>
Timesheet Viewer
</button>
</div>
</div>
@endsection
@endsection
packages/portal/timesheet/routes/web.php
View file @
3b2235dd
...
@@ -12,6 +12,7 @@ Route::group(
...
@@ -12,6 +12,7 @@ Route::group(
//dashboard
//dashboard
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'vwviewer'
,[
'uses'
=>
'DashboardController@vwviewer'
,
'as'
=>
'dashboard.vwviewer'
]);
//timesheet
//timesheet
Route
::
get
(
'timesheetApproval'
,[
'uses'
=>
'DashboardController@timesheetApproval'
,
'as'
=>
'dashboard.timesheetApproval'
]);
Route
::
get
(
'timesheetApproval'
,[
'uses'
=>
'DashboardController@timesheetApproval'
,
'as'
=>
'dashboard.timesheetApproval'
]);
Route
::
get
(
'timesheetReport'
,[
'uses'
=>
'DashboardController@timesheetReport'
,
'as'
=>
'dashboard.timesheetReport'
]);
Route
::
get
(
'timesheetReport'
,[
'uses'
=>
'DashboardController@timesheetReport'
,
'as'
=>
'dashboard.timesheetReport'
]);
...
@@ -22,6 +23,8 @@ Route::group(
...
@@ -22,6 +23,8 @@ Route::group(
Route
::
post
(
'reviewselectmonthphase'
,
[
'uses'
=>
'DashboardController@reviewselectmonthphase'
,
'as'
=>
'dashboard.reviewselectmonthphase'
]);
Route
::
post
(
'reviewselectmonthphase'
,
[
'uses'
=>
'DashboardController@reviewselectmonthphase'
,
'as'
=>
'dashboard.reviewselectmonthphase'
]);
Route
::
post
(
'viewerselectmonthphase'
,
[
'uses'
=>
'DashboardController@viewerselectmonthphase'
,
'as'
=>
'dashboard.viewerselectmonthphase'
]);
Route
::
post
(
'viewerselectmonthphase'
,
[
'uses'
=>
'DashboardController@viewerselectmonthphase'
,
'as'
=>
'dashboard.viewerselectmonthphase'
]);
Route
::
get
(
'tsubmit'
,
[
'uses'
=>
'DashboardController@tsubmit'
,
'as'
=>
'dashboard.tsubmit'
]);
Route
::
get
(
'tsubmit'
,
[
'uses'
=>
'DashboardController@tsubmit'
,
'as'
=>
'dashboard.tsubmit'
]);
Route
::
get
(
'revaction'
,
[
'uses'
=>
'DashboardController@revaction'
,
'as'
=>
'dashboard.revaction'
]);
Route
::
post
(
'verify'
,
[
'uses'
=>
'DashboardController@verify'
,
'as'
=>
'dashboard.verify'
]);
//maintenance
//maintenance
Route
::
get
(
'senaraiProject'
,[
'uses'
=>
'MaintenanceController@senaraiProject'
,
'as'
=>
'maintenance.senaraiProject'
]);
Route
::
get
(
'senaraiProject'
,[
'uses'
=>
'MaintenanceController@senaraiProject'
,
'as'
=>
'maintenance.senaraiProject'
]);
...
@@ -60,9 +63,11 @@ Route::group(
...
@@ -60,9 +63,11 @@ Route::group(
Route
::
get
(
'filterChargeable'
,[
'uses'
=>
'FormController@filterChargeable'
,
'as'
=>
'form.filterChargeable'
]);
Route
::
get
(
'filterChargeable'
,[
'uses'
=>
'FormController@filterChargeable'
,
'as'
=>
'form.filterChargeable'
]);
Route
::
get
(
'filterNonChargeable'
,[
'uses'
=>
'FormController@filterNonChargeable'
,
'as'
=>
'form.filterNonChargeable'
]);
Route
::
get
(
'filterNonChargeable'
,[
'uses'
=>
'FormController@filterNonChargeable'
,
'as'
=>
'form.filterNonChargeable'
]);
Route
::
get
(
'filterOverhead'
,[
'uses'
=>
'FormController@filterOverhead'
,
'as'
=>
'form.filterOverhead'
]);
Route
::
get
(
'filterOverhead'
,[
'uses'
=>
'FormController@filterOverhead'
,
'as'
=>
'form.filterOverhead'
]);
Route
::
get
(
'filterNotes'
,[
'uses'
=>
'FormController@filterNotes'
,
'as'
=>
'form.filterNotes'
]);
Route
::
post
(
'chargeableselectmonthphase'
,
[
'uses'
=>
'FormController@chargeableselectmonthphase'
,
'as'
=>
'form.chargeableselectmonthphase'
]);
Route
::
post
(
'chargeableselectmonthphase'
,
[
'uses'
=>
'FormController@chargeableselectmonthphase'
,
'as'
=>
'form.chargeableselectmonthphase'
]);
Route
::
post
(
'nonchargeableselectmonthphase'
,
[
'uses'
=>
'FormController@nonchargeableselectmonthphase'
,
'as'
=>
'form.nonchargeableselectmonthphase'
]);
Route
::
post
(
'nonchargeableselectmonthphase'
,
[
'uses'
=>
'FormController@nonchargeableselectmonthphase'
,
'as'
=>
'form.nonchargeableselectmonthphase'
]);
Route
::
post
(
'overheadselectmonthphase'
,
[
'uses'
=>
'FormController@overheadselectmonthphase'
,
'as'
=>
'form.overheadselectmonthphase'
]);
Route
::
post
(
'overheadselectmonthphase'
,
[
'uses'
=>
'FormController@overheadselectmonthphase'
,
'as'
=>
'form.overheadselectmonthphase'
]);
Route
::
post
(
'noteselectmonthphase'
,
[
'uses'
=>
'FormController@noteselectmonthphase'
,
'as'
=>
'form.noteselectmonthphase'
]);
// nonChargeableForm
// nonChargeableForm
Route
::
post
(
'addnonchargeabletask'
,[
'uses'
=>
'FormController@addnonchargeabletask'
,
'as'
=>
'form.addnonchargeabletask'
]);
Route
::
post
(
'addnonchargeabletask'
,[
'uses'
=>
'FormController@addnonchargeabletask'
,
'as'
=>
'form.addnonchargeabletask'
]);
...
...
packages/portal/timesheet/src/Http/Controllers/DashboardController.php
View file @
3b2235dd
...
@@ -14,6 +14,8 @@ use Portal\Timesheet\Model\Pteam;
...
@@ -14,6 +14,8 @@ use Portal\Timesheet\Model\Pteam;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Role
;
use
Portal\Timesheet\Model\Role
;
use
Portal\Timesheet\Model\VwViewer
;
use
Portal\Timesheet\Model\VwReviewProfile
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
Illuminate\Support\Facades\Input
;
use
File
;
use
File
;
...
@@ -80,6 +82,12 @@ class DashboardController extends Controller
...
@@ -80,6 +82,12 @@ class DashboardController extends Controller
}
}
}
}
public
function
vwviewer
(){
$data
=
VwViewer
::
orderby
(
'DEPARTMENT'
,
'DESC'
)
->
get
();
// dd($data[0]);
return
view
(
'timesheet::dashboard.vwviewer'
,
compact
(
'data'
));
}
public
function
filterViewer
()
public
function
filterViewer
()
{
{
$currmonth
=
date
(
'n'
);
$currmonth
=
date
(
'n'
);
...
@@ -132,15 +140,16 @@ class DashboardController extends Controller
...
@@ -132,15 +140,16 @@ class DashboardController extends Controller
public
function
timesheetReview
(
Request
$request
)
public
function
timesheetReview
(
Request
$request
)
{
{
// dd($request);
$curryear
=
date
(
'Y'
);
$curryear
=
date
(
'Y'
);
if
(
$request
->
year
)
{
if
(
$request
->
year
)
{
$curryear
=
$request
->
year
;
$curryear
=
$request
->
year
;
}
}
$hod
=
Users
::
find
(
Auth
::
id
());
$hod
=
Users
::
find
(
Auth
::
id
());
// dd($hod->id);
$profile
=
VwReviewProfile
::
where
(
'hod_id'
,
$hod
->
id
)
->
where
(
'tm_year'
,
$curryear
)
->
get
();
$staffs
=
Staff_info
::
where
(
'penyokong'
,
$hod
->
id
)
$staffs
=
Staff_info
::
where
(
'penyokong'
,
$hod
->
id
)
->
get
();
->
get
();
...
@@ -149,14 +158,14 @@ class DashboardController extends Controller
...
@@ -149,14 +158,14 @@ class DashboardController extends Controller
->
where
(
'tm_year'
,
$curryear
)
->
where
(
'tm_year'
,
$curryear
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
get
()
;
->
get
()
;
$checktd
=
Ts_detail
::
where
(
'tm_year'
,
$curryear
)
$checktd
=
Ts_detail
::
where
(
'tm_year'
,
$curryear
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'td_hours'
,
"<>"
,
0
)
->
where
(
'td_hours'
,
"<>"
,
0
)
->
orwhereNotNull
(
'td_overhead_note'
)
->
orwhereNotNull
(
'td_overhead_note'
)
->
get
();
->
get
();
$cpt
=
Pteam
::
where
(
'pt_project_type'
,
1
)
$cpt
=
Pteam
::
where
(
'pt_project_type'
,
1
)
->
get
();
->
get
();
...
@@ -174,9 +183,50 @@ class DashboardController extends Controller
...
@@ -174,9 +183,50 @@ class DashboardController extends Controller
$pmname
=
Staff_info
::
where
(
'fk_lkp_department'
,
4
)
$pmname
=
Staff_info
::
where
(
'fk_lkp_department'
,
4
)
->
get
();
->
get
();
// dd($checktd);
return
view
(
'timesheet::dashboard.timesheetReview'
,
compact
(
'staffs'
,
'checkts'
,
'checktd'
,
'cpt'
,
'ncpt'
,
'cp'
,
'ncp'
,
'pmname'
));
return
view
(
'timesheet::dashboard.timesheetReview'
,
compact
(
'profile'
,
'staffs'
,
'checkts'
,
'checktd'
,
'cpt'
,
'ncpt'
,
'cp'
,
'ncp'
,
'pmname'
));
}
public
function
revaction
(
Request
$request
)
{
$hod
=
Users
::
find
(
Auth
::
id
());
$profile
=
VwReviewProfile
::
where
(
'hod_id'
,
$hod
->
id
)
->
where
(
'tmid'
,
$request
->
tmid
)
->
first
();
return
view
(
'timesheet::dashboard.revaction'
,
compact
(
'profile'
,
'hod'
));
}
public
function
verify
(
Request
$request
)
{
$hod
=
Users
::
find
(
Auth
::
id
());
$today
=
Carbon
::
today
()
->
toDateString
();
if
(
$request
->
action
==
1
)
{
$ts
=
Ts_master
::
where
(
'id'
,
$request
->
tmid
)
->
update
(
[
'tm_timesheet_master_sts'
=>
3
,
'tm_verified_at'
=>
$today
,
'tm_verified_by'
=>
$request
->
verifier
]);
$td
=
Ts_detail
::
where
(
'fk_tm_id'
,
$request
->
tmid
)
->
update
([
'td_timesheet_sts'
=>
3
]);
}
else
{
dd
(
'rejected'
);
}
$profile
=
VwReviewProfile
::
where
(
'hod_id'
,
$hod
->
id
)
->
where
(
'tmid'
,
$request
->
tmid
)
->
first
();
$month
=
$profile
->
tm_month
;
$phase
=
$profile
->
tm_phase
;
return
redirect
()
->
route
(
'timesheet::dashboard.timesheetReview'
,
compact
(
'month'
,
'phase'
));
}
}
public
function
timesheetViewer
(
Request
$request
)
public
function
timesheetViewer
(
Request
$request
)
...
@@ -184,25 +234,24 @@ class DashboardController extends Controller
...
@@ -184,25 +234,24 @@ class DashboardController extends Controller
$user
=
Staff_info
::
where
(
'fk_users'
,
Auth
::
id
())
$user
=
Staff_info
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
->
first
();
$profile
=
VwViewer
::
where
(
'STAFF_ID'
,
$user
->
staff_id
)
->
orderby
(
'DEPARTMENT'
,
'DESC'
)
->
first
();
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
->
first
();
->
first
();
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
->
fullname
;
->
fullname
;
// $month = date('n');
$penyokong
=
Staff_info
::
where
(
'penyokong'
,
0
)
$year
=
date
(
'Y'
);
->
get
();
// $day = date('j');
// $month = 7;
$bod
=
Staff_info
::
select
(
'id'
,
'fullname'
)
// $year = 2022;
->
whereIn
(
'id'
,
[
45
,
46
,
47
,
48
])
// $day = 2
;
->
get
()
;
// if ($day < 16) {
$year
=
date
(
'Y'
);
// $phase = 1;
// } else {
// $phase = 2;
// }
if
(
isset
(
$request
->
phase
))
if
(
isset
(
$request
->
phase
))
{
{
...
@@ -359,15 +408,23 @@ class DashboardController extends Controller
...
@@ -359,15 +408,23 @@ class DashboardController extends Controller
}
}
// dd($check->id);
// dd($check->id);
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'user'
,
'dept'
,
'hod'
,
'phase'
,
'month'
,
'year'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'nonchargeablelist'
,
'overheadlist'
,
'chargehour'
,
'nonchargehour'
,
'totalchargehrs'
,
'totalnonchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
,
'check'
,
'strdays
'
));
return
view
(
'timesheet::dashboard.timesheetViewer'
,
compact
(
'user'
,
'profile'
,
'dept'
,
'hod'
,
'phase'
,
'month'
,
'year'
,
'strMonth'
,
'daymonth'
,
'chargeablelist'
,
'nonchargeablelist'
,
'overheadlist'
,
'chargehour'
,
'nonchargehour'
,
'totalchargehrs'
,
'totalnonchargehrs'
,
'totaloverheadhrs'
,
'overheadhour'
,
'notes'
,
'check'
,
'strdays'
,
'penyokong'
,
'bod
'
));
}
}
public
function
tsubmit
(
Request
$request
)
public
function
tsubmit
(
Request
$request
)
{
{
$today
=
Carbon
::
today
()
->
toDateString
();
$submit
=
2
;
$submit
=
2
;
$ts
=
Ts_master
::
where
(
'id'
,
$request
->
tid
)
$ts
=
Ts_master
::
where
(
'id'
,
$request
->
tid
)
->
update
([
'tm_timesheet_master_sts'
=>
2
]);
->
update
(
[
'tm_timesheet_master_sts'
=>
2
,
'tm_overtime_hrs'
=>
$request
->
totalot
,
'tm_total_hours'
=>
$request
->
totalchargehrs
+
$request
->
totalnonchargehrs
+
$request
->
totaloverheadhrs
,
'tm_total_days'
=>
(
$request
->
totalchargehrs
+
$request
->
totalnonchargehrs
+
$request
->
totaloverheadhrs
)
/
8
,
'tm_submission_at'
=>
$today
,
]);
$td
=
Ts_detail
::
where
(
'fk_tm_id'
,
$request
->
tid
)
$td
=
Ts_detail
::
where
(
'fk_tm_id'
,
$request
->
tid
)
->
update
([
'td_timesheet_sts'
=>
2
]);
->
update
([
'td_timesheet_sts'
=>
2
]);
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
3b2235dd
...
@@ -70,6 +70,20 @@ class FormController extends Controller
...
@@ -70,6 +70,20 @@ class FormController extends Controller
return
view
(
'timesheet::form.filterOverhead'
,
compact
(
'month'
,
'currmonth'
,
'curryear'
));
return
view
(
'timesheet::form.filterOverhead'
,
compact
(
'month'
,
'currmonth'
,
'curryear'
));
}
}
public
function
filterNotes
()
{
$currmonth
=
date
(
'n'
);
$curryear
=
date
(
'Y'
);
$month
=
[];
for
(
$m
=
1
;
$m
<=
12
;
$m
++
)
{
$month
[]
=
date
(
'F'
,
mktime
(
0
,
0
,
0
,
$m
,
1
,
date
(
'Y'
)));
}
return
view
(
'timesheet::form.filterNotes'
,
compact
(
'month'
,
'currmonth'
,
'curryear'
));
}
public
function
chargeableselectmonthphase
(
Request
$request
){
public
function
chargeableselectmonthphase
(
Request
$request
){
return
redirect
()
->
route
(
'timesheet::form.chargeableForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
]);
return
redirect
()
->
route
(
'timesheet::form.chargeableForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
]);
...
@@ -85,8 +99,14 @@ class FormController extends Controller
...
@@ -85,8 +99,14 @@ class FormController extends Controller
return
redirect
()
->
route
(
'timesheet::form.overheadForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
]);
return
redirect
()
->
route
(
'timesheet::form.overheadForm'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
]);
}
}
public
function
noteselectmonthphase
(
Request
$request
){
return
redirect
()
->
route
(
'timesheet::form.notelist'
,
[
'phase'
=>
$request
->
phase
,
'month'
=>
$request
->
month
]);
}
public
function
chargeableForm
(
Request
$request
)
public
function
chargeableForm
(
Request
$request
)
{
{
$chargeable
=
1
;
$chargeable
=
1
;
$userId
=
users
::
find
(
Auth
::
id
())
$userId
=
users
::
find
(
Auth
::
id
())
...
@@ -165,6 +185,7 @@ class FormController extends Controller
...
@@ -165,6 +185,7 @@ class FormController extends Controller
$userId
=
users
::
find
(
Auth
::
id
())
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
->
u_staffID
;
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_month'
,
$request
->
month
)
...
@@ -181,14 +202,13 @@ class FormController extends Controller
...
@@ -181,14 +202,13 @@ class FormController extends Controller
$check
->
tm_year
=
$request
->
year
;
$check
->
tm_year
=
$request
->
year
;
$check
->
tm_month
=
$request
->
month
;
$check
->
tm_month
=
$request
->
month
;
$check
->
tm_phase
=
$request
->
phase
;
$check
->
tm_phase
=
$request
->
phase
;
$ch
ce
k
->
tm_timesheet_master_sts
=
1
;
$ch
ec
k
->
tm_timesheet_master_sts
=
1
;
$check
->
updated_by
=
$userId
;
$check
->
updated_by
=
$userId
;
$check
->
save
();
$check
->
save
();
}
}
$tmasterid
=
$check
->
id
;
$tmasterid
=
$check
->
id
;
$detail
=
$request
->
hour
;
$detail
=
$request
->
hour
;
foreach
(
$detail
as
$key
=>
$value
)
foreach
(
$detail
as
$key
=>
$value
)
...
@@ -198,7 +218,8 @@ class FormController extends Controller
...
@@ -198,7 +218,8 @@ class FormController extends Controller
$projectid
=
$key
;
$projectid
=
$key
;
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$checkTimesheetDetail
=
Ts_detail
::
where
(
'td_project'
,
$projectid
)
$checkTimesheetDetail
=
Ts_detail
::
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'td_project'
,
$projectid
)
->
where
(
'td_project_type'
,
$chargeable
)
->
where
(
'td_project_type'
,
$chargeable
)
->
where
(
'td_date'
,
$date
)
->
where
(
'td_date'
,
$date
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
...
@@ -246,6 +267,7 @@ class FormController extends Controller
...
@@ -246,6 +267,7 @@ class FormController extends Controller
}
}
$sumdetailhour
=
Ts_detail
::
where
(
'td_project_type'
,
$chargeable
)
$sumdetailhour
=
Ts_detail
::
where
(
'td_project_type'
,
$chargeable
)
->
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
sum
(
'td_hours'
);
->
sum
(
'td_hours'
);
...
@@ -368,7 +390,6 @@ class FormController extends Controller
...
@@ -368,7 +390,6 @@ class FormController extends Controller
if
(
isset
(
$request
->
month
))
if
(
isset
(
$request
->
month
))
{
{
$month
=
$request
->
month
;
$month
=
$request
->
month
;
dump
(
$request
->
month
);
}
}
if
(
isset
(
$request
->
year
))
if
(
isset
(
$request
->
year
))
...
@@ -473,32 +494,24 @@ class FormController extends Controller
...
@@ -473,32 +494,24 @@ class FormController extends Controller
public
function
savenonchargeablehours
(
Request
$request
)
public
function
savenonchargeablehours
(
Request
$request
)
{
{
// chargeable, project type 1.
$nonchargeable
=
2
;
$nonchargeable
=
2
;
$userId
=
users
::
find
(
Auth
::
id
())
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
->
u_staffID
;
// dd($request->phase);
// check table master. untuk total chargeable hours.
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
->
first
();
// dd($check);
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if
(
$check
)
if
(
$check
)
{
{
// dd('tmaster dah ada');
}
}
// kalau takda, save() baru.
else
else
{
{
// dd('null, gi sini');
$check
=
new
Ts_master
;
$check
=
new
Ts_master
;
$check
->
tm_staff_id
=
$userId
;
$check
->
tm_staff_id
=
$userId
;
$check
->
tm_year
=
$request
->
year
;
$check
->
tm_year
=
$request
->
year
;
...
@@ -510,11 +523,6 @@ class FormController extends Controller
...
@@ -510,11 +523,6 @@ class FormController extends Controller
}
}
$tmasterid
=
$check
->
id
;
$tmasterid
=
$check
->
id
;
// dd($tmasterid);
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail
=
$request
->
hour
;
$detail
=
$request
->
hour
;
foreach
(
$detail
as
$key
=>
$value
)
foreach
(
$detail
as
$key
=>
$value
)
...
@@ -525,7 +533,8 @@ class FormController extends Controller
...
@@ -525,7 +533,8 @@ class FormController extends Controller
// dd($projectid);
// dd($projectid);
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$checkTimesheetDetail
=
Ts_detail
::
where
(
'td_project'
,
$projectid
)
$checkTimesheetDetail
=
Ts_detail
::
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'td_project'
,
$projectid
)
->
where
(
'td_project_type'
,
$nonchargeable
)
->
where
(
'td_project_type'
,
$nonchargeable
)
->
where
(
'td_date'
,
$date
)
->
where
(
'td_date'
,
$date
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
...
@@ -539,17 +548,16 @@ class FormController extends Controller
...
@@ -539,17 +548,16 @@ class FormController extends Controller
if
(
$checkTimesheetDetail
)
if
(
$checkTimesheetDetail
)
{
{
//update hours to null
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
td_timesheet_sts
=
1
;
$checkTimesheetDetail
->
td_timesheet_sts
=
1
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
update
();
$checkTimesheetDetail
->
update
();
}
//kalau takde, isi semua.
}
else
else
{
{
//isi semua
$tmdetail
=
new
Ts_detail
;
$tmdetail
=
new
Ts_detail
;
$tmdetail
->
td_date
=
$date
;
$tmdetail
->
td_date
=
$date
;
$tmdetail
->
td_project
=
$projectid
;
$tmdetail
->
td_project
=
$projectid
;
...
@@ -567,12 +575,7 @@ class FormController extends Controller
...
@@ -567,12 +575,7 @@ class FormController extends Controller
$tmdetail
->
td_hours
=
$valuehour
;
$tmdetail
->
td_hours
=
$valuehour
;
$tmdetail
->
td_timesheet_sts
=
1
;
$tmdetail
->
td_timesheet_sts
=
1
;
$tmdetail
->
updated_by
=
$userId
;
$tmdetail
->
updated_by
=
$userId
;
$tmdetail
->
save
();
$tmdetail
->
save
();
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
...
@@ -580,8 +583,6 @@ class FormController extends Controller
...
@@ -580,8 +583,6 @@ class FormController extends Controller
}
}
}
}
//update total ke master;
//buat query sum td_hours where condition :
$sumdetailhour
=
Ts_detail
::
where
(
'td_project_type'
,
$nonchargeable
)
$sumdetailhour
=
Ts_detail
::
where
(
'td_project_type'
,
$nonchargeable
)
->
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
...
@@ -651,10 +652,10 @@ class FormController extends Controller
...
@@ -651,10 +652,10 @@ class FormController extends Controller
}
}
$checkoverhead
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
$checkoverhead
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
->
first
();
// dd($checkoverhead);
// dd($checkoverhead);
...
@@ -687,21 +688,16 @@ class FormController extends Controller
...
@@ -687,21 +688,16 @@ class FormController extends Controller
$userId
=
users
::
find
(
Auth
::
id
())
$userId
=
users
::
find
(
Auth
::
id
())
->
u_staffID
;
->
u_staffID
;
// check table master. untuk total chargeable hours.
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
$check
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_year'
,
$request
->
year
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
->
first
();
//kalau ada, update().
//staff kena edit bila timesheet kena reject.
//kalau ada, biar dlu.
if
(
$check
)
if
(
$check
)
{
{
}
}
// kalau takda, save() baru.
else
else
{
{
$check
=
new
Ts_master
;
$check
=
new
Ts_master
;
...
@@ -711,18 +707,12 @@ class FormController extends Controller
...
@@ -711,18 +707,12 @@ class FormController extends Controller
$check
->
tm_phase
=
$request
->
phase
;
$check
->
tm_phase
=
$request
->
phase
;
$check
->
tm_timesheet_master_sts
=
1
;
$check
->
tm_timesheet_master_sts
=
1
;
$check
->
updated_by
=
$userId
;
$check
->
updated_by
=
$userId
;
// $check ->tm_chargeable_hrs = ;
$check
->
save
();
$check
->
save
();
}
}
$tmasterid
=
$check
->
id
;
$tmasterid
=
$check
->
id
;
// semak detail dari form
// untuk project type : 1 = chargeable, 2 = nonchargeable, 3 = overhead;
// . . .
$detail
=
$request
->
hour
;
$detail
=
$request
->
hour
;
foreach
(
$detail
as
$key
=>
$value
)
foreach
(
$detail
as
$key
=>
$value
)
...
@@ -733,7 +723,7 @@ class FormController extends Controller
...
@@ -733,7 +723,7 @@ class FormController extends Controller
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$date
=
$request
->
year
.
'-'
.
$request
->
month
.
'-'
.
sprintf
(
'%02d'
,
$keyday
);
$checkTimesheetDetail
=
Ts_detail
::
where
(
'fk_o_id'
,
$projectid
)
$checkTimesheetDetail
=
Ts_detail
::
where
(
'fk_o_id'
,
$projectid
)
// ->where('td_project_type', $project_type
)
->
where
(
'fk_tm_id'
,
$tmasterid
)
->
where
(
'td_date'
,
$date
)
->
where
(
'td_date'
,
$date
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
first
();
->
first
();
...
@@ -746,17 +736,16 @@ class FormController extends Controller
...
@@ -746,17 +736,16 @@ class FormController extends Controller
if
(
$checkTimesheetDetail
)
if
(
$checkTimesheetDetail
)
{
{
//update hours to null
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
td_hours
=
$valuehour
;
$checkTimesheetDetail
->
td_timesheet_sts
=
1
;
$checkTimesheetDetail
->
td_timesheet_sts
=
1
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
updated_by
=
$userId
;
$checkTimesheetDetail
->
update
();
$checkTimesheetDetail
->
update
();
}
//kalau takde, isi semua.
}
else
else
{
{
//isi semua
$tmdetail
=
new
Ts_detail
;
$tmdetail
=
new
Ts_detail
;
$tmdetail
->
td_date
=
$date
;
$tmdetail
->
td_date
=
$date
;
$tmdetail
->
fk_o_id
=
$projectid
;
$tmdetail
->
fk_o_id
=
$projectid
;
...
@@ -775,14 +764,7 @@ class FormController extends Controller
...
@@ -775,14 +764,7 @@ class FormController extends Controller
$tmdetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$tmdetail
->
td_overhead_desc
=
$project
->
o_overhead_desc
;
$tmdetail
->
td_hours
=
$valuehour
;
$tmdetail
->
td_hours
=
$valuehour
;
$tmdetail
->
td_timesheet_sts
=
1
;
$tmdetail
->
td_timesheet_sts
=
1
;
$tmdetail
->
save
();
$tmdetail
->
save
();
//error kat sini -> done : typo nama column td_overhead_description
//$tmdetail -> kjhdiwhdf;
//project = Project::where('id','project')->first();
//
// /lepas save ();
}
}
...
@@ -892,25 +874,51 @@ class FormController extends Controller
...
@@ -892,25 +874,51 @@ class FormController extends Controller
public
function
notelist
(
Request
$request
)
public
function
notelist
(
Request
$request
)
{
{
$month
=
$request
->
month
;
$phase
=
$request
->
phase
;
$overhead
=
3
;
$overhead
=
3
;
$userId
=
Users
::
find
(
Auth
::
id
())
$userId
=
Users
::
find
(
Auth
::
id
())
->
u_staffID
;
->
u_staffID
;
$notes
=
Ts_detail
::
where
(
'tm_year'
,
$request
->
year
)
$year
=
date
(
'Y'
);
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
if
(
isset
(
$request
->
phase
))
->
where
(
'fk_tm_id'
,
$request
->
fk_tm_id
)
{
->
where
(
'tm_staff_id'
,
$userId
)
$phase
=
$request
->
phase
;
->
where
(
'td_project_type'
,
$overhead
)
}
->
whereNotNull
(
'td_overhead_note'
)
->
orderby
(
'td_date'
)
if
(
isset
(
$request
->
month
))
->
get
();
{
$month
=
$request
->
month
;
}
if
(
isset
(
$request
->
year
))
{
$year
=
$request
->
year
;
}
$checknotelist
=
Ts_master
::
where
(
'tm_staff_id'
,
$userId
)
->
where
(
'tm_year'
,
$year
)
->
where
(
'tm_month'
,
$month
)
->
where
(
'tm_phase'
,
$phase
)
->
first
();
// dd($checknotelist);
if
(
$checknotelist
)
{
$notes
=
Ts_detail
::
where
(
'fk_tm_id'
,
$checknotelist
->
id
)
->
where
(
'td_project_type'
,
$overhead
)
->
whereNotNull
(
'td_overhead_note'
)
->
orderby
(
'td_date'
)
->
get
();
$fk_tm_id
=
$checknotelist
->
id
;
}
else
{
$notes
=
null
;
$fk_tm_id
=
null
;
}
return
view
(
'timesheet::form.notelist'
,
compact
(
'notes'
,
'phase'
,
'month'
));
return
view
(
'timesheet::form.notelist'
,
compact
(
'notes'
,
'phase'
,
'month'
,
'year'
,
'fk_tm_id'
));
}
}
public
function
penambahannote
()
public
function
penambahannote
()
...
...
packages/portal/timesheet/src/Model/Tproject.php
0 → 100644
View file @
3b2235dd
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
Tproject
extends
Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'timesheet_prj'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/VwReviewProfile.php
0 → 100644
View file @
3b2235dd
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Notifications\Notifiable
;
class
VwReviewProfile
extends
Model
{
use
Notifiable
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'vw_review_profile_details'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/Model/VwViewer.php
0 → 100644
View file @
3b2235dd
<?php
namespace
Portal\Timesheet\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Notifications\Notifiable
;
class
VwViewer
extends
Model
{
use
Notifiable
;
/**
* The database table used by the model.
*
* @var string
*/
protected
$table
=
'vw_viewer_profile_detail'
;
/**
* undocumented function
*
* @return void
* @author
**/
public
function
info
()
{
}
}
packages/portal/timesheet/src/ServiceProvider.php
View file @
3b2235dd
...
@@ -54,6 +54,10 @@ class ServiceProvider extends BaseServiceProvider
...
@@ -54,6 +54,10 @@ class ServiceProvider extends BaseServiceProvider
$dashboard
->
add
(
__
(
'Halaman Utama'
),
url
(
'/home/'
))
$dashboard
->
add
(
__
(
'Halaman Utama'
),
url
(
'/home/'
))
->
data
(
'icon'
,
'tachometer alternate icon'
)
->
data
(
'icon'
,
'tachometer alternate icon'
)
->
active
(
'home/*'
);
->
active
(
'home/*'
);
$dashboard
->
add
(
__
(
'vwviewer'
),
url
(
'/vwviewer/'
))
->
data
(
'icon'
,
'tachometer alternate icon'
)
->
active
(
'home/*'
);
// $dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar'))
// $dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar'))
// ->data('icon', 'calendar alternate outline')
// ->data('icon', 'calendar alternate outline')
// ->active('kalendar/*')
// ->active('kalendar/*')
...
@@ -76,6 +80,11 @@ class ServiceProvider extends BaseServiceProvider
...
@@ -76,6 +80,11 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'overheadForm/*'
)
->
active
(
'overheadForm/*'
)
->
data
(
'permission'
,
Permission
::
borang
);
->
data
(
'permission'
,
Permission
::
borang
);
$form
->
add
(
__
(
'Notes'
),
route
(
'timesheet::form.filterNotes'
))
->
data
(
'icon'
,
'circle outline'
)
->
active
(
'notelist/*'
)
->
data
(
'permission'
,
Permission
::
borang
);
$form
->
add
(
__
(
'Timesheet Viewer'
),
route
(
'timesheet::dashboard.filterViewer'
))
$form
->
add
(
__
(
'Timesheet Viewer'
),
route
(
'timesheet::dashboard.filterViewer'
))
->
data
(
'icon'
,
'eye icon'
)
->
data
(
'icon'
,
'eye icon'
)
->
active
(
'timesheetViewer/*'
)
->
active
(
'timesheetViewer/*'
)
...
...
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