Commit fb3e31f7 by hannan

completion of verify and approval from penyokong and pelulus

parent b2733f9f
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTimesheetMaster extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_master', function (Blueprint $table) {
$table->string('hod_remarks',50)->after('tm_timesheet_master_sts')->nullable();
$table->string('bod_remarks',50)->after('hod_remarks')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_master', function (Blueprint $table) {
$table->dropColumn('hod_remarks');
$table->dropColumn('bod_remarks');
});
}
}
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddRejectionColumnInTimesheetMaster extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('timesheet_master', function (Blueprint $table) {
$table->date('hod_rejected_at')->after('tm_approved_at')->nullable();
$table->date('bod_dissaproved_at')->after('hod_rejected_at')->nullable();
$table->date('hr_rejected_at')->after('bod_dissaproved_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('timesheet_master', function (Blueprint $table) {
$table->dropColumn('hod_rejected_at');
$table->dropColumn('bod_dissaproved_at');
$table->dropColumn('hr_rejected_at');
});
}
}
@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.approval') }}" method="POST" class="ui form">
{{csrf_field()}}
<input type="hidden" name="tmid" value="{{ data_get($profile,'tmid') }}">
<div class="six wide field">
<label>Staff Name</label>
<input type="text" readonly="readonly" value="{{ data_get($profile,'fullname') }}">
</div>
<div class="three fields">
<div class="two wide field">
<label>Year</label>
<input type="text" readonly="readonly" value="{{ data_get($profile,'tm_year') }}">
</div>
<div class="two wide field">
<label>Month</label>
<input type="text" readonly="readonly" value="{{ data_get($profile,'tm_month') }}">
</div>
<div class="two wide field">
<label>Phase</label>
<input type="text" readonly="readonly" value="{{ data_get($profile,'tm_phase') }}">
</div>
</div>
<div class="two fields">
<div class="six wide field">
<input type="hidden" name="approval" value="{{ data_get($bod,'id') }}">
<label>Pelulus</label>
<input type="text" readonly="readonly" value="{{ data_get($bod,'name') }}">
</div>
<div class="three wide field">
<label>Action</label>
<select class="ui fluid dropdown" name="action">
<option value="1">Approval</option>
<option value="2">Reject</option>
</select>
</div>
</div>
<div class="field">
<label>Remarks</label>
<textarea name="remarks"></textarea>
</div>
<button class="ui green button" type="submit">Submit</button>
</form>
</div>
@endsection
\ No newline at end of file
......@@ -59,28 +59,26 @@
<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 == 3) Verified by HOD/HOU
@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
@elseif($value->tm_timesheet_master_sts == 5) Dissaproved by BOD
@elseif($value->tm_timesheet_master_sts == 6) Rejected by HOD/HOU
@elseif($value->tm_timesheet_master_sts == 7) 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 == 4) Successfully received by HR
@elseif($value->tm_timesheet_master_sts == 5) Revised the timesheet
@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
@elseif($value->tm_timesheet_master_sts == 7) Revised the timesheet
@endif
</td>
<td>{{ data_get($value,'tm_submission_at') }}</td>
<td>{{ data_get($value,'tm_verified_at') }}</td>
<td>{{ data_get($value,'tm_approval_at') }}</td>
<td>{{ data_get($value,'tm_approved_at') }}</td>
</tr>
@endforeach
</tbody>
......
@extends('timesheet::layouts.filtermonthphase')
@section('action')
<form class="ui form" action="{{ route('timesheet::dashboard.approvalselectmonthphase') }}" method="POST">
@endsection
\ No newline at end of file
......@@ -39,7 +39,7 @@
<div class="three wide field">
<label>Action</label>
<select class="ui fluid dropdown" name="action">
<option value="1">Approve</option>
<option value="1">Verify</option>
<option value="2">Reject</option>
</select>
</div>
......
......@@ -6,6 +6,202 @@
<div class="ui blue left ribbon label">
Timesheet Approval
</div>
<br>
<br>
<div class="ui styled fluid accordion">
@foreach($profile as $key => $staff)
<div class="title">
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="3" style="width: 60%;"><i class="dropdown icon"></i>{{ data_get($staff,'fullname') }}</th>
<th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($staff->status == 4) <i class="green check icon"></i>Verified by BOD
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@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.approvalaction', [ '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" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => $phase, 'month' => $month, 'year' => $year]) }}';" target='_blank'>View</button>
</th>
</tr>
<tr>
<td style="width: 20%;">Chargeable (A) : {{ data_get($staff,'chargeable') }}</td>
<td style="width: 20%;">Nonchargeable (B) : {{ data_get($staff,'nonchargeable') }}</td>
<td style="width: 20%;">Overhead (C) : {{ data_get($staff,'overhead') }}</td>
<td style="width: 15%;">Overtime: {{ data_get($staff,'overtime') }}</td>
<td class="right aligned">Total Hours/Days: {{ data_get($staff,'totalhrs')." hours/ ".data_get($staff,'totaldays')." days" }}</td>
</tr>
</thead>
</table>
</div>
<?php
$cptype = "A";
$ncptype = "B";
$otype = "C";
$td = $checktd->where('tm_staff_id', $staff->staff_id);
$detail = $details->where('staffid', $staff->staff_id);
$ts = $checkts->where('tm_staff_id', $staff->staff_id);
?>
<div class="content" style="padding-top: 0px;">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 6%;" class="center aligned">Type</th>
<th style="width: 17%;">Project Code</th>
<th style="width: 26%;">Project Name</th>
<th style="width: 26%;">Project Manager</th>
<th style="width: 12.5%;" class="center aligned">Total Hours</th>
<th style="width: 12.5%;" class="center aligned">Total Days</th>
</tr>
</thead>
@if($detail->where('ptype', 1))
@foreach($detail->where('ptype', 1) as $key => $chargeable)
<tr>
<td style="width: 6%;" class="center aligned">{{ $cptype }}</td>
<td style="width: 17%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
</tr>
@endforeach
@endif
@if($detail->where('ptype', 2))
@foreach($detail->where('ptype', 2) as $key => $nonchargeable)
<tr>
<td style="width: 6%;" class="center aligned">{{ $ncptype }}</td>
<td style="width: 17%;">{{ data_get($nonchargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours')/8 }}</td>
</tr>
@endforeach
@endif
@if($detail->where('ptype', 3))
@foreach($detail->where('ptype', 3) as $key => $chargeable)
<tr>
<td style="width: 6%;" class="center aligned">{{ $otype }}</td>
<td style="width: 17%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</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">{{ data_get($value,'td_date') }}</td>
<td>{{ data_get($value,'td_overhead_note') }}</td>
</tr>
@endif
@endforeach
@endif
</table>
@foreach ($ts as $key => $value)
@if(data_get($value,'attachement'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>
<a href="{{ asset(data_get($value,'attachement.path'))}}" target="_blank">
<button class="ui active button">
<i class="download icon"></i>
Download
</button>
</a>
</td>
</tr>
</tbody>
</table>
@endif
@endforeach
@if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="center aligned">Date</th>
<th class="center aligned">Verifier</th>
<th class="center aligned">Remarks by Verifier</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 15%;">{{ data_get($staff,'verified_at') }}</td>
<td style="width: 25%;">{{ data_get($staff,'hodname') }}</td>
<td style="width: 60%;">{{ data_get($staff,'hodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
@if(data_get($staff,'bodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th class="center aligned">Date</th>
<th class="center aligned">Approver</th>
<th class="center aligned">Remarks by Approver</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 15%;" class="center aligned">{{ data_get($staff,'approved_at') }}</td>
<td style="width: 25%;" class="center aligned">{{ data_get($staff,'bodname') }}</td>
<td style="width: 60%;" class="center aligned">{{ data_get($staff,'bodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
</div>
@endforeach
</div>
</div>
@endsection
\ No newline at end of file
@endsection
@push('script')
<script>
$('.ui.accordion').accordion();
</script>
@endpush
\ No newline at end of file
......@@ -21,17 +21,20 @@
<th style="width: 15%;" class="center aligned">
@if($staff->status == 1 || $staff->status == null) In Preparation
@elseif($staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 3) <i class="green check icon"></i> Verified by HOD
@elseif($staff->status == 4) Verified by BOD
@elseif($staff->status == 3) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($staff->status == 4) <i class="green check icon"></i>Verified by BOD
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@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>
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.revaction', [ 'tmid'=>$staff->tmid ]) }}';">Verify | Reject</button>
@else
<button class="center aligned ui green icon button disabled">Approve | Reject</button>
<!-- <button class="center aligned ui green icon button disabled">Approve | Reject</button> -->
@endif
<button class="center aligned ui blue icon button">View</button>
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => $phase, 'month' => $month, 'year' => $year]) }}';" target='_blank'>View</button>
</th>
</tr>
<tr>
......@@ -51,57 +54,55 @@
$otype = "C";
$td = $checktd->where('tm_staff_id', $staff->staff_id);
$detail = $details->where('staffid', $staff->staff_id);
?>
$ts = $checkts->where('tm_staff_id', $staff->staff_id);
// dump($ts);
?>
<div class="content" style="padding-top: 0px;">
<table class="ui unstackable celled table">
<thead>
<tr>
<th style="width: 5%;" class="center aligned">Type</th>
<th style="width: 15%;">Project Code</th>
<th style="width: 20%;">Project Name</th>
<th style="width: 20%;">Project Manager</th>
<th style="width: 7.5%;" class="center aligned">Total Hours</th>
<th style="width: 7.5%;" class="center aligned">Total Days</th>
<th style="width: 25%;" class="center aligned">Remarks</th>
<th style="width: 6%;" class="center aligned">Type</th>
<th style="width: 17%;">Project Code</th>
<th style="width: 26%;">Project Name</th>
<th style="width: 26%;">Project Manager</th>
<th style="width: 12.5%;" class="center aligned">Total Hours</th>
<th style="width: 12.5%;" class="center aligned">Total Days</th>
</tr>
</thead>
@if($detail->where('ptype', 1))
@foreach($detail->where('ptype', 1) as $key => $chargeable)
<tr>
<td style="width: 5%;" class="center aligned">{{ $cptype }}</td>
<td style="width: 15%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 20%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 20%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
<td style="width: 25%;" class="center aligned"></td>
<td style="width: 6%;" class="center aligned">{{ $cptype }}</td>
<td style="width: 17%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
</tr>
@endforeach
@endif
@if($detail->where('ptype', 2))
@foreach($detail->where('ptype', 2) as $key => $nonchargeable)
<tr>
<td style="width: 5%;" class="center aligned">{{ $ncptype }}</td>
<td style="width: 15%;">{{ data_get($nonchargeable, 'pcode') }}</td>
<td style="width: 20%;">{{ data_get($nonchargeable, 'pname') }}</td>
<td style="width: 20%;">{{ data_get($nonchargeable, 'pmname') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours')/8 }}</td>
<td style="width: 25%;" class="center aligned"></td>
<td style="width: 6%;" class="center aligned">{{ $ncptype }}</td>
<td style="width: 17%;">{{ data_get($nonchargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($nonchargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($nonchargeable, 'hours')/8 }}</td>
</tr>
@endforeach
@endif
@if($detail->where('ptype', 3))
@foreach($detail->where('ptype', 3) as $key => $chargeable)
<tr>
<td style="width: 5%;" class="center aligned">{{ $otype }}</td>
<td style="width: 15%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 20%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 20%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 7.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
<td style="width: 25%;" class="center aligned"></td>
<td style="width: 6%;" class="center aligned">{{ $otype }}</td>
<td style="width: 17%;">{{ data_get($chargeable, 'pcode') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pname') }}</td>
<td style="width: 26%;">{{ data_get($chargeable, 'pmname') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours') }}</td>
<td style="width: 12.5%;" class="center aligned">{{ data_get($chargeable, 'hours')/8 }}</td>
</tr>
@endforeach
@endif
......@@ -125,6 +126,51 @@
@endforeach
@endif
</table>
@foreach ($ts as $key => $value)
@if(data_get($value,'attachement'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>
<a href="{{ asset(data_get($value,'attachement.path'))}}" target="_blank">
<button class="ui active button">
<i class="download icon"></i>
Download
</button>
</a>
</td>
</tr>
</tbody>
</table>
@endif
@endforeach
@if(data_get($staff,'hodremarks'))
<table class="ui unstackable celled table">
<thead>
<tr>
<th colspan="2" class="center aligned">Remarks</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 4%;"></td>
<td>{{ data_get($staff,'hodremarks') }}</td>
</tr>
</tbody>
</table>
@endif
</div>
@endforeach
</div>
......
......@@ -527,12 +527,12 @@
<table id="printtable5" class="ui celled structured table unstackable">
<thead>
<tr>
<th colspan="2" class="center aligned">Notes Attachment</th>
<th colspan="2" class="center aligned">Attachment</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 13.5%;">Notes Attachement</td>
<td style="width: 4%;"></td>
<td>
<a href="{{ asset(data_get($check,'attachement.path'))}}" target="_blank">
......@@ -551,11 +551,6 @@
<div class="ui segment">
<table id="printtabl6" class="ui celled structured table unstackable">
<!-- <thead>
<th colspan="@if($phase == 1) 17 @else {{$daymonth-13}} @endif"></th>
<th>Total hours</th>
<th>Total days</th>
</thead> -->
<tbody>
<tr>
<td style="width: 4%;"></td>
......@@ -765,12 +760,21 @@
<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, 'totalot'=> $totalot, 'totalchargehrs'=>$totalchargehrs, 'totalnonchargehrs'=> $totalnonchargehrs, 'totaloverheadhrs'=>$totaloverheadhrs ]) }}';">Submit</button>
@if($curruser->id == $user->penyokong)
<button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetReview',[ 'phase' => $phase, 'month' => $month ]) }}';">Back</button>
@elseif($curruser->id == $user->pelulus)
<button type="button" class="ui green button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetApproval',[ 'phase' => $phase, 'month' => $month ]) }}';">Back</button>
@else
<button type="button" class="ui disabled green button">Submit</button>
@endif
@if($check != null)
<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
@endif
<button type="button" class="ui primary button" onclick="printdiv('print_div')">Print</button>
</div>
......
......@@ -16,7 +16,6 @@
<div class="field">
<label>Title</label>
<input type="file" name="attachment" id="uploadfile" style="">
</div>
<button class="ui blue button" type="submit">Upload</button>
</form>
......@@ -25,17 +24,13 @@
<div class="ui unstackable segment">
<a class="ui blue left ribbon label">Senarai Notes</a>
kalau user dept bdd, display upload files.
<!-- <form action="">
<label for="uploadfile" class="ui right floated small purple labeled icon button">
<i class="plus icon"></i>Upload Attachment
</label>
<input type="file" name="attachment" id="uploadfile" style="display: none;">
</form> -->
@if(data_get($staff,'fk_lkp_department') == 7)
<button class="ui right floated small purple labeled icon button" id="uploadmodal">
<i class="file icon"></i>
Upload File
</button>
@endif
<a href="{{ route('timesheet::form.penambahannote') }}" class="ui right floated small yellow labeled icon button">
<i class="plus icon"></i>Add New Notes
......
......@@ -20,11 +20,15 @@ Route::group(
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::get('filterApproval',['uses' => 'DashboardController@filterApproval', 'as' => 'dashboard.filterApproval']);
Route::post('reviewselectmonthphase', ['uses' => 'DashboardController@reviewselectmonthphase', 'as' => 'dashboard.reviewselectmonthphase']);
Route::post('viewerselectmonthphase', ['uses' => 'DashboardController@viewerselectmonthphase', 'as' => 'dashboard.viewerselectmonthphase']);
Route::post('approvalselectmonthphase', ['uses' => 'DashboardController@approvalselectmonthphase', 'as' => 'dashboard.approvalselectmonthphase']);
Route::get('tsubmit', ['uses' => 'DashboardController@tsubmit', 'as' => 'dashboard.tsubmit']);
Route::get('revaction', ['uses' => 'DashboardController@revaction', 'as' => 'dashboard.revaction']);
Route::get('approvalaction', ['uses' => 'DashboardController@approvalaction', 'as' => 'dashboard.approvalaction']);
Route::post('verify', ['uses' => 'DashboardController@verify', 'as' => 'dashboard.verify']);
Route::post('approval', ['uses' => 'DashboardController@approval', 'as' => 'dashboard.approval']);
//maintenance
Route::get('senaraiProject',['uses' => 'MaintenanceController@senaraiProject', 'as' => 'maintenance.senaraiProject']);
......
......@@ -93,7 +93,6 @@ class DashboardController extends Controller
public function filterViewer()
{
$currmonth = date('n');
// $currmonth = 1;
$curryear = date('Y');
$month = [];
......@@ -108,7 +107,6 @@ class DashboardController extends Controller
public function filterReview()
{
$currmonth = date('n');
// $currmonth = 1;
$curryear = date('Y');
$month = [];
......@@ -120,6 +118,20 @@ class DashboardController extends Controller
return view('timesheet::dashboard.filterReview', compact('month', 'curryear', 'currmonth'));
}
public function filterApproval()
{
$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::dashboard.filterApproval', compact('month', 'curryear', 'currmonth'));
}
public function viewerselectmonthphase(Request $request){
return redirect()->route('timesheet::dashboard.timesheetViewer', ['phase' => $request->phase, 'month' =>$request->month]);
......@@ -130,9 +142,65 @@ class DashboardController extends Controller
return redirect()->route('timesheet::dashboard.timesheetReview', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function timesheetApproval()
public function approvalselectmonthphase(Request $request){
return redirect()->route('timesheet::dashboard.timesheetApproval', ['phase' => $request->phase, 'month' =>$request->month]);
}
public function timesheetApproval(Request $request)
{
return view('timesheet::dashboard.timesheetApproval');
// dd($request);
$curryear = date('Y');
if ($request->year) {
$curryear = $request->year;
}
$year = date('Y');
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$approval = Users::find(Auth::id());
$profile = VwReviewProfile::where('bod_id', $approval->id)
->where('tm_year', $curryear)
->get();
$staffs = Staff_info::where('pelulus', $approval->id)
->first();
$checkts = Ts_master::where('tm_timesheet_master_sts', '>' ,2)
->where('tm_year', $curryear)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->with('attachement')
->get();
$details = VwReviewDetails::where('year', $curryear)
->where('month', $request->month)
->where('phase', $request->phase)
->where('approval', $approval->id)
->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();
return view('timesheet::dashboard.timesheetApproval', compact('profile', 'staffs', 'details', 'checkts', 'checktd', 'year', 'month', 'phase'));
}
public function timesheetReport()
......@@ -142,30 +210,48 @@ class DashboardController extends Controller
public function timesheetReview(Request $request)
{
// dd($request->phase);
$curryear = date('Y');
if ($request->year) {
$curryear = $request->year;
}
$hod = Users::find(Auth::id());
$year = date('Y');
$profile = VwReviewProfile::where('hod_id', $hod->id)
if(isset($request->phase))
{
$phase = $request->phase;
}
if(isset($request->month))
{
$month = $request->month;
}
if(isset($request->year))
{
$year = $request->year;
}
$verifier = Users::find(Auth::id());
$profile = VwReviewProfile::where('hod_id', $verifier->id)
->where('tm_year', $curryear)
->get();
$staffs = Staff_info::where('penyokong', $hod->id)
->get();
$checkts = Ts_master::where('tm_timesheet_master_sts', 2)
$staffs = Staff_info::where('penyokong', $verifier->id)
->first();
$checkts = Ts_master::where('tm_timesheet_master_sts', '>' ,1)
->where('tm_year', $curryear)
->where('tm_month', $request->month)
->where('tm_phase', $request->phase)
->with('attachement')
->get() ;
$details = VwReviewDetails::where('year', $curryear)
->where('month', $request->month)
->where('phase', $request->phase)
->where('verifier', $hod->id)
->where('verifier', $verifier->id)
->get();
$checktd = Ts_detail::where('tm_year', $curryear)
......@@ -175,7 +261,7 @@ class DashboardController extends Controller
->orwhereNotNull('td_overhead_note')
->get();
return view('timesheet::dashboard.timesheetReview', compact('profile', 'staffs', 'details', 'checkts', 'checktd'));
return view('timesheet::dashboard.timesheetReview', compact('profile', 'staffs', 'details', 'checkts', 'checktd', 'year', 'month', 'phase'));
}
public function revaction(Request $request)
......@@ -191,17 +277,27 @@ class DashboardController extends Controller
public function verify(Request $request)
{
// dd($request);
$hod = Users::find(Auth::id());
$today = Carbon::today()->toDateString();
$profile = VwReviewProfile::where('hod_id', $hod->id)
->where('tmid', $request->tmid)
->first();
$month = $profile->tm_month;
$phase = $profile->tm_phase;
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
'tm_verified_by' => $request->verifier,
'hod_remarks' => $request->remarks
]);
$td = Ts_detail::where('fk_tm_id', $request->tmid)
......@@ -210,24 +306,100 @@ class DashboardController extends Controller
$tp = Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 3]);
return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withSuccess('Staff Timesheet has been verify');
} else {
dd('rejected');
$ts = Ts_master::where('id', $request->tmid)
->update(
[
'tm_timesheet_master_sts' => 6,
'hod_rejected_at' => $today,
'hod_remarks' => $request->remarks
]);
$td = Ts_detail::where('fk_tm_id', $request->tmid)
->update([ 'td_timesheet_sts' => 6 ]);
$tp = Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 6]);
return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'))->withErrors('Timesheet has been rejected with remarks');
}
}
$profile = VwReviewProfile::where('hod_id', $hod->id)
public function approvalaction(Request $request)
{
$bod = Users::find(Auth::id());
$profile = VwReviewProfile::where('bod_id', $bod->id)
->where('tmid', $request->tmid)
->first();
return view('timesheet::dashboard.approvalaction', compact('profile', 'bod'));
}
public function approval(Request $request)
{
// dd($request);
$bod = Users::find(Auth::id());
$today = Carbon::today()->toDateString();
$profile = VwReviewProfile::where('bod_id', $bod->id)
->where('tmid', $request->tmid)
->first();
$month = $profile->tm_month;
$phase = $profile->tm_phase;
return redirect()->route('timesheet::dashboard.timesheetReview', compact('month', 'phase'));
if ($request->action == 1) {
$ts = Ts_master::where('id', $request->tmid)
->update(
[
'tm_timesheet_master_sts' => 4,
'tm_approved_at' => $today,
'tm_approved_by' => $request->approval,
'bod_remarks' => $request->remarks
]);
$td = Ts_detail::where('fk_tm_id', $request->tmid)
->update([ 'td_timesheet_sts' => 4 ]);
$tp = Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 4]);
return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withSuccess('Staff Timesheet has been approved');
} else {
$ts = Ts_master::where('id', $request->tmid)
->update(
[
'tm_timesheet_master_sts' => 5,
'bod_rejected_at' => $today,
'bod_remarks' => $request->remarks
]);
$td = Ts_detail::where('fk_tm_id', $request->tmid)
->update([ 'td_timesheet_sts' => 5 ]);
$tp = Tproject::where('fk_tm_id', $request->tmid)
->update(['tp_timesheet_sts' => 5]);
return redirect()->route('timesheet::dashboard.timesheetApproval', compact('month', 'phase'))->withErrors('Timesheet has been rejected with remarks');
}
}
public function timesheetViewer(Request $request)
{
$user = Staff_info::where('fk_users', Auth::id())
$curruser = $user = Staff_info::where('fk_users', Auth::id())
->first();
if (isset($request->user)) {
$user = Staff_info::where('staff_id', $request->user)
->first();
}
$profile = VwViewer::where('STAFF_ID', $user->staff_id)
->orderby('DEPARTMENT', 'DESC')
......@@ -243,7 +415,7 @@ class DashboardController extends Controller
->get();
$bod = Staff_info::select('id', 'fullname')
->whereIn('id', [45,46,47,48])
->whereIn('id', [1,45,46,47,48])
->get();
$year = date('Y');
......@@ -405,7 +577,7 @@ class DashboardController extends Controller
}
// dd($check->id);
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'));
return view('timesheet::dashboard.timesheetViewer', compact('curruser', '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)
......
......@@ -977,6 +977,9 @@ class FormController extends Controller
$userId = Users::find(Auth::id())
->u_staffID;
$staff = Staff_info::find(Auth::id());
// dd($staff->fk_lkp_department);
$year = date('Y');
......@@ -1017,7 +1020,7 @@ class FormController extends Controller
$fk_tm_id = null;
}
return view('timesheet::form.notelist', compact('notes', 'phase', 'month', 'year', 'fk_tm_id'));
return view('timesheet::form.notelist', compact('notes', 'phase', 'month', 'year', 'fk_tm_id', 'staff'));
}
public function penambahannote()
......
......@@ -93,7 +93,7 @@ class ServiceProvider extends BaseServiceProvider
->data('icon', 'file alternate icon')
->active('timesheetReview/*')
->data('permission', Permission::kehadiran);
$form->add(__('Timesheet Approval'))
$form->add(__('Timesheet Approval'), route('timesheet::dashboard.filterApproval'))
->data('icon', 'check square icon')
->active('timesheetApproval/*')
->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