feat(issue management): add date range and user for export data and filder datatable

This commit is contained in:
Yoga Pangestu 2025-10-10 15:37:25 +07:00
parent 019c6374f2
commit 51c2365cfa
5 changed files with 1284 additions and 1112 deletions

View File

@ -11,26 +11,54 @@
use Maatwebsite\Excel\Concerns\WithStyles; use Maatwebsite\Excel\Concerns\WithStyles;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class IssueManagementExport implements FromCollection, WithHeadings, WithStyles, WithMapping class IssueManagementExport implements FromCollection, WithHeadings, WithMapping, WithStyles
{ {
/** /**
* @return \Illuminate\Support\Collection * @return \Illuminate\Support\Collection
*/ */
protected $no = 1; protected $no = 1;
protected $classification; protected $classification;
protected $sub_classification; protected $sub_classification;
protected $location; protected $location;
protected $sub_location; protected $sub_location;
protected $government_agency; protected $government_agency;
protected $issue; protected $issue;
protected $response; protected $response;
protected $year; protected $year;
protected $month; protected $month;
protected $date; protected $date;
public function __construct($classification, $sub_classification, $location, $sub_location, $government_agency, $issue, $response, $year, $month, $date) protected $start_date;
{
protected $end_date;
protected $user;
public function __construct(
$classification,
$sub_classification,
$location,
$sub_location,
$government_agency,
$issue,
$response,
$year,
$month,
$date,
$start_date,
$end_date,
$user
) {
$this->classification = $classification; $this->classification = $classification;
$this->sub_classification = $sub_classification; $this->sub_classification = $sub_classification;
$this->location = $location; $this->location = $location;
@ -41,6 +69,9 @@ public function __construct($classification, $sub_classification, $location, $su
$this->year = $year; $this->year = $year;
$this->month = $month; $this->month = $month;
$this->date = $date; $this->date = $date;
$this->start_date = $start_date;
$this->end_date = $end_date;
$this->user = $user;
} }
public function collection() public function collection()
@ -70,7 +101,7 @@ public function collection()
} }
if ($this->issue) { if ($this->issue) {
switch($this->issue){ switch ($this->issue) {
case 'positive': case 'positive':
$query->where('issue', 'positif'); $query->where('issue', 'positif');
break; break;
@ -87,7 +118,7 @@ public function collection()
} }
if ($this->response) { if ($this->response) {
switch($this->response){ switch ($this->response) {
case 'positive': case 'positive':
$query->where('response', 'positif'); $query->where('response', 'positif');
break; break;
@ -117,6 +148,17 @@ public function collection()
$query->whereDate('created_at', $this->date); $query->whereDate('created_at', $this->date);
} }
if ($this->start_date && $this->end_date) {
$start = \Carbon\Carbon::createFromFormat('m/d/Y', $this->start_date)->startOfDay();
$end = \Carbon\Carbon::createFromFormat('m/d/Y', $this->end_date)->endOfDay();
$query->whereBetween('created_at', [$start, $end]);
}
if ($this->user) {
$query->where('enhancer_id', decrypt_id($this->user));
}
return $query->get(); return $query->get();
} }
@ -132,7 +174,7 @@ public function map($issueManagement): array
$issueManagement->subLocation->name, $issueManagement->subLocation->name,
ucfirst($issueManagement->issue), ucfirst($issueManagement->issue),
ucfirst($issueManagement->response), ucfirst($issueManagement->response),
$issueManagement->governmentAgencies->map(function($agency) { $issueManagement->governmentAgencies->map(function ($agency) {
return Str::ucfirst($agency->name); return Str::ucfirst($agency->name);
})->implode(', '), })->implode(', '),
$issueManagement->enhancer->name ?? 'Admin', $issueManagement->enhancer->name ?? 'Admin',
@ -144,7 +186,7 @@ public function headings(): array
{ {
return [ return [
['Data Managemen Isu', '', '', '', '', '', '', '', '', '', '', ''], ['Data Managemen Isu', '', '', '', '', '', '', '', '', '', '', ''],
['NO', 'Kode', 'Monitoring Media', 'Klasifikasi', 'Sub Klasifikasi', 'Lokus', 'Sub Lokus', 'Isu', 'Tanggapan', 'Dinas', 'Oleh', 'Dibuat Pada'] ['NO', 'Kode', 'Monitoring Media', 'Klasifikasi', 'Sub Klasifikasi', 'Lokus', 'Sub Lokus', 'Isu', 'Tanggapan', 'Dinas', 'Oleh', 'Dibuat Pada'],
]; ];
} }

File diff suppressed because it is too large Load Diff

View File

@ -12,16 +12,17 @@
use App\Models\MediaMonitoring; use App\Models\MediaMonitoring;
use App\Models\SubClassification; use App\Models\SubClassification;
use App\Models\SubLocation; use App\Models\SubLocation;
use App\Models\User;
use Barryvdh\DomPDF\Facade\Pdf; use Barryvdh\DomPDF\Facade\Pdf;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
class IssueManagementController extends Controller class IssueManagementController extends Controller
{ {
public function index(Request $request){ public function index(Request $request)
{
return view('dashboard.issue-managements.index', [ return view('dashboard.issue-managements.index', [
'title' => 'Manajemen Isu', 'title' => 'Manajemen Isu',
'classification' => $request->input('classification', null), 'classification' => $request->input('classification', null),
@ -35,23 +36,28 @@ public function index(Request $request){
'year' => $request->input('year', null), 'year' => $request->input('year', null),
'month' => $request->input('month', null), 'month' => $request->input('month', null),
'date' => $request->input('date', null), 'date' => $request->input('date', null),
'start_date' => $request->input('start_date', null),
'end_date' => $request->input('end_date', null),
'user' => $request->input('user', null),
'locations' => Location::all(), 'locations' => Location::all(),
'sub_locations' => SubLocation::all(), 'sub_locations' => SubLocation::all(),
'classifications' => Classification::all(), 'classifications' => Classification::all(),
'sub_classifications' => SubClassification::all(), 'sub_classifications' => SubClassification::all(),
'government_agencies' => GovernmentAgency::all(), 'government_agencies' => GovernmentAgency::all(),
'users' => User::all(),
]); ]);
} }
public function create(Request $request){ public function create(Request $request)
{
return view('dashboard.issue-managements.create', [ return view('dashboard.issue-managements.create', [
'title' => 'Tambah Manajemen Isu', 'title' => 'Tambah Manajemen Isu',
'locations' => Location::all(), 'locations' => Location::all(),
'classifications' => Classification::all(), 'classifications' => Classification::all(),
'governmentAgencies' => GovernmentAgency::all(), 'governmentAgencies' => GovernmentAgency::all(),
'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find(decrypt_id($request->input('media_monitoring'))), 'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find(decrypt_id($request->input('media_monitoring'))),
'mediaMonitoringId' => $request->input('media_monitoring') ?? null 'mediaMonitoringId' => $request->input('media_monitoring') ?? null,
]); ]);
} }
@ -60,8 +66,8 @@ public function store(IssueManagementRequest $request, $media_monitoring_id)
$validatedData = $request->validated(); $validatedData = $request->validated();
$validatedData['media_monitoring_id'] = decrypt_id($media_monitoring_id); $validatedData['media_monitoring_id'] = decrypt_id($media_monitoring_id);
try{ try {
$createdIssueManagement = DB::transaction(function()use($validatedData, $request){ $createdIssueManagement = DB::transaction(function () use ($validatedData, $request) {
$createdIssueManagement = IssueManagement::create($validatedData); $createdIssueManagement = IssueManagement::create($validatedData);
$createdIssueManagement->governmentAgencies()->attach($request->input('government_agencies')); $createdIssueManagement->governmentAgencies()->attach($request->input('government_agencies'));
@ -73,15 +79,20 @@ public function store(IssueManagementRequest $request, $media_monitoring_id)
} else { } else {
return redirect()->back()->with('failed-status', 'Gagal menambahkan manajemen isu'); return redirect()->back()->with('failed-status', 'Gagal menambahkan manajemen isu');
} }
}catch(\Exception $e){ } catch (\Exception $e) {
return redirect()->back()->with('failed-status', 'Gagal menambahkan manajemen isu'); return redirect()->back()->with('failed-status', 'Gagal menambahkan manajemen isu');
} }
} }
public function edit(Request $request, $id)
public function edit(Request $request, $id) { {
$issueManagement = IssueManagement::with([ $issueManagement = IssueManagement::with([
'location', 'subLocation', 'classification', 'subClassification', 'mediaMonitoring', 'enhancer' 'location',
'subLocation',
'classification',
'subClassification',
'mediaMonitoring',
'enhancer',
])->findOrFail(decrypt_id($id)); ])->findOrFail(decrypt_id($id));
return view('dashboard.issue-managements.edit', [ return view('dashboard.issue-managements.edit', [
@ -92,17 +103,22 @@ public function edit(Request $request, $id) {
'selectedGovernmentAgencies' => $issueManagement->governmentAgencies->pluck('id')->toArray(), 'selectedGovernmentAgencies' => $issueManagement->governmentAgencies->pluck('id')->toArray(),
'issueManagement' => $issueManagement, 'issueManagement' => $issueManagement,
'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find($issueManagement->media_monitoring_id), 'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find($issueManagement->media_monitoring_id),
'mediaMonitoringId' => $request->input('media_monitoring') ?? null 'mediaMonitoringId' => $request->input('media_monitoring') ?? null,
]); ]);
} }
public function update(IssueManagementRequest $request, $id)
public function update(IssueManagementRequest $request, $id){ {
$validatedData = $request->validated(); $validatedData = $request->validated();
try{ try {
$issueManagement = IssueManagement::with([ $issueManagement = IssueManagement::with([
'location', 'subLocation', 'classification', 'subClassification', 'mediaMonitoring', 'enhancer' 'location',
'subLocation',
'classification',
'subClassification',
'mediaMonitoring',
'enhancer',
])->findOrFail(decrypt_id($id)); ])->findOrFail(decrypt_id($id));
$validatedData['media_monitoring_id'] = $issueManagement->media_monitoring_id; $validatedData['media_monitoring_id'] = $issueManagement->media_monitoring_id;
@ -110,26 +126,33 @@ public function update(IssueManagementRequest $request, $id){
if ($request->has('government_agencies')) { if ($request->has('government_agencies')) {
$issueManagement->governmentAgencies()->sync($validatedData['government_agencies']); $issueManagement->governmentAgencies()->sync($validatedData['government_agencies']);
} }
}catch(\Exception $e){ } catch (\Exception $e) {
return redirect()->back()->with('failed-status', 'Gagal mengubah manajemen isu'); return redirect()->back()->with('failed-status', 'Gagal mengubah manajemen isu');
} }
return redirect()->route('dashboard.issue.managements.show', ['id' => encrypt_id($issueManagement->id)])->with('success-status', 'Berhasil mengubah manajemen isu.'); return redirect()->route('dashboard.issue.managements.show', ['id' => encrypt_id($issueManagement->id)])->with('success-status', 'Berhasil mengubah manajemen isu.');
} }
public function show($id){ public function show($id)
{
$issueManagement = IssueManagement::with([ $issueManagement = IssueManagement::with([
'location', 'subLocation', 'classification', 'subClassification', 'mediaMonitoring', 'enhancer' 'location',
'subLocation',
'classification',
'subClassification',
'mediaMonitoring',
'enhancer',
])->findOrFail(decrypt_id($id)); ])->findOrFail(decrypt_id($id));
return view('dashboard.issue-managements.show', [ return view('dashboard.issue-managements.show', [
'title' => 'Detail Manajemen Isu', 'title' => 'Detail Manajemen Isu',
'issueManagement' => $issueManagement, 'issueManagement' => $issueManagement,
'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find($issueManagement->media_monitoring_id) 'mediaMonitoring' => MediaMonitoring::with(['enhancer'])->find($issueManagement->media_monitoring_id),
]); ]);
} }
public function destroy($id){ public function destroy($id)
{
try { try {
$issueManagement = IssueManagement::findOrFail(decrypt_id($id)); $issueManagement = IssueManagement::findOrFail(decrypt_id($id));
@ -156,9 +179,9 @@ public function getSubClassifications($location_id)
return response()->json(['sub_classifications' => $subLocations]); return response()->json(['sub_classifications' => $subLocations]);
} }
public function filter(Request $request){ public function filter(Request $request)
{
try{ try {
$filteredRequest = $request->except('_token'); $filteredRequest = $request->except('_token');
$filterField = array_filter($filteredRequest, function ($value) { $filterField = array_filter($filteredRequest, function ($value) {
@ -166,15 +189,14 @@ public function filter(Request $request){
}); });
return redirect()->route('dashboard.issue.managements.index', $filterField); return redirect()->route('dashboard.issue.managements.index', $filterField);
}catch(\Exception $e){ } catch (\Exception $e) {
return redirect()->back()->with('status-failed', 'Gagal melakukan proses filter data.'); return redirect()->back()->with('status-failed', 'Gagal melakukan proses filter data.');
} }
} }
public function export(Request $request) public function export(Request $request)
{ {
try {
try{
$classification = $request->input('classification', null); $classification = $request->input('classification', null);
$sub_classification = $request->input('sub_classification', null); $sub_classification = $request->input('sub_classification', null);
$location = $request->input('location', null); $location = $request->input('location', null);
@ -185,27 +207,49 @@ public function export(Request $request)
$year = $request->input('year', null); $year = $request->input('year', null);
$month = $request->input('month', null); $month = $request->input('month', null);
$date = $request->input('date', null); $date = $request->input('date', null);
$start_date = $request->input('start_date', null);
$end_date = $request->input('end_date', null);
$user = $request->input('user', null);
$formattedNow = Carbon::parse(now())->locale('id')->translatedFormat('d-m-Y'); $formattedNow = Carbon::parse(now())->locale('id')->translatedFormat('d-m-Y');
return Excel::download(new IssueManagementExport($classification, $sub_classification, $location, $sub_location, $government_agency, $issue, $response, $year, $month, $date), 'issue-managements-'.$formattedNow.'.xlsx'); return Excel::download(new IssueManagementExport(
}catch(\Exception $e){ $classification,
$sub_classification,
$location,
$sub_location,
$government_agency,
$issue,
$response,
$year,
$month,
$date,
$start_date,
$end_date,
$user
), 'issue-managements-'.$formattedNow.'.xlsx');
} catch (\Exception $e) {
return redirect()->back()->with('failed-status', 'Gagal melakukan proses export data.'); return redirect()->back()->with('failed-status', 'Gagal melakukan proses export data.');
} }
} }
public function printData($id){ public function printData($id)
{
try {
try{
$issueManagement = IssueManagement::with([ $issueManagement = IssueManagement::with([
'location', 'subLocation', 'classification', 'subClassification', 'governmentAgencies','enhancer', 'mediaMonitoring' 'location',
'subLocation',
'classification',
'subClassification',
'governmentAgencies',
'enhancer',
'mediaMonitoring',
])->findOrFail(decrypt_id($id)); ])->findOrFail(decrypt_id($id));
$pdf = Pdf::loadView('dashboard.issue-managements.print', compact('issueManagement')); $pdf = Pdf::loadView('dashboard.issue-managements.print', compact('issueManagement'));
return $pdf->stream(slugify('manajemen isu '. $issueManagement->mediaMonitoring->code).'.pdf'); return $pdf->stream(slugify('manajemen isu '.$issueManagement->mediaMonitoring->code).'.pdf');
}catch(\Exception $e){ } catch (\Exception $e) {
return redirect()->back()->with('failed-status', 'Gagal melakukan proses print data.'); return redirect()->back()->with('failed-status', 'Gagal melakukan proses print data.');
} }
} }

View File

@ -1,36 +1,64 @@
@include('partials.dashboard.head') @include('partials.dashboard.head')
@include('partials.dashboard.sidebar', ['page' => 'issue_managements']) @include('partials.dashboard.sidebar', ['page' => 'issue_managements'])
@include('partials.dashboard.header') @include('partials.dashboard.header')
<!-- content @s --> <!-- content @s -->
<div class="nk-content "> <div class="nk-content ">
<div class="container-fluid"> <div class="container-fluid">
<div class="nk-content-inner"> <div class="nk-content-inner">
<div class="nk-content-body"> <div class="nk-content-body">
<div class="nk-block-head nk-block-head-sm"> <div class="nk-block-head nk-block-head-sm">
<div class="nk-block-between"> <div class="nk-block-between">
<div class="nk-block-head-content"> <div class="nk-block-head-content">
<h3 class="nk-block-title page-title">{{$title}}</h3> <h3 class="nk-block-title page-title">{{ $title }}</h3>
</div><!-- .nk-block-head-content --> </div><!-- .nk-block-head-content -->
<div class="nk-block-head-content"> <div class="nk-block-head-content">
<div class="toggle-wrap nk-block-tools-toggle"> <div class="toggle-wrap nk-block-tools-toggle">
<a href="#" class="btn btn-icon btn-trigger toggle-expand me-n1" data-target="pageMenu"><em class="icon ni ni-more-v"></em></a> <a href="#" class="btn btn-icon btn-trigger toggle-expand me-n1"
data-target="pageMenu"><em class="icon ni ni-more-v"></em></a>
<div class="toggle-expand-content" data-content="pageMenu"> <div class="toggle-expand-content" data-content="pageMenu">
<ul class="nk-block-tools g-3"> <ul class="nk-block-tools g-3">
<li> <li>
@if (filled(value: $media_monitoring) || filled(value: $classification) || filled(value: $sub_classification) || filled(value: $location) || filled(value: $sub_location) || filled($year) || filled(value: $government_agency) || filled(value: $issue) || filled($response) || filled($year) || filled($month) || filled($date)) @if (filled(value: $media_monitoring) ||
filled(value: $classification) ||
filled(value: $sub_classification) ||
filled(value: $location) ||
filled(value: $sub_location) ||
filled($year) ||
filled(value: $government_agency) ||
filled(value: $issue) ||
filled($response) ||
filled($year) ||
filled($month) ||
filled($date) ||
filled($start_date) ||
filled($end_date))
<span class="mx-1"> <span class="mx-1">
<a href="{{route('dashboard.issue.managements.index')}}" class="text-secondary"> <a href="{{ route('dashboard.issue.managements.index') }}"
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" class="icon icon-tabler icons-tabler-filled icon-tabler-xbox-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10 -10 10s-10 -4.477 -10 -10s4.477 -10 10 -10m3.6 5.2a1 1 0 0 0 -1.4 .2l-2.2 2.933l-2.2 -2.933a1 1 0 1 0 -1.6 1.2l2.55 3.4l-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2 -2.933l2.2 2.933a1 1 0 0 0 1.6 -1.2l-2.55 -3.4l2.55 -3.4a1 1 0 0 0 -.2 -1.4" /></svg> class="text-secondary">
<svg xmlns="http://www.w3.org/2000/svg" width="24"
height="24" viewBox="0 0 24 24" fill="currentColor"
class="icon icon-tabler icons-tabler-filled icon-tabler-xbox-x">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M12 2c5.523 0 10 4.477 10 10s-4.477 10 -10 10s-10 -4.477 -10 -10s4.477 -10 10 -10m3.6 5.2a1 1 0 0 0 -1.4 .2l-2.2 2.933l-2.2 -2.933a1 1 0 1 0 -1.6 1.2l2.55 3.4l-2.55 3.4a1 1 0 1 0 1.6 1.2l2.2 -2.933l2.2 2.933a1 1 0 0 0 1.6 -1.2l-2.55 -3.4l2.55 -3.4a1 1 0 0 0 -.2 -1.4" />
</svg>
</a> </a>
</span> </span>
@endif @endif
<div> <div>
<a href="javascript: void(0);" class="btn btn-white btn-dim btn-outline-light" data-bs-toggle="modal" data-bs-target="#modalFilter"><em class="d-none d-sm-inline icon ni ni-filter"></em><span><span class="d-none d-md-inline">Filter</a> <a href="javascript: void(0);"
class="btn btn-white btn-dim btn-outline-light"
data-bs-toggle="modal" data-bs-target="#modalFilter"><em
class="d-none d-sm-inline icon ni ni-filter"></em><span><span
class="d-none d-md-inline">Filter</a>
</div> </div>
</li> </li>
<li> <li>
<div> <div>
<a href="javascript: void(0);" class="btn btn-info" data-bs-toggle="modal" data-bs-target="#modalExport"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a> <a href="javascript: void(0);" class="btn btn-info"
data-bs-toggle="modal" data-bs-target="#modalExport"><em
class="d-none d-sm-inline icon ni ni-upload"></em><span><span
class="d-none d-md-inline">Export</a>
</div> </div>
</li> </li>
</ul> </ul>
@ -43,7 +71,8 @@
<div class="card card-bordered card-preview"> <div class="card card-bordered card-preview">
<div class="card-inner"> <div class="card-inner">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered nowrap" id="issueManagementsTable" border="1"> <table class="table table-striped table-bordered nowrap" id="issueManagementsTable"
border="1">
<thead> <thead>
<tr> <tr>
<th style="width: 10% !important;">No</th> <th style="width: 10% !important;">No</th>
@ -74,16 +103,19 @@
<em class="icon ni ni-cross"></em> <em class="icon ni ni-cross"></em>
</a> </a>
</div> </div>
<form action="{{route('dashboard.issue.managements.filter')}}" class="form-validate is-alter" method="post"> <form action="{{ route('dashboard.issue.managements.filter') }}"
class="form-validate is-alter" method="post">
@csrf @csrf
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label class="form-label">Lokus</label> <label class="form-label">Lokus</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="location"> <select class="form-select js-select2" name="location">
<option value="all" @selected(isset($location) && $location == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($location) && $location == 'all') selected disabled>
Semua</option>
@foreach ($locations as $item) @foreach ($locations as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($location) && $location == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($location) && $location == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -92,9 +124,11 @@
<label class="form-label">Sub Lokus</label> <label class="form-label">Sub Lokus</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="sub_location"> <select class="form-select js-select2" name="sub_location">
<option value="all" @selected(isset($sub_location) && $sub_location == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($sub_location) && $sub_location == 'all') selected disabled>
Semua</option>
@foreach ($sub_locations as $item) @foreach ($sub_locations as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($sub_location) && $sub_location == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($sub_location) && $sub_location == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -103,9 +137,11 @@
<label class="form-label">Klasifikasi</label> <label class="form-label">Klasifikasi</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="classification"> <select class="form-select js-select2" name="classification">
<option value="all" @selected(isset($classification) && $classification == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($classification) && $classification == 'all') selected disabled>
Semua</option>
@foreach ($classifications as $item) @foreach ($classifications as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($classification) && $classification == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($classification) && $classification == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -114,9 +150,11 @@
<label class="form-label">Sub Klasifikasi</label> <label class="form-label">Sub Klasifikasi</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="sub_classification"> <select class="form-select js-select2" name="sub_classification">
<option value="all" @selected(isset($sub_classification) && $sub_classification == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($sub_classification) && $sub_classification == 'all') selected disabled>
Semua</option>
@foreach ($sub_classifications as $item) @foreach ($sub_classifications as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($sub_classification) && $sub_classification == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($sub_classification) && $sub_classification == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -125,9 +163,11 @@
<label class="form-label">Dinas/OPD</label> <label class="form-label">Dinas/OPD</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="government_agency"> <select class="form-select js-select2" name="government_agency">
<option value="all" @selected(isset($government_agency) && $government_agency == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($government_agency) && $government_agency == 'all') selected disabled>
Semua</option>
@foreach ($government_agencies as $item) @foreach ($government_agencies as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($government_agency) && $government_agency == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($government_agency) && $government_agency == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -136,7 +176,8 @@
<label class="form-label">Isu</label> <label class="form-label">Isu</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="issue"> <select class="form-select js-select2" name="issue">
<option value="all" @selected(isset($issue) && $issue == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($issue) && $issue == 'all') selected disabled>
Semua</option>
<option value="positive" @selected(isset($issue) && $issue == 'positive')>Positif</option> <option value="positive" @selected(isset($issue) && $issue == 'positive')>Positif</option>
<option value="negative" @selected(isset($issue) && $issue == 'negative')>Negatif</option> <option value="negative" @selected(isset($issue) && $issue == 'negative')>Negatif</option>
<option value="neutral" @selected(isset($issue) && $issue == 'neutral')>Netral</option> <option value="neutral" @selected(isset($issue) && $issue == 'neutral')>Netral</option>
@ -148,7 +189,8 @@
<label class="form-label">Tanggapan</label> <label class="form-label">Tanggapan</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="response"> <select class="form-select js-select2" name="response">
<option value="all" @selected(isset($response) && $response == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($response) && $response == 'all') selected disabled>
Semua</option>
<option value="positive" @selected(isset($response) && $response == 'positive')>Positif</option> <option value="positive" @selected(isset($response) && $response == 'positive')>Positif</option>
<option value="negative" @selected(isset($response) && $response == 'negative')>Negatif</option> <option value="negative" @selected(isset($response) && $response == 'negative')>Negatif</option>
<option value="neutral" @selected(isset($response) && $response == 'neutral')>Netral</option> <option value="neutral" @selected(isset($response) && $response == 'neutral')>Netral</option>
@ -159,19 +201,51 @@
<div class="form-group"> <div class="form-group">
<label class="form-label" for="year">Tahun</label> <label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Data isu pada tahun" name="year" value="{{ old('year', $year ?? '') }}"> <input type="number" class="form-control" id="year"
placeholder="Data isu pada tahun" name="year"
value="{{ old('year', $year ?? '') }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="month">Bulan</label> <label class="form-label" for="month">Bulan</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="month" class="form-control" id="month" placeholder="Data berita pada bulan dan tahun" name="month" value="{{ old('month', $month ?? '') }}"> <input type="month" class="form-control" id="month"
placeholder="Data berita pada bulan dan tahun" name="month"
value="{{ old('month', $month ?? '') }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="date">Tanggal</label> <label class="form-label" for="date">Tanggal</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="date" class="form-control" id="date" placeholder="Data berita pada bulan dan tahun" name="date" value="{{ old('date', $date ?? '') }}"> <input type="date" class="form-control" id="date"
placeholder="Data berita pada bulan dan tahun" name="date"
value="{{ old('date', $date ?? '') }}">
</div>
</div>
<div class="form-group"> <label class="form-label">Rentang Tanggal</label>
<div class="form-control-wrap">
<div class="input-daterange date-picker-range input-group">
<input type="text" class="form-control" id="start-date"
name="start_date"
value="{{ old('start_date', $start_date ?? '') }}" />
<div class="input-group-addon">TO</div>
<input type="text" class="form-control" id="end-date"
name="end_date" value="{{ old('end_date', $end_date ?? '') }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="form-label">Pengguna</label>
<div class="form-control-wrap">
<select class="form-select js-select2" name="user">
<option value="all" @selected(isset($user) && $user == 'all') selected disabled>
Semua</option>
@foreach ($users as $item)
<option value="{{ encrypt_id($item->id) }}"
@selected(isset($user) && $user == encrypt_id($item->id))>{{ $item->name }}
</option>
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
@ -189,20 +263,24 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">Export</h5> <h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close"> <a href="javascript:void(0);" class="close" data-bs-dismiss="modal"
aria-label="Close">
<em class="icon ni ni-cross"></em> <em class="icon ni ni-cross"></em>
</a> </a>
</div> </div>
<form action="{{route('dashboard.issue.managements.export')}}" class="form-validate is-alter" method="post"> <form action="{{ route('dashboard.issue.managements.export') }}"
class="form-validate is-alter" method="post">
@csrf @csrf
<div class="modal-body"> <div class="modal-body">
<div class="form-group"> <div class="form-group">
<label class="form-label">Lokus</label> <label class="form-label">Lokus</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="location"> <select class="form-select js-select2" name="location">
<option value="all" @selected(isset($location) && $location == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($location) && $location == 'all') selected disabled>
Semua</option>
@foreach ($locations as $item) @foreach ($locations as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($location) && $location == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($location) && $location == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -211,9 +289,11 @@
<label class="form-label">Sub Lokus</label> <label class="form-label">Sub Lokus</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="sub_location"> <select class="form-select js-select2" name="sub_location">
<option value="all" @selected(isset($sub_location) && $sub_location == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($sub_location) && $sub_location == 'all') selected disabled>
Semua</option>
@foreach ($sub_locations as $item) @foreach ($sub_locations as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($sub_location) && $sub_location == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($sub_location) && $sub_location == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -222,9 +302,11 @@
<label class="form-label">Klasifikasi</label> <label class="form-label">Klasifikasi</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="classification"> <select class="form-select js-select2" name="classification">
<option value="all" @selected(isset($classification) && $classification == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($classification) && $classification == 'all') selected disabled>
Semua</option>
@foreach ($classifications as $item) @foreach ($classifications as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($classification) && $classification == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($classification) && $classification == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -233,9 +315,11 @@
<label class="form-label">Sub Klasifikasi</label> <label class="form-label">Sub Klasifikasi</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="sub_classification"> <select class="form-select js-select2" name="sub_classification">
<option value="all" @selected(isset($sub_classification) && $sub_classification == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($sub_classification) && $sub_classification == 'all') selected disabled>
Semua</option>
@foreach ($sub_classifications as $item) @foreach ($sub_classifications as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($sub_classification) && $sub_classification == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($sub_classification) && $sub_classification == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -244,9 +328,11 @@
<label class="form-label">Dinas/OPD</label> <label class="form-label">Dinas/OPD</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="government_agency"> <select class="form-select js-select2" name="government_agency">
<option value="all" @selected(isset($government_agency) && $government_agency == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($government_agency) && $government_agency == 'all') selected disabled>
Semua</option>
@foreach ($government_agencies as $item) @foreach ($government_agencies as $item)
<option value="{{ encrypt_id($item->id) }}" @selected(isset($government_agency) && $government_agency == encrypt_id($item->id))>{{$item->name}}</option> <option value="{{ encrypt_id($item->id) }}"
@selected(isset($government_agency) && $government_agency == encrypt_id($item->id))>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@ -255,7 +341,8 @@
<label class="form-label">Isu</label> <label class="form-label">Isu</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="issue"> <select class="form-select js-select2" name="issue">
<option value="all" @selected(isset($issue) && $issue == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($issue) && $issue == 'all') selected disabled>
Semua</option>
<option value="positive" @selected(isset($issue) && $issue == 'positive')>Positif</option> <option value="positive" @selected(isset($issue) && $issue == 'positive')>Positif</option>
<option value="negative" @selected(isset($issue) && $issue == 'negative')>Negatif</option> <option value="negative" @selected(isset($issue) && $issue == 'negative')>Negatif</option>
<option value="neutral" @selected(isset($issue) && $issue == 'neutral')>Netral</option> <option value="neutral" @selected(isset($issue) && $issue == 'neutral')>Netral</option>
@ -267,7 +354,8 @@
<label class="form-label">Tanggapan</label> <label class="form-label">Tanggapan</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<select class="form-select js-select2" name="response"> <select class="form-select js-select2" name="response">
<option value="all" @selected(isset($response) && $response == 'all') selected disabled>Semua</option> <option value="all" @selected(isset($response) && $response == 'all') selected disabled>
Semua</option>
<option value="positive" @selected(isset($response) && $response == 'positive')>Positif</option> <option value="positive" @selected(isset($response) && $response == 'positive')>Positif</option>
<option value="negative" @selected(isset($response) && $response == 'negative')>Negatif</option> <option value="negative" @selected(isset($response) && $response == 'negative')>Negatif</option>
<option value="neutral" @selected(isset($response) && $response == 'neutral')>Netral</option> <option value="neutral" @selected(isset($response) && $response == 'neutral')>Netral</option>
@ -278,19 +366,51 @@
<div class="form-group"> <div class="form-group">
<label class="form-label" for="year">Tahun</label> <label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Data isu pada tahun" name="year" value="{{ old('year', $year ?? '') }}"> <input type="number" class="form-control" id="year"
placeholder="Data isu pada tahun" name="year"
value="{{ old('year', $year ?? '') }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="month">Bulan</label> <label class="form-label" for="month">Bulan</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="month" class="form-control" id="month" placeholder="Data berita pada bulan dan tahun" name="month" value="{{ old('month', $month ?? '') }}"> <input type="month" class="form-control" id="month"
placeholder="Data berita pada bulan dan tahun" name="month"
value="{{ old('month', $month ?? '') }}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="form-label" for="date">Tanggal</label> <label class="form-label" for="date">Tanggal</label>
<div class="form-control-wrap"> <div class="form-control-wrap">
<input type="date" class="form-control" id="date" placeholder="Data berita pada bulan dan tahun" name="date" value="{{ old('date', $date ?? '') }}"> <input type="date" class="form-control" id="date"
placeholder="Data berita pada bulan dan tahun" name="date"
value="{{ old('date', $date ?? '') }}">
</div>
</div>
<div class="form-group"> <label class="form-label">Rentang Tanggal</label>
<div class="form-control-wrap">
<div class="input-daterange date-picker-range input-group">
<input type="text" class="form-control" id="start-date"
name="start_date"
value="{{ old('start_date', $start_date ?? '') }}" />
<div class="input-group-addon">TO</div>
<input type="text" class="form-control" id="end-date"
name="end_date" value="{{ old('end_date', $end_date ?? '') }}" />
</div>
</div>
</div>
<div class="form-group">
<label class="form-label">Pengguna</label>
<div class="form-control-wrap">
<select class="form-select js-select2" name="user">
<option value="all" @selected(isset($user) && $user == 'all') selected disabled>
Semua</option>
@foreach ($users as $item)
<option value="{{ encrypt_id($item->id) }}"
@selected(isset($user) && $user == encrypt_id($item->id))>{{ $item->name }}
</option>
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
@ -306,6 +426,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- content @e --> <!-- content @e -->
@include('partials.dashboard.footer' ,['datatable' => 'issue_management']) @include('partials.dashboard.footer', ['datatable' => 'issue_management'])

View File

@ -1237,6 +1237,8 @@
d.year = '{{ $year }}'; d.year = '{{ $year }}';
d.month = '{{ $month }}'; d.month = '{{ $month }}';
d.date = '{{ $date }}'; d.date = '{{ $date }}';
d.start_date = '{{ $start_date }}';
d.end_date = '{{ $end_date }}';
} }
}, },
columns: [ columns: [