feat: login activity export PDF

feat: media cooperation export PDF
This commit is contained in:
myqnrrhmn 2025-07-14 14:27:23 +07:00
parent f34d3de8a6
commit e851b5c072
19 changed files with 1407 additions and 267 deletions

View File

@ -202,7 +202,6 @@ public function printData($id){
'location', 'subLocation', 'classification', 'subClassification', 'governmentAgencies','enhancer', 'mediaMonitoring'
])->findOrFail(decrypt_id($id));
$pdf = Pdf::loadView('dashboard.issue-managements.print', compact('issueManagement'));
return $pdf->stream(slugify('manajemen isu '. $issueManagement->mediaMonitoring->code).'.pdf');

View File

@ -12,6 +12,7 @@
use App\Models\Report;
use App\Models\User;
use App\Models\Visitor;
use Barryvdh\DomPDF\Facade\Pdf;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@ -611,4 +612,525 @@ public function show(Request $request, $category){
abort(404);
}
}
public function export(Request $request, $category){
$data = [
'category' => $category,
'year' => $request->input('year') ? $request->input('year') : Carbon::now()->year,
'from_month' => $request->input('from_month') ? $request->input('from_month') : null,
'to_month' => $request->input('to_month') ? $request->input('to_month') : null,
];
$year = $request->input('year', Carbon::now()->year);
$from_month = $request->input('from_month', null);
$to_month = $request->input('to_month', null);
switch($category){
case 'login-activities':
$data['title'] = 'Statistik Aktivitas Login';
$monthlyCount = array_fill(0, 12, 0);
$loginActivities = LoginHistory::with(['user']);
if($year && $year !== 'all'){
$loginActivities->whereYear('created_at', '=', $year);
}
$loginActivities = $loginActivities->get();
$loginActivities->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
// Simpan jumlah item tiap bulan ke index bulan - 1 (0-based)
$monthlyCount[$month - 1] = $items->count();
});
$data['loginActivities'] = $monthlyCount;
$pdf = Pdf::loadView('dashboard.statistics.exports.pdf.login-activity', $data);
return $pdf->stream('aktivitas-login-'.$data['year'].'.pdf');
case 'media-cooperations':
$data['title'] = 'Statistik Kerja Sama Media';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$mediaCooperation = MediaCooperation::with(['cooperation', 'media']);
if($year && $year !== 'all'){
$mediaCooperation->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$mediaCooperation->whereBetween('created_at', [$start, $end]);
}
$mediaCooperation = $mediaCooperation->get();
$mediaCooperationCount = $mediaCooperation->groupBy('status')->map(function ($group) {
return $group->count();
});
// Inisialisasi array 12 bulan untuk masing-masing status
$monthlyStatus = [
'waiting' => array_fill(0, 12, 0),
'accepted' => array_fill(0, 12, 0),
'rejected' => array_fill(0, 12, 0),
];
// Kelompokkan data berdasarkan status lalu bulan
$mediaCooperation->groupBy('status')->each(function ($groupedByStatus, $status) use (&$monthlyStatus) {
$label = match ((int)$status) {
0 => 'waiting',
1 => 'accepted',
2 => 'rejected',
default => null,
};
if ($label) {
$groupedByStatus->groupBy(function ($item) {
return (int)$item->created_at->format('m'); // bulan sebagai angka 112
})->each(function ($items, $month) use (&$monthlyStatus, $label) {
$monthlyStatus[$label][$month - 1] = $items->count();
});
}
});
$monthlyCount = array_fill(0, 12, 0);
$mediaCooperation->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
// Simpan jumlah item tiap bulan ke index bulan - 1 (0-based)
$monthlyCount[$month - 1] = $items->count();
});
// Simpan ke variabel `$data`
$data['mediaCooperationStatusMonthly'] = $monthlyStatus;
$data['mediaCooperationMonthly'] = $monthlyCount;
$data['mediaCooperationWaiting'] = $mediaCooperationCount->get('0', 0);
$data['mediaCooperationAccepted'] = $mediaCooperationCount->get('1', 0);
$data['mediaCooperationRejected'] = $mediaCooperationCount->get('2', 0);
// dd($data);
$pdf = Pdf::loadView('dashboard.statistics.exports.pdf.media-cooperation', $data);
return $pdf->stream('kerja-sama-media.pdf');
case 'airing-proof-reports':
$data['title'] = 'Statistik Laporan Bukti Tayang';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$airingProofReport = Report::with(['order', 'media']);
if($year && $year !== 'all'){
$airingProofReport->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$airingProofReport->whereBetween('created_at', [$start, $end]);
}
$airingProofReport = $airingProofReport->get();
$airingProofReportCount = $airingProofReport->groupBy('status')->map(function ($group) {
return $group->count();
});
// Inisialisasi array 12 bulan untuk masing-masing status
$monthlyStatus = [
'waiting' => array_fill(0, 12, 0),
'accepted' => array_fill(0, 12, 0),
'rejected' => array_fill(0, 12, 0),
];
// Kelompokkan data berdasarkan status lalu bulan
$airingProofReport->groupBy('status')->each(function ($groupedByStatus, $status) use (&$monthlyStatus) {
$label = match ((int)$status) {
0 => 'waiting',
1 => 'accepted',
2 => 'rejected',
default => null,
};
if ($label) {
$groupedByStatus->groupBy(function ($item) {
return (int)$item->created_at->format('m'); // bulan sebagai angka 112
})->each(function ($items, $month) use (&$monthlyStatus, $label) {
$monthlyStatus[$label][$month - 1] = $items->count();
});
}
});
$monthlyCount = array_fill(0, 12, 0);
$airingProofReport->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->publication_date)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
// Simpan jumlah item tiap bulan ke index bulan - 1 (0-based)
$monthlyCount[$month - 1] = $items->count();
});
// Simpan ke variabel `$data`
$data['airingProofReportStatusMonthly'] = $monthlyStatus;
$data['airingProofReportPublicationMonthly'] = $monthlyCount;
$data['airingProofReportWaiting'] = $airingProofReportCount->get('0', 0);
$data['airingProofReportAccepted'] = $airingProofReportCount->get('1', 0);
$data['airingProofReportRejected'] = $airingProofReportCount->get('2', 0);
$pdf = Pdf::loadView('dashboard.statistics.exports.pdf.airing-proof-report', $data);
return $pdf->stream('laporan-bukti-tayang.pdf');
case 'media-monitorings-issue-management':
$data['title'] = 'Statistik Monitoring Media & Manajemen Isu';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
// Statistik Isu
$issues = IssueManagement::with(['mediaMonitoring']);
$mediaMonitorings = MediaMonitoring::with(['issue']);
if($year && $year !== 'all'){
$issues->whereYear('created_at', $year);
$mediaMonitorings->whereYear('created_at', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$issues->whereBetween('created_at', [$start, $end]);
$mediaMonitorings->whereBetween('created_at', [$start, $end]);
}
$issues = $issues->get();
$mediaMonitorings = $mediaMonitorings->get();
$issueCounts = $issues->groupBy('issue')->map(function ($group) {
return $group->count();
});
$data['crisisIssue'] = $issueCounts->get('krisis', 0);
$data['negativeIssue'] = $issueCounts->get('negatif', 0);
$data['neutralIssue'] = $issueCounts->get('netral', 0);
$data['positiveIssue'] = $issueCounts->get('positif', 0);
// Akhir Statistik Isu
// Statistik Monitoring Media
$mediaMonitoringCount = $mediaMonitorings->groupBy('channel')->map(function ($group) {
return $group->count();
});
$data['facebookMediaMonitoring'] = $mediaMonitoringCount->get('facebook', 0);
$data['twitterMediaMonitoring'] = $mediaMonitoringCount->get('twitter', 0);
$data['websiteMediaMonitoring'] = $mediaMonitoringCount->get('website', 0);
$data['youtubeMediaMonitoring'] = $mediaMonitoringCount->get('youtube', 0);
$data['instagramMediaMonitoring'] = $mediaMonitoringCount->get('instagram', 0);
$data['tiktokMediaMonitoring'] = $mediaMonitoringCount->get('tiktok', 0);
$data['cetakMediaMonitoring'] = $mediaMonitoringCount->get('cetak', 0);
// Akhir Statistik Monitoring Media
// Media Monitoring 2 (pakai koleksi yang sudah ada)
$mediaMonitoringMonthly = array_fill(0, 12, 0); // Init array 12 bulan
$mediaMonitorings->groupBy(function ($item) {
return (int) $item->created_at->format('m'); // bulan sebagai int
})->each(function ($group, $month) use (&$mediaMonitoringMonthly) {
$mediaMonitoringMonthly[$month - 1] = $group->count();
});
// Issue Management 2 (pakai koleksi yang sudah ada)
$issueManagementMonthly = array_fill(0, 12, 0);
$issues->groupBy(function ($item) {
return (int) $item->created_at->format('m');
})->each(function ($group, $month) use (&$issueManagementMonthly) {
$issueManagementMonthly[$month - 1] = $group->count();
});
$mediaMonitoringWithoutIssue = MediaMonitoring::doesntHave('issue')
->when($year && $year !== 'all', function ($query) use ($year) {
$query->whereYear('created_at', $year);
})
->when($from_month && $to_month, function ($query) use ($from_month, $to_month) {
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
$query->whereBetween('created_at', [$start, $end]);
})
->get();
$mediaMonitoringWithIssue = MediaMonitoring::has('issue')
->when($year && $year !== 'all', function ($query) use ($year) {
$query->whereYear('created_at', $year);
})
->when($from_month && $to_month, function ($query) use ($from_month, $to_month) {
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
$query->whereBetween('created_at', [$start, $end]);
})
->get();
$data['mediaMonitoringWithoutIssueCount'] = $mediaMonitoringWithoutIssue->count();
$data['mediaMonitoringWithIssueCount'] = $mediaMonitoringWithIssue->count();
$data['mediaMonitoringMonthly'] = $mediaMonitoringMonthly;
$data['issueManagementMonthly'] = $issueManagementMonthly;
return view('dashboard.statistics.show.media-monitoring-issue-management', $data);
case 'cooperation-completions':
$data['title'] = 'Statistik Laporan Bukti Tayang';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$cooperationCompletion = CooperationCompletion::with(['order', 'media']);
if($year && $year !== 'all'){
$cooperationCompletion->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$cooperationCompletion->whereBetween('created_at', [$start, $end]);
}
$cooperationCompletion = $cooperationCompletion->get();
$cooperationCompletionCount = $cooperationCompletion->groupBy('status')->map(function ($group) {
return $group->count();
});
// Inisialisasi array 12 bulan untuk masing-masing status
$monthlyStatus = [
'waiting' => array_fill(0, 12, 0),
'accepted' => array_fill(0, 12, 0),
'rejected' => array_fill(0, 12, 0),
];
// Kelompokkan data berdasarkan status lalu bulan
$cooperationCompletion->groupBy('status')->each(function ($groupedByStatus, $status) use (&$monthlyStatus) {
$label = match ((int)$status) {
0 => 'waiting',
1 => 'accepted',
2 => 'rejected',
default => null,
};
if ($label) {
$groupedByStatus->groupBy(function ($item) {
return (int)$item->created_at->format('m'); // bulan sebagai angka 112
})->each(function ($items, $month) use (&$monthlyStatus, $label) {
$monthlyStatus[$label][$month - 1] = $items->count();
});
}
});
$monthlyCount = array_fill(0, 12, 0);
$cooperationCompletion->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
// Simpan jumlah item tiap bulan ke index bulan - 1 (0-based)
$monthlyCount[$month - 1] = $items->count();
});
// Simpan ke variabel `$data`
$data['cooperationCompletionStatusMonthly'] = $monthlyStatus;
$data['cooperationCompletionMonthly'] = $monthlyCount;
$data['cooperationCompletionWaiting'] = $cooperationCompletionCount->get('0', 0);
$data['cooperationCompletionAccepted'] = $cooperationCompletionCount->get('1', 0);
$data['cooperationCompletionRejected'] = $cooperationCompletionCount->get('2', 0);
return view('dashboard.statistics.show.cooperation-completion', $data);
case 'users':
$data['title'] = 'Statistik Pengguna';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$monthlyCount = array_fill(0, 12, 0);
$registerUsers = User::query();
if($year && $year !== 'all'){
$registerUsers->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$registerUsers->whereBetween('created_at', [$start, $end]);
}
$registerUsers = $registerUsers->get();
$registerUsers->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
$monthlyCount[$month - 1] = $items->count();
});
$data['registerUserMonth'] = $monthlyCount;
return view('dashboard.statistics.show.user', $data);
case 'content-recaps':
$data['title'] = 'Statistik Rekap Konten';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$contenteRecap = ContentRecap::with(['enhancer', 'classification']);
if($year && $year !== 'all'){
$contenteRecap->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$contenteRecap->whereBetween('created_at', [$start, $end]);
}
$contenteRecap = $contenteRecap->get();
$contentRecapChannelCount = $contenteRecap->groupBy('channel')->map(function ($group) {
return $group->count();
});
$contentRecapSocialMediaCount = $contenteRecap->groupBy('social_media')->map(function ($group) {
return $group->count();
});
$monthlyCount = array_fill(0, 12, 0);
$contenteRecap->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
// Simpan jumlah item tiap bulan ke index bulan - 1 (0-based)
$monthlyCount[$month - 1] = $items->count();
});
$data['contentRecapMonthly'] = $monthlyCount;
$data['facebookContentRecap'] = $contentRecapChannelCount->get('facebook', 0);
$data['twitterContentRecap'] = $contentRecapChannelCount->get('twitter', 0);
$data['websiteContentRecap'] = $contentRecapChannelCount->get('website', 0);
$data['youtubeContentRecap'] = $contentRecapChannelCount->get('youtube', 0);
$data['instagramContentRecap'] = $contentRecapChannelCount->get('instagram', 0);
$data['tiktokContentRecap'] = $contentRecapChannelCount->get('tiktok', 0);
$data['cetakContentRecap'] = $contentRecapChannelCount->get('cetak', 0);
$data['socialMedia1ContentRecap'] = $contentRecapSocialMediaCount->get('Diskominfo Purwakarta', 0);
$data['socialMedia2ContentRecap'] = $contentRecapSocialMediaCount->get('PPID Diskominfo Purwakarta', 0);
$data['socialMedia3ContentRecap'] = $contentRecapSocialMediaCount->get('Purwakarta Saber Hoaks', 0);
return view('dashboard.statistics.show.content-recap', $data);
case 'website-visitors':
$data['title'] = 'Statistik Pengunjung Website';
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
$monthlyCount = array_fill(0, 12, 0);
$websiteVisitors = Visitor::query();
if($year && $year !== 'all'){
$websiteVisitors->whereYear('created_at', '=', $year);
}
if($from_month && $to_month){
$start = Carbon::parse($from_month)->startOfMonth();
$end = Carbon::parse($to_month)->endOfMonth();
// Asumsikan from_month dan to_month dalam format 'YYYY-MM'
$fromDate = $from_month ? Carbon::createFromFormat('Y-m', $from_month) : null;
$toDate = $to_month ? Carbon::createFromFormat('Y-m', $to_month) : null;
// Format ke bentuk "Mei 2025"
$fromFormatted = $fromDate ? $fromDate->translatedFormat('F Y') : '-';
$toFormatted = $toDate ? $toDate->translatedFormat('F Y') : '-';
$data['data_time'] = $fromFormatted . ' - ' . $toFormatted;
$websiteVisitors->whereBetween('created_at', [$start, $end]);
}
$websiteVisitors = $websiteVisitors->get();
$websiteVisitors->groupBy(function ($item) {
return (int) \Carbon\Carbon::parse($item->created_at)->format('m');
})->each(function ($items, $month) use (&$monthlyCount) {
$monthlyCount[$month - 1] = $items->count();
});
$data['websiteVisitorMonth'] = $monthlyCount;
return view('dashboard.statistics.show.website-visitor', $data);
default:
abort(404);
}
}
}

View File

@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>{{ $title }}</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
background-color: #f9f9f9;
}
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('assets/defaults/simedkom-logo-circle.png');
background-size: 300px auto;
background-repeat: no-repeat;
background-position: center center;
opacity: 0.05;
z-index: -1;
}
header .icon {
text-align: center;
padding: 20px 0;
}
header .icon img {
width: 20%;
max-width: 200px;
height: auto;
}
.container {
width: 80%;
margin: 20px auto;
padding: 20px;
background-color: #ffffff;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
.header {
text-align: center;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 2px solid #e0e0e0;
}
.header .title {
font-size: 24px;
color: #3A59D1;
margin: 0;
}
.header h4 {
font-size: 18px;
color: #666;
margin-top: 8px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table thead {
background-color: #3A59D1;
color: white;
}
table th, table td {
padding: 10px;
text-align: left;
border: 1px solid #ccc;
}
table tbody tr:nth-child(even) {
background-color: #f5f5f5;
}
.footer {
text-align: right;
font-size: 12px;
color: #888;
margin-top: 30px;
}
</style>
</head>
<body>
<header>
<div class="icon">
<img src="{{ public_path('assets/defaults/simedkom-logo-full.png') }}" alt="Logo Simedkom">
</div>
</header>
<div class="container">
<div class="header">
<h2 class="title">Aktivitas Login</h2>
<h4>Data: Tahun {{ $year }}</h4>
</div>
@php
$month = [
"Januari", "Februari", "Maret", "April", "Mei", "Juni",
"Juli", "Agustus", "September", "Oktober", "November", "Desember"
];
@endphp
<table>
<thead>
<tr>
<th>Bulan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
@for ($i = 0; $i < count($month); $i++)
<tr>
<td>{{ $month[$i] }}</td>
<td>{{ $loginActivities[$i] }}</td>
</tr>
@endfor
</tbody>
</table>
<div class="footer">
Dicetak pada {{ now()->format('d-m-Y H:i') }} - {{ $app->app_title }}
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<title>{{ $title }}</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
background-color: #f9f9f9;
}
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('assets/defaults/simedkom-logo-circle.png');
background-size: 300px auto;
background-repeat: no-repeat;
background-position: center center;
opacity: 0.05;
z-index: -1;
}
header .icon {
text-align: center;
padding: 20px 0;
}
header .icon img {
width: 20%;
max-width: 200px;
height: auto;
}
.container {
width: 80%;
margin: 20px auto;
padding: 20px;
background-color: #ffffff;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}
.header {
text-align: center;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 2px solid #e0e0e0;
}
.header .title {
font-size: 24px;
color: #3A59D1;
margin: 0;
}
.header h4 {
font-size: 18px;
color: #666;
margin-top: 8px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table thead {
background-color: #3A59D1;
color: white;
}
table th, table td {
padding: 10px;
text-align: left;
border: 1px solid #ccc;
}
table tbody tr:nth-child(even) {
background-color: #f5f5f5;
}
.footer {
text-align: right;
font-size: 12px;
color: #888;
margin-top: 30px;
}
</style>
</head>
<body>
<header>
<div class="icon">
<img src="{{ public_path('assets/defaults/simedkom-logo-full.png') }}" alt="Logo Simedkom">
</div>
</header>
<div class="container">
<div class="header">
<h2 class="title">Kerja Sama Media</h2>
<h4>Data: Tahun {{ $year }}</h4>
</div>
@php
$month = [
"Januari", "Februari", "Maret", "April", "Mei", "Juni",
"Juli", "Agustus", "September", "Oktober", "November", "Desember"
];
@endphp
<table>
<div style="margin-bottom: 1px !important; margin-top: 2px !important;">
<h4>Total Jumlah Kerja Sama Media Berdasarkan Status</h4>
</div>
<thead>
<tr>
<th>Status</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
<tr>
<td>Menunggu</td>
<td>{{$mediaCooperationWaiting}}</td>
</tr>
<tr>
<td>Diterima</td>
<td>{{$mediaCooperationAccepted}}</td>
</tr>
<tr>
<td>Ditolak</td>
<td>{{$mediaCooperationRejected}}</td>
</tr>
</tbody>
</table>
<div style="margin-bottom: 1px !important; margin-top: 2px !important;">
<h4>Total Semua Kerja Sama Media Perbulan Berdasarkan Status</h4>
</div>
<table>
<thead>
<tr>
<th>Bulan</th>
<th>Jumlah</th>
</tr>
</thead>
<tbody>
@for ($i = 0; $i < count($month); $i++)
<tr>
<td>{{ $month[$i] }}</td>
<td>
<ul style="list-style: none; padding-left: 0;">
<li>Menunggu: {{$mediaCooperationStatusMonthly['waiting'][$i]}}</li>
<li>Diterima: {{$mediaCooperationStatusMonthly['accepted'][$i]}}</li>
<li>Ditolak: {{$mediaCooperationStatusMonthly['rejected'][$i]}}</li>
<li><b>Total</b>: {{$mediaCooperationStatusMonthly['waiting'][$i] + $mediaCooperationStatusMonthly['accepted'][$i] + $mediaCooperationStatusMonthly['rejected'][$i]}}</li>
</ul>
</td>
</tr>
@endfor
</tbody>
</table>
<div class="footer">
Dicetak pada {{ now()->format('d-m-Y H:i') }} - {{ $app->app_title }}
</div>
</div>
</body>
</html>

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -112,47 +115,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -156,47 +159,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -112,47 +115,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -60,33 +63,61 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -112,47 +115,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -249,7 +249,8 @@
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -60,47 +63,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -34,7 +34,10 @@
</span>
@endif
<div>
<a href="javascript: void(0);" class="btn btn-primary" 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-primary mx-1" 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>
<a href="javascript: void(0);" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exportModal"><em class="d-none d-sm-inline icon ni ni-upload"></em><span><span class="d-none d-md-inline">Export</a>
</div>
</li>
</ul>
@ -60,47 +63,89 @@
</div><!-- .card -->
</div><!-- .col -->
<div class="modal fade" id="modalFilter">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Filter</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="exportModal">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export</h5>
<a href="javascript:void(0);" class="close" data-bs-dismiss="modal" aria-label="Close">
<em class="icon ni ni-cross"></em>
</a>
</div>
<form action="{{route('dashboard.statistics.export', ['category' => $category])}}" class="form-validate is-alter" method="post">
@csrf
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
<form action="{{route('dashboard.statistics.show', ['category' => $category])}}" class="form-validate is-alter" method="get">
<div class="modal-body">
<div class="form-group">
<label class="form-label" for="year">Tahun</label>
<div class="form-control-wrap">
<input type="number" class="form-control" id="year" placeholder="Contoh: 2025" name="year" value="{{ old('year', $year ?? '') }}">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label class="form-label" for="from_month">Dari Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="from_month" placeholder="Data berita pada bulan dan tahun" name="from_month" value="{{ old('from_month', $from_month ?? '') }}">
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="to_month">Sampai Bulan</label>
<div class="form-control-wrap">
<input type="month" class="form-control" id="to_month" placeholder="Data berita pada bulan dan tahun" name="to_month" value="{{ old('to_month', $to_month ?? '') }}">
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<span class="sub-text">
<a href="{{route('dashboard.statistics.show', ['category' => $category, 'year' => 'all'])}}" class="btn btn-sm btn-info">Semua Data</a>
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
</span>
</div>
</form>
</div>
</div>
</div>
{{-- <div class="col-xxl-3 col-md-12">
<div class="card card-bordered card-preview">
<div class="card-inner">

View File

@ -229,6 +229,7 @@
Route::get('/', 'index')->name('index');
Route::get('/{category}', 'show')->name('show');
Route::post('/{category}', 'export')->name('export');
});
});
});