Commit 90c767b3 by Azhan Hannan

changes in dashboard view. replace disable button with view

parent 6f534ff2
...@@ -110,9 +110,9 @@ ...@@ -110,9 +110,9 @@
@if(data_get($chargeable, 'tp_timesheet_sts') == 3) @if(data_get($chargeable, 'tp_timesheet_sts') == 3)
<button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($chargeable, 'id'), 'phase'=>data_get($chargeable, 'tp_phase'), 'month'=>data_get($chargeable, 'tp_month'), 'year'=>data_get($chargeable, 'tp_year'), 'page'=>$page ]) }}';">Approval</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($chargeable, 'id'), 'phase'=>data_get($chargeable, 'tp_phase'), 'month'=>data_get($chargeable, 'tp_month'), 'year'=>data_get($chargeable, 'tp_year'), 'page'=>$page ]) }}';">Approval</button>
@else @else
<button class="center aligned ui green icon button disabled">Approval</button> <!-- <button class="center aligned ui green icon button disabled">Approval</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staffid') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif @endif
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staffid') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</button>
</td> </td>
</tr> </tr>
@endif @endif
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
@if(data_get($staff,'tmid') == data_get($overhead,'fk_tm_id')) @if(data_get($staff,'tmid') == data_get($overhead,'fk_tm_id'))
<tr> <tr>
<td style="width: 25%;" class="single line"> <td style="width: 25%;" class="single line">
<!-- {{data_get($overhead,'id')}} -->
@if(data_get($overhead,'tp_timesheet_sts') == 3) @if(data_get($overhead,'tp_timesheet_sts') == 3)
<div class="ui toggle checkbox"> <div class="ui toggle checkbox">
<input type="checkbox" name="pid[{{data_get($overhead,'id')}}]" value="{{data_get($overhead,'id')}}"> <input type="checkbox" name="pid[{{data_get($overhead,'id')}}]" value="{{data_get($overhead,'id')}}">
...@@ -168,9 +169,9 @@ ...@@ -168,9 +169,9 @@
@if(data_get($overhead, 'tp_timesheet_sts') == 3) @if(data_get($overhead, 'tp_timesheet_sts') == 3)
<button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($overhead, 'id'), 'phase'=>data_get($overhead, 'tp_phase'), 'month'=>data_get($overhead, 'tp_month'), 'year'=>data_get($overhead, 'tp_year'), 'page'=>$page ]) }}';">Approval</button> <button type="button" class="center aligned ui green icon button" onclick="window.location.href='{{ route('timesheet::dashboard.approvalaction', ['tpid'=>data_get($overhead, 'id'), 'phase'=>data_get($overhead, 'tp_phase'), 'month'=>data_get($overhead, 'tp_month'), 'year'=>data_get($overhead, 'tp_year'), 'page'=>$page ]) }}';">Approval</button>
@else @else
<button type="button" class="center aligned ui green icon button disabled">Approval</button> <!-- <button type="button" class="center aligned ui green icon button disabled">Approval</button> -->
@endif
<a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staffid') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" type="button" class="center aligned ui blue icon button" target='_blank'>View</a> <a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staffid') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" type="button" class="center aligned ui blue icon button" target='_blank'>View</a>
@endif
</td> </td>
</tr> </tr>
@endif @endif
......
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
<div class="ui styled fluid accordion"> <div class="ui styled fluid accordion">
<?php $page = 1; ?> <?php $page = 1; ?>
@foreach($profile as $key => $staff) @foreach($profile as $key => $staff)
@if(data_get($staff,'status') == 2) @if(data_get($staff,'status') == 2 || data_get($staff,'status') == 3)
<?php <?php
// dd($details);
// $detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_timesheet_sts', 2); // $detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_timesheet_sts', 2);
$detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_type', 3)->where('tp_timesheet_sts', 2); $detail = $details->where('staffid', $staff->staff_id)->where('fk_tm_id', $staff->tmid)->where('tp_project_type', 3)->whereIn('tp_timesheet_sts', [2,3,6]);
// dump($detail); // dump($detail);
$ts = $checkts->where('tm_staff_id', $staff->staff_id); $ts = $checkts->where('tm_staff_id', $staff->staff_id);
?> ?>
...@@ -29,23 +30,24 @@ ...@@ -29,23 +30,24 @@
</th> </th>
<th style="width: 15%;" class="center aligned"> <th style="width: 15%;" class="center aligned">
<?php <?php
$over = 0; $overheadverified = 0;
// dd($details); // dd($details);
foreach ($details as $key => $value) { foreach ($details as $key => $value) {
if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3) if(data_get($value,'staffid') == data_get($staff,'staff_id') && data_get($value,'tp_timesheet_sts') == 3)
$over += 1; $overheadverified += 1;
} }
// dump($over); // dump($overheadverified);
// dump(data_get($staff,'status')); // dump(data_get($staff,'status'));
?> ?>
@if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR @if($staff->status == 7) <i class="red attention icon"></i>Rejected by HR
@elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU @elseif($staff->status == 6) <i class="red attention icon"></i>Rejected by HOD/HOU
@elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD @elseif($staff->status == 5) <i class="red attention icon"></i>Dissaproved by BOD
@elseif($staff->status == 4) <i class="green check icon"></i>Verified by BOD @elseif($staff->status == 4) <i class="green check icon"></i>Approved by BOD
@elseif($over > 0 && $over == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU @elseif($staff->status == 3) <i class="green check icon"></i>Verified by HOD
@elseif($over != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted @elseif($overheadverified > 0 && $overheadverified == count(data_get($staff,'overheads'))) <i class="green check icon"></i> Verified by HOD/HOU
@elseif($overheadverified != count(data_get($staff,'overheads')) || $staff->status == 2) <i class="red attention icon"></i> Submitted
@elseif($staff->status == 1 || $staff->status == null) In Preparation @elseif($staff->status == 1 || $staff->status == null) In Preparation
@endif @endif
</th> </th>
...@@ -94,9 +96,9 @@ ...@@ -94,9 +96,9 @@
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp,'tp_phase'), 'month'=>data_get($tp,'tp_month'), 'year'=>data_get($tp,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp,'tp_phase'), 'month'=>data_get($tp,'tp_month'), 'year'=>data_get($tp,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
@endif
<a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tm_phase'), 'month' => data_get($staff,'tm_month'), 'year' => data_get($staff,'tm_year') ]) }}" class="center aligned ui blue icon button" target='_blank'>View</a> <a href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tm_phase'), 'month' => data_get($staff,'tm_month'), 'year' => data_get($staff,'tm_year') ]) }}" class="center aligned ui blue icon button" target='_blank'>View</a>
@endif
</td> </td>
</tr> </tr>
@endif @endif
......
...@@ -89,9 +89,9 @@ ...@@ -89,9 +89,9 @@
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=>data_get($detail, 'id'), 'phase'=>data_get($staff,'tp_phase'), 'month'=>data_get($staff,'tp_month'), 'year'=>data_get($staff,'tp_year'), 'page'=>$page ]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
@endif
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target="_blank">View</a> <a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target="_blank">View</a>
@endif
</td> </td>
</tr> </tr>
@endif @endif
......
...@@ -125,10 +125,10 @@ ...@@ -125,10 +125,10 @@
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year'), 'page' => $page]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year'), 'page' => $page]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif @endif
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</button>
</td> </td>
</tr> </tr>
@endif @endif
...@@ -176,10 +176,10 @@ ...@@ -176,10 +176,10 @@
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</a>
@endif @endif
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</button>
</td> </td>
</tr> </tr>
@endif @endif
...@@ -333,10 +333,10 @@ ...@@ -333,10 +333,10 @@
@if(data_get($detail, 'tp_timesheet_sts') == 2) @if(data_get($detail, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.projectaction', ['tpid'=> data_get($detail, 'id'), 'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year'), 'page' => $page]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}" target='_blank'>View</a>
@endif @endif
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'phase'), 'month' => data_get($staff,'month'), 'year' => data_get($staff,'year')]) }}';" target='_blank'>View</button>
</td> </td>
</tr> </tr>
@endif @endif
...@@ -384,10 +384,10 @@ ...@@ -384,10 +384,10 @@
@if(data_get($tp, 'tp_timesheet_sts') == 2) @if(data_get($tp, 'tp_timesheet_sts') == 2)
<button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button> <button class="center aligned ui green icon button" onclick="window.location.href='{{route('timesheet::dashboard.revaction', ['tpid'=>data_get($tp, 'id'), 'phase'=>data_get($tp, 'tp_phase'), 'month'=>data_get($tp, 'tp_month'), 'year'=>data_get($tp, 'tp_year') ]) }}';">Verify | Reject</button>
@else @else
<button class="center aligned ui green icon button disabled">Verify | Reject</button> <!-- <button class="center aligned ui green icon button disabled">Verify | Reject</button> -->
<a class="center aligned ui blue icon button" href="{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}" target='_blank'>View</a>
@endif @endif
<button class="center aligned ui blue icon button" onclick="window.location.href='{{ route('timesheet::dashboard.timesheetViewer', [ 'user'=>data_get($staff,'staff_id') ,'phase' => data_get($staff,'tp_phase'), 'month' => data_get($staff,'tp_month'), 'year' => data_get($staff,'tp_year')]) }}';" target='_blank'>View</button>
</td> </td>
</tr> </tr>
@endif @endif
......
...@@ -61,7 +61,7 @@ class DashboardController extends Controller ...@@ -61,7 +61,7 @@ class DashboardController extends Controller
$verifier = Users::find(Auth::id()); $verifier = Users::find(Auth::id());
$profile = VwReviewProfile::where('hod_id', $verifier->id) $profile = VwReviewProfile::where('hod_id', $verifier->id)
->where('status', 2) ->whereIn('status', [2,3,6])
->with('overheads') ->with('overheads')
->orderby('tm_year', 'desc') ->orderby('tm_year', 'desc')
->orderby('tm_month', 'desc') ->orderby('tm_month', 'desc')
...@@ -74,7 +74,7 @@ class DashboardController extends Controller ...@@ -74,7 +74,7 @@ class DashboardController extends Controller
->with('notes') ->with('notes')
->get(); ->get();
$checkts = Ts_master::where('tm_timesheet_master_sts', 2) $checkts = Ts_master::whereIn('tm_timesheet_master_sts', [2,3,6])
->with('attachement') ->with('attachement')
->get(); ->get();
......
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