feat(dashboard/rekap-so): penambahan dashboard, rekap so
This commit is contained in:
36
app/Http/Controllers/DashboardController.php
Normal file
36
app/Http/Controllers/DashboardController.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Modules\Lpj\Services\DashboardService;
|
||||||
|
|
||||||
|
class DashboardController extends Controller
|
||||||
|
{
|
||||||
|
public $dashboardService;
|
||||||
|
public function __construct(DashboardService $dashboardService)
|
||||||
|
{
|
||||||
|
$this->dashboardService = $dashboardService;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
// nilai default
|
||||||
|
$start_date = $request->input('start_date', now()->startOfYear()->format('Y-m-d'));
|
||||||
|
$end_date = $request->input('end_date', now()->format('Y-m-d'));
|
||||||
|
|
||||||
|
$validate = $request->validate([
|
||||||
|
'start_date' => 'nullable|date_format:Y-m-d',
|
||||||
|
'end_date' => 'nullable|date_format:Y-m-d',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$dashboard = $this->dashboardService->getDashboardData($start_date, $end_date);
|
||||||
|
|
||||||
|
// dd($dashboard);
|
||||||
|
return view('lpj::dashboard.index', compact('dashboard'));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
67
app/Http/Controllers/RekapHarianSoController.php
Normal file
67
app/Http/Controllers/RekapHarianSoController.php
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Modules\Lpj\Models\TujuanPenilaian;
|
||||||
|
|
||||||
|
class RekapHarianSoController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$tujuan_penilaian = TujuanPenilaian::all();
|
||||||
|
return view('lpj::rekap-harian-so.index', compact('tujuan_penilaian'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('lpj::create');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the specified resource.
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
return view('lpj::show');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
return view('lpj::edit');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
134
app/Services/DashboardService.php
Normal file
134
app/Services/DashboardService.php
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Modules\Lpj\Services;
|
||||||
|
|
||||||
|
use Modules\Lpj\Models\Laporan;
|
||||||
|
|
||||||
|
class DashboardService
|
||||||
|
{
|
||||||
|
public function getDashboardData($start_date, $end_date)
|
||||||
|
{
|
||||||
|
$countLpjInternal = $this->getTotalLpjInternal($start_date, $end_date);
|
||||||
|
$countLpjExternal = $this->getTotalLpjEksternal($start_date, $end_date);
|
||||||
|
$countResume = $this->getResumeCabang($start_date, $end_date);
|
||||||
|
|
||||||
|
return [
|
||||||
|
'count_lpj_internal' => $countLpjInternal,
|
||||||
|
'count_lpj_eksternal' => $countLpjExternal,
|
||||||
|
'count_resume' => $countResume
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getTotalLpjInternal($start_date, $end_date)
|
||||||
|
{
|
||||||
|
$months = $this->getMonthly();
|
||||||
|
$regions = $this->getRegion();
|
||||||
|
$data = [];
|
||||||
|
|
||||||
|
foreach ($months as $index => $month) {
|
||||||
|
$monthNumber = $index + 1;
|
||||||
|
$data[$month] = [];
|
||||||
|
|
||||||
|
foreach ($regions as $region) {
|
||||||
|
if ($monthNumber > now()->month) {
|
||||||
|
|
||||||
|
$data[$month][$region] = [
|
||||||
|
'total_laporan' => 0,
|
||||||
|
'total_debiture' => 0,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$totalLaporan = Laporan::whereBetween('created_at', [$start_date, $end_date])
|
||||||
|
->count();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$data[$month][$region] = [
|
||||||
|
'total_laporan' => $totalLaporan,
|
||||||
|
'total_debiture' => 20,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getPendapatanAppraisal()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getResumeCabang($start_date, $end_date)
|
||||||
|
{
|
||||||
|
$regions = $this->getRegion();
|
||||||
|
$status = ['batal', 'done'];
|
||||||
|
$data = [];
|
||||||
|
|
||||||
|
foreach ($status as $item) {
|
||||||
|
$data[$item] = [];
|
||||||
|
foreach ($regions as $region) {
|
||||||
|
$totalLaporan = Laporan::where('created_at', '>=', $start_date)->where('created_at', '<=', $end_date)->count();
|
||||||
|
$data[$item][$region] = [
|
||||||
|
'count_report' => $totalLaporan,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}
|
||||||
|
public function getTotalLpjEksternal($start_date, $end_date)
|
||||||
|
{
|
||||||
|
$months = $this->getMonthly();
|
||||||
|
$data = [];
|
||||||
|
foreach ($months as $index => $month) {
|
||||||
|
$monthNumber = $index + 1;
|
||||||
|
if ($monthNumber > now()->month) {
|
||||||
|
$data[$month] = [
|
||||||
|
'total_laporan' => 0,
|
||||||
|
'total_debiture' => 0,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$totalLaporan = Laporan::where('created_at', '>=', $start_date)->where('created_at', '<=', $end_date)->count();
|
||||||
|
$data[$month] = [
|
||||||
|
'total_laporan' => $totalLaporan,
|
||||||
|
'total_debiture' => 20,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getMonthly()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'januari',
|
||||||
|
'februari',
|
||||||
|
'maret',
|
||||||
|
'april',
|
||||||
|
'mei',
|
||||||
|
'juni',
|
||||||
|
'juli',
|
||||||
|
'agustus',
|
||||||
|
'september',
|
||||||
|
'oktober',
|
||||||
|
'november',
|
||||||
|
'desember',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getRegion()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'jabodetabek',
|
||||||
|
'non-jabodetabek',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
12
module.json
12
module.json
@@ -115,6 +115,18 @@
|
|||||||
"EO Appraisal",
|
"EO Appraisal",
|
||||||
"senior-officer"
|
"senior-officer"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Rekap Harian So",
|
||||||
|
"path": "rekap-harian-so",
|
||||||
|
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||||
|
"classes": "",
|
||||||
|
"attributes": [],
|
||||||
|
"permission": "",
|
||||||
|
"roles": [
|
||||||
|
"administrator",
|
||||||
|
"senior-officer"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"otorisator": [
|
"otorisator": [
|
||||||
|
|||||||
369
resources/views/dashboard/index.blade.php
Normal file
369
resources/views/dashboard/index.blade.php
Normal file
@@ -0,0 +1,369 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="w-full grid gap-6 mx-auto">
|
||||||
|
<!-- Header Section -->
|
||||||
|
<div class="flex flex-wrap items-center lg:items-end justify-between gap-5 pb-8">
|
||||||
|
<div class="flex flex-col justify-center gap-3">
|
||||||
|
<h1 class="text-2xl font-bold leading-none text-gray-800">
|
||||||
|
Dashboard
|
||||||
|
</h1>
|
||||||
|
<div class="flex items-center gap-2 text-sm font-medium text-gray-600">
|
||||||
|
<i class="ki-filled ki-clipboard"></i>
|
||||||
|
Selamat datang, <span class="text-primary font-semibold">{{ auth()->user()->name }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-3 w-[30%]">
|
||||||
|
<div class="flex items-center gap-2 w-full">
|
||||||
|
<input type="date" class="input" name="start_date" id="start_date">
|
||||||
|
<input type="date" class="input" name="end_date" id="end_date">
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">Filter</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Stats Cards -->
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
|
||||||
|
@foreach ($dashboard['count_resume'] as $status => $count)
|
||||||
|
@php
|
||||||
|
|
||||||
|
$gradientFrom = $status === 'batal' ? 'from-red-50' : 'from-amber-50';
|
||||||
|
$gradientTo = $status === 'batal' ? 'to-red-100' : 'to-amber-100';
|
||||||
|
$borderColor = $status === 'batal' ? 'border-red-200' : 'border-amber-200';
|
||||||
|
$iconBg = $status === 'batal' ? 'bg-red-500' : 'bg-amber-500';
|
||||||
|
$iconColor = $status === 'batal' ? 'text-red-500' : 'text-amber-500';
|
||||||
|
$textColor = $status === 'batal' ? 'text-red-800' : 'text-amber-800';
|
||||||
|
$cardTitle = $status === 'batal' ? 'Batal dari Cabang' : 'Menunggu Keputusan Cabang';
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="card bg-gradient-to-br {{ $gradientFrom }} {{ $gradientTo }} {{ $borderColor }}">
|
||||||
|
<div class="card-header border-b {{ $borderColor }}">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-10 h-10 {{ $iconBg }} rounded-lg flex items-center justify-center">
|
||||||
|
<i
|
||||||
|
class="ki-filled {{ $status === 'batal' ? 'ki-cross-circle text-white' : 'ki-time text-white' }}"></i>
|
||||||
|
</div>
|
||||||
|
<h3 class="card-title {{ $textColor }} font-semibold">{{ $cardTitle }}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||||
|
<div
|
||||||
|
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h4 class="text-sm font-semibold text-gray-700 mb-1">Jabodetabek</h4>
|
||||||
|
<span
|
||||||
|
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
|
||||||
|
{{ $count['jabodetabek']['count_report'] ?? 0 }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
|
||||||
|
<i class="ki-filled {{ $iconColor }}"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<h4 class="text-sm font-semibold text-gray-700 mb-1">Luar Jabodetabek</h4>
|
||||||
|
<span
|
||||||
|
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
|
||||||
|
{{ $count['non-jabodetabek']['count_report'] ?? 0 }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
|
||||||
|
<i class="ki-filled {{ $iconColor }}"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Chart Section -->
|
||||||
|
<div class="card ">
|
||||||
|
<div class="card-header border-b border-blue-200">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-10 h-10 bg-blue-500 rounded-lg flex items-center justify-center">
|
||||||
|
<i class="ki-filled ki-chart-simple-2 text-white"></i>
|
||||||
|
</div>
|
||||||
|
<h3 class="text-lg font-semibold text-blue-800">Pendapatan Appraisal</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="bg-white rounded-xl p-4 shadow-sm">
|
||||||
|
<canvas id="bar-chart" class="w-full h-80"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tables Section -->
|
||||||
|
<div class="flex w-full gap-6">
|
||||||
|
<!-- Laporan Internal -->
|
||||||
|
<div class="card w-[60%] ">
|
||||||
|
<div class="card-header border-b border-green-200">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-10 h-10 bg-green-500 rounded-lg flex items-center justify-center">
|
||||||
|
<i class="ki-filled ki-document text-white"></i>
|
||||||
|
</div>
|
||||||
|
<h3 class="text-lg font-semibold text-green-800">Laporan Internal</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
|
||||||
|
<table class="table table-auto w-full">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2"
|
||||||
|
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Bulan
|
||||||
|
</th>
|
||||||
|
<th colspan="2"
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Jabodetabek
|
||||||
|
</th>
|
||||||
|
<th colspan="2"
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||||
|
Luar Jabodetabek
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="border-t border-gray-200">
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Laporan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Debitur
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Laporan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||||
|
Debitur
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="bg-white divide-y divide-gray-200">
|
||||||
|
@foreach ($dashboard['count_lpj_internal'] as $month => $regions)
|
||||||
|
<tr class="hover:bg-gray-50 transition-colors">
|
||||||
|
<td class="px-4 py-2 text-sm font-medium text-gray-900">
|
||||||
|
{{ ucfirst($month) }}
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||||
|
{{ $regions['jabodetabek']['total_laporan'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||||
|
{{ $regions['jabodetabek']['total_debiture'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||||
|
{{ $regions['non-jabodetabek']['total_laporan'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-sm text-center text-gray-700">
|
||||||
|
{{ $regions['non-jabodetabek']['total_debiture'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<!-- Add more rows as needed -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Laporan Eksternal -->
|
||||||
|
<div class="card w-[40%]">
|
||||||
|
<div class="card-header border-b border-purple-200">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-10 h-10 bg-purple-500 rounded-lg flex items-center justify-center">
|
||||||
|
<i class="ki-filled ki-tab-tablet text-white"></i>
|
||||||
|
</div>
|
||||||
|
<h3 class="text-lg font-semibold text-purple-800">Laporan Eksternal</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
|
||||||
|
<table class="table table-auto w-full">
|
||||||
|
<thead class="bg-gray-50">
|
||||||
|
<tr>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Bulan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
|
||||||
|
Laporan
|
||||||
|
</th>
|
||||||
|
<th
|
||||||
|
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
|
||||||
|
Debitur
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="bg-white divide-y divide-gray-200">
|
||||||
|
@foreach ($dashboard['count_lpj_eksternal'] as $month => $data)
|
||||||
|
<tr class="hover:bg-gray-50 transition-colors">
|
||||||
|
<!-- Kolom Nama month -->
|
||||||
|
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
|
||||||
|
{{ ucfirst($month) }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- Kolom Total Laporan -->
|
||||||
|
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||||
|
{{ $data['total_laporan'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- Kolom Total Debitur -->
|
||||||
|
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
|
||||||
|
{{ $data['total_debiture'] ?? '-' }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<!-- Add more rows as needed -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Chart.js CDN -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function filterDashboard() {
|
||||||
|
const start_date = document.getElementById('start_date').value;
|
||||||
|
const end_date = document.getElementById('end_date').value;
|
||||||
|
window.location.href = `?start_date=${start_date}&end_date=${end_date}`;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<!-- Chart initialization script -->
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// Get the canvas element
|
||||||
|
const ctx = document.getElementById('bar-chart').getContext('2d');
|
||||||
|
|
||||||
|
// Create the bar chart
|
||||||
|
const barChart = new Chart(ctx, {
|
||||||
|
type: 'bar',
|
||||||
|
data: {
|
||||||
|
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov',
|
||||||
|
'Dec'
|
||||||
|
],
|
||||||
|
datasets: [{
|
||||||
|
label: 'Jumlah',
|
||||||
|
data: [1200000, 1900000, 3000000, 5000000, 2000000, 3000000, 4500000,
|
||||||
|
3200000, 2800000, 4100000, 3600000, 4800000
|
||||||
|
],
|
||||||
|
backgroundColor: 'rgba(59, 130, 246, 0.8)', // Blue color
|
||||||
|
borderColor: 'rgba(59, 130, 246, 1)',
|
||||||
|
borderWidth: 1,
|
||||||
|
borderRadius: 4,
|
||||||
|
borderSkipped: false
|
||||||
|
}, {
|
||||||
|
label: 'Akumulasi',
|
||||||
|
data: [800000, 1200000, 1800000, 2200000, 1500000, 2000000, 2800000,
|
||||||
|
2100000, 1900000, 2500000, 2300000, 3100000
|
||||||
|
],
|
||||||
|
backgroundColor: 'rgba(16, 185, 129, 0.8)', // Green color
|
||||||
|
borderColor: 'rgba(16, 185, 129, 1)',
|
||||||
|
borderWidth: 1,
|
||||||
|
borderRadius: 4,
|
||||||
|
borderSkipped: false
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
plugins: {
|
||||||
|
|
||||||
|
legend: {
|
||||||
|
display: true,
|
||||||
|
position: 'top',
|
||||||
|
labels: {
|
||||||
|
font: {
|
||||||
|
size: 12
|
||||||
|
},
|
||||||
|
color: '#374151',
|
||||||
|
usePointStyle: true,
|
||||||
|
padding: 20
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
||||||
|
titleColor: '#ffffff',
|
||||||
|
bodyColor: '#ffffff',
|
||||||
|
borderColor: 'rgba(0, 0, 0, 0.8)',
|
||||||
|
borderWidth: 1,
|
||||||
|
cornerRadius: 6,
|
||||||
|
displayColors: true,
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
let label = context.dataset.label || '';
|
||||||
|
if (label) {
|
||||||
|
label += ': ';
|
||||||
|
}
|
||||||
|
label += 'Rp ' + context.parsed.y.toLocaleString('id-ID');
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
x: {
|
||||||
|
grid: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
color: '#6b7280',
|
||||||
|
font: {
|
||||||
|
size: 11
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
beginAtZero: true,
|
||||||
|
grid: {
|
||||||
|
color: 'rgba(229, 231, 235, 0.8)',
|
||||||
|
borderDash: [2, 2]
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
color: '#6b7280',
|
||||||
|
font: {
|
||||||
|
size: 11
|
||||||
|
},
|
||||||
|
callback: function(value) {
|
||||||
|
if (value >= 1000000) {
|
||||||
|
return 'Rp ' + (value / 1000000) + 'M';
|
||||||
|
} else if (value >= 1000) {
|
||||||
|
return 'Rp ' + (value / 1000) + 'K';
|
||||||
|
}
|
||||||
|
return 'Rp ' + value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
interaction: {
|
||||||
|
intersect: false,
|
||||||
|
mode: 'index'
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
duration: 1000,
|
||||||
|
easing: 'easeInOutQuart'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
58
resources/views/rekap-harian-so/index.blade.php
Normal file
58
resources/views/rekap-harian-so/index.blade.php
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{ Breadcrumbs::render('rekap-harian-so') }}
|
||||||
|
@endsection
|
||||||
|
@section('content')
|
||||||
|
<div class="grid">
|
||||||
|
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||||
|
data-datatable-state-save="false" id="jenis-aset-table">
|
||||||
|
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Rekap Harian {{ date('Y-m-d') }}
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="scrollable-x-auto">
|
||||||
|
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||||
|
data-datatable-table="true">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2" class="text-center border px-4 py-2">Jenis</th>
|
||||||
|
<th rowspan="2" class="text-center border px-4 py-2">Laporan (Debitur)</th>
|
||||||
|
<th colspan="2" class="text-center border px-4 py-2">Kunjungan</th>
|
||||||
|
<th rowspan="2" class="text-center border px-4 py-2">Pipeline (Proses/Debitur)</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center border px-4 py-2">Debitur</th>
|
||||||
|
<th class="text-center border px-4 py-2">Lokasi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($tujuan_penilaian as $jenis)
|
||||||
|
<tr>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $jenis->name }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $jenis->laporan_debitur ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $jenis->kunjungan_debitur ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $jenis->kunjungan_lokasi ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $jenis->pipeline ?? '' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
<tr class="bg-gray-200">
|
||||||
|
<td class="text-center border px-4 py-2 font-bold">Lokasi</td>
|
||||||
|
<td colspan="4" class="text-center border px-4 py-2"></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="bg-gray-300 font-bold">
|
||||||
|
<td class="text-center border px-4 py-2">TOTAL</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $totals['laporan_debitur'] ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $totals['kunjungan_debitur'] ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $totals['kunjungan_lokasi'] ?? '' }}</td>
|
||||||
|
<td class="text-center border px-4 py-2">{{ $totals['pipeline'] ?? '' }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -754,5 +754,9 @@ Breadcrumbs::for('laporan-penilai-jaminan', function ($trail) {
|
|||||||
$trail->push('Laporan Hasil Penilaian Jaminan Internal External', route('laporan-hasil-penilaian-jaminan-internal-external.index'));
|
$trail->push('Laporan Hasil Penilaian Jaminan Internal External', route('laporan-hasil-penilaian-jaminan-internal-external.index'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('rekap-harian-so', function ($trail) {
|
||||||
|
$trail->push('Rekap Harian');
|
||||||
|
});
|
||||||
|
|
||||||
// add andy
|
// add andy
|
||||||
require __DIR__ . '/breadcrumbs_registrasi.php';
|
require __DIR__ . '/breadcrumbs_registrasi.php';
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ use Modules\Lpj\Http\Controllers\TenderController;
|
|||||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||||
use Modules\Lpj\Http\Controllers\LaporanPenilaiJaminanController;
|
use Modules\Lpj\Http\Controllers\LaporanPenilaiJaminanController;
|
||||||
|
use Modules\Lpj\Http\Controllers\RekapHarianSoController;
|
||||||
|
|
||||||
// use Modules\Lpj\Http\Controllers\ActivityController;
|
// use Modules\Lpj\Http\Controllers\ActivityController;
|
||||||
|
|
||||||
@@ -680,6 +681,7 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::put('{id}', [LaporanAdminKreditController::class,'update'])->name('update');
|
Route::put('{id}', [LaporanAdminKreditController::class,'update'])->name('update');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::name('bank-data.')->prefix('bank-data')->group(function () {
|
Route::name('bank-data.')->prefix('bank-data')->group(function () {
|
||||||
Route::get('datatables', [BankDataController::class, 'dataForDatatables'])->name('datatables');
|
Route::get('datatables', [BankDataController::class, 'dataForDatatables'])->name('datatables');
|
||||||
});
|
});
|
||||||
@@ -717,6 +719,7 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::get('/', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'index'])->name('index');
|
Route::get('/', [LaporanHasilPenilaianJaminanInternalExternalController::class, 'index'])->name('index');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::resource('rekap-harian-so', RekapHarianSoController::class);
|
||||||
});
|
});
|
||||||
|
|
||||||
require __DIR__ . '/registrasi.php';
|
require __DIR__ . '/registrasi.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user