Commit d9bc3526 by hannan

timesheet review page for hod

parent 279534e5
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Welcome Back</a>
<br>
<br>
<div class="column sixteen wide">
<div class="ui cards four doubling">
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Baru Hantar</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="american sign language interpreting icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Belum Hantar </h3>
</div>
<div class="extra content">
<span class="right floated"><i class="retweet icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
<div class="content">
<h3 class="header link">Timesheet Diluluskan</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="icon calendar check outline"></i>1</span>
</div>
</a>
</div>
</div>
<br>
<a class="ui teal left ribbon label">Timesheet Tracking</a>
<br>
<table class="ui unstackable celled table">
<thead>
<tr>
<th>Year</th>
<th>Month</th>
<th>Phase</th>
<th>Status</th>
<th>Action</th>
<th>Review Remark</th>
<th>Approval Remark</th>
</tr>
</thead>
<tbody>
@foreach($timesheet as $key => $value)
<tr>
<td>{{ $value->tm_year }}</td>
<td>{{ $value->tm_month }}</td>
<td>{{ $value->tm_phase }}</td>
<td>
@if($value->tm_timesheet_master_sts == 1) Draft
@elseif($value->tm_timesheet_master_sts == 2) Submitted
@elseif($value->tm_timesheet_master_sts == 3) Verified by HOD
@elseif($value->tm_timesheet_master_sts == 4) Approved by BOD
@elseif($value->tm_timesheet_master_sts == 5)
@elseif($value->tm_timesheet_master_sts == 6) Rejected by PM
@elseif($value->tm_timesheet_master_sts == 7) Rejected by HOD
@elseif($value->tm_timesheet_master_sts == 8) Rejected by BOD
@endif
</td>
<td>
@if($value->tm_timesheet_master_sts == 1) Submit after timesheet completion
@elseif($value->tm_timesheet_master_sts == 2) Need to verified by HOD
@elseif($value->tm_timesheet_master_sts == 3) Need to approved by BOD
@elseif($value->tm_timesheet_master_sts == 4)
@elseif($value->tm_timesheet_master_sts == 5)
@elseif($value->tm_timesheet_master_sts == 6) Revised the timesheet
@elseif($value->tm_timesheet_master_sts == 7) Revised the timesheet
@elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet
@endif
</td>
<td>{{ $value->tm_year }}</td>
<td>{{ $value->tm_year }}</td>
</tr>
@endforeach
</tbody>
</table>
<br>
</div>
@endsection
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::dashboard.reviewselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
......@@ -12,7 +12,7 @@
<h3 class="header link">Timesheet Baru Hantar</h3>
</div>
<div class="extra content">
<span class="right floated"><i class="american sign language interpreting icon"></i> 3</span>
<span class="right floated"><i class="american sign language interpreting icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
......@@ -20,7 +20,7 @@
<h3 class="header link">Timesheet Belum Hantar </h3>
</div>
<div class="extra content">
<span class="right floated"><i class="retweet icon"></i> 1</span>
<span class="right floated"><i class="retweet icon"></i>1</span>
</div>
</a>
<a href="/home" class="ui card">
......@@ -29,14 +29,65 @@
</div>
<div class="extra content">
<span class="right floated"><i class="icon calendar check outline"></i> 1</span>
<span class="right floated"><i class="icon calendar check outline"></i>1</span>
</div>
</a>
</div>
</div>
<br>
<a class="ui blue left ribbon label">Pengguna</a>
<a class="ui teal left ribbon label">Timesheet Status</a>
<br>
<table class="ui unstackable celled table">
<thead>
<tr>
<th>Year</th>
<th>Month</th>
<th>Phase</th>
<th>Status</th>
<th>Action</th>
<th>Review Remark</th>
<th>Approval Remark</th>
</tr>
</thead>
<tbody>
@foreach($timesheet as $key => $value)
<tr>
<td>{{ $value->tm_year }}</td>
<td>{{ $value->tm_month }}</td>
<td>{{ $value->tm_phase }}</td>
<td>
@if($value->tm_timesheet_master_sts == 1) Draft
@elseif($value->tm_timesheet_master_sts == 2) Submitted
@elseif($value->tm_timesheet_master_sts == 3) Verified by Project Manager
@elseif($value->tm_timesheet_master_sts == 4) Verified by HOD
@elseif($value->tm_timesheet_master_sts == 5) Approved by BOD
@elseif($value->tm_timesheet_master_sts == 6) Rejected by PM
@elseif($value->tm_timesheet_master_sts == 7) Rejected by HOD
@elseif($value->tm_timesheet_master_sts == 8) Rejected by BOD
@endif
</td>
<td>
@if($value->tm_timesheet_master_sts == 1) Submit after timesheet completion
@elseif($value->tm_timesheet_master_sts == 2) Need to verified by Project Manager
@elseif($value->tm_timesheet_master_sts == 3) Need to verified by HOD
@elseif($value->tm_timesheet_master_sts == 4) Need to approved by BOD
@elseif($value->tm_timesheet_master_sts == 5)
@elseif($value->tm_timesheet_master_sts == 6) Revised the timesheet
@elseif($value->tm_timesheet_master_sts == 7) Revised the timesheet
@elseif($value->tm_timesheet_master_sts == 8) Revised the timesheet
@endif
</td>
<td>{{ $value->tm_year }}</td>
<td>{{ $value->tm_year }}</td>
</tr>
@endforeach
</tbody>
</table>
<br>
</div>
@endsection
<!-- <a class="ui blue left ribbon label">Pengguna</a>
<br>
<br>
......@@ -51,8 +102,4 @@
])
->render()
!!}
<br>
</div>
@endsection
<br> -->
......@@ -6,6 +6,194 @@
<div class="ui blue left ribbon label">
Timesheet Review
</div>
<br>
<br>
<div class="ui styled fluid accordion">
<!-- {{ $checkts }} -->
@foreach($staffs 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">
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="3" style="width: 60%;"><i class="dropdown icon"></i>{{$staff->fullname}}</th>
<th style="width: 15%;" class="center aligned">Status</th>
<th class="right aligned">Approve | Reject | View</th>
</tr>
<tr>
<td style="width: 20%;">Chargeable: {{$chargeable}}</td>
<td style="width: 20%;">Nonchargeable: {{$nonchargeable}}</td>
<td style="width: 20%;">Overhead: {{$overhead}}</td>
<td style="width: 15%;">Overtime: {{$overtime}}</td>
<td class="right aligned">Total Hours/Days: {{$totalhrs." hours/ ".$totaldays." days"}}</td>
</tr>
</thead>
</table>
</div>
<?php
$cptype = "A";
$ncptype = "B";
$pcode = $pname = "";
$td = $checktd->where('tm_staff_id', $staff->staff_id);
$checkcpt = $cpt->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: 0px;">
<table class="ui unstackable celled table">
@if($checkcpt)
<tr>
<td style="width: 5%;" class="center aligned">{{ $cptype }}</td>
<td style="width: 15%;">{{ $pcode }}</td>
<td style="width: 20%;">{{ $pname }}</td>
<td style="width: 20%;">{{ $pm }}</td>
<td style="width: 7.5%;" class="center aligned">Hours</td>
<td style="width: 7.5%;" class="center aligned">Days</td>
<td style="width: 25%;" class="center aligned">Remarks</td>
</tr>
@endif
<tr>
<td style="width: 5%;" class="center aligned">B</td>
<td style="width: 15%;">Project Code</td>
<td style="width: 20%;">Project Name</td>
<td style="width: 20%;">Project Manager</td>
<td style="width: 7.5%;" class="center aligned">Hours</td>
<td style="width: 7.5%;" class="center aligned">Days</td>
<td style="width: 25%;" class="center aligned">Remarks</td>
</tr>
<tr>
<td style="width: 5%;" class="center aligned">C</td>
<td style="width: 15%;">Project Code</td>
<td style="width: 20%;">Project Name</td>
<td style="width: 20%;">Project Manager</td>
<td style="width: 7.5%;" class="center aligned">Hours</td>
<td style="width: 7.5%;" class="center aligned">Days</td>
<td style="width: 25%;" class="center aligned">Remarks</td>
</tr>
</table>
</div>
@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: 0px;">
<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>
@endsection
@push('script')
<script>
$('.ui.accordion').accordion();
</script>
<!-- <script>
$('.trigger.example .accordion')
.accordion({
selector: {
trigger: '.title .icon'
}
})
;
</script> -->
@endpush
\ No newline at end of file
......@@ -717,6 +717,11 @@
</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>
@else
<button type="button" class="ui disabled green button">Submit</button>
@endif
</div>
......
......@@ -34,7 +34,14 @@ input[type=number] {
<div class="default text">Task</div>
<div class="menu">
@foreach($nonchargeables as $key => $nonchargeable)
<div class="item" data-value="{{ $nonchargeable->id }}">{{ data_get($nonchargeable, 'p_project_description')}}</div>
<div class="item" data-value="{{ $nonchargeable->id }}">
@foreach($pcodes as $key => $value)
@if($value->p_project_description == $nonchargeable->p_project_description)
{{ $value->p_project_code }} -
@endif
@endforeach
{{ data_get($nonchargeable, 'p_project_description')}}
</div>
@endforeach
</div>
</div>
......
......@@ -28,7 +28,7 @@
<td>{{ data_get($project,'status') }} </td>
<td>
<button class="compact ui button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProjectTeam', ['id' => $project['id']]) }}';">Team</button>
<button class="compact ui button" onclick="window.location.href='JavaScript:void(0)';">Edit</button>
<button class="compact ui button" onclick="window.location.href='{{ route('timesheet::maintenance.updateProject', ['id' => $project['id']]) }}';">Edit</button>
</td>
</tr>
@endforeach
......
@extends('ui::layouts.app')
@section('content')
<div class="ui segment">
<a class="ui blue left ribbon label">Edit Project</a>
<br><br>
<form class="ui form" action="{{ route('timesheet::maintenance.editproject') }}" method="POST">
{{csrf_field()}}
<input type="hidden" name="staffid" value="staffid">
<div class="field">
<label>Project Code</label>
<input type="text" name="projectcode" value="{{$project->p_project_code}}" disabled="disabled">
</div>
<div class="field">
<label>Project Name</label>
<input type="text" name="projectname" value="{{$project->p_project_description}}" disabled="disabled">
</div>
<div class="field">
<label>Project Manager</label>
<select name="projectmanager" class="ui fluid dropdown">
<option value="{{$project->p_project_task_team}}">
@foreach($pm as $key => $value)
@if($value->staff_id == $project->p_project_task_team){{$value->fullname}}@endif
@endforeach
</option>
@foreach($pm as $key => $value)
<option value="{{$value->staff_id}}">{{$value->fullname}}</option>
@endforeach
</select>
</div>
<div class="field">
<label>Project Status</label>
<select name="status" class="ui fluid dropdown">
<option value="1">Active</option>
<option value="0">Inactive</option>
</select>
</div>
<button class="ui blue button" type="submit">Submit</button>
<button class="ui green button" type="button" onclick="window.location.href='{{ route('timesheet::maintenance.senaraiProject') }} ';">Back</button>
</form>
</div>
@endsection
\ No newline at end of file
......@@ -17,13 +17,18 @@ Route::group(
Route::get('timesheetReport',['uses' => 'DashboardController@timesheetReport', 'as' => 'dashboard.timesheetReport']);
Route::get('timesheetReview',['uses' => 'DashboardController@timesheetReview', 'as' => 'dashboard.timesheetReview']);
Route::get('timesheetViewer',['uses' => 'DashboardController@timesheetViewer', 'as' => 'dashboard.timesheetViewer']);
Route::get('filterReview',['uses' => 'DashboardController@filterReview', 'as' => 'dashboard.filterReview']);
Route::get('filterViewer',['uses' => 'DashboardController@filterViewer', 'as' => 'dashboard.filterViewer']);
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']);
//maintenance
Route::get('senaraiProject',['uses' => 'MaintenanceController@senaraiProject', 'as' => 'maintenance.senaraiProject']);
Route::get('penambahanProject',['uses' => 'MaintenanceController@penambahanProject', 'as' => 'maintenance.penambahanProject']);
Route::post('addnewproject',['uses' => 'MaintenanceController@addnewproject', 'as' => 'maintenance.addnewproject']);
Route::get('updateProject',['uses' => 'MaintenanceController@updateProject', 'as' => 'maintenance.updateProject']);
Route::post('editproject',['uses' => 'MaintenanceController@editproject', 'as' => 'maintenance.editproject']);
Route::get('senaraiProjectTeam',['uses' => 'MaintenanceController@senaraiProjectTeam', 'as' => 'maintenance.senaraiProjectTeam']);
Route::get('penambahanProjectTeam',['uses' => 'MaintenanceController@penambahanProjectTeam', 'as' => 'maintenance.penambahanProjectTeam']);
......
......@@ -49,6 +49,16 @@ class DashboardController extends Controller
}
if (($roleid == '2' ) OR ($roleid == '5' )) {
$staffid = users::find(Auth::id())
->u_staffID;
$timesheet = Ts_master::where('tm_staff_id', $staffid)
->orderby('tm_year')
->orderby('tm_month', 'DESC')
->orderby('tm_phase', 'DESC')
->get();
// dd($timesheet);
$user = Users::where('name', 'like', '%'.$keyword.'%')
->orWhere(
function ($query) use ($keyword) {
......@@ -56,7 +66,7 @@ class DashboardController extends Controller
}
)->paginate(15);
return view('timesheet::dashboard.staff',compact('user'));
return view('timesheet::dashboard.dashboardstaff',compact('user', 'timesheet'));
}if ($roleid == '3') {
......@@ -85,11 +95,31 @@ class DashboardController extends Controller
return view('timesheet::dashboard.filterViewer', compact('month', 'curryear', 'currmonth'));
}
public function filterReview()
{
$currmonth = date('n');
// $currmonth = 1;
$curryear = date('Y');
$month = [];
for ($m=1; $m<=12; $m++) {
$month[] = date('F', mktime(0,0,0,$m, 1, date('Y')));
}
return view('timesheet::dashboard.filterReview', compact('month', 'curryear', 'currmonth'));
}
public function viewerselectmonthphase(Request $request){
return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function reviewselectmonthphase(Request $request){
return redirect()->route('timesheet::dashboard.timesheetReview', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function timesheetApproval()
{
return view('timesheet::dashboard.timesheetApproval');
......@@ -100,9 +130,53 @@ class DashboardController extends Controller
return view('timesheet::dashboard.timesheetReport');
}
public function timesheetReview()
public function timesheetReview(Request $request)
{
return view('timesheet::dashboard.timesheetReview');
// dd($request);
$curryear = date('Y');
if ($request->year) {
$curryear = $request->year;
}
$hod = Users::find(Auth::id());
// dd($hod->id);
$staffs = Staff_info::where('penyokong', $hod->id)
->get();
$checkts = Ts_master::where('tm_timesheet_master_sts', 2)
->where('tm_year', $curryear)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->get();
$checktd = Ts_detail::where('tm_year', $curryear)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->where('td_hours', "<>", 0)
->orwhereNotNull('td_overhead_note')
->get();
$cpt = Pteam::where('pt_project_type', 1)
->get();
$ncpt = Pteam::where('pt_project_type', 2)
->get();
$cp = Project::where('p_project_sts', 1)
->where('p_project_type', 1)
->get();
$ncp = Project::where('p_project_sts', 1)
->where('p_project_type', 2)
->get();
$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'));
}
public function timesheetViewer(Request $request)
......@@ -220,14 +294,13 @@ class DashboardController extends Controller
$overheadhour = Ts_detail::where('fk_tm_id',$check->id)
->where('td_project_type', $overhead)
->where('td_hours', '!=', 0)
// ->where('td_hours', '!=', 0)
->get();
$tempOverhead = [];
// dd($tempOverhead);
$tempOverheadid = [];
$tempOverhead[0] = "";
$tempOverheadid[0] = 0;
if(isset($overheadhour))
if(isset($overheadhour[0]))
{
// dd('sini ke?');
$tempOverhead[0] = $overheadhour[0]->td_overhead_desc;
......@@ -273,9 +346,7 @@ class DashboardController extends Controller
->orderby('td_date')
->get();
}
else
{
$chargehour = null;
$nonchargehour = null;
......@@ -284,13 +355,24 @@ class DashboardController extends Controller
$totalnonchargehrs = null;
$totaloverheadhrs = null;
$notes = null;
$check = null;
}
// dd($check);
// 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'));
}
public function tsubmit(Request $request)
{
$submit = 2;
$ts = Ts_master::where('id', $request->tid)
->update([ 'tm_timesheet_master_sts' => 2 ]);
$td = Ts_detail::where('fk_tm_id', $request->tid)
->update([ 'td_timesheet_sts' => 2 ]);
return redirect()->route('timesheet::dashboard.index')->withSuccess('Timesheet has been submitted!');
}
}
\ No newline at end of file
......@@ -117,10 +117,7 @@ class FormController extends Controller
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
......@@ -184,6 +181,7 @@ class FormController extends Controller
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$chcek->tm_timesheet_master_sts = 1;
$check->updated_by = $userId;
$check->save();
}
......@@ -262,6 +260,8 @@ class FormController extends Controller
public function nonChargeableForm(Request $request)
{
// dd($request);
$nonchargeable = 2;
$userId = users::find(Auth::id())
......@@ -270,6 +270,12 @@ class FormController extends Controller
$nonchargeables = Project::where('p_project_type', $nonchargeable)
->get();
$pcodes = Project::select('p_project_code', 'p_project_description')
->whereNotNull('p_project_code')
->get();
// dd($pcode);
$project = Pteam::where('pt_staff_id',$userId)
->where('pt_project_type', $nonchargeable)
->get();
......@@ -347,7 +353,7 @@ class FormController extends Controller
$fk_tm_id = null;
}
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','hour','nonchargeables','strdays', 'fk_tm_id'));
return view('timesheet::form.nonChargeableForm', compact('projectlist','userId','month','phase','daymonth','year','hour','nonchargeables','strdays', 'fk_tm_id', 'pcodes'));
}
public function addnonchargeabletask(Request $request)
......@@ -462,7 +468,7 @@ class FormController extends Controller
}
return redirect()->route('timesheet::form.nonChargeableForm')->withSuccess('Successfully Added New Task');
return redirect()->route('timesheet::form.nonChargeableForm', compact('month', 'year', 'phase'))->withSuccess('Successfully Added New Task');
}
public function savenonchargeablehours(Request $request)
......@@ -498,6 +504,7 @@ class FormController extends Controller
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->tm_timesheet_master_sts = 1;
$check->updated_by = $userId;
$check->save();
}
......@@ -535,6 +542,7 @@ class FormController extends Controller
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->td_timesheet_sts = 1;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
......@@ -557,6 +565,7 @@ class FormController extends Controller
$tmdetail->td_project_name = $project->p_project_description;
$tmdetail->td_hours = $valuehour;
$tmdetail->td_timesheet_sts = 1;
$tmdetail->updated_by = $userId;
$tmdetail->save();
......@@ -700,6 +709,7 @@ class FormController extends Controller
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->tm_timesheet_master_sts = 1;
$check->updated_by = $userId;
// $check ->tm_chargeable_hrs = ;
......@@ -739,6 +749,7 @@ class FormController extends Controller
//update hours to null
$checkTimesheetDetail->td_hours = $valuehour;
$checkTimesheetDetail->td_timesheet_sts = 1;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
......@@ -755,6 +766,7 @@ class FormController extends Controller
$tmdetail->tm_year = $check->tm_year;
$tmdetail->tm_phase = $check->tm_phase;
$tmdetail->td_project_type = $overhead;
$tmdetail->td_timesheet_sts= 1;
$tmdetail->updated_by = $userId;
$project = Overhead::where('id', $projectid)
......@@ -762,6 +774,7 @@ class FormController extends Controller
$tmdetail->td_overhead_desc = $project->o_overhead_desc;
$tmdetail->td_hours = $valuehour;
$tmdetail->td_timesheet_sts = 1;
$tmdetail->save();
//error kat sini -> done : typo nama column td_overhead_description
......@@ -816,6 +829,7 @@ class FormController extends Controller
$check->tm_year = $request->year;
$check->tm_month = $request->month;
$check->tm_phase = $request->phase;
$check->tm_timesheet_master_sts = 1;
$check->updated_by = $userId;
$check->save();
......@@ -834,6 +848,7 @@ class FormController extends Controller
if($checkTimesheetDetail){
$checkTimesheetDetail->td_overhead_note = $request->description;
$checkTimesheetDetail->td_timesheet_sts = 1;
$checkTimesheetDetail->updated_by = $userId;
$checkTimesheetDetail->update();
......@@ -853,6 +868,7 @@ class FormController extends Controller
$data->updated_by = $userId;
$data->td_overhead_note = $request->description;
$data->td_overhead_desc = $request->task;
$date->td_timesheet_sts = 1;
$data->save();
}
......@@ -957,6 +973,7 @@ class FormController extends Controller
$data->fk_o_id = $request->task;
$data->td_overhead_desc = "OTHERS";
$data->td_overhead_note = $request->description;
$date->td_timesheet_sts = 1;
$data->save();
}
......@@ -970,6 +987,7 @@ class FormController extends Controller
->first();
$data->td_overhead_note = $request->description;
$data->td_timesheet_sts = 1;
$data->update();
}
......
......@@ -134,6 +134,28 @@ class MaintenanceController extends Controller
->with('success', 'New Project Added');
}
public function updateProject(Request $request){
$staffid = Users::find(Auth::id())
->u_staffID;
$project = Project::where('id', $request->id)
->first();
$pms = 4;
$pm = Staff_info::where('flag_pm', 1)
->where('status', 1)
->get();
// dd($project);
return view('timesheet::maintenance.updateProject',compact('pm', 'project', 'staffid'));
}
public function editproject(Request $request){
dd($request);
return redirect()->route('timesheet::maintenance.senaraiProject')->withSuccess('Project updated!');
}
public function senaraiProjectTeam(Request $request)
{
// dd($request);
......
......@@ -80,7 +80,7 @@ class ServiceProvider extends BaseServiceProvider
->data('icon', 'eye icon')
->active('timesheetViewer/*')
->data('permission', Permission::tsviewer);
$form->add(__('Timesheet Review'))
$form->add(__('Timesheet Review'), route('timesheet::dashboard.filterReview'))
->data('icon', 'file alternate icon')
->active('timesheetReview/*')
->data('permission', Permission::kehadiran);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment