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

70 lines
3.7 KiB
PHP

@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
@if(in_array($model->status,[1,4,5,6,7,9]) && Auth::user()->can($route[0].'.read'))
<a href="{{ route($route[0].'.label',$model->id) }}" target="_blank"
class="btn btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("printer", "text-success","duotune") !!} Label Dus
</a>
<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>
@if($model->status == 4 && Auth::user()->hasRole('otorisator'))
<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('otorisator'))
<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 && Auth::user()->hasRole('operator'))
<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].'.delete'))
@if( Auth::user()->hasRole('operator'))
<a href="{{ route($route[0].'.aktif',$model->id) }}"
class="btn-aktif btn btn-bg-light btn-active-light-primary btn-sm me-1">
@if($model->aktif == 1)
{!! getIcon("check-square", "text-success","duotune") !!} Aktif
@else
{!! getIcon("cross-square", "text-danger","duotune") !!} Tidak Aktif
@endif
</a>
@elseif( Auth::user()->hasRole('otorisator'))
<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('operator'))
{{ Form::button(getIcon("trash", "text-danger","duotune")." Reqeust Delete", ['type' => 'submit', 'class' => 'delete btn btn-bg-light btn-active-light-danger btn-sm'] ) }}
@elseif(Auth::user()->hasRole('otorisator') || Auth::user()->hasRole('administrator'))
{{ Form::button(getIcon("trash", "text-danger","duotune")."Approve Delete", ['type' => 'submit', 'class' => 'delete btn btn-bg-light btn-active-light-danger btn-sm'] ) }}
@endif
{!! Form::close() !!}
@endif
@elseif($model->status == 0)
@if(Auth::user()->hasRole('otorisator'))
<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>