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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
412 additions
and
97 deletions
+412
-97
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
+0
-0
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
+76
-19
packages/portal/timesheet/src/Http/Controllers/FormController.php
+0
-0
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 @@
<th>Phase</th>
<th>Status</th>
<th>Action</th>
<th>Review Remark</th>
<th>Approval Remark</th>
<th>Submission Date</th>
<th>Verified Date</th>
<th>Approval Date</th>
</tr>
</thead>
<tbody>
...
...
@@ -77,8 +78,9 @@
@elseif(
$value->tm_timesheet_master_sts
== 8) Revised the timesheet
@endif
</td>
<td>{{
$value->tm_year
}}</td>
<td>{{
$value->tm_year
}}</td>
<td>{{
$value->tm_submission_at
}}</td>
<td>{{
$value->tm_verified_at
}}</td>
<td>{{
$value->tm_approval_at
}}</td>
</tr>
@endforeach
</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
This diff is collapsed.
Click to expand it.
packages/portal/timesheet/resources/views/dashboard/timesheetViewer.blade.php
View file @
3b2235dd
...
...
@@ -18,20 +18,20 @@
</td>
<td>Name</td>
<td>:</td>
<td>{{
$
user->fullname
}}</td>
<td>{{
$
profile->STAFF_NAME
}}</td>
<td rowspan="
3
"></td>
<td>Department</td>
<td>:</td>
<td>{{
$
dept->description
}}</td>
<td>{{
$
profile->DEPARTMENT
}}</td>
<td rowspan="
3
"></td>
</tr>
<tr>
<td>Staff No</td>
<td>:</td>
<td>{{
$
user->staff_id
}}</td>
<td>{{
$
profile->STAFF_ID
}}</td>
<td>Reporting Manager</td>
<td>:</td>
<td>{{
$
hod
}}</td>
<td>{{
$
profile->HOD_NAME
}}</td>
</tr>
<tr>
<td>Month</td>
...
...
@@ -714,11 +714,47 @@
</table>
</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>
<br>
<button type="
button
" class="
ui
primary
button
" onclick="
printdiv
(
'print_div'
)
">Print</button>
@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
<button type="
button
" class="
ui
disabled
green
button
">Submit</button>
@endif
...
...
@@ -729,57 +765,6 @@
@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
">
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 @@
</tr>
@endforeach
</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>
<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>
Back
</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>
@endsection
packages/portal/timesheet/routes/web.php
View file @
3b2235dd
...
...
@@ -12,6 +12,7 @@ Route::group(
//dashboard
Route
::
get
(
'home'
,[
'uses'
=>
'DashboardController@index'
,
'as'
=>
'dashboard.index'
]);
Route
::
get
(
'vwviewer'
,[
'uses'
=>
'DashboardController@vwviewer'
,
'as'
=>
'dashboard.vwviewer'
]);
//timesheet
Route
::
get
(
'timesheetApproval'
,[
'uses'
=>
'DashboardController@timesheetApproval'
,
'as'
=>
'dashboard.timesheetApproval'
]);
Route
::
get
(
'timesheetReport'
,[
'uses'
=>
'DashboardController@timesheetReport'
,
'as'
=>
'dashboard.timesheetReport'
]);
...
...
@@ -22,6 +23,8 @@ Route::group(
Route
::
post
(
'reviewselectmonthphase'
,
[
'uses'
=>
'DashboardController@reviewselectmonthphase'
,
'as'
=>
'dashboard.reviewselectmonthphase'
]);
Route
::
post
(
'viewerselectmonthphase'
,
[
'uses'
=>
'DashboardController@viewerselectmonthphase'
,
'as'
=>
'dashboard.viewerselectmonthphase'
]);
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
Route
::
get
(
'senaraiProject'
,[
'uses'
=>
'MaintenanceController@senaraiProject'
,
'as'
=>
'maintenance.senaraiProject'
]);
...
...
@@ -60,9 +63,11 @@ Route::group(
Route
::
get
(
'filterChargeable'
,[
'uses'
=>
'FormController@filterChargeable'
,
'as'
=>
'form.filterChargeable'
]);
Route
::
get
(
'filterNonChargeable'
,[
'uses'
=>
'FormController@filterNonChargeable'
,
'as'
=>
'form.filterNonChargeable'
]);
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
(
'nonchargeableselectmonthphase'
,
[
'uses'
=>
'FormController@nonchargeableselectmonthphase'
,
'as'
=>
'form.nonchargeableselectmonthphase'
]);
Route
::
post
(
'overheadselectmonthphase'
,
[
'uses'
=>
'FormController@overheadselectmonthphase'
,
'as'
=>
'form.overheadselectmonthphase'
]);
Route
::
post
(
'noteselectmonthphase'
,
[
'uses'
=>
'FormController@noteselectmonthphase'
,
'as'
=>
'form.noteselectmonthphase'
]);
// nonChargeableForm
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;
use
Portal\Timesheet\Model\Staff_info
;
use
Portal\Timesheet\Model\Overhead
;
use
Portal\Timesheet\Model\Role
;
use
Portal\Timesheet\Model\VwViewer
;
use
Portal\Timesheet\Model\VwReviewProfile
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Input
;
use
File
;
...
...
@@ -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
()
{
$currmonth
=
date
(
'n'
);
...
...
@@ -132,15 +140,16 @@ class DashboardController extends Controller
public
function
timesheetReview
(
Request
$request
)
{
// dd($request);
$curryear
=
date
(
'Y'
);
if
(
$request
->
year
)
{
$curryear
=
$request
->
year
;
}
$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
)
->
get
();
...
...
@@ -149,7 +158,7 @@ class DashboardController extends Controller
->
where
(
'tm_year'
,
$curryear
)
->
where
(
'tm_month'
,
$request
->
month
)
->
where
(
'tm_phase'
,
$request
->
phase
)
->
get
()
;
->
get
()
;
$checktd
=
Ts_detail
::
where
(
'tm_year'
,
$curryear
)
->
where
(
'tm_month'
,
$request
->
month
)
...
...
@@ -174,9 +183,50 @@ class DashboardController extends Controller
$pmname
=
Staff_info
::
where
(
'fk_lkp_department'
,
4
)
->
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
)
...
...
@@ -184,25 +234,24 @@ class DashboardController extends Controller
$user
=
Staff_info
::
where
(
'fk_users'
,
Auth
::
id
())
->
first
();
$profile
=
VwViewer
::
where
(
'STAFF_ID'
,
$user
->
staff_id
)
->
orderby
(
'DEPARTMENT'
,
'DESC'
)
->
first
();
$dept
=
Department
::
where
(
'id'
,
$user
->
fk_lkp_department
)
->
first
();
$hod
=
Staff_info
::
find
(
$user
->
penyokong
)
->
fullname
;
// $month = date('n');
$year
=
date
(
'Y'
);
// $day = date('j');
$penyokong
=
Staff_info
::
where
(
'penyokong'
,
0
)
->
get
();
// $month = 7;
// $year = 2022;
// $day = 2
;
$bod
=
Staff_info
::
select
(
'id'
,
'fullname'
)
->
whereIn
(
'id'
,
[
45
,
46
,
47
,
48
])
->
get
()
;
// if ($day < 16) {
// $phase = 1;
// } else {
// $phase = 2;
// }
$year
=
date
(
'Y'
);
if
(
isset
(
$request
->
phase
))
{
...
...
@@ -359,15 +408,23 @@ class DashboardController extends Controller
}
// 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
)
{
$today
=
Carbon
::
today
()
->
toDateString
();
$submit
=
2
;
$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
)
->
update
([
'td_timesheet_sts'
=>
2
]);
...
...
packages/portal/timesheet/src/Http/Controllers/FormController.php
View file @
3b2235dd
This diff is collapsed.
Click to expand it.
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
$dashboard
->
add
(
__
(
'Halaman Utama'
),
url
(
'/home/'
))
->
data
(
'icon'
,
'tachometer alternate icon'
)
->
active
(
'home/*'
);
$dashboard
->
add
(
__
(
'vwviewer'
),
url
(
'/vwviewer/'
))
->
data
(
'icon'
,
'tachometer alternate icon'
)
->
active
(
'home/*'
);
// $dashboard->add(__('Timesheet Calendar'), route('timesheet::kalendar.kalendar'))
// ->data('icon', 'calendar alternate outline')
// ->active('kalendar/*')
...
...
@@ -76,6 +80,11 @@ class ServiceProvider extends BaseServiceProvider
->
active
(
'overheadForm/*'
)
->
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'
))
->
data
(
'icon'
,
'eye icon'
)
->
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