Merge remote-tracking branch 'composer/_temp' into _temp

# Conflicts:
#	DataTables/CardboardOdnerDataTable.php
This commit is contained in:
daeng.deni@dharma.or.id 2023-07-07 08:00:44 +07:00
commit dac9371f29
41 changed files with 984 additions and 93 deletions

View File

@ -4,7 +4,6 @@
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Illuminate\Support\Facades\URL;
use Modules\Cetaklabel\Entities\Cardboard;
use Modules\Cetaklabel\Entities\CardboardDetail;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;

View File

@ -2,8 +2,11 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Illuminate\Support\Facades\Auth;
use Modules\Cetaklabel\Entities\Directorat;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -23,11 +26,27 @@
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
if(Auth::user()->hasRole('otorisator')) {
$query->whereIn('status', [0, 4, 6, 9]);
}
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%");
}
})
->addIndexColumn()
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.directorat._action')
->rawColumns(['status', 'action'])
@ -74,6 +93,10 @@
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('name'),
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\DocumentType;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -28,7 +30,21 @@
}
})
->addIndexColumn()
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.document-type._status')
->addColumn('action', 'cetaklabel::masters.document-type._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -72,11 +88,20 @@
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->title('Approved By')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\Job;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -36,7 +38,21 @@
->addColumn('sub_directorat', function ($job) {
return $job->sub_directorat->name;
})
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.job._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -82,11 +98,20 @@
Column::make('sub_directorat'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\SpecialCode;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -28,7 +30,21 @@
}
})
->addIndexColumn()
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.special-code._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -73,11 +89,20 @@
Column::make('kode'),
Column::make('name'),
Column::make('description'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->title('Approved By')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\SubDirectorat;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -32,7 +34,21 @@
->addColumn('directorat', function ($subDirectorat) {
return $subDirectorat->directorat->name;
})
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.sub-directorat._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -77,11 +93,20 @@
Column::make('directorat'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->title('Approved By')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\SubJob;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -40,7 +42,21 @@
->addColumn('job', function ($subJob) {
return $subJob->job->name;
})
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.sub-job._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -87,11 +103,20 @@
Column::make('job'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->title('Approved By')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -2,8 +2,10 @@
namespace Modules\Cetaklabel\DataTables;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Modules\Cetaklabel\Entities\SubSubJob;
use Modules\Usermanager\Entities\User;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Column;
@ -44,7 +46,21 @@
->addColumn('sub_job', function ($subJob) {
return $subJob->sub_job->name;
})
->addColumn('craeted_at', function ($model) {
return $model->created_at !== null ? Carbon::parse($model->created_at)->format('d F Y H:i:s') : '-';
})
->addColumn('created_by', function ($model) {
return $model->created_by ? $model->creator->name : '-';
})
->addColumn('approved_at', function ($model) {
return $model->approved_at !== null ? Carbon::parse($model->approved_at)->format('d F Y H:i:s') : '-';
})
->addColumn('approved_by', function ($model) {
return $model->approved_by ? User::find($model->approved_by)->name : '-';
})
->addColumn('status', 'cetaklabel::masters.directorat._status')
->addColumn('action', 'cetaklabel::masters.sub-sub-job._action')
->rawColumns(['status', 'action'])
->setRowId('id');
}
@ -92,11 +108,20 @@
Column::make('sub_job'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
Column::make('craeted_at')->className('none'),
Column::make('created_by')->className('none'),
Column::make('approved_at')->className('none'),
Column::make('approved_by')->title('Approved By')->className('none'),
Column::computed('status')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(250)
->addClass('text-center'),
];
}

View File

@ -4,10 +4,7 @@
class DocumentType extends BaseModel
{
protected $fillable = [
'kode',
'name'
];
protected $fillable = ['kode', 'name', 'status', 'approved_by', 'approved_at'];
public function document_detail()
{

View File

@ -5,12 +5,7 @@
class Job extends BaseModel
{
protected $fillable = [
'directorat_id',
'sub_directorat_id',
'kode',
'name'
];
protected $fillable = ['directorat_id', 'sub_directorat_id', 'kode', 'name', 'status', 'approved_by', 'approved_at'];
public function directorat()

View File

@ -7,8 +7,7 @@
protected $fillable = [
'kode',
'name',
'description'
];
'description', 'status','approved_by','approved_at'];
public function document()
{

View File

@ -7,8 +7,7 @@
protected $fillable = [
'directorat_id',
'kode',
'name'
];
'name', 'status','approved_by','approved_at'];
public function directorat()
{

View File

@ -9,8 +9,7 @@
'sub_directorat_id',
'job_id',
'kode',
'name'
];
'name', 'status','approved_by','approved_at'];
public function directorat()

View File

@ -10,8 +10,7 @@
'job_id',
'sub_job_id',
'kode',
'name'
];
'name', 'status','approved_by','approved_at'];
public function directorat()

View File

@ -68,6 +68,7 @@
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
@ -76,3 +77,4 @@
}
}
}
}

View File

@ -29,7 +29,10 @@
{
return [
'kode' => 'required|string|max:2|min:2|unique:document_types,kode,' . $this->document_type->id,
'name' => 'required|string|max:50'
'name' => 'required|string|max:50',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer',
];
}
@ -62,4 +65,16 @@
'messages' => 'Document Type updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -31,7 +31,10 @@
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'kode' => 'required|string|max:2|min:2|unique:jobs,kode,' . $this->job->id,
'name' => 'required|string|max:50'
'name' => 'required|string|max:50',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer',
];
}
@ -64,4 +67,16 @@
'messages' => 'Job updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -30,7 +30,10 @@
return [
'kode' => 'required|string|max:2|min:2|unique:special_codes,kode,' . $this->special_code->id,
'name' => 'required|string|max:50',
'description' => 'nullable|string|max:255'
'description' => 'nullable|string|max:255',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer'
];
}
@ -63,4 +66,16 @@
'messages' => 'Special Code updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -30,7 +30,10 @@
return [
'directorat_id' => 'required|exists:directorats,id',
'kode' => 'required|string|max:2|min:2|unique:sub_directorats,kode,' . $this->sub_directorat->id,
'name' => 'required|string|max:50'
'name' => 'required|string|max:50',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer'
];
}
@ -63,4 +66,16 @@
'messages' => 'Sub Directorat updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -32,7 +32,10 @@
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'job_id' => 'required|exists:jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_jobs,kode,' . $this->sub_job->id,
'name' => 'required|string|max:50'
'name' => 'required|string|max:50',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer'
];
}
@ -65,4 +68,16 @@
'messages' => 'Sub Job updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -34,7 +34,10 @@
'job_id' => 'required|exists:jobs,id',
'sub_job_id' => 'required|exists:sub_jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_sub_jobs,kode,' . $this->sub_sub_job->id,
'name' => 'required|string|max:50'
'name' => 'required|string|max:50',
'status' => 'nullable|integer',
'approved_at' => 'nullable|date',
'approved_by' => 'nullable|integer',
];
}
@ -67,4 +70,16 @@
'messages' => 'Sub Sub Job updated failed.'
], JsonResponse::HTTP_UNPROCESSABLE_ENTITY));
}
protected function prepareForValidation()
{
if(isset($this->status) && $this->status == 1) {
if (isset($this->approval) && $this->approval == 1) {
$this->merge([
'approved_at' => now(),
'approved_by' => auth()->user()->id,
]);
}
}
}
}

View File

@ -3,7 +3,7 @@
@endphp
@if( Auth::user()->hasRole('operator') || Auth::user()->hasRole('administrator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['directorat' => $model->id]) }}"
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -16,7 +16,6 @@
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">

View File

@ -12,4 +12,6 @@
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['document_type' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,35 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -100,6 +100,60 @@
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['job' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,39 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -104,6 +104,60 @@
}
})
})
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})
})
</script>
@endpush

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['special_code' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,35 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -104,6 +104,60 @@
}
})
})
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})
})
</script>
@endpush

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['sub_directorat' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,37 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -104,6 +104,60 @@
}
})
})
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})
})
</script>
@endpush

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['sub_job' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,41 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->job_id}}" name="job_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->job_id}}" name="job_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -105,6 +105,60 @@
}
})
})
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})
})
</script>
@endpush

View File

@ -1,8 +1,9 @@
@php
$route = explode('.', Route::currentRouteName());
@endphp
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',['sub_sub_job' => $model->id]) }}"
@if( Auth::user()->hasRole('operator'))
<div class="d-flex flex-row flex-center">
<a href="{{ route($route[0].'.edit',[str_replace('-','_',$route[0]) => $model->id]) }}"
class="kt_edit_form btn btn-icon btn-bg-light btn-active-light-primary btn-sm me-1">
{!! getIcon("pencil", "fs-1 text-info","duotune") !!}
</a>
@ -10,4 +11,43 @@
{!! Form::open(['method' => 'DELETE','route' => [$route[0].'.destroy', $model->id],'class'=>'']) !!}
{{ Form::button(getIcon("trash", "fs-1 text-danger","duotune"), ['type' => 'submit', 'class' => 'delete btn btn-icon btn-bg-light btn-active-light-danger btn-sm'] ) }}
{!! Form::close() !!}
</div>
</div>
@endif
@if(Auth::user()->hasRole('otorisator'))
@if($model->status == 0)
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->job_id}}" name="job_id">
<input type="hidden" value="{{$model->sub_job_id}}" name="sub_job_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="1" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_approve_form btn btn-light-success btn-active-success btn-sm " style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-double-check">
<i class="path1"></i>
<i class="path2"></i>
</i> Approve
</button>
{!! Form::close() !!}
{!! Form::open(['method' => 'PUT','route' => [$route[0].'.update', $model->id],'class'=>'d-inline-block']) !!}
<input type="hidden" value="{{$model->directorat_id}}" name="directorat_id">
<input type="hidden" value="{{$model->sub_directorat_id}}" name="sub_directorat_id">
<input type="hidden" value="{{$model->job_id}}" name="job_id">
<input type="hidden" value="{{$model->sub_job_id}}" name="sub_job_id">
<input type="hidden" value="{{$model->kode}}" name="kode">
<input type="hidden" value="{{$model->name}}" name="name">
<input type="hidden" value="3" name="status">
<input type="hidden" value="1" name="approval">
<button type="submit" value="1" class="kt_reject_form btn btn-light-danger btn-active-danger btn-sm" style="--bs-btn-padding-y: .25rem !important; --bs-btn-padding-x: .5rem !important; --bs-btn-font-size: .75rem !important;">
<i class="ki-duotone ki-cross">
<i class="path1"></i>
<i class="path2"></i>
</i> Reject
</button>
{!! Form::close() !!}
@endif
@endif

View File

@ -0,0 +1,17 @@
{{--
<span class="badge badge-light-primary">New</span>
<span class="badge badge-light-secondary">New</span>
<span class="badge badge-light-success">New</span>
<span class="badge badge-light-info">New</span>
<span class="badge badge-light-warning">New</span>
<span class="badge badge-light-danger">New</span>
<span class="badge badge-light-dark">New</span>--}}
@if($model->status == 0)
<span class="badge badge-light-primary">Waiting Approval</span>
@elseif($model->status == 1)
<span class="badge badge-light-success">Approved</span>
@elseif($model->status == 3)
<span class="badge badge-light-danger">Rejected</span>
@endif

View File

@ -106,6 +106,60 @@
}
})
})
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_approve_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Approve This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Approve it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
});
LaravelDataTables["{{$route[0]}}-table"].on('click', '.kt_reject_form', function (event) {
var form = $(this).closest("form");
event.preventDefault();
Swal.fire({
title: 'Are you sure?',
text: "Reject This Data!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, Reject it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: form.attr('action'),
data: form.serialize(), // serializes the form's elements.
success: function (data) {
toastr.success('{{ucfirst($route[0])}} has been deleted.', 'Success!', {timeOut: 5000});
LaravelDataTables["{{$route[0]}}-table"].ajax.reload();
}
});
}
})
})
})
</script>
@endpush