chore: add issue count column in classification and sub classification
This commit is contained in:
parent
f51a2ef4a3
commit
e4fd3ee809
@ -25,13 +25,12 @@ public function create(){
|
||||
|
||||
public function store(ClassificationRequest $request){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$createdClassification = Classification::create($validatedData);
|
||||
|
||||
if($createdClassification){
|
||||
return redirect()->back()->with('success-status', 'Berhasil menambahkan klasifikasi.');
|
||||
return redirect()->route('dashboard.classifications.index')->with('success-status', 'Berhasil menambahkan klasifikasi.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan klasifikasi.');
|
||||
}
|
||||
@ -48,7 +47,6 @@ public function edit($id){
|
||||
|
||||
public function update(ClassificationRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$classification = Classification::findOrFail(decrypt_id($id));
|
||||
|
||||
@ -56,11 +56,21 @@ public function classification(Request $request){
|
||||
return $subClassificationCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('issues', function ($data) {
|
||||
$issueCount = $data->issues->count();
|
||||
|
||||
if($issueCount > 0){
|
||||
return $issueCount. ' [<a href="'.route('dashboard.issue.managements.index', ['classification' => encrypt_id($data->id)]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $issueCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.classifications.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
$addSubClassificationUrl = route('dashboard.sub.classifications.create', ['classification' => $data->slug]);
|
||||
$addSubClassificationUrl = route('dashboard.sub.classifications.create', ['classification' => encrypt_id($data->id)]);
|
||||
|
||||
$editUrl = route('dashboard.classifications.edit', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
@ -92,7 +102,7 @@ public function classification(Request $request){
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['sub_classifications', 'status', 'action'])
|
||||
->rawColumns(['sub_classifications', 'issues', 'status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
@ -134,6 +144,16 @@ public function subClassification(Request $request){
|
||||
return '<span class="badge bg-primary" style="display:inline-block;font-size:0.8rem;">Aktif</span>';
|
||||
}
|
||||
})
|
||||
->addColumn('issues', function ($data) {
|
||||
$issueCount = $data->issues->count();
|
||||
|
||||
if($issueCount > 0){
|
||||
return $issueCount. ' [<a href="'.route('dashboard.issue.managements.index', ['sub_classification' => encrypt_id($data->id)]).'">Lihat</a>]';
|
||||
}else{
|
||||
return $issueCount;
|
||||
}
|
||||
|
||||
})
|
||||
->addColumn('action', function ($data) {
|
||||
$showUrl = route('dashboard.sub.classifications.show', ['id' => encrypt_id($data->id)]);
|
||||
|
||||
@ -163,7 +183,7 @@ public function subClassification(Request $request){
|
||||
return $dropdown;
|
||||
})
|
||||
|
||||
->rawColumns(['status', 'action'])
|
||||
->rawColumns(['issues', 'status', 'action'])
|
||||
->make(true);
|
||||
}
|
||||
|
||||
@ -1662,7 +1682,20 @@ public function mediaMonitoring(Request $request){
|
||||
|
||||
public function issueManagement(Request $request){
|
||||
if ($request->ajax()) {
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->get();
|
||||
|
||||
$classificationParam = $request->input('classification', null);
|
||||
$subClassificationParam = $request->input('sub_classification', null);
|
||||
|
||||
if($classificationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('classification_id', decrypt_id($classificationParam))->get();
|
||||
|
||||
}else if($subClassificationParam){
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->where('sub_classification_id', decrypt_id($subClassificationParam))->get();
|
||||
|
||||
}else{
|
||||
$data = IssueManagement::with(['location', 'subLocation', 'classification', 'subClassification', 'enhancer', 'governmentAgencies'])->get();
|
||||
}
|
||||
|
||||
|
||||
return DataTables::of($data)
|
||||
->addIndexColumn()
|
||||
|
||||
@ -16,9 +16,14 @@
|
||||
|
||||
class IssueManagementController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
public function index(Request $request){
|
||||
return view('dashboard.issue-managements.index', [
|
||||
'title' => 'Manajemen Isu'
|
||||
'title' => 'Manajemen Isu',
|
||||
'classification' => $request->input('classification', null),
|
||||
'sub_classification' => $request->input('sub_classification', null),
|
||||
'location' => $request->input('location', null),
|
||||
'sub_location' => $request->input('sub_location', null),
|
||||
'agency' => $request->input('agency', null),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -42,13 +42,12 @@ public function create(Request $request){
|
||||
|
||||
public function store(SubClassificationRequest $request){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$createdSubClassification = SubClassification::create($validatedData);
|
||||
|
||||
if($createdSubClassification){
|
||||
return redirect()->back()->with('success-status', 'Berhasil menambahkan sub klasifikasi.');
|
||||
return redirect()->route('dashboard.sub.classifications.index')->with('success-status', 'Berhasil menambahkan sub klasifikasi.');
|
||||
}else{
|
||||
return redirect()->back()->with('failed-status', 'Gagal menambahkan sub klasifikasi.');
|
||||
}
|
||||
@ -66,7 +65,6 @@ public function edit($id){
|
||||
|
||||
public function update(SubClassificationRequest $request, $id){
|
||||
$validatedData = $request->validated();
|
||||
$validatedData['slug'] = Str::slug($validatedData['name']);
|
||||
$validatedData['enhancer_id'] = Auth::id();
|
||||
|
||||
$subClassification = SubClassification::findOrFail(decrypt_id($id));
|
||||
|
||||
@ -20,4 +20,8 @@ class Classification extends Model
|
||||
public function subClassifications(){
|
||||
return $this->hasMany(SubClassification::class, 'classification_id', 'id');
|
||||
}
|
||||
|
||||
public function issues(){
|
||||
return $this->hasMany(IssueManagement::class, 'classification_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,4 +19,8 @@ class SubClassification extends Model
|
||||
public function classification(){
|
||||
return $this->belongsTo(Classification::class, 'classification_id', 'id');
|
||||
}
|
||||
|
||||
public function issues(){
|
||||
return $this->hasMany(IssueManagement::class, 'sub_classification_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.classifications.store')}}" method="post">
|
||||
<form action="{{route('dashboard.classifications.store')}}" method="post" id="myForm">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
@ -49,7 +49,7 @@
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.classifications.update', ['id' => encrypt_id($classification->id)])}}" method="post">
|
||||
<form action="{{route('dashboard.classifications.update', ['id' => encrypt_id($classification->id)])}}" method="post" id="myForm">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
@ -49,8 +49,12 @@
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
@if (request()->query('show'))
|
||||
<a href="{{route('dashboard.classifications.show', ['id' => encrypt_id($classification->id)])}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@else
|
||||
<a href="{{route('dashboard.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,11 +44,12 @@
|
||||
<table class="table table-striped table-bordered nowrap" id="classificationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>No</th>
|
||||
<th>Nama</th>
|
||||
<th style="width: 13% !important;">Status</th>
|
||||
<th style="width: 17% !important;">Sub Klasifikasi</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
<th>Status</th>
|
||||
<th>Sub Klasifikasi</th>
|
||||
<th>Isu</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'journalists'])
|
||||
@include('partials.dashboard.sidebar', ['page' => 'classifications'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Jurnalis</span></a>
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Klasifikasi</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
@ -44,6 +44,30 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Sub Klasifikasi</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($classification->subClassifications->count() > 0)
|
||||
<a href="{{route('dashboard.sub.classifications.index', ['classification' => encrypt_id($classification->id)])}}"><u>{{$classification->subClassifications->count()}}</u></a>
|
||||
@else
|
||||
{{$classification->subClassifications->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Isu</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($classification->issues->count() > 0)
|
||||
<a href="{{route('dashboard.issue.managements.index', ['classification' => encrypt_id($classification->id)])}}"><u>{{$classification->issues->count()}}</u></a>
|
||||
@else
|
||||
{{$classification->issues->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- .profile-ud-list -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-divider divider md"></div> --}}
|
||||
@ -59,22 +83,10 @@
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Konten</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$journalistMonitoring->content!!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block --> --}}
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
{{-- <a href="{{route('dashboard.content.recaps.edit', ['id' => encrypt_id($journalistMonitoring->id)])}}" class="btn btn-warning"><span>Ubah</span></a> --}}
|
||||
<a href="{{route('dashboard.classifications.edit', ['id' => encrypt_id($classification->id), 'show' => true])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div><!-- .nk-block -->
|
||||
</div><!-- .card-inner -->
|
||||
</div><!-- .card-content -->
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="nk-block">
|
||||
<div class="row g-gs">
|
||||
@if (is_role(['1']))
|
||||
<div class="col-xxl-3 col-md-6">
|
||||
<div class="card card-full overflow-hidden">
|
||||
<div class="nk-ecwg nk-ecwg7 h-100">
|
||||
@ -210,6 +211,7 @@
|
||||
</div>
|
||||
</div><!-- .card -->
|
||||
</div><!-- .col -->
|
||||
@endif
|
||||
</div><!-- .row -->
|
||||
</div><!-- .nk-block -->
|
||||
<div class="nk-block">
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.sub.classifications.store')}}" method="post">
|
||||
<form action="{{route('dashboard.sub.classifications.store')}}" method="post" id="myForm">
|
||||
@csrf
|
||||
<div class="row g-4">
|
||||
<div class="col-lg-6">
|
||||
@ -67,7 +67,7 @@
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.sub.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Tambahkan</button>
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Tambahkan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-head">
|
||||
<h5 class="card-title">{{$title}}</h5>
|
||||
</div>
|
||||
<form action="{{route('dashboard.sub.classifications.update', ['id' => encrypt_id($subClassification->id)])}}" method="post">
|
||||
<form action="{{route('dashboard.sub.classifications.update', ['id' => encrypt_id($subClassification->id)])}}" method="post" id="myForm">
|
||||
@csrf
|
||||
@method('put')
|
||||
<div class="row g-4">
|
||||
@ -61,8 +61,12 @@
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div class="form-group d-flex justify-content-end">
|
||||
@if (request()->query('show'))
|
||||
<a href="{{route('dashboard.sub.classifications.show', ['id' => encrypt_id($subClassification->id)])}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
@else
|
||||
<a href="{{route('dashboard.sub.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<button type="submit" class="btn btn-md btn-primary">Simpan</button>
|
||||
@endif
|
||||
<button type="button" class="btn btn-md btn-primary" id="submitButton">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,11 +44,12 @@
|
||||
<table class="table table-striped table-bordered nowrap" id="subClassificationsTable" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10% !important;">No</th>
|
||||
<th>No</th>
|
||||
<th>Klasifikasi</th>
|
||||
<th>Nama</th>
|
||||
<th style="width: 13% !important;">Status</th>
|
||||
<th style="width: 10% !important;"></th>
|
||||
<th>Isu</th>
|
||||
<th>Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
@include('partials.dashboard.head')
|
||||
@include('partials.dashboard.sidebar', ['page' => 'journalists'])
|
||||
@include('partials.dashboard.sidebar', ['page' => 'sub_classifications'])
|
||||
@include('partials.dashboard.header')
|
||||
<!-- content @s -->
|
||||
<div class="nk-content ">
|
||||
@ -12,7 +12,7 @@
|
||||
<div class="card-content">
|
||||
<ul class="nav nav-tabs nav-tabs-mb-icon nav-tabs-card">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Jurnalis</span></a>
|
||||
<a class="nav-link text-primary" href="#"><em class="icon ni ni-info"></em><span>Detail Sub Klasifikasi</span></a>
|
||||
</li>
|
||||
</ul><!-- .nav-tabs -->
|
||||
<div class="card-inner">
|
||||
@ -34,6 +34,18 @@
|
||||
<span class="profile-ud-value">{{$subClassification->classification->name}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Isu</span>
|
||||
<span class="profile-ud-value">
|
||||
@if ($subClassification->issues->count() > 0)
|
||||
<a href="{{route('dashboard.issue.managements.index', ['sub_classification' => encrypt_id($subClassification->id)])}}"><u>{{$subClassification->issues->count()}}</u></a>
|
||||
@else
|
||||
{{$subClassification->issues->count()}}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="profile-ud-item">
|
||||
<div class="profile-ud wider">
|
||||
<span class="profile-ud-label">Status</span>
|
||||
@ -65,22 +77,10 @@
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block -->
|
||||
{{-- <div class="nk-block">
|
||||
<div class="nk-block-head nk-block-head-sm nk-block-between">
|
||||
<span class="profile-ud-label">Konten</span>
|
||||
</div><!-- .nk-block-head -->
|
||||
<div class="bq-note">
|
||||
<div class="bq-note-item">
|
||||
<div class="bq-note-text">
|
||||
{!!$journalistMonitoring->content!!}
|
||||
</div>
|
||||
</div><!-- .bq-note-item -->
|
||||
</div><!-- .bq-note -->
|
||||
</div><!-- .nk-block --> --}}
|
||||
<hr>
|
||||
<div class="nk-block d-flex justify-content-end">
|
||||
<a href="{{route('dashboard.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
{{-- <a href="{{route('dashboard.content.recaps.edit', ['id' => encrypt_id($journalistMonitoring->id)])}}" class="btn btn-warning"><span>Ubah</span></a> --}}
|
||||
<a href="{{route('dashboard.sub.classifications.index')}}" class="btn btn-white btn-dim btn-outline-light mx-2"><span>Kembali</span></a>
|
||||
<a href="{{route('dashboard.sub.classifications.edit', ['id' => encrypt_id($subClassification->id), 'show' => true])}}" class="btn btn-warning"><span>Ubah</span></a>
|
||||
</div><!-- .nk-block -->
|
||||
</div><!-- .card-inner -->
|
||||
</div><!-- .card-content -->
|
||||
|
||||
@ -38,20 +38,20 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@if ($user->role_id !== 3)
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Role<span class="required-input">*</span></label>
|
||||
<div class="form-control-wrap">
|
||||
<select class="form-select js-select2" name="role_id">
|
||||
@foreach ($roles as $role)
|
||||
@if ($role->id != '3')
|
||||
<option value="{{$role->id}}" {{$user->role_id == $role->id ? 'selected' : ''}}>{{$role->name}}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Status<span class="required-input">*</span></label>
|
||||
|
||||
@ -33,13 +33,33 @@
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'sub_classifications', name: 'sub_classifications' },
|
||||
{ data: 'issues', name: 'issues' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 0, width: 'auto' },
|
||||
{ targets: 2, width: '7%' },
|
||||
{ targets: 3, width: '10%' },
|
||||
{ targets: 4, width: '10%' },
|
||||
{ targets: 5, width: 'auto' },
|
||||
{
|
||||
targets: [1],
|
||||
createdCell: function(td, cellData, rowData, row, col) {
|
||||
$(td).css({
|
||||
'word-wrap': 'break-word',
|
||||
'white-space': 'normal',
|
||||
'overflow-wrap': 'break-word'
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[5, 'desc']],
|
||||
order: [
|
||||
[6, 'desc'],
|
||||
],
|
||||
pagingType: "simple",
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']],
|
||||
scrollX: true
|
||||
@ -60,14 +80,34 @@
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'classification', name: 'classification' },
|
||||
{ data: 'name', name: 'name' },
|
||||
{ data: 'issues', name: 'issues' },
|
||||
{ data: 'status', name: 'status' },
|
||||
{ data: 'action', name: 'action', orderable: false, searchable: false },
|
||||
{ data: 'created_at', name: 'created_at', visible: false },
|
||||
{ data: 'id', name: 'id', orderable: true, searchable: false, visible: false },
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 0, width: 'auto' },
|
||||
{ targets: 1, width: '10%' },
|
||||
{ targets: 3, width: '10%' },
|
||||
{ targets: 4, width: '10%' },
|
||||
{ targets: 5, width: 'auto' },
|
||||
{
|
||||
targets: [2],
|
||||
createdCell: function(td, cellData, rowData, row, col) {
|
||||
$(td).css({
|
||||
'word-wrap': 'break-word',
|
||||
'white-space': 'normal',
|
||||
'overflow-wrap': 'break-word'
|
||||
});
|
||||
}
|
||||
}
|
||||
],
|
||||
language: datatableLanguage,
|
||||
autoWidth: false,
|
||||
order: [[5, 'desc']],
|
||||
order: [
|
||||
[6, 'desc']
|
||||
],
|
||||
pagingType: "simple",
|
||||
lengthMenu: [[10, 25, 50, 100, -1], ['Tampilkan 10 data', 'Tampilkan 25 data', 'Tampilkan 50 data', 'Tampilkan 100 data', 'Tampilkan semua']],
|
||||
scrollX: true
|
||||
@ -729,7 +769,7 @@
|
||||
$('#issueManagementsTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: '{{ route('dashboard.issue.managements.data') }}',
|
||||
ajax: '{{ route('dashboard.issue.managements.data', ["classification" => $classification, "sub_classification" => $sub_classification, "location" => $location, "sub_location" => $sub_location, "agency" => $agency]) }}',
|
||||
columns: [
|
||||
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
|
||||
{ data: 'code', name: 'code' },
|
||||
|
||||
@ -699,6 +699,8 @@ function ecommerceBarS1(selector, set_data) {
|
||||
data: [4305, 859, 482, 138]
|
||||
}]
|
||||
};
|
||||
|
||||
@if(is_role(['1']))
|
||||
var issueStatistics = {
|
||||
labels: ["Krisis", "Negatif", "Netral", "Positif"],
|
||||
dataUnit: 'Data',
|
||||
@ -720,6 +722,7 @@ function ecommerceBarS1(selector, set_data) {
|
||||
data: ["{{ $facebookMediaMonitoring }}", "{{ $twitterMediaMonitoring }}", "{{ $websiteMediaMonitoring }}", "{{ $youtubeMediaMonitoring }}", "{{ $instagramMediaMonitoring }}", "{{ $tiktokMediaMonitoring }}", "{{ $cetakMediaMonitoring }}"]
|
||||
}]
|
||||
};
|
||||
@endif
|
||||
|
||||
var mediaOrderStatistics = {
|
||||
labels: ["Menunggu", "Diterima", "Ditolak"],
|
||||
|
||||
@ -143,7 +143,7 @@ function statusAction(url, message, confirmButtonAction) {
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
console.log("Form akan dikirim...");
|
||||
// console.log("Form akan dikirim...");
|
||||
|
||||
$('#myForm').off('submit').submit(); // Pastikan hanya submit 1x
|
||||
}
|
||||
|
||||
@ -51,38 +51,42 @@
|
||||
Route::get('/overview', 'index')->name('overview');
|
||||
});
|
||||
|
||||
Route::prefix('classifications')->name('classifications.')->group(function(){
|
||||
Route::controller(ClassificationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
Route::middleware('role:1,2,4')->group(function(){
|
||||
Route::prefix('classifications')->name('classifications.')->group(function(){
|
||||
Route::controller(ClassificationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('/data', [DatatableController::class, 'classification'])->name('data');
|
||||
Route::get('/data', [DatatableController::class, 'classification'])->name('data');
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('sub-classifications')->name('sub.classifications.')->group(function(){
|
||||
Route::controller(SubClassificationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
Route::middleware('role:1,2,4')->group(function(){
|
||||
Route::prefix('sub-classifications')->name('sub.classifications.')->group(function(){
|
||||
Route::controller(SubClassificationController::class)->group(function(){
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/{id}/show', 'show')->name('show');
|
||||
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
Route::middleware('role:1')->group(function(){
|
||||
Route::get('/create', 'create')->name('create');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::get('/{id}/edit', 'edit')->name('edit');
|
||||
Route::put('/{id}', 'update')->name('update');
|
||||
Route::delete('/{id}', 'destroy')->name('destroy');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Route::get('/data', [DatatableController::class, 'subClassification'])->name('data');
|
||||
Route::get('/data', [DatatableController::class, 'subClassification'])->name('data');
|
||||
});
|
||||
});
|
||||
|
||||
Route::prefix('locations')->name('locations.')->group(function(){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user