feat: fix functionality to filter in all statistic
This commit is contained in:
parent
ae9d8cd908
commit
f34d3de8a6
@ -111,10 +111,18 @@ public function show(Request $request, $category){
|
||||
switch($category){
|
||||
case 'login-activities':
|
||||
$data['title'] = 'Statistik Aktivitas Login';
|
||||
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
|
||||
|
||||
$monthlyCount = array_fill(0, 12, 0);
|
||||
|
||||
$loginActivities = LoginHistory::with(['user'])->get();
|
||||
$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) {
|
||||
@ -125,8 +133,161 @@ public function show(Request $request, $category){
|
||||
$data['loginActivities'] = $monthlyCount;
|
||||
|
||||
return view('dashboard.statistics.show.login-activity', $data);
|
||||
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 1–12
|
||||
})->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);
|
||||
|
||||
return view('dashboard.statistics.show.media-cooperation', $data);
|
||||
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 1–12
|
||||
})->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);
|
||||
|
||||
return view('dashboard.statistics.show.airing-proof-report', $data);
|
||||
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']);
|
||||
@ -141,6 +302,16 @@ public function show(Request $request, $category){
|
||||
$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]);
|
||||
}
|
||||
@ -219,91 +390,35 @@ public function show(Request $request, $category){
|
||||
$data['issueManagementMonthly'] = $issueManagementMonthly;
|
||||
|
||||
return view('dashboard.statistics.show.media-monitoring-issue-management', $data);
|
||||
case 'airing-proof-reports':
|
||||
$data['title'] = 'Statistik Laporan Bukti Tayang';
|
||||
|
||||
$airingProofReport = Report::with(['order', 'media'])->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 1–12
|
||||
})->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);
|
||||
|
||||
return view('dashboard.statistics.show.airing-proof-report', $data);
|
||||
case 'users':
|
||||
$data['title'] = 'Statistik Pengguna';
|
||||
|
||||
$monthlyCount = array_fill(0, 12, 0);
|
||||
|
||||
$registerUsers = User::all();
|
||||
$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 'website-visitors':
|
||||
$data['title'] = 'Statistik Pengunjung Website';
|
||||
|
||||
$monthlyCount = array_fill(0, 12, 0);
|
||||
|
||||
$websiteVisitors = Visitor::all();
|
||||
$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);
|
||||
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();
|
||||
|
||||
$cooperationCompletion = CooperationCompletion::with(['order', 'media'])->get();
|
||||
$cooperationCompletionCount = $cooperationCompletion->groupBy('status')->map(function ($group) {
|
||||
return $group->count();
|
||||
});
|
||||
@ -351,61 +466,75 @@ public function show(Request $request, $category){
|
||||
$data['cooperationCompletionRejected'] = $cooperationCompletionCount->get('2', 0);
|
||||
|
||||
return view('dashboard.statistics.show.cooperation-completion', $data);
|
||||
case 'media-cooperations':
|
||||
$data['title'] = 'Statistik Laporan Bukti Tayang';
|
||||
|
||||
$mediaCooperation = MediaCooperation::with(['cooperation', 'media'])->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 1–12
|
||||
})->each(function ($items, $month) use (&$monthlyStatus, $label) {
|
||||
$monthlyStatus[$label][$month - 1] = $items->count();
|
||||
});
|
||||
}
|
||||
});
|
||||
case 'users':
|
||||
$data['title'] = 'Statistik Pengguna';
|
||||
$data['data_time'] = $year === 'all' ? 'Semua' : 'Tahun '.$year;
|
||||
|
||||
$monthlyCount = array_fill(0, 12, 0);
|
||||
|
||||
$mediaCooperation->groupBy(function ($item) {
|
||||
$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) {
|
||||
// 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['registerUserMonth'] = $monthlyCount;
|
||||
|
||||
$data['mediaCooperationWaiting'] = $mediaCooperationCount->get('0', 0);
|
||||
$data['mediaCooperationAccepted'] = $mediaCooperationCount->get('1', 0);
|
||||
$data['mediaCooperationRejected'] = $mediaCooperationCount->get('2', 0);
|
||||
|
||||
return view('dashboard.statistics.show.media-cooperation', $data);
|
||||
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();
|
||||
|
||||
$contenteRecap = ContentRecap::with(['enhancer', 'classification'])->get();
|
||||
$contentRecapChannelCount = $contenteRecap->groupBy('channel')->map(function ($group) {
|
||||
return $group->count();
|
||||
});
|
||||
@ -438,6 +567,46 @@ public function show(Request $request, $category){
|
||||
$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);
|
||||
}
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -145,6 +145,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -189,6 +189,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -145,6 +145,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
@if (filled($year) || filled($from_month) || filled($to_month))
|
||||
@if (filled($year))
|
||||
<span class="mx-1">
|
||||
<a href="{{route('dashboard.statistics.show', ['category' => $category])}}" 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>
|
||||
@ -76,23 +76,10 @@
|
||||
<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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -52,7 +52,7 @@
|
||||
<div class="card-inner flex-grow-1">
|
||||
<div class="card-title-group mb-4">
|
||||
<div class="card-title">
|
||||
<h6 class="title">Status Kerjam Sama Media</h6>
|
||||
<h6 class="title">Status Kerja Sama Media</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nk-ecwg7-ck">
|
||||
@ -145,6 +145,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -232,6 +232,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -93,6 +93,7 @@
|
||||
</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>
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
<div class="nk-block-between">
|
||||
<div class="nk-block-head-content">
|
||||
<h3 class="nk-block-title page-title">{{$title}}</h3>
|
||||
{{-- <div class="nk-block-des text-soft">
|
||||
<p>Data: Tahun {{$data_year}}</p>
|
||||
</div> --}}
|
||||
<div class="nk-block-des text-soft">
|
||||
<p>Data: {{$data_time}}</p>
|
||||
</div>
|
||||
</div><!-- .nk-block-head-content -->
|
||||
{{-- {{dd($cooperationRequests)}} --}}
|
||||
<div class="nk-block-head-content">
|
||||
@ -93,6 +93,7 @@
|
||||
</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>
|
||||
|
||||
@ -108,31 +108,31 @@
|
||||
|
||||
@if (isset($statistic_chart))
|
||||
@switch($statistic_chart)
|
||||
@case('media-monitoring')
|
||||
@include('dashboard.statistics.chart.media-monitoring-issue-management')
|
||||
@include('dashboard.media-monitorings.statistics.media-monitoring-statistics')
|
||||
@break
|
||||
@case('airing-proof-report')
|
||||
@include('dashboard.statistics.chart.airing-proof-report')
|
||||
@break
|
||||
@case('login-activities')
|
||||
@include('dashboard.statistics.chart.login-activity')
|
||||
@break
|
||||
@case('users')
|
||||
@include('dashboard.statistics.chart.user')
|
||||
@break
|
||||
@case('website-visitors')
|
||||
@include('dashboard.statistics.chart.website-visitor')
|
||||
@break
|
||||
@case('cooperation-completion')
|
||||
@include('dashboard.statistics.chart.cooperation-completion')
|
||||
@break
|
||||
@case('media-cooperation')
|
||||
@include('dashboard.statistics.chart.media-cooperation')
|
||||
@break
|
||||
@case('airing-proof-report')
|
||||
@include('dashboard.statistics.chart.airing-proof-report')
|
||||
@break
|
||||
@case('media-monitoring')
|
||||
@include('dashboard.statistics.chart.media-monitoring-issue-management')
|
||||
@include('dashboard.media-monitorings.statistics.media-monitoring-statistics')
|
||||
@break
|
||||
@case('cooperation-completion')
|
||||
@include('dashboard.statistics.chart.cooperation-completion')
|
||||
@break
|
||||
@case('users')
|
||||
@include('dashboard.statistics.chart.user')
|
||||
@break
|
||||
@case('content-recap')
|
||||
@include('dashboard.statistics.chart.content-recap')
|
||||
@break
|
||||
@case('website-visitors')
|
||||
@include('dashboard.statistics.chart.website-visitor')
|
||||
@break
|
||||
@default
|
||||
|
||||
@endswitch
|
||||
|
||||
Loading…
Reference in New Issue
Block a user