Cetaklabel/Resources/views/app/document/_action.blade.php

80 lines
4.3 KiB
PHP

@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
@if(!Auth::user()->hasRole('ad'))
<a href="{{ route($route[0].'.odner',$model->id) }}" target="_blank"
class="btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("printer", "text-primary","duotune") !!} Odner
</a>
@endif
@if(in_array($model->status,[1,4,5,6,7,9]) && Auth::user()->can($route[0].'.read'))
@if($model->status == 4 && Auth::user()->hasRole('dd') && $model->approval_flag==1)
<a href="{{ route($route[0].'.download',$model->id) }}"
class="approve-download btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("cloud-download", "text-info","duotune") !!} Approve Download
</a>
@elseif($model->status == 1 && Auth::user()->hasRole('eo') && $model->approval_flag==1)
<a href="{{ route($route[0].'.download',$model->id) }}"
class="btn-download btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("cloud-download", "text-info","duotune") !!} Request Download
</a>
@elseif($model->status == 5 || $model->approval_flag!==1)
<a href="{{ route($route[0].'.download',$model->id) }}" target="_blank"
class="btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("cloud-download", "text-success","duotune") !!} Download
</a>
@endif
@if(Auth::user()->can($route[0].'.read'))
@if( Auth::user()->hasRole('eo'))
@if($model->aktif == 1)
<a href="{{ route($route[0].'.aktif',$model->id) }}"
class="btn-aktif btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("check-square", "text-success","duotune") !!} Aktif
</a>
@else
<span
class="btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("cross-square", "text-danger","duotune") !!} Tidak Aktif
</span>
@endif
@elseif(Auth::user()->hasRole('dd') && $model->status == 9)
<a href="{{ route($route[0].'.aktif',$model->id) }}"
class="btn-approve-aktif btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("check-square", "text-success","duotune") !!} Approve Non Aktif
</a>
@endif
@endif
@if(Auth::user()->can($route[0].'.delete'))
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
@if( Auth::user()->hasRole('eo'))
{{ Form::button(getIcon("trash", "text-danger","duotune")."Delete", ['type' => 'submit', 'class' => 'delete btn btn-bg-light btn-active-light-danger btn-sm'] ) }}
@elseif(Auth::user()->hasRole('dd') && $model->status == 6)
{{ Form::button(getIcon("trash", "text-danger","duotune")."Approve Delete", ['type' => 'submit', 'class' => 'approvedelete btn btn-bg-light btn-active-light-danger btn-sm'] ) }}
@elseif(Auth::user()->hasRole('administrator') && $model->status == 7)
{{ Form::button(getIcon("trash", "text-danger","duotune")."Approve Delete", ['type' => 'submit', 'class' => 'approveddelete btn btn-bg-light btn-active-light-danger btn-sm'] ) }}
@endif
{!! Form::close() !!}
@if(in_array($model->status,[6,7,9]) && Auth::user()->can($route[0].'.read'))
<a href="{{ route($route[0].'.edit',['document' => $model->id]) }}"
class="kt_edit_form btn btn-bg-light btn-active-light-warning btn-sm me-1">
{!! getIcon("eye", "text-warning","duotune") !!} View
</a>
@endif
@endif
@elseif($model->status == 0)
@if(Auth::user()->hasRole('dd'))
<a href="{{ route($route[0].'.edit',['document' => $model->id]) }}"
class="kt_edit_form btn btn-bg-light btn-active-light-warning btn-sm me-1">
{!! getIcon("eye", "text-warning","duotune") !!} View
</a>
@endif
@endif
</div>