dlt dsb
This commit is contained in:
parent
53fe6c3220
commit
96bd5c7a21
|
@ -1,89 +0,0 @@
|
||||||
@extends('layouts.app_operator')
|
|
||||||
|
|
||||||
@section('title', 'Dashboard Operator')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<div class="container mt-4">
|
|
||||||
<div class="title-box">
|
|
||||||
<h3 class="fw-bold m-0">Dashboard</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Box Pendapatan -->
|
|
||||||
<div class="dashboard-container" style="height: 100%;">
|
|
||||||
<div class="info-box flex justify-end mb-6">
|
|
||||||
<div class="bg-yellow-100 p-4 rounded shadow text-right w-64">
|
|
||||||
<h2 class="font-semibold">Jumlah Total Barang</h2>
|
|
||||||
<p class="text-lg font-bold"> {{ $jumlahBarang }} </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Aktivitas Terbaru -->
|
|
||||||
<div class="subtitle-box bg-yellow-100 p-6 rounded shadow">
|
|
||||||
<h2 class="font-bold mb-4">Aktivitas Terbaru</h2>
|
|
||||||
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="box-custom">
|
|
||||||
<h3>Barang</h3>
|
|
||||||
<table class="w-full text-sm bg-white rounded shadow">
|
|
||||||
<thead class="bg-blue-500 text-white">
|
|
||||||
<tr>
|
|
||||||
<th class="p-2 text-left">No</th>
|
|
||||||
<th class="p-2 text-left">Kode</th>
|
|
||||||
<th class="p-2 text-left">Nama Barang</th>
|
|
||||||
<th class="p-2 text-left">Qty</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($barangTerbaru as $i => $brg)
|
|
||||||
@php
|
|
||||||
$kode = '-';
|
|
||||||
if ($brg->pendukung) {
|
|
||||||
$kode = $brg->pendukung->kode;
|
|
||||||
} elseif ($brg->produk) {
|
|
||||||
$kode = $brg->produk->kode;
|
|
||||||
}
|
|
||||||
@endphp
|
|
||||||
<tr>
|
|
||||||
<td class="p-2">{{ $i + 1 }}</td>
|
|
||||||
<td class="p-2">{{ $kode }}</td>
|
|
||||||
<td class="p-2">{{ $brg->nama_barang }}</td>
|
|
||||||
<td class="p-2">{{ number_format($brg->qty, 0, ',', '.') }} kg</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<a href="{{ route('operator.barang.index') }}" class="info-all text-blue-500 mt-2 inline-block">Selengkapnya</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tabel Transaksi -->
|
|
||||||
<div class="box-custom">
|
|
||||||
<h3>Aktivitas Transaksi</h3>
|
|
||||||
<table class="w-full text-sm bg-white rounded shadow">
|
|
||||||
<thead class="bg-blue-500 text-white">
|
|
||||||
<tr>
|
|
||||||
<th class="p-2 text-left">No</th>
|
|
||||||
<th class="p-2 text-left">Waktu</th>
|
|
||||||
<th class="p-2 text-left">Nama</th>
|
|
||||||
<th class="p-2 text-left">Kategori</th>
|
|
||||||
<th class="p-2 text-left">Harga</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($transaksiTerbaru as $i => $trx)
|
|
||||||
<tr>
|
|
||||||
<td class="p-2">{{ $i + 1 }}</td>
|
|
||||||
<td class="p-2">{{ \Carbon\Carbon::parse($trx['waktu'])->format('d-m-Y H:i') }}</td>
|
|
||||||
<td class="p-2">{{ $trx['nama_barang'] }}</td>
|
|
||||||
<td class="p-2">{{ $trx['kategori'] }}</td>
|
|
||||||
<td class="b-pri p-2">{{ $trx['harga'] }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<a href="{{ route('operator.transaksi.index') }}" class="info-all text-blue-500 mt-2 inline-block">Selengkapnya</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
|
@ -1,77 +0,0 @@
|
||||||
@extends('layouts.app_pimpinan')
|
|
||||||
|
|
||||||
@section('title', 'Dashboard Pimpinan')
|
|
||||||
|
|
||||||
@section('content')
|
|
||||||
<div class="container mt-4">
|
|
||||||
<div class="title-box">
|
|
||||||
<h3 class="fw-bold m-0">Dashboard</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="dashboard-container">
|
|
||||||
<div class="info-row">
|
|
||||||
<div class="info-box">
|
|
||||||
<div>Pendapatan</div>
|
|
||||||
<div class="text-success mt-2">
|
|
||||||
Rp {{ number_format($keuangan['pendapatan'], 0, ',', '.') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="info-box">
|
|
||||||
<div>Pengeluaran</div>
|
|
||||||
<div class="text-danger mt-2">
|
|
||||||
Rp {{ number_format($keuangan['pengeluaran'], 0, ',', '.') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="chart-card">
|
|
||||||
<div class="chart-title mb-2">Grafik Pendapatan <span class="text-dark">vs</span> Pengeluaran</div>
|
|
||||||
<canvas id="financeChart" height="100"></canvas>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Chart.js -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
||||||
<script>
|
|
||||||
const ctx = document.getElementById('financeChart').getContext('2d');
|
|
||||||
const financeChart = new Chart(ctx, {
|
|
||||||
type: 'line',
|
|
||||||
data: {
|
|
||||||
labels: {!! json_encode($labels) !!},
|
|
||||||
datasets: [
|
|
||||||
{
|
|
||||||
label: 'Pendapatan',
|
|
||||||
data: {!! json_encode($pendapatanBulanan) !!},
|
|
||||||
borderColor: 'blue',
|
|
||||||
backgroundColor: 'blue',
|
|
||||||
fill: false,
|
|
||||||
tension: 0.4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Pengeluaran',
|
|
||||||
data: {!! json_encode($pengeluaranBulanan) !!},
|
|
||||||
borderColor: 'red',
|
|
||||||
backgroundColor: 'red',
|
|
||||||
fill: false,
|
|
||||||
tension: 0.4
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
responsive: true,
|
|
||||||
maintainAspectRatio: false,
|
|
||||||
scales: {
|
|
||||||
y: {
|
|
||||||
beginAtZero: true,
|
|
||||||
ticks: {
|
|
||||||
callback: function(value) {
|
|
||||||
return 'Rp ' + value.toLocaleString('id-ID');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@endsection
|
|
Loading…
Reference in New Issue