dashboard
This commit is contained in:
parent
a4c1a733b2
commit
7586a2beb5
|
|
@ -0,0 +1,141 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\Keuangan;
|
||||||
|
use App\Models\PembayaranSpp;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class KeuanganController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$query = Keuangan::query();
|
||||||
|
|
||||||
|
if ($request->filled('search')) {
|
||||||
|
$query->search($request->search);
|
||||||
|
}
|
||||||
|
if ($request->filled('jenis')) {
|
||||||
|
$query->where('jenis', $request->jenis);
|
||||||
|
}
|
||||||
|
if ($request->filled('bulan') && $request->filled('tahun')) {
|
||||||
|
$query->bulan($request->bulan, $request->tahun);
|
||||||
|
}
|
||||||
|
|
||||||
|
$transaksi = $query->orderByDesc('tanggal')
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->paginate(20)
|
||||||
|
->appends(request()->query());
|
||||||
|
|
||||||
|
return view('admin.keuangan.index', compact('transaksi'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
return view('admin.keuangan.create');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
$validated = $request->validate([
|
||||||
|
'jenis' => 'required|in:pemasukan,pengeluaran',
|
||||||
|
'nominal' => 'required|numeric|min:1',
|
||||||
|
'keterangan' => 'nullable|string|max:500',
|
||||||
|
'tanggal' => 'required|date',
|
||||||
|
], [
|
||||||
|
'jenis.required' => 'Jenis transaksi wajib dipilih.',
|
||||||
|
'nominal.required' => 'Nominal wajib diisi.',
|
||||||
|
'nominal.min' => 'Nominal minimal Rp 1.',
|
||||||
|
'tanggal.required' => 'Tanggal wajib diisi.',
|
||||||
|
]);
|
||||||
|
|
||||||
|
Keuangan::create($validated);
|
||||||
|
|
||||||
|
return redirect()->route('admin.keuangan.index')
|
||||||
|
->with('success', 'Transaksi keuangan berhasil ditambahkan.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
$transaksi = Keuangan::findOrFail($id);
|
||||||
|
return view('admin.keuangan.show', compact('transaksi'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
$transaksi = Keuangan::findOrFail($id);
|
||||||
|
return view('admin.keuangan.edit', compact('transaksi'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
$transaksi = Keuangan::findOrFail($id);
|
||||||
|
|
||||||
|
$validated = $request->validate([
|
||||||
|
'jenis' => 'required|in:pemasukan,pengeluaran',
|
||||||
|
'nominal' => 'required|numeric|min:1',
|
||||||
|
'keterangan' => 'nullable|string|max:500',
|
||||||
|
'tanggal' => 'required|date',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$transaksi->update($validated);
|
||||||
|
|
||||||
|
return redirect()->route('admin.keuangan.index')
|
||||||
|
->with('success', 'Transaksi berhasil diperbarui.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
Keuangan::findOrFail($id)->delete();
|
||||||
|
|
||||||
|
return redirect()->route('admin.keuangan.index')
|
||||||
|
->with('success', 'Transaksi berhasil dihapus.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Laporan Neraca: SPP terkumpul vs pengeluaran pondok = sisa kas
|
||||||
|
*/
|
||||||
|
public function laporan(Request $request)
|
||||||
|
{
|
||||||
|
$bulan = $request->get('bulan', (int) date('n'));
|
||||||
|
$tahun = $request->get('tahun', (int) date('Y'));
|
||||||
|
|
||||||
|
// SPP terkumpul bulan ini
|
||||||
|
$sppTerkumpul = PembayaranSpp::where('bulan', $bulan)
|
||||||
|
->where('tahun', $tahun)
|
||||||
|
->lunas()
|
||||||
|
->sum('nominal');
|
||||||
|
|
||||||
|
// Pemasukan pondok (kas masuk non-SPP)
|
||||||
|
$pemasukanPondok = Keuangan::pemasukan()->bulan($bulan, $tahun)->sum('nominal');
|
||||||
|
|
||||||
|
// Pengeluaran pondok
|
||||||
|
$pengeluaranPondok = Keuangan::pengeluaran()->bulan($bulan, $tahun)->sum('nominal');
|
||||||
|
|
||||||
|
$totalPemasukan = $sppTerkumpul + $pemasukanPondok;
|
||||||
|
$sisaKas = $totalPemasukan - $pengeluaranPondok;
|
||||||
|
|
||||||
|
// Detail pengeluaran terbesar
|
||||||
|
$detailPengeluaran = Keuangan::pengeluaran()
|
||||||
|
->bulan($bulan, $tahun)
|
||||||
|
->orderByDesc('nominal')
|
||||||
|
->limit(10)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
// Detail pemasukan non-SPP
|
||||||
|
$detailPemasukan = Keuangan::pemasukan()
|
||||||
|
->bulan($bulan, $tahun)
|
||||||
|
->orderByDesc('nominal')
|
||||||
|
->limit(10)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return view('admin.keuangan.laporan', compact(
|
||||||
|
'bulan', 'tahun',
|
||||||
|
'sppTerkumpul', 'pemasukanPondok', 'pengeluaranPondok',
|
||||||
|
'totalPemasukan', 'sisaKas',
|
||||||
|
'detailPengeluaran', 'detailPemasukan'
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,50 +8,117 @@
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class UangSakuController extends Controller
|
class UangSakuController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Tampilkan daftar transaksi uang saku
|
* Tampilkan daftar uang saku — Grouped per Santri
|
||||||
*/
|
*/
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$query = UangSaku::with('santri:id_santri,nama_lengkap');
|
$search = $request->get('search');
|
||||||
|
|
||||||
// Search
|
// Query santri aktif yang punya transaksi (atau semua jika tidak ada filter)
|
||||||
if ($request->filled('search')) {
|
$santriQuery = Santri::aktif()
|
||||||
$query->search($request->search);
|
->select('id_santri', 'nama_lengkap')
|
||||||
|
->withCount(['uangSaku as transaksi_bulan_ini' => function ($q) {
|
||||||
|
$q->whereMonth('tanggal_transaksi', now()->month)
|
||||||
|
->whereYear('tanggal_transaksi', now()->year);
|
||||||
|
}])
|
||||||
|
->has('uangSaku');
|
||||||
|
|
||||||
|
if ($search) {
|
||||||
|
$santriQuery->where(function ($q) use ($search) {
|
||||||
|
$q->where('nama_lengkap', 'like', "%{$search}%")
|
||||||
|
->orWhere('id_santri', 'like', "%{$search}%");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter berdasarkan santri
|
$santriList = $santriQuery->orderBy('nama_lengkap')
|
||||||
if ($request->filled('id_santri')) {
|
|
||||||
$query->bySantri($request->id_santri);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter berdasarkan jenis transaksi
|
|
||||||
if ($request->filled('jenis_transaksi')) {
|
|
||||||
$query->byJenis($request->jenis_transaksi);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter berdasarkan tanggal
|
|
||||||
if ($request->filled('tanggal_dari') && $request->filled('tanggal_sampai')) {
|
|
||||||
$query->byDateRange($request->tanggal_dari, $request->tanggal_sampai);
|
|
||||||
}
|
|
||||||
|
|
||||||
$transaksi = $query->orderBy('tanggal_transaksi', 'desc')
|
|
||||||
->orderBy('created_at', 'desc')
|
|
||||||
->paginate(20)
|
->paginate(20)
|
||||||
->appends(request()->query());
|
->appends(request()->query());
|
||||||
|
|
||||||
// Cache santri list untuk dropdown
|
// Ambil saldo terakhir & transaksi terbaru per santri (batch)
|
||||||
$santriList = Cache::remember('santri_aktif_uang_saku', 300, function () {
|
$ids = $santriList->pluck('id_santri');
|
||||||
return Santri::where('status', 'Aktif')
|
|
||||||
->select('id_santri', 'nama_lengkap')
|
// Saldo terakhir per santri (dari transaksi terbaru)
|
||||||
->orderBy('nama_lengkap')
|
$saldoMap = UangSaku::whereIn('id_santri', $ids)
|
||||||
->get();
|
->select('id_santri', 'saldo_sesudah')
|
||||||
|
->orderByDesc('tanggal_transaksi')
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->get()
|
||||||
|
->unique('id_santri')
|
||||||
|
->keyBy('id_santri');
|
||||||
|
|
||||||
|
// Transaksi terbaru per santri (max 5)
|
||||||
|
$transaksiMap = UangSaku::whereIn('id_santri', $ids)
|
||||||
|
->orderByDesc('tanggal_transaksi')
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->get()
|
||||||
|
->groupBy('id_santri')
|
||||||
|
->map(fn ($group) => $group->take(5));
|
||||||
|
|
||||||
|
// Attach ke santri objects
|
||||||
|
$santriList->getCollection()->each(function ($santri) use ($saldoMap, $transaksiMap) {
|
||||||
|
$santri->saldo_terakhir = $saldoMap[$santri->id_santri]->saldo_sesudah ?? 0;
|
||||||
|
$santri->transaksi_terbaru = $transaksiMap[$santri->id_santri] ?? collect();
|
||||||
});
|
});
|
||||||
|
|
||||||
return view('admin.uang-saku.index', compact('transaksi', 'santriList'));
|
return view('admin.uang-saku.index', compact('santriList'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AJAX: Info santri untuk form create/edit
|
||||||
|
*/
|
||||||
|
public function santriInfo($id_santri)
|
||||||
|
{
|
||||||
|
$santri = Santri::where('id_santri', $id_santri)->firstOrFail();
|
||||||
|
|
||||||
|
$bulanIni = now();
|
||||||
|
|
||||||
|
// Saldo terakhir
|
||||||
|
$lastTx = UangSaku::where('id_santri', $id_santri)
|
||||||
|
->orderByDesc('tanggal_transaksi')
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$saldo = $lastTx ? $lastTx->saldo_sesudah : 0;
|
||||||
|
|
||||||
|
// Total pemasukan & pengeluaran bulan ini
|
||||||
|
$pemasukanBulanIni = UangSaku::where('id_santri', $id_santri)
|
||||||
|
->where('jenis_transaksi', 'pemasukan')
|
||||||
|
->whereMonth('tanggal_transaksi', $bulanIni->month)
|
||||||
|
->whereYear('tanggal_transaksi', $bulanIni->year)
|
||||||
|
->sum('nominal');
|
||||||
|
|
||||||
|
$pengeluaranBulanIni = UangSaku::where('id_santri', $id_santri)
|
||||||
|
->where('jenis_transaksi', 'pengeluaran')
|
||||||
|
->whereMonth('tanggal_transaksi', $bulanIni->month)
|
||||||
|
->whereYear('tanggal_transaksi', $bulanIni->year)
|
||||||
|
->sum('nominal');
|
||||||
|
|
||||||
|
// 3 transaksi terakhir
|
||||||
|
$transaksiTerakhir = UangSaku::where('id_santri', $id_santri)
|
||||||
|
->orderByDesc('tanggal_transaksi')
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->limit(3)
|
||||||
|
->get()
|
||||||
|
->map(fn ($t) => [
|
||||||
|
'tanggal' => $t->tanggal_transaksi->format('d/m/Y'),
|
||||||
|
'jenis' => $t->jenis_transaksi,
|
||||||
|
'nominal' => number_format($t->nominal, 0, ',', '.'),
|
||||||
|
'keterangan' => $t->keterangan ?? '-',
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'nama' => $santri->nama_lengkap,
|
||||||
|
'saldo_terakhir' => number_format($saldo, 0, ',', '.'),
|
||||||
|
'saldo_raw' => $saldo,
|
||||||
|
'total_pemasukan_bulan_ini' => number_format($pemasukanBulanIni, 0, ',', '.'),
|
||||||
|
'total_pengeluaran_bulan_ini' => number_format($pengeluaranBulanIni, 0, ',', '.'),
|
||||||
|
'transaksi_terakhir' => $transaksiTerakhir,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,39 +3,269 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use App\Models\Santri;
|
use App\Models\Santri;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Models\Kegiatan;
|
||||||
|
use App\Models\AbsensiKegiatan;
|
||||||
|
use App\Models\KategoriKegiatan;
|
||||||
use App\Models\RiwayatPelanggaran;
|
use App\Models\RiwayatPelanggaran;
|
||||||
use App\Models\Berita;
|
use App\Models\Berita;
|
||||||
use App\Models\KesehatanSantri;
|
use App\Models\KesehatanSantri;
|
||||||
use App\Models\Kepulangan;
|
use App\Models\Kepulangan;
|
||||||
|
use App\Models\PengajuanKepulangan;
|
||||||
|
use App\Models\PembayaranSpp;
|
||||||
|
use App\Models\UangSaku;
|
||||||
use App\Models\Capaian;
|
use App\Models\Capaian;
|
||||||
use App\Models\Semester;
|
use App\Models\Semester;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Mapping hari Carbon (English) → DB enum (Indonesia)
|
||||||
|
*/
|
||||||
|
private function hariIndonesia(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'Monday' => 'Senin', 'Tuesday' => 'Selasa', 'Wednesday' => 'Rabu',
|
||||||
|
'Thursday' => 'Kamis', 'Friday' => 'Jumat', 'Saturday' => 'Sabtu',
|
||||||
|
'Sunday' => 'Ahad',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dashboard Admin
|
* Dashboard Admin
|
||||||
*/
|
*/
|
||||||
public function admin()
|
public function admin()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$data = [
|
$today = Carbon::today();
|
||||||
'total_santri' => Santri::count(),
|
$now = Carbon::now();
|
||||||
'total_wali' => User::where('role', 'wali')->count(),
|
$hariIni = $this->hariIndonesia()[$today->format('l')];
|
||||||
'kegiatan_hari_ini' => 0,
|
$bulanIni = (int) $today->format('m');
|
||||||
];
|
$tahunIni = (int) $today->format('Y');
|
||||||
|
|
||||||
return view('admin.dashboardAdmin', compact('data'));
|
// ────────────────────────── KPI CARDS ──────────────────────────
|
||||||
|
$totalSantriAktif = Cache::remember('dash_santri_aktif', 300, fn () => Santri::aktif()->count());
|
||||||
|
|
||||||
|
// Kegiatan hari ini + status absensi
|
||||||
|
$kegiatanHariIni = Kegiatan::with(['kategori', 'absensis' => fn ($q) => $q->whereDate('tanggal', $today)])
|
||||||
|
->where('hari', $hariIni)
|
||||||
|
->orderBy('waktu_mulai')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$totalKegiatan = $kegiatanHariIni->count();
|
||||||
|
$sudahAbsensi = $kegiatanHariIni->filter(fn ($k) => $k->absensis->isNotEmpty())->count();
|
||||||
|
$belumAbsensi = $totalKegiatan - $sudahAbsensi;
|
||||||
|
|
||||||
|
// Santri di UKP (sedang dirawat)
|
||||||
|
$santriSakit = KesehatanSantri::dirawat()->count();
|
||||||
|
|
||||||
|
// Pengajuan kepulangan menunggu approval
|
||||||
|
$kepulanganMenunggu = PengajuanKepulangan::where('status', 'Menunggu')->count();
|
||||||
|
|
||||||
|
// Santri aktif yang belum punya akun wali
|
||||||
|
$santriTanpaWali = Santri::aktif()
|
||||||
|
->whereDoesntHave('waliUser')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$kpiCards = compact(
|
||||||
|
'totalSantriAktif', 'totalKegiatan', 'sudahAbsensi',
|
||||||
|
'belumAbsensi', 'santriSakit', 'kepulanganMenunggu', 'santriTanpaWali'
|
||||||
|
);
|
||||||
|
|
||||||
|
// ──────────────────── JADWAL KEGIATAN HARI INI ────────────────────
|
||||||
|
$kegiatanHariIni->each(function ($kegiatan) use ($now, $today, $totalSantriAktif) {
|
||||||
|
$waktuMulaiStr = is_string($kegiatan->waktu_mulai) ? $kegiatan->waktu_mulai : $kegiatan->waktu_mulai->format('H:i');
|
||||||
|
$waktuSelesaiStr = is_string($kegiatan->waktu_selesai) ? $kegiatan->waktu_selesai : $kegiatan->waktu_selesai->format('H:i');
|
||||||
|
|
||||||
|
$mulai = Carbon::parse($today->format('Y-m-d') . ' ' . $waktuMulaiStr);
|
||||||
|
$selesai = Carbon::parse($today->format('Y-m-d') . ' ' . $waktuSelesaiStr);
|
||||||
|
|
||||||
|
$kegiatan->status_kegiatan = $now->lt($mulai) ? 'belum'
|
||||||
|
: ($now->between($mulai, $selesai) ? 'berlangsung' : 'selesai');
|
||||||
|
|
||||||
|
$totalAbsen = $kegiatan->absensis->count();
|
||||||
|
$hadir = $kegiatan->absensis->where('status', 'Hadir')->count();
|
||||||
|
$kegiatan->persen_kehadiran = $totalAbsen > 0 ? round(($hadir / $totalAbsen) * 100) : 0;
|
||||||
|
$kegiatan->total_absensi = $totalAbsen;
|
||||||
|
$kegiatan->belum_input = $kegiatan->status_kegiatan === 'selesai' && $totalAbsen === 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
// ────────────────────────── ALERT PANEL ──────────────────────────
|
||||||
|
// 1) Santri alpa beruntun (≥3 hari berturut-turut dalam 7 hari terakhir)
|
||||||
|
$santriAlpaBeruntun = $this->getSantriAlpaBeruntun();
|
||||||
|
|
||||||
|
// 2) SPP jatuh tempo (belum lunas & batas_bayar sudah lewat)
|
||||||
|
$sppJatuhTempo = PembayaranSpp::telat()
|
||||||
|
->with('santri:id_santri,nama_lengkap')
|
||||||
|
->select('id_pembayaran', 'id_santri', 'bulan', 'tahun', 'nominal', 'batas_bayar')
|
||||||
|
->orderBy('batas_bayar')
|
||||||
|
->limit(10)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
// 3) Pengajuan kepulangan menunggu review
|
||||||
|
$kepulanganPending = PengajuanKepulangan::where('status', 'Menunggu')
|
||||||
|
->with('santri:id_santri,nama_lengkap')
|
||||||
|
->select('id_pengajuan', 'id_santri', 'tanggal_pulang', 'tanggal_kembali', 'alasan')
|
||||||
|
->orderBy('created_at')
|
||||||
|
->limit(5)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$alerts = compact('santriAlpaBeruntun', 'sppJatuhTempo', 'kepulanganPending');
|
||||||
|
|
||||||
|
// ──────────────── GRAFIK TREN KEHADIRAN (4 MINGGU) ────────────────
|
||||||
|
$trenKehadiran = $this->getTrenKehadiran($today);
|
||||||
|
|
||||||
|
// ──────────────── RINGKASAN SPP BULAN INI ────────────────
|
||||||
|
$sppBulanIni = Cache::remember("dash_spp_{$bulanIni}_{$tahunIni}", 300, function () use ($bulanIni, $tahunIni) {
|
||||||
|
$lunas = PembayaranSpp::where('bulan', $bulanIni)->where('tahun', $tahunIni)->lunas()->count();
|
||||||
|
$belum = PembayaranSpp::where('bulan', $bulanIni)->where('tahun', $tahunIni)->belumLunas()->count();
|
||||||
|
$terkumpul = PembayaranSpp::where('bulan', $bulanIni)->where('tahun', $tahunIni)->lunas()->sum('nominal');
|
||||||
|
$totalTagihan = PembayaranSpp::where('bulan', $bulanIni)->where('tahun', $tahunIni)->sum('nominal');
|
||||||
|
|
||||||
|
return compact('lunas', 'belum', 'terkumpul', 'totalTagihan');
|
||||||
|
});
|
||||||
|
|
||||||
|
// ──────────────── FEED AKTIVITAS TERBARU ────────────────
|
||||||
|
$feedAktivitas = $this->getFeedAktivitas($today);
|
||||||
|
|
||||||
|
return view('admin.dashboardAdmin', compact(
|
||||||
|
'kpiCards', 'kegiatanHariIni', 'alerts',
|
||||||
|
'trenKehadiran', 'sppBulanIni', 'feedAktivitas',
|
||||||
|
'hariIni', 'today'
|
||||||
|
));
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error('Error di Dashboard Admin: ' . $e->getMessage());
|
Log::error('Error di Dashboard Admin: ' . $e->getMessage() . ' | ' . $e->getFile() . ':' . $e->getLine());
|
||||||
abort(500, 'Terjadi kesalahan saat memuat dashboard Admin: ' . $e->getMessage());
|
if (config('app.debug')) {
|
||||||
|
abort(500, 'Error: ' . $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine());
|
||||||
|
}
|
||||||
|
abort(500, 'Terjadi kesalahan saat memuat dashboard Admin.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ══════════════════ HELPER METHODS ══════════════════
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Santri dengan alpa ≥ 3x beruntun dalam 7 hari terakhir
|
||||||
|
*/
|
||||||
|
private function getSantriAlpaBeruntun(int $threshold = 3): \Illuminate\Support\Collection
|
||||||
|
{
|
||||||
|
$weekAgo = Carbon::today()->subDays(7);
|
||||||
|
|
||||||
|
// Ambil data alpa per santri 7 hari terakhir
|
||||||
|
$alpaData = AbsensiKegiatan::where('status', 'Alpa')
|
||||||
|
->whereDate('tanggal', '>=', $weekAgo)
|
||||||
|
->select('id_santri')
|
||||||
|
->selectRaw('COUNT(*) as total_alpa')
|
||||||
|
->groupBy('id_santri')
|
||||||
|
->having('total_alpa', '>=', $threshold)
|
||||||
|
->pluck('total_alpa', 'id_santri');
|
||||||
|
|
||||||
|
if ($alpaData->isEmpty()) {
|
||||||
|
return collect([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Santri::aktif()
|
||||||
|
->whereIn('id_santri', $alpaData->keys())
|
||||||
|
->select('id_santri', 'nama_lengkap')
|
||||||
|
->get()
|
||||||
|
->map(fn ($s) => (object) [
|
||||||
|
'nama' => $s->nama_lengkap,
|
||||||
|
'id_santri' => $s->id_santri,
|
||||||
|
'total_alpa' => $alpaData[$s->id_santri],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tren kehadiran 4 minggu terakhir, dikelompokkan per kategori kegiatan
|
||||||
|
*/
|
||||||
|
private function getTrenKehadiran(Carbon $today): array
|
||||||
|
{
|
||||||
|
$labels = [];
|
||||||
|
$series = [];
|
||||||
|
|
||||||
|
$kategoris = KategoriKegiatan::select('kategori_id', 'nama_kategori')->get();
|
||||||
|
|
||||||
|
// 4 minggu terakhir → label "Mg 1" s.d "Mg 4"
|
||||||
|
for ($i = 3; $i >= 0; $i--) {
|
||||||
|
$start = $today->copy()->subWeeks($i)->startOfWeek(Carbon::MONDAY);
|
||||||
|
$end = $start->copy()->endOfWeek(Carbon::SUNDAY);
|
||||||
|
$labels[] = 'Mg ' . (4 - $i);
|
||||||
|
|
||||||
|
foreach ($kategoris as $kat) {
|
||||||
|
$kegiatanIds = Kegiatan::where('kategori_id', $kat->kategori_id)
|
||||||
|
->pluck('kegiatan_id');
|
||||||
|
|
||||||
|
$totalAbsen = AbsensiKegiatan::whereIn('kegiatan_id', $kegiatanIds)
|
||||||
|
->dateRange($start, $end)
|
||||||
|
->count();
|
||||||
|
$hadir = AbsensiKegiatan::whereIn('kegiatan_id', $kegiatanIds)
|
||||||
|
->dateRange($start, $end)
|
||||||
|
->where('status', 'Hadir')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$series[$kat->nama_kategori][] = $totalAbsen > 0 ? round(($hadir / $totalAbsen) * 100, 1) : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return compact('labels', 'series');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Feed aktivitas terbaru: absensi, pelanggaran, pembayaran SPP, transaksi uang saku
|
||||||
|
*/
|
||||||
|
private function getFeedAktivitas(Carbon $today): \Illuminate\Support\Collection
|
||||||
|
{
|
||||||
|
$items = collect();
|
||||||
|
|
||||||
|
// Absensi terbaru
|
||||||
|
AbsensiKegiatan::with(['santri:id_santri,nama_lengkap', 'kegiatan:kegiatan_id,nama_kegiatan'])
|
||||||
|
->whereDate('tanggal', $today)
|
||||||
|
->orderByDesc('created_at')
|
||||||
|
->limit(5)
|
||||||
|
->get()
|
||||||
|
->each(fn ($a) => $items->push((object) [
|
||||||
|
'icon' => 'fa-clipboard-check',
|
||||||
|
'color' => 'success',
|
||||||
|
'text' => ($a->santri->nama_lengkap ?? '-') . ' — ' . $a->status . ' di ' . ($a->kegiatan->nama_kegiatan ?? '-'),
|
||||||
|
'time' => $a->created_at,
|
||||||
|
]));
|
||||||
|
|
||||||
|
// Pelanggaran terbaru (7 hari)
|
||||||
|
RiwayatPelanggaran::with(['santri:id_santri,nama_lengkap', 'kategori:id_kategori,nama_pelanggaran'])
|
||||||
|
->whereDate('tanggal', '>=', $today->copy()->subDays(7))
|
||||||
|
->terbaru()
|
||||||
|
->limit(5)
|
||||||
|
->get()
|
||||||
|
->each(fn ($p) => $items->push((object) [
|
||||||
|
'icon' => 'fa-exclamation-triangle',
|
||||||
|
'color' => 'danger',
|
||||||
|
'text' => ($p->santri->nama_lengkap ?? '-') . ' — ' . ($p->kategori->nama_pelanggaran ?? '-') . ' (' . $p->poin . ' poin)',
|
||||||
|
'time' => $p->created_at,
|
||||||
|
]));
|
||||||
|
|
||||||
|
// Pembayaran SPP terbaru (7 hari)
|
||||||
|
PembayaranSpp::with('santri:id_santri,nama_lengkap')
|
||||||
|
->lunas()
|
||||||
|
->whereNotNull('tanggal_bayar')
|
||||||
|
->whereDate('tanggal_bayar', '>=', $today->copy()->subDays(7))
|
||||||
|
->orderByDesc('tanggal_bayar')
|
||||||
|
->limit(5)
|
||||||
|
->get()
|
||||||
|
->each(fn ($s) => $items->push((object) [
|
||||||
|
'icon' => 'fa-money-bill-wave',
|
||||||
|
'color' => 'info',
|
||||||
|
'text' => ($s->santri->nama_lengkap ?? '-') . ' — SPP ' . $s->bulan_nama . '/' . $s->tahun . ' (Rp ' . number_format($s->nominal, 0, ',', '.') . ')',
|
||||||
|
'time' => $s->created_at,
|
||||||
|
]));
|
||||||
|
|
||||||
|
return $items->sortByDesc('time')->take(10)->values();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dashboard Santri/Wali - FIXED VERSION ✅
|
* Dashboard Santri/Wali - FIXED VERSION ✅
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Keuangan extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $table = 'keuangan';
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'id_keuangan', 'jenis', 'nominal', 'keterangan', 'tanggal',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'tanggal' => 'date',
|
||||||
|
'nominal' => 'decimal:2',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected static function boot()
|
||||||
|
{
|
||||||
|
parent::boot();
|
||||||
|
static::creating(function ($model) {
|
||||||
|
if (empty($model->id_keuangan)) {
|
||||||
|
$last = static::orderBy('id', 'desc')->first();
|
||||||
|
$num = $last ? intval(substr($last->id_keuangan, 3)) + 1 : 1;
|
||||||
|
$model->id_keuangan = 'KEU' . str_pad($num, 3, '0', STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Scopes ──
|
||||||
|
public function scopePemasukan($query) { return $query->where('jenis', 'pemasukan'); }
|
||||||
|
public function scopePengeluaran($query) { return $query->where('jenis', 'pengeluaran'); }
|
||||||
|
|
||||||
|
public function scopeBulan($query, $bulan, $tahun)
|
||||||
|
{
|
||||||
|
return $query->whereMonth('tanggal', $bulan)->whereYear('tanggal', $tahun);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeSearch($query, $search)
|
||||||
|
{
|
||||||
|
return $query->where(function ($q) use ($search) {
|
||||||
|
$q->where('id_keuangan', 'like', "%{$search}%")
|
||||||
|
->orWhere('keterangan', 'like', "%{$search}%");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Accessors ──
|
||||||
|
public function getNominalFormatAttribute()
|
||||||
|
{
|
||||||
|
return 'Rp ' . number_format($this->nominal, 0, ',', '.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('keuangan', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('id_keuangan', 20)->unique();
|
||||||
|
$table->enum('jenis', ['pemasukan', 'pengeluaran']);
|
||||||
|
$table->decimal('nominal', 15, 2);
|
||||||
|
$table->string('keterangan', 500)->nullable();
|
||||||
|
$table->date('tanggal');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('keuangan');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -77,8 +77,8 @@ body {
|
||||||
.splash-screen {
|
.splash-screen {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: linear-gradient(135deg, #6FBA9D 0%, #FF8B94 100%);
|
background: #ffffff;
|
||||||
color: white;
|
color: #2C3E50;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -91,21 +91,32 @@ .splash-content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.splash-content h1 {
|
.splash-logo {
|
||||||
font: 700 3rem/1.2 inherit;
|
width: 110px;
|
||||||
margin-bottom: 1rem;
|
height: 110px;
|
||||||
letter-spacing: -1px;
|
object-fit: contain;
|
||||||
|
margin: 0 auto 16px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.splash-title {
|
||||||
|
font-family: 'Cinzel', serif;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
color: #2C3E50;
|
||||||
|
letter-spacing: 0.15em;
|
||||||
|
margin: 0 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spinner,
|
.spinner,
|
||||||
.loading-spinner {
|
.loading-spinner {
|
||||||
border: 4px solid rgba(255, 255, 255, 0.2);
|
border: 3px solid #E8F7F2;
|
||||||
border-top-color: #fff;
|
border-top-color: #6FBA9D;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 50px;
|
width: 32px;
|
||||||
height: 50px;
|
height: 32px;
|
||||||
animation: spin 0.8s linear infinite;
|
animation: spin 0.8s linear infinite;
|
||||||
margin: 20px auto 0;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-spinner {
|
.loading-spinner {
|
||||||
|
|
@ -1863,6 +1874,207 @@ @media (max-width: 480px) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===================================
|
||||||
|
DASHBOARD ADMIN — Extra Styles
|
||||||
|
=================================== */
|
||||||
|
|
||||||
|
/* 5-column KPI row */
|
||||||
|
.row-cards-5 {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, 1fr);
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-sub {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.78rem;
|
||||||
|
color: var(--text-light);
|
||||||
|
margin-top: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Two-column grid for charts */
|
||||||
|
.dash-grid-2 {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 3fr 2fr;
|
||||||
|
gap: 20px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chart containers */
|
||||||
|
.dash-chart-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dash-chart-box h4 {
|
||||||
|
margin: 0 0 16px 0;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-container {
|
||||||
|
position: relative;
|
||||||
|
height: 280px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-container-sm {
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Jadwal kegiatan table enhancements */
|
||||||
|
.row-danger {
|
||||||
|
background-color: #FFF0F0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge-sm {
|
||||||
|
font-size: 0.68rem;
|
||||||
|
padding: 2px 6px;
|
||||||
|
margin-left: 6px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar-wrap {
|
||||||
|
width: 100%;
|
||||||
|
height: 6px;
|
||||||
|
background: var(--primary-light);
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-bar-fill {
|
||||||
|
height: 100%;
|
||||||
|
background: var(--success-color);
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: width 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Alert panel */
|
||||||
|
.dash-alerts {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-body strong {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-list {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-list li {
|
||||||
|
padding: 4px 0;
|
||||||
|
font-size: 0.88rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* SPP summary */
|
||||||
|
.spp-summary {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spp-stat {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spp-label {
|
||||||
|
font-size: 0.78rem;
|
||||||
|
color: var(--text-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-success { color: var(--success-color); }
|
||||||
|
.text-danger { color: var(--danger-color); }
|
||||||
|
|
||||||
|
/* Feed aktivitas */
|
||||||
|
.feed-list {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 10px 0;
|
||||||
|
border-bottom: 1px solid var(--primary-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-icon {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-icon-success { background: var(--success-color); }
|
||||||
|
.feed-icon-danger { background: var(--danger-color); }
|
||||||
|
.feed-icon-info { background: var(--info-color); }
|
||||||
|
.feed-icon-warning { background: var(--warning-color); }
|
||||||
|
|
||||||
|
.feed-body p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 0.88rem;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-body small {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-muted {
|
||||||
|
color: var(--text-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive overrides for dashboard */
|
||||||
|
@media (max-width: 1024px) {
|
||||||
|
.row-cards-5 {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
.dash-grid-2 {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.row-cards-5 {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.row-cards-5 {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
.spp-summary {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ===================================
|
/* ===================================
|
||||||
END OF OPTIMIZED CSS
|
END OF OPTIMIZED CSS
|
||||||
=================================== */
|
=================================== */
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 255 KiB |
|
|
@ -0,0 +1,59 @@
|
||||||
|
{{-- Alert Panel --}}
|
||||||
|
@if($alerts['santriAlpaBeruntun']->isNotEmpty() || $alerts['sppJatuhTempo']->isNotEmpty() || $alerts['kepulanganPending']->isNotEmpty())
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-exclamation-circle"></i> Peringatan & Tindak Lanjut</h3>
|
||||||
|
<div class="dash-alerts">
|
||||||
|
|
||||||
|
{{-- Santri Alpa Beruntun --}}
|
||||||
|
@if($alerts['santriAlpaBeruntun']->isNotEmpty())
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-user-times"></i> Santri Alpa Beruntun (7 Hari Terakhir)</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
@foreach($alerts['santriAlpaBeruntun'] as $s)
|
||||||
|
<li>{{ $s->nama }} <span class="badge badge-danger badge-sm">{{ $s->total_alpa }}x alpa</span></li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- SPP Jatuh Tempo --}}
|
||||||
|
@if($alerts['sppJatuhTempo']->isNotEmpty())
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-file-invoice-dollar"></i> SPP Jatuh Tempo</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
@foreach($alerts['sppJatuhTempo'] as $s)
|
||||||
|
<li>
|
||||||
|
{{ $s->santri->nama_lengkap ?? '-' }}
|
||||||
|
— Bln {{ $s->bulan }}/{{ $s->tahun }}
|
||||||
|
<small>(jatuh tempo {{ $s->batas_bayar->translatedFormat('d M Y') }})</small>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
{{-- Pengajuan Kepulangan Pending --}}
|
||||||
|
@if($alerts['kepulanganPending']->isNotEmpty())
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-home"></i> Pengajuan Kepulangan Menunggu Review</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
@foreach($alerts['kepulanganPending'] as $k)
|
||||||
|
<li>
|
||||||
|
{{ $k->santri->nama_lengkap ?? '-' }}
|
||||||
|
— {{ $k->tanggal_pulang->translatedFormat('d M') }} s.d {{ $k->tanggal_kembali->translatedFormat('d M Y') }}
|
||||||
|
<small>({{ $k->alasan }})</small>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{{-- Feed Aktivitas Terbaru --}}
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-rss"></i> Aktivitas Terbaru</h3>
|
||||||
|
<div class="content-box">
|
||||||
|
@if($feed->isEmpty())
|
||||||
|
<p class="text-muted">Belum ada aktivitas tercatat.</p>
|
||||||
|
@else
|
||||||
|
<ul class="feed-list">
|
||||||
|
@foreach($feed as $item)
|
||||||
|
<li class="feed-item">
|
||||||
|
<span class="feed-icon feed-icon-{{ $item->color }}">
|
||||||
|
<i class="fas {{ $item->icon }}"></i>
|
||||||
|
</span>
|
||||||
|
<div class="feed-body">
|
||||||
|
<p>{{ $item->text }}</p>
|
||||||
|
<small class="text-muted">{{ $item->time->diffForHumans() }}</small>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
{{-- Jadwal Kegiatan Hari Ini --}}
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-list-alt"></i> Jadwal Kegiatan — {{ $hari }}</h3>
|
||||||
|
<div class="content-box">
|
||||||
|
@if($kegiatan->isEmpty())
|
||||||
|
<p class="text-muted">Tidak ada kegiatan terjadwal hari ini.</p>
|
||||||
|
@else
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Kegiatan</th>
|
||||||
|
<th>Kategori</th>
|
||||||
|
<th>Waktu</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Kehadiran</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($kegiatan as $k)
|
||||||
|
<tr class="{{ $k->belum_input ? 'row-danger' : '' }}">
|
||||||
|
<td>
|
||||||
|
<strong>{{ $k->nama_kegiatan }}</strong>
|
||||||
|
@if($k->belum_input)
|
||||||
|
<span class="badge badge-danger badge-sm">Belum input absensi!</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{ $k->kategori->nama_kategori ?? '-' }}</td>
|
||||||
|
<td>
|
||||||
|
{{ is_string($k->waktu_mulai) ? $k->waktu_mulai : $k->waktu_mulai->format('H:i') }}
|
||||||
|
—
|
||||||
|
{{ is_string($k->waktu_selesai) ? $k->waktu_selesai : $k->waktu_selesai->format('H:i') }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($k->status_kegiatan === 'berlangsung')
|
||||||
|
<span class="badge badge-info">Berlangsung</span>
|
||||||
|
@elseif($k->status_kegiatan === 'selesai')
|
||||||
|
<span class="badge badge-success">Selesai</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-secondary">Belum Mulai</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@if($k->total_absensi > 0)
|
||||||
|
<div class="progress-bar-wrap">
|
||||||
|
<div class="progress-bar-fill" style="width: {{ $k->persen_kehadiran }}%"></div>
|
||||||
|
</div>
|
||||||
|
<small>{{ $k->persen_kehadiran }}% ({{ $k->total_absensi }} data)</small>
|
||||||
|
@else
|
||||||
|
<small class="text-muted">—</small>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
{{-- KPI Cards --}}
|
||||||
|
<div class="row-cards row-cards-5">
|
||||||
|
<div class="card card-info">
|
||||||
|
<h3>Santri Aktif</h3>
|
||||||
|
<p class="card-value">{{ $kpi['totalSantriAktif'] }}</p>
|
||||||
|
<i class="fas fa-user-graduate card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card {{ $kpi['belumAbsensi'] > 0 ? 'card-warning' : 'card-success' }}">
|
||||||
|
<h3>Kegiatan Hari Ini</h3>
|
||||||
|
<p class="card-value">{{ $kpi['totalKegiatan'] }}</p>
|
||||||
|
<span class="card-sub">{{ $kpi['sudahAbsensi'] }} sudah absen · {{ $kpi['belumAbsensi'] }} belum</span>
|
||||||
|
<i class="fas fa-calendar-check card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card {{ $kpi['santriSakit'] > 0 ? 'card-danger' : 'card-success' }}">
|
||||||
|
<h3>Santri di UKP</h3>
|
||||||
|
<p class="card-value">{{ $kpi['santriSakit'] }}</p>
|
||||||
|
<span class="card-sub">sedang dirawat</span>
|
||||||
|
<i class="fas fa-briefcase-medical card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card {{ $kpi['kepulanganMenunggu'] > 0 ? 'card-warning' : 'card-success' }}">
|
||||||
|
<h3>Menunggu Approval</h3>
|
||||||
|
<p class="card-value">{{ $kpi['kepulanganMenunggu'] }}</p>
|
||||||
|
<span class="card-sub">pengajuan kepulangan</span>
|
||||||
|
<i class="fas fa-clock card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card {{ $kpi['santriTanpaWali'] > 0 ? 'card-secondary' : 'card-success' }}">
|
||||||
|
<h3>Belum Ada Akun Wali</h3>
|
||||||
|
<p class="card-value">{{ $kpi['santriTanpaWali'] }}</p>
|
||||||
|
<span class="card-sub">santri tanpa wali mobile</span>
|
||||||
|
<i class="fas fa-user-plus card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{{-- Ringkasan SPP Bulan Ini --}}
|
||||||
|
<div class="content-box dash-chart-box">
|
||||||
|
<h4><i class="fas fa-wallet"></i> SPP Bulan Ini</h4>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$total = $spp['lunas'] + $spp['belum'];
|
||||||
|
$persenLunas = $total > 0 ? round(($spp['lunas'] / $total) * 100) : 0;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="chart-container chart-container-sm">
|
||||||
|
<canvas id="sppDonutChart"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spp-summary">
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Lunas</span>
|
||||||
|
<strong class="text-success">{{ $spp['lunas'] }} santri ({{ $persenLunas }}%)</strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Belum Lunas</span>
|
||||||
|
<strong class="text-danger">{{ $spp['belum'] }} santri</strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Terkumpul</span>
|
||||||
|
<strong>Rp {{ number_format($spp['terkumpul'], 0, ',', '.') }}</strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Total Tagihan</span>
|
||||||
|
<strong>Rp {{ number_format($spp['totalTagihan'], 0, ',', '.') }}</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{{-- Tren Kehadiran 4 Minggu Terakhir --}}
|
||||||
|
<div class="content-box dash-chart-box">
|
||||||
|
<h4><i class="fas fa-chart-line"></i> Tren Kehadiran (4 Minggu)</h4>
|
||||||
|
<div class="chart-container">
|
||||||
|
<canvas id="trenKehadiranChart"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- views/admin/dashboardAdmin.blade.php -->
|
{{-- views/admin/dashboardAdmin.blade.php --}}
|
||||||
@extends('layouts.app', ['isAdmin' => true])
|
@extends('layouts.app', ['isAdmin' => true])
|
||||||
|
|
||||||
@section('title', 'Dashboard Admin')
|
@section('title', 'Dashboard Admin')
|
||||||
|
|
@ -6,31 +6,93 @@
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2>Dashboard Admin</h2>
|
<h2>Dashboard Admin</h2>
|
||||||
<p>Selamat datang di Sistem Informasi Monitoring Santri.</p>
|
<p>{{ $hariIni }}, {{ $today->translatedFormat('d F Y') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-cards">
|
{{-- 1. KPI Cards --}}
|
||||||
<div class="card card-info">
|
@include('admin.dashboard._kpi-cards', ['kpi' => $kpiCards])
|
||||||
<h3>Total Santri</h3>
|
|
||||||
<p class="card-value">{{ $data['total_santri'] }}</p>
|
|
||||||
<i class="fas fa-user-graduate card-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div class="card card-success">
|
|
||||||
<h3>Total Wali Santri</h3>
|
|
||||||
<p class="card-value">{{ $data['total_wali'] }}</p>
|
|
||||||
<i class="fas fa-user-shield card-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div class="card card-warning">
|
|
||||||
<h3>Kegiatan Hari Ini</h3>
|
|
||||||
<p class="card-value">{{ $data['kegiatan_hari_ini'] }}</p>
|
|
||||||
<i class="fas fa-calendar-alt card-icon"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content-section">
|
{{-- 2. Jadwal Kegiatan Hari Ini --}}
|
||||||
<h3>Statistik & Grafik</h3>
|
@include('admin.dashboard._jadwal-kegiatan', ['kegiatan' => $kegiatanHariIni, 'hari' => $hariIni])
|
||||||
<div class="content-box">
|
|
||||||
<p>Area untuk menempatkan statistik dan grafik sistem.</p>
|
{{-- 3. Alert Panel --}}
|
||||||
</div>
|
@include('admin.dashboard._alert-panel', ['alerts' => $alerts])
|
||||||
|
|
||||||
|
{{-- Row: Grafik + SPP --}}
|
||||||
|
<div class="dash-grid-2">
|
||||||
|
{{-- 4. Grafik Tren Kehadiran --}}
|
||||||
|
@include('admin.dashboard._tren-kehadiran', ['trenKehadiran' => $trenKehadiran])
|
||||||
|
|
||||||
|
{{-- 5. Ringkasan SPP Bulan Ini --}}
|
||||||
|
@include('admin.dashboard._ringkasan-spp', ['spp' => $sppBulanIni])
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- 6. Feed Aktivitas Terbaru --}}
|
||||||
|
@include('admin.dashboard._feed-aktivitas', ['feed' => $feedAktivitas])
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('scripts')
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4/dist/chart.umd.min.js"></script>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
// ── Tren Kehadiran (Line Chart) ──
|
||||||
|
const trenCtx = document.getElementById('trenKehadiranChart');
|
||||||
|
if (trenCtx) {
|
||||||
|
const trenData = @json($trenKehadiran);
|
||||||
|
const colors = ['#6FBA9D', '#FF8B94', '#81C6E8', '#FFD56B', '#B39DDB', '#FFAB91'];
|
||||||
|
const datasets = Object.keys(trenData.series).map((label, i) => ({
|
||||||
|
label: label,
|
||||||
|
data: trenData.series[label],
|
||||||
|
borderColor: colors[i % colors.length],
|
||||||
|
backgroundColor: colors[i % colors.length] + '20',
|
||||||
|
tension: 0.3,
|
||||||
|
fill: true,
|
||||||
|
pointRadius: 4,
|
||||||
|
pointHoverRadius: 6,
|
||||||
|
}));
|
||||||
|
|
||||||
|
new Chart(trenCtx, {
|
||||||
|
type: 'line',
|
||||||
|
data: { labels: trenData.labels, datasets },
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
plugins: {
|
||||||
|
legend: { position: 'bottom', labels: { padding: 16, usePointStyle: true } },
|
||||||
|
tooltip: { callbacks: { label: ctx => ctx.dataset.label + ': ' + ctx.parsed.y + '%' } }
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: { beginAtZero: true, max: 100, ticks: { callback: v => v + '%' } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Ringkasan SPP (Donut Chart) ──
|
||||||
|
const sppCtx = document.getElementById('sppDonutChart');
|
||||||
|
if (sppCtx) {
|
||||||
|
const sppData = @json($sppBulanIni);
|
||||||
|
new Chart(sppCtx, {
|
||||||
|
type: 'doughnut',
|
||||||
|
data: {
|
||||||
|
labels: ['Lunas', 'Belum Lunas'],
|
||||||
|
datasets: [{
|
||||||
|
data: [sppData.lunas, sppData.belum],
|
||||||
|
backgroundColor: ['#6FBA9D', '#FF8B94'],
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: '#fff',
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
cutout: '65%',
|
||||||
|
plugins: {
|
||||||
|
legend: { position: 'bottom', labels: { padding: 16, usePointStyle: true } },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Transaksi Keuangan</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="{{ route('admin.keuangan.store') }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="jenis"><i class="fas fa-exchange-alt form-icon"></i> Jenis Transaksi <span style="color:red;">*</span></label>
|
||||||
|
<select name="jenis" id="jenis" class="form-control @error('jenis') is-invalid @enderror" required>
|
||||||
|
<option value="">-- Pilih Jenis --</option>
|
||||||
|
<option value="pemasukan" {{ old('jenis')=='pemasukan'?'selected':'' }}>Pemasukan (Kas Masuk)</option>
|
||||||
|
<option value="pengeluaran" {{ old('jenis')=='pengeluaran'?'selected':'' }}>Pengeluaran (Kas Keluar)</option>
|
||||||
|
</select>
|
||||||
|
@error('jenis') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nominal"><i class="fas fa-money-bill-wave form-icon"></i> Nominal (Rp) <span style="color:red;">*</span></label>
|
||||||
|
<input type="number" name="nominal" id="nominal" class="form-control @error('nominal') is-invalid @enderror"
|
||||||
|
value="{{ old('nominal') }}" placeholder="Contoh: 500000" min="1" step="1" required>
|
||||||
|
@error('nominal') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal"><i class="fas fa-calendar form-icon"></i> Tanggal <span style="color:red;">*</span></label>
|
||||||
|
<input type="date" name="tanggal" id="tanggal" class="form-control @error('tanggal') is-invalid @enderror"
|
||||||
|
value="{{ old('tanggal', date('Y-m-d')) }}" required>
|
||||||
|
@error('tanggal') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keterangan"><i class="fas fa-sticky-note form-icon"></i> Keterangan</label>
|
||||||
|
<textarea name="keterangan" id="keterangan" class="form-control @error('keterangan') is-invalid @enderror"
|
||||||
|
rows="3" placeholder="Contoh: Pembelian beras 50kg">{{ old('keterangan') }}</textarea>
|
||||||
|
@error('keterangan') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success hover-lift"><i class="fas fa-save"></i> Simpan</button>
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-edit"></i> Edit Transaksi Keuangan</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="{{ route('admin.keuangan.update', $transaksi->id) }}" method="POST">
|
||||||
|
@csrf
|
||||||
|
@method('PUT')
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="jenis"><i class="fas fa-exchange-alt form-icon"></i> Jenis Transaksi <span style="color:red;">*</span></label>
|
||||||
|
<select name="jenis" id="jenis" class="form-control @error('jenis') is-invalid @enderror" required>
|
||||||
|
<option value="">-- Pilih Jenis --</option>
|
||||||
|
<option value="pemasukan" {{ old('jenis', $transaksi->jenis)=='pemasukan'?'selected':'' }}>Pemasukan (Kas Masuk)</option>
|
||||||
|
<option value="pengeluaran" {{ old('jenis', $transaksi->jenis)=='pengeluaran'?'selected':'' }}>Pengeluaran (Kas Keluar)</option>
|
||||||
|
</select>
|
||||||
|
@error('jenis') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nominal"><i class="fas fa-money-bill-wave form-icon"></i> Nominal (Rp) <span style="color:red;">*</span></label>
|
||||||
|
<input type="number" name="nominal" id="nominal" class="form-control @error('nominal') is-invalid @enderror"
|
||||||
|
value="{{ old('nominal', $transaksi->nominal) }}" min="1" step="1" required>
|
||||||
|
@error('nominal') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal"><i class="fas fa-calendar form-icon"></i> Tanggal <span style="color:red;">*</span></label>
|
||||||
|
<input type="date" name="tanggal" id="tanggal" class="form-control @error('tanggal') is-invalid @enderror"
|
||||||
|
value="{{ old('tanggal', $transaksi->tanggal->format('Y-m-d')) }}" required>
|
||||||
|
@error('tanggal') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keterangan"><i class="fas fa-sticky-note form-icon"></i> Keterangan</label>
|
||||||
|
<textarea name="keterangan" id="keterangan" class="form-control @error('keterangan') is-invalid @enderror"
|
||||||
|
rows="3">{{ old('keterangan', $transaksi->keterangan) }}</textarea>
|
||||||
|
@error('keterangan') <div class="invalid-feedback">{{ $message }}</div> @enderror
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success hover-lift"><i class="fas fa-save"></i> Simpan Perubahan</button>
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-cash-register"></i> Kas & Keuangan Pondok</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success"><i class="fas fa-check-circle"></i> {{ session('success') }}</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px;">
|
||||||
|
<a href="{{ route('admin.keuangan.create') }}" class="btn btn-primary">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
|
</a>
|
||||||
|
<a href="{{ route('admin.keuangan.laporan') }}" class="btn btn-info">
|
||||||
|
<i class="fas fa-chart-bar"></i> Laporan Neraca
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Filter --}}
|
||||||
|
<form method="GET" action="{{ route('admin.keuangan.index') }}" id="filterForm" style="margin-bottom: 20px;">
|
||||||
|
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end;">
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<input type="text" name="search" class="form-control" placeholder="Cari ID / keterangan..."
|
||||||
|
value="{{ request('search') }}">
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<select name="jenis" class="form-control" onchange="this.form.submit()">
|
||||||
|
<option value="">Semua Jenis</option>
|
||||||
|
<option value="pemasukan" {{ request('jenis')=='pemasukan'?'selected':'' }}>Pemasukan</option>
|
||||||
|
<option value="pengeluaran" {{ request('jenis')=='pengeluaran'?'selected':'' }}>Pengeluaran</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<select name="bulan" class="form-control" onchange="this.form.submit()">
|
||||||
|
<option value="">Semua Bulan</option>
|
||||||
|
@for($i = 1; $i <= 12; $i++)
|
||||||
|
<option value="{{ $i }}" {{ request('bulan')==$i?'selected':'' }}>
|
||||||
|
{{ \Carbon\Carbon::create()->month($i)->translatedFormat('F') }}
|
||||||
|
</option>
|
||||||
|
@endfor
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<input type="number" name="tahun" class="form-control" placeholder="Tahun"
|
||||||
|
value="{{ request('tahun', date('Y')) }}" min="2020" max="2100">
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; gap:8px;">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm"><i class="fas fa-search"></i> Filter</button>
|
||||||
|
@if(request()->hasAny(['search','jenis','bulan','tahun']))
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}" class="btn btn-secondary btn-sm"><i class="fas fa-redo"></i></a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@if($transaksi->count() > 0)
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width:5%;">No</th>
|
||||||
|
<th style="width:10%;">ID</th>
|
||||||
|
<th style="width:12%;">Tanggal</th>
|
||||||
|
<th style="width:10%;">Jenis</th>
|
||||||
|
<th style="width:15%;">Nominal</th>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<th style="width:10%;" class="text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($transaksi as $i => $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $transaksi->firstItem() + $i }}</td>
|
||||||
|
<td><strong>{{ $item->id_keuangan }}</strong></td>
|
||||||
|
<td>{{ $item->tanggal->format('d/m/Y') }}</td>
|
||||||
|
<td>
|
||||||
|
@if($item->jenis === 'pemasukan')
|
||||||
|
<span class="badge badge-success"><i class="fas fa-arrow-down"></i> Masuk</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger"><i class="fas fa-arrow-up"></i> Keluar</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td class="nominal-highlight">{{ $item->nominal_format }}</td>
|
||||||
|
<td><div class="content-preview">{{ $item->keterangan ?? '-' }}</div></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div style="display:flex; gap:4px; justify-content:center;">
|
||||||
|
<a href="{{ route('admin.keuangan.show', $item->id) }}" class="btn btn-primary btn-sm" title="Detail"><i class="fas fa-eye"></i></a>
|
||||||
|
<a href="{{ route('admin.keuangan.edit', $item->id) }}" class="btn btn-warning btn-sm" title="Edit"><i class="fas fa-edit"></i></a>
|
||||||
|
<form action="{{ route('admin.keuangan.destroy', $item->id) }}" method="POST" style="display:inline;" onsubmit="return confirm('Yakin hapus transaksi ini?')">
|
||||||
|
@csrf @method('DELETE')
|
||||||
|
<button class="btn btn-danger btn-sm" title="Hapus"><i class="fas fa-trash"></i></button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div style="margin-top:20px;">{{ $transaksi->links() }}</div>
|
||||||
|
@else
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="fas fa-cash-register"></i>
|
||||||
|
<h3>Belum Ada Transaksi</h3>
|
||||||
|
<p>Tambahkan transaksi keuangan pondok pertama.</p>
|
||||||
|
<a href="{{ route('admin.keuangan.create') }}" class="btn btn-success"><i class="fas fa-plus"></i> Tambah</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@php
|
||||||
|
$namaBulan = \Carbon\Carbon::create()->month($bulan)->translatedFormat('F');
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-chart-bar"></i> Laporan Neraca Keuangan</h2>
|
||||||
|
<p>Periode: {{ $namaBulan }} {{ $tahun }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Filter Periode --}}
|
||||||
|
<div class="content-box" style="margin-bottom:20px;">
|
||||||
|
<form method="GET" action="{{ route('admin.keuangan.laporan') }}" style="display:flex; gap:12px; align-items:end; flex-wrap:wrap;">
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<label>Bulan</label>
|
||||||
|
<select name="bulan" class="form-control">
|
||||||
|
@for($i = 1; $i <= 12; $i++)
|
||||||
|
<option value="{{ $i }}" {{ $bulan==$i?'selected':'' }}>
|
||||||
|
{{ \Carbon\Carbon::create()->month($i)->translatedFormat('F') }}
|
||||||
|
</option>
|
||||||
|
@endfor
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<label>Tahun</label>
|
||||||
|
<input type="number" name="tahun" class="form-control" value="{{ $tahun }}" min="2020" max="2100" style="width:100px;">
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary"><i class="fas fa-search"></i> Tampilkan</button>
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Ringkasan Neraca --}}
|
||||||
|
<div class="row-cards" style="grid-template-columns: repeat(4, 1fr);">
|
||||||
|
<div class="card card-info">
|
||||||
|
<h3>SPP Terkumpul</h3>
|
||||||
|
<p class="card-value-small">Rp {{ number_format($sppTerkumpul, 0, ',', '.') }}</p>
|
||||||
|
<i class="fas fa-file-invoice-dollar card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card card-success">
|
||||||
|
<h3>Pemasukan Lain</h3>
|
||||||
|
<p class="card-value-small">Rp {{ number_format($pemasukanPondok, 0, ',', '.') }}</p>
|
||||||
|
<i class="fas fa-arrow-down card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card card-danger">
|
||||||
|
<h3>Total Pengeluaran</h3>
|
||||||
|
<p class="card-value-small">Rp {{ number_format($pengeluaranPondok, 0, ',', '.') }}</p>
|
||||||
|
<i class="fas fa-arrow-up card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card {{ $sisaKas >= 0 ? 'card-primary' : 'card-danger' }}">
|
||||||
|
<h3>Sisa Kas</h3>
|
||||||
|
<p class="card-value-small">Rp {{ number_format($sisaKas, 0, ',', '.') }}</p>
|
||||||
|
<i class="fas fa-wallet card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Detail Tabel --}}
|
||||||
|
<div style="display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:24px;">
|
||||||
|
|
||||||
|
{{-- Pengeluaran Terbesar --}}
|
||||||
|
<div class="content-box">
|
||||||
|
<h4 style="margin-bottom:12px;"><i class="fas fa-arrow-up" style="color:var(--danger-color);"></i> Pengeluaran Terbesar</h4>
|
||||||
|
@if($detailPengeluaran->count() > 0)
|
||||||
|
<table class="data-table">
|
||||||
|
<thead><tr><th>Tanggal</th><th>Keterangan</th><th>Nominal</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($detailPengeluaran as $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $item->tanggal->format('d/m') }}</td>
|
||||||
|
<td>{{ $item->keterangan ?? '-' }}</td>
|
||||||
|
<td class="nominal-highlight">{{ $item->nominal_format }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
@else
|
||||||
|
<p class="text-muted">Tidak ada pengeluaran bulan ini.</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- Pemasukan Non-SPP --}}
|
||||||
|
<div class="content-box">
|
||||||
|
<h4 style="margin-bottom:12px;"><i class="fas fa-arrow-down" style="color:var(--success-color);"></i> Pemasukan Non-SPP</h4>
|
||||||
|
@if($detailPemasukan->count() > 0)
|
||||||
|
<table class="data-table">
|
||||||
|
<thead><tr><th>Tanggal</th><th>Keterangan</th><th>Nominal</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($detailPemasukan as $item)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $item->tanggal->format('d/m') }}</td>
|
||||||
|
<td>{{ $item->keterangan ?? '-' }}</td>
|
||||||
|
<td class="nominal-highlight">{{ $item->nominal_format }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
@else
|
||||||
|
<p class="text-muted">Tidak ada pemasukan non-SPP bulan ini.</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-info-circle"></i> Detail Transaksi Keuangan</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="detail-header">
|
||||||
|
<h3>{{ $transaksi->id_keuangan }}</h3>
|
||||||
|
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
||||||
|
<a href="{{ route('admin.keuangan.edit', $transaksi->id) }}" class="btn btn-warning"><i class="fas fa-edit"></i> Edit</a>
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="detail-section">
|
||||||
|
<h4><i class="fas fa-file-alt"></i> Informasi Transaksi</h4>
|
||||||
|
<table class="detail-table">
|
||||||
|
<tr>
|
||||||
|
<th>ID Transaksi</th>
|
||||||
|
<td><strong>{{ $transaksi->id_keuangan }}</strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Jenis</th>
|
||||||
|
<td>
|
||||||
|
@if($transaksi->jenis === 'pemasukan')
|
||||||
|
<span class="badge badge-success badge-lg"><i class="fas fa-arrow-down"></i> Pemasukan</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger badge-lg"><i class="fas fa-arrow-up"></i> Pengeluaran</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Nominal</th>
|
||||||
|
<td class="nominal-highlight" style="font-size:1.3rem;">{{ $transaksi->nominal_format }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<td>{{ $transaksi->tanggal->translatedFormat('d F Y') }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<td>{{ $transaksi->keterangan ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Dibuat</th>
|
||||||
|
<td>{{ $transaksi->created_at->translatedFormat('d F Y H:i') }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
@ -28,6 +28,27 @@
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- Info Card Santri (AJAX) --}}
|
||||||
|
<div id="santri-info" style="display:none; margin-bottom:20px;">
|
||||||
|
<div class="content-box" style="padding:16px; background:var(--primary-light);">
|
||||||
|
<div style="display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:12px;">
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Saldo Terakhir</small>
|
||||||
|
<div id="info-saldo" style="font-weight:700; font-size:1.1rem;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pemasukan Bln Ini</small>
|
||||||
|
<div id="info-masuk" style="font-weight:600; color:#6FBA9D;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pengeluaran Bln Ini</small>
|
||||||
|
<div id="info-keluar" style="font-weight:600; color:#FF8B94;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="info-riwayat"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="jenis_transaksi">
|
<label for="jenis_transaksi">
|
||||||
<i class="fas fa-exchange-alt form-icon"></i>
|
<i class="fas fa-exchange-alt form-icon"></i>
|
||||||
|
|
@ -98,25 +119,39 @@ class="form-control @error('tanggal_transaksi') is-invalid @enderror"
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Format nominal input (tambah separator ribuan saat blur)
|
document.getElementById('id_santri').addEventListener('change', function() {
|
||||||
document.getElementById('nominal').addEventListener('blur', function(e) {
|
var infoBox = document.getElementById('santri-info');
|
||||||
if (this.value) {
|
var val = this.value;
|
||||||
const value = parseInt(this.value.replace(/\D/g, ''));
|
if (!val) { infoBox.style.display = 'none'; return; }
|
||||||
if (!isNaN(value)) {
|
|
||||||
this.value = value;
|
fetch('{{ url("admin/uang-saku/santri-info") }}/' + val)
|
||||||
|
.then(function(r) { return r.json(); })
|
||||||
|
.then(function(d) {
|
||||||
|
var saldoColor = d.saldo_raw >= 0 ? '#6FBA9D' : '#FF8B94';
|
||||||
|
document.getElementById('info-saldo').innerHTML = '<span style="color:' + saldoColor + '">Rp ' + d.saldo_terakhir + '</span>';
|
||||||
|
document.getElementById('info-masuk').textContent = 'Rp ' + d.total_pemasukan_bulan_ini;
|
||||||
|
document.getElementById('info-keluar').textContent = 'Rp ' + d.total_pengeluaran_bulan_ini;
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
if (d.transaksi_terakhir.length > 0) {
|
||||||
|
html = '<small class="text-muted">3 Transaksi Terakhir:</small><table class="data-table" style="margin-top:6px;font-size:.85rem;"><thead><tr><th>Tanggal</th><th>Jenis</th><th>Nominal</th><th>Ket</th></tr></thead><tbody>';
|
||||||
|
d.transaksi_terakhir.forEach(function(t) {
|
||||||
|
var badge = t.jenis === 'pemasukan'
|
||||||
|
? '<span class="badge badge-success">Masuk</span>'
|
||||||
|
: '<span class="badge badge-danger">Keluar</span>';
|
||||||
|
html += '<tr><td>' + t.tanggal + '</td><td>' + badge + '</td><td>Rp ' + t.nominal + '</td><td>' + t.keterangan + '</td></tr>';
|
||||||
|
});
|
||||||
|
html += '</tbody></table>';
|
||||||
}
|
}
|
||||||
}
|
document.getElementById('info-riwayat').innerHTML = html;
|
||||||
});
|
infoBox.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(function() { infoBox.style.display = 'none'; });
|
||||||
|
});
|
||||||
|
|
||||||
// Validasi form sebelum submit
|
// Trigger on page load if santri pre-selected
|
||||||
document.getElementById('transaksiForm').addEventListener('submit', function(e) {
|
if (document.getElementById('id_santri').value) {
|
||||||
const nominal = document.getElementById('nominal').value;
|
document.getElementById('id_santri').dispatchEvent(new Event('change'));
|
||||||
|
}
|
||||||
if (nominal && parseInt(nominal) < 1) {
|
|
||||||
e.preventDefault();
|
|
||||||
alert('Nominal harus lebih dari 0');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -19,6 +19,27 @@
|
||||||
<small class="form-text">Santri tidak dapat diubah</small>
|
<small class="form-text">Santri tidak dapat diubah</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{-- Info Card Santri (AJAX on page load) --}}
|
||||||
|
<div id="santri-info" style="display:none; margin-bottom:20px;">
|
||||||
|
<div class="content-box" style="padding:16px; background:var(--primary-light);">
|
||||||
|
<div style="display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:12px;">
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Saldo Terakhir</small>
|
||||||
|
<div id="info-saldo" style="font-weight:700; font-size:1.1rem;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pemasukan Bln Ini</small>
|
||||||
|
<div id="info-masuk" style="font-weight:600; color:#6FBA9D;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pengeluaran Bln Ini</small>
|
||||||
|
<div id="info-keluar" style="font-weight:600; color:#FF8B94;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="info-riwayat"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="jenis_transaksi">
|
<label for="jenis_transaksi">
|
||||||
<i class="fas fa-exchange-alt form-icon"></i>
|
<i class="fas fa-exchange-alt form-icon"></i>
|
||||||
|
|
@ -87,15 +108,31 @@ class="form-control @error('tanggal_transaksi') is-invalid @enderror"
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Validasi form sebelum submit
|
(function() {
|
||||||
document.getElementById('transaksiForm').addEventListener('submit', function(e) {
|
var idSantri = '{{ $transaksi->santri->id_santri }}';
|
||||||
const nominal = document.getElementById('nominal').value;
|
fetch('{{ url("admin/uang-saku/santri-info") }}/' + idSantri)
|
||||||
|
.then(function(r) { return r.json(); })
|
||||||
|
.then(function(d) {
|
||||||
|
var saldoColor = d.saldo_raw >= 0 ? '#6FBA9D' : '#FF8B94';
|
||||||
|
document.getElementById('info-saldo').innerHTML = '<span style="color:' + saldoColor + '">Rp ' + d.saldo_terakhir + '</span>';
|
||||||
|
document.getElementById('info-masuk').textContent = 'Rp ' + d.total_pemasukan_bulan_ini;
|
||||||
|
document.getElementById('info-keluar').textContent = 'Rp ' + d.total_pengeluaran_bulan_ini;
|
||||||
|
|
||||||
if (nominal && parseInt(nominal) < 1) {
|
var html = '';
|
||||||
e.preventDefault();
|
if (d.transaksi_terakhir.length > 0) {
|
||||||
alert('Nominal harus lebih dari 0');
|
html = '<small class="text-muted">3 Transaksi Terakhir:</small><table class="data-table" style="margin-top:6px;font-size:.85rem;"><thead><tr><th>Tanggal</th><th>Jenis</th><th>Nominal</th><th>Ket</th></tr></thead><tbody>';
|
||||||
return false;
|
d.transaksi_terakhir.forEach(function(t) {
|
||||||
}
|
var badge = t.jenis === 'pemasukan'
|
||||||
});
|
? '<span class="badge badge-success">Masuk</span>'
|
||||||
|
: '<span class="badge badge-danger">Keluar</span>';
|
||||||
|
html += '<tr><td>' + t.tanggal + '</td><td>' + badge + '</td><td>Rp ' + t.nominal + '</td><td>' + t.keterangan + '</td></tr>';
|
||||||
|
});
|
||||||
|
html += '</tbody></table>';
|
||||||
|
}
|
||||||
|
document.getElementById('info-riwayat').innerHTML = html;
|
||||||
|
document.getElementById('santri-info').style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(function() {});
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -6,214 +6,135 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if(session('success'))
|
@if(session('success'))
|
||||||
<div class="alert alert-success" id="success-alert">
|
<div class="alert alert-success"><i class="fas fa-check-circle"></i> {{ session('success') }}</div>
|
||||||
<i class="fas fa-check-circle"></i> {{ session('success') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if(session('error'))
|
@if(session('error'))
|
||||||
<div class="alert alert-danger" id="error-alert">
|
<div class="alert alert-danger"><i class="fas fa-exclamation-circle"></i> {{ session('error') }}</div>
|
||||||
<i class="fas fa-exclamation-circle"></i> {{ session('error') }}
|
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
{{-- Main Content --}}
|
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
{{-- Header Actions --}}
|
{{-- Header --}}
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px;">
|
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:10px;">
|
||||||
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
<a href="{{ route('admin.uang-saku.create') }}" class="btn btn-primary">
|
||||||
<a href="{{ route('admin.uang-saku.create') }}" class="btn btn-primary">
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
<i class="fas fa-plus"></i> Tambah Transaksi
|
</a>
|
||||||
</a>
|
<form method="GET" action="{{ route('admin.uang-saku.index') }}" style="display:flex; gap:8px;">
|
||||||
</div>
|
<input type="text" name="search" class="form-control" placeholder="Cari nama / ID santri..."
|
||||||
|
value="{{ request('search') }}" style="width:250px;">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm"><i class="fas fa-search"></i></button>
|
||||||
|
@if(request('search'))
|
||||||
|
<a href="{{ route('admin.uang-saku.index') }}" class="btn btn-secondary btn-sm"><i class="fas fa-redo"></i></a>
|
||||||
|
@endif
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- Filter Section --}}
|
{{-- Grouped Santri List --}}
|
||||||
<form method="GET" action="{{ route('admin.uang-saku.index') }}" id="filterForm" style="margin-bottom: 20px;">
|
@if($santriList->count() > 0)
|
||||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; align-items: end;">
|
@foreach($santriList as $santri)
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
<div class="content-box" style="margin-bottom:12px; padding:16px;">
|
||||||
<input type="text"
|
{{-- Baris utama --}}
|
||||||
name="search"
|
<div style="display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; cursor:pointer;"
|
||||||
class="form-control"
|
onclick="toggleDetail('detail-{{ $santri->id_santri }}', this)">
|
||||||
placeholder="Cari ID, santri, atau keterangan..."
|
<div style="display:flex; align-items:center; gap:12px;">
|
||||||
value="{{ request('search') }}"
|
<i class="fas fa-chevron-right toggle-arrow" style="transition:transform .2s; color:var(--text-light);"></i>
|
||||||
id="searchInput">
|
<div>
|
||||||
|
<strong>{{ $santri->nama_lengkap }}</strong>
|
||||||
|
<small class="text-muted" style="margin-left:6px;">{{ $santri->id_santri }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; align-items:center; gap:20px; flex-wrap:wrap;">
|
||||||
|
<span style="font-weight:700; font-size:1.1rem; color:{{ $santri->saldo_terakhir >= 0 ? '#6FBA9D' : '#FF8B94' }};">
|
||||||
|
Rp {{ number_format($santri->saldo_terakhir, 0, ',', '.') }}
|
||||||
|
</span>
|
||||||
|
<span class="badge badge-info">{{ $santri->transaksi_bulan_ini }} transaksi bln ini</span>
|
||||||
|
<div style="display:flex; gap:6px;">
|
||||||
|
<a href="{{ route('admin.uang-saku.riwayat', $santri->id_santri) }}" class="btn btn-primary btn-sm" title="Riwayat Lengkap" onclick="event.stopPropagation();">
|
||||||
|
<i class="fas fa-history"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
{{-- Detail transaksi (collapsed) --}}
|
||||||
<select name="id_santri" class="form-control" onchange="document.getElementById('filterForm').submit();">
|
<div id="detail-{{ $santri->id_santri }}" style="display:none; margin-top:12px; border-top:1px solid var(--primary-light); padding-top:12px;">
|
||||||
<option value="">Semua Santri</option>
|
@if($santri->transaksi_terbaru->isNotEmpty())
|
||||||
@foreach($santriList as $santri)
|
<table class="data-table">
|
||||||
<option value="{{ $santri->id_santri }}" {{ request('id_santri') == $santri->id_santri ? 'selected' : '' }}>
|
<thead>
|
||||||
{{ $santri->nama_lengkap }}
|
<tr>
|
||||||
</option>
|
<th>Tanggal</th>
|
||||||
@endforeach
|
<th>Jenis</th>
|
||||||
</select>
|
<th>Nominal</th>
|
||||||
</div>
|
<th>Keterangan</th>
|
||||||
|
<th>Saldo</th>
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
<th class="text-center">Aksi</th>
|
||||||
<select name="jenis_transaksi" class="form-control" onchange="document.getElementById('filterForm').submit();">
|
</tr>
|
||||||
<option value="">Semua Jenis</option>
|
</thead>
|
||||||
<option value="pemasukan" {{ request('jenis_transaksi') == 'pemasukan' ? 'selected' : '' }}>Pemasukan</option>
|
<tbody>
|
||||||
<option value="pengeluaran" {{ request('jenis_transaksi') == 'pengeluaran' ? 'selected' : '' }}>Pengeluaran</option>
|
@foreach($santri->transaksi_terbaru as $tx)
|
||||||
</select>
|
<tr>
|
||||||
</div>
|
<td>{{ $tx->tanggal_transaksi->format('d/m/Y') }}</td>
|
||||||
|
<td>
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
@if($tx->jenis_transaksi === 'pemasukan')
|
||||||
<input type="date"
|
<span class="badge badge-success"><i class="fas fa-arrow-down"></i> Masuk</span>
|
||||||
name="tanggal_dari"
|
@else
|
||||||
class="form-control"
|
<span class="badge badge-danger"><i class="fas fa-arrow-up"></i> Keluar</span>
|
||||||
placeholder="Dari Tanggal"
|
@endif
|
||||||
value="{{ request('tanggal_dari') }}"
|
</td>
|
||||||
onchange="document.getElementById('filterForm').submit();">
|
<td class="nominal-highlight">{{ $tx->nominal_format }}</td>
|
||||||
</div>
|
<td><div class="content-preview">{{ $tx->keterangan ?? '-' }}</div></td>
|
||||||
|
<td style="color:{{ $tx->saldo_sesudah >= 0 ? '#6FBA9D' : '#FF8B94' }}; font-weight:600;">
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
Rp {{ number_format($tx->saldo_sesudah, 0, ',', '.') }}
|
||||||
<input type="date"
|
</td>
|
||||||
name="tanggal_sampai"
|
<td class="text-center">
|
||||||
class="form-control"
|
<div style="display:flex; gap:4px; justify-content:center;">
|
||||||
placeholder="Sampai Tanggal"
|
<a href="{{ route('admin.uang-saku.show', $tx->id) }}" class="btn btn-primary btn-sm"><i class="fas fa-eye"></i></a>
|
||||||
value="{{ request('tanggal_sampai') }}"
|
<a href="{{ route('admin.uang-saku.edit', $tx->id) }}" class="btn btn-warning btn-sm"><i class="fas fa-edit"></i></a>
|
||||||
onchange="document.getElementById('filterForm').submit();">
|
<form action="{{ route('admin.uang-saku.destroy', $tx->id) }}" method="POST" style="display:inline;" onsubmit="return confirm('Yakin hapus?')">
|
||||||
</div>
|
@csrf @method('DELETE')
|
||||||
|
<button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></button>
|
||||||
<div style="display: flex; gap: 10px;">
|
</form>
|
||||||
<button type="submit" class="btn btn-primary">
|
</div>
|
||||||
<i class="fas fa-search"></i> Filter
|
</td>
|
||||||
</button>
|
</tr>
|
||||||
|
@endforeach
|
||||||
@if(request()->hasAny(['search', 'id_santri', 'jenis_transaksi', 'tanggal_dari', 'tanggal_sampai']))
|
</tbody>
|
||||||
<a href="{{ route('admin.uang-saku.index') }}" class="btn btn-secondary">
|
</table>
|
||||||
<i class="fas fa-redo"></i> Reset
|
@if($santri->transaksi_terbaru->count() >= 5)
|
||||||
</a>
|
<div style="text-align:center; margin-top:8px;">
|
||||||
|
<a href="{{ route('admin.uang-saku.riwayat', $santri->id_santri) }}" class="btn btn-secondary btn-sm">
|
||||||
|
<i class="fas fa-arrow-right"></i> Lihat Semua Riwayat
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@else
|
||||||
|
<p class="text-muted">Belum ada transaksi.</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
@endforeach
|
||||||
|
|
||||||
{{-- Tabel Transaksi --}}
|
<div style="margin-top:20px;">{{ $santriList->links() }}</div>
|
||||||
@if($transaksi->count() > 0)
|
|
||||||
<table class="data-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 5%;">No</th>
|
|
||||||
<th style="width: 10%;">ID Transaksi</th>
|
|
||||||
<th style="width: 15%;">Santri</th>
|
|
||||||
<th style="width: 10%;">Tanggal</th>
|
|
||||||
<th style="width: 10%;">Jenis</th>
|
|
||||||
<th style="width: 12%;">Nominal</th>
|
|
||||||
<th style="width: 20%;">Keterangan</th>
|
|
||||||
<th style="width: 12%;">Saldo</th>
|
|
||||||
<th style="width: 6%;" class="text-center">Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach($transaksi as $index => $item)
|
|
||||||
<tr>
|
|
||||||
<td>{{ $transaksi->firstItem() + $index }}</td>
|
|
||||||
<td><strong>{{ $item->id_uang_saku }}</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ route('admin.uang-saku.riwayat', $item->id_santri) }}"
|
|
||||||
class="link-primary"
|
|
||||||
title="Lihat Riwayat">
|
|
||||||
{{ $item->santri->nama_lengkap }}
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>{{ $item->tanggal_transaksi->format('d/m/Y') }}</td>
|
|
||||||
<td>
|
|
||||||
@if($item->jenis_transaksi === 'pemasukan')
|
|
||||||
<span class="badge badge-success">
|
|
||||||
<i class="fas fa-arrow-down"></i> Pemasukan
|
|
||||||
</span>
|
|
||||||
@else
|
|
||||||
<span class="badge badge-danger">
|
|
||||||
<i class="fas fa-arrow-up"></i> Pengeluaran
|
|
||||||
</span>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td class="nominal-highlight">
|
|
||||||
{{ $item->nominal_format }}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="content-preview">
|
|
||||||
{{ $item->keterangan ?? '-' }}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<strong style="color: {{ $item->saldo_sesudah >= 0 ? '#6FBA9D' : '#FF8B94' }}">
|
|
||||||
{{ $item->saldo_sesudah_format }}
|
|
||||||
</strong>
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<div style="display: flex; gap: 5px; justify-content: center;">
|
|
||||||
<a href="{{ route('admin.uang-saku.show', $item->id) }}"
|
|
||||||
class="btn btn-primary btn-sm"
|
|
||||||
title="Detail">
|
|
||||||
<i class="fas fa-eye"></i>
|
|
||||||
</a>
|
|
||||||
<a href="{{ route('admin.uang-saku.edit', $item->id) }}"
|
|
||||||
class="btn btn-warning btn-sm"
|
|
||||||
title="Edit">
|
|
||||||
<i class="fas fa-edit"></i>
|
|
||||||
</a>
|
|
||||||
<form action="{{ route('admin.uang-saku.destroy', $item->id) }}"
|
|
||||||
method="POST"
|
|
||||||
style="display: inline;"
|
|
||||||
onsubmit="return confirm('Yakin ingin menghapus transaksi ini?')">
|
|
||||||
@csrf
|
|
||||||
@method('DELETE')
|
|
||||||
<button type="submit" class="btn btn-danger btn-sm" title="Hapus">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div style="margin-top: 20px;">
|
|
||||||
{{ $transaksi->links() }}
|
|
||||||
</div>
|
|
||||||
@else
|
@else
|
||||||
<div class="empty-state">
|
<div class="empty-state">
|
||||||
<i class="fas fa-wallet"></i>
|
<i class="fas fa-wallet"></i>
|
||||||
<h3>Belum Ada Transaksi</h3>
|
<h3>Belum Ada Data</h3>
|
||||||
<p>Belum ada transaksi uang saku yang tercatat. Tambahkan transaksi pertama!</p>
|
<p>Belum ada santri dengan transaksi uang saku.</p>
|
||||||
<a href="{{ route('admin.uang-saku.create') }}" class="btn btn-success">
|
<a href="{{ route('admin.uang-saku.create') }}" class="btn btn-success"><i class="fas fa-plus"></i> Tambah Transaksi</a>
|
||||||
<i class="fas fa-plus"></i> Tambah Transaksi
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Auto hide alerts after 5 seconds
|
function toggleDetail(id, el) {
|
||||||
setTimeout(function() {
|
var detail = document.getElementById(id);
|
||||||
const successAlert = document.getElementById('success-alert');
|
var arrow = el.querySelector('.toggle-arrow');
|
||||||
const errorAlert = document.getElementById('error-alert');
|
if (detail.style.display === 'none') {
|
||||||
|
detail.style.display = 'block';
|
||||||
if (successAlert) {
|
arrow.style.transform = 'rotate(90deg)';
|
||||||
successAlert.style.transition = 'opacity 0.5s ease';
|
} else {
|
||||||
successAlert.style.opacity = '0';
|
detail.style.display = 'none';
|
||||||
setTimeout(() => successAlert.remove(), 500);
|
arrow.style.transform = 'rotate(0deg)';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (errorAlert) {
|
|
||||||
errorAlert.style.transition = 'opacity 0.5s ease';
|
|
||||||
errorAlert.style.opacity = '0';
|
|
||||||
setTimeout(() => errorAlert.remove(), 500);
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
// Auto submit on search (debounce)
|
|
||||||
let searchTimeout;
|
|
||||||
document.getElementById('searchInput').addEventListener('input', function() {
|
|
||||||
clearTimeout(searchTimeout);
|
|
||||||
searchTimeout = setTimeout(() => {
|
|
||||||
document.getElementById('filterForm').submit();
|
|
||||||
}, 800);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
@ -120,7 +120,7 @@ class="{{ Request::routeIs('admin.riwayat-pelanggaran.*') ? 'active' : '' }}">
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- ADMINISTRASI -->
|
<!-- ADMINISTRASI -->
|
||||||
<li class="menu-toggle {{ Request::is('admin/pembayaran-spp*') || Request::is('admin/uang-saku*') ? 'active' : '' }}">
|
<li class="menu-toggle {{ Request::is('admin/pembayaran-spp*') || Request::is('admin/uang-saku*') || Request::is('admin/keuangan*') ? 'active' : '' }}">
|
||||||
<a href="javascript:void(0)" class="menu-parent">
|
<a href="javascript:void(0)" class="menu-parent">
|
||||||
<i class="fas fa-money-bill-wave"></i><span>Administrasi</span>
|
<i class="fas fa-money-bill-wave"></i><span>Administrasi</span>
|
||||||
<i class="fas fa-chevron-down toggle-icon"></i>
|
<i class="fas fa-chevron-down toggle-icon"></i>
|
||||||
|
|
@ -132,6 +132,12 @@ class="{{ Request::is('admin/pembayaran-spp*') ? 'active' : '' }}">
|
||||||
<i class="fas fa-file-invoice-dollar"></i><span>Pembayaran SPP</span>
|
<i class="fas fa-file-invoice-dollar"></i><span>Pembayaran SPP</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('admin.keuangan.index') }}"
|
||||||
|
class="{{ Request::is('admin/keuangan*') ? 'active' : '' }}">
|
||||||
|
<i class="fas fa-cash-register"></i><span>Kas & Keuangan</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ route('admin.uang-saku.index') }}"
|
<a href="{{ route('admin.uang-saku.index') }}"
|
||||||
class="{{ Request::is('admin/uang-saku*') ? 'active' : '' }}">
|
class="{{ Request::is('admin/uang-saku*') ? 'active' : '' }}">
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<title>@yield('title', 'SIM Santri')</title>
|
<title>@yield('title', 'SIM Santri')</title>
|
||||||
<!-- Link ke Font Awesome untuk ikon -->
|
<!-- Link ke Font Awesome untuk ikon -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
|
<!-- Google Font Cinzel untuk splash screen -->
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&display=swap" rel="stylesheet">
|
||||||
<!-- Link ke file CSS utama -->
|
<!-- Link ke file CSS utama -->
|
||||||
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
|
||||||
<!-- Tambahkan CSS untuk memastikan smooth transition -->
|
<!-- Tambahkan CSS untuk memastikan smooth transition -->
|
||||||
|
|
@ -21,8 +25,8 @@
|
||||||
<!-- 1. SPLASH SCREEN -->
|
<!-- 1. SPLASH SCREEN -->
|
||||||
<div id="splash-screen" class="splash-screen">
|
<div id="splash-screen" class="splash-screen">
|
||||||
<div class="splash-content">
|
<div class="splash-content">
|
||||||
<h1>SIM Santri</h1>
|
<img src="{{ asset('images/logo.png') }}" alt="Logo PKPPS Riyadlul Jannah" class="splash-logo">
|
||||||
<p>Monitoring Santri Berbasis Web</p>
|
<p class="splash-title">PKPPS RIYADLUL JANNAH</p>
|
||||||
<div class="spinner"></div>
|
<div class="spinner"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
use App\Http\Controllers\Admin\PembayaranSppController;
|
use App\Http\Controllers\Admin\PembayaranSppController;
|
||||||
use App\Http\Controllers\Admin\UangSakuController;
|
use App\Http\Controllers\Admin\UangSakuController;
|
||||||
use App\Http\Controllers\Admin\KategoriKegiatanController;
|
use App\Http\Controllers\Admin\KategoriKegiatanController;
|
||||||
|
use App\Http\Controllers\Admin\KeuanganController;
|
||||||
use App\Http\Controllers\Admin\KegiatanController;
|
use App\Http\Controllers\Admin\KegiatanController;
|
||||||
use App\Http\Controllers\Admin\AbsensiKegiatanController;
|
use App\Http\Controllers\Admin\AbsensiKegiatanController;
|
||||||
use App\Http\Controllers\Admin\KartuRfidController;
|
use App\Http\Controllers\Admin\KartuRfidController;
|
||||||
|
|
@ -239,6 +240,7 @@
|
||||||
Route::get('/', [UangSakuController::class, 'index'])->name('index');
|
Route::get('/', [UangSakuController::class, 'index'])->name('index');
|
||||||
Route::get('/create', [UangSakuController::class, 'create'])->name('create');
|
Route::get('/create', [UangSakuController::class, 'create'])->name('create');
|
||||||
Route::post('/', [UangSakuController::class, 'store'])->name('store');
|
Route::post('/', [UangSakuController::class, 'store'])->name('store');
|
||||||
|
Route::get('/santri-info/{id_santri}', [UangSakuController::class, 'santriInfo'])->name('santri-info');
|
||||||
Route::get('/riwayat/{id_santri}', [UangSakuController::class, 'riwayat'])->name('riwayat');
|
Route::get('/riwayat/{id_santri}', [UangSakuController::class, 'riwayat'])->name('riwayat');
|
||||||
Route::get('/{uangSaku}', [UangSakuController::class, 'show'])->name('show');
|
Route::get('/{uangSaku}', [UangSakuController::class, 'show'])->name('show');
|
||||||
Route::get('/{uangSaku}/edit', [UangSakuController::class, 'edit'])->name('edit');
|
Route::get('/{uangSaku}/edit', [UangSakuController::class, 'edit'])->name('edit');
|
||||||
|
|
@ -246,6 +248,18 @@
|
||||||
Route::delete('/{uangSaku}', [UangSakuController::class, 'destroy'])->name('destroy');
|
Route::delete('/{uangSaku}', [UangSakuController::class, 'destroy'])->name('destroy');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 10b. KAS & KEUANGAN PONDOK
|
||||||
|
Route::prefix('keuangan')->name('keuangan.')->group(function () {
|
||||||
|
Route::get('/laporan', [KeuanganController::class, 'laporan'])->name('laporan');
|
||||||
|
Route::get('/', [KeuanganController::class, 'index'])->name('index');
|
||||||
|
Route::get('/create', [KeuanganController::class, 'create'])->name('create');
|
||||||
|
Route::post('/', [KeuanganController::class, 'store'])->name('store');
|
||||||
|
Route::get('/{keuangan}', [KeuanganController::class, 'show'])->name('show');
|
||||||
|
Route::get('/{keuangan}/edit', [KeuanganController::class, 'edit'])->name('edit');
|
||||||
|
Route::put('/{keuangan}', [KeuanganController::class, 'update'])->name('update');
|
||||||
|
Route::delete('/{keuangan}', [KeuanganController::class, 'destroy'])->name('destroy');
|
||||||
|
});
|
||||||
|
|
||||||
// 11. KATEGORI KEGIATAN
|
// 11. KATEGORI KEGIATAN
|
||||||
Route::resource('kategori-kegiatan', KategoriKegiatanController::class);
|
Route::resource('kategori-kegiatan', KategoriKegiatanController::class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
a:4:{s:6:"_token";s:40:"bf9dBI8efArQ1AtOhkTpqquBWEkeJ1zo3SlMfLDn";s:13:"last_activity";i:1771233300;s:9:"_previous";a:1:{s:3:"url";s:33:"http://127.0.0.1:8000/admin/login";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
a:6:{s:6:"_token";s:40:"fe2GfTCvZNVwH5kpuN4AgcNd1YwDdOssaJiyRRDl";s:50:"login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:4;s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:17:"password_hash_web";s:60:"$2y$12$9M69cy/TrE6OHdchW18R/.8IZIaeFpEaKAM7RS1/F877rH6Egb3Va";s:13:"last_activity";i:1771301366;s:9:"_previous";a:1:{s:3:"url";s:47:"http://127.0.0.1:8000/admin/riwayat-pelanggaran";}}
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
a:2:{s:6:"_token";s:40:"axq3iYx3MShQESdoZ2GL9tRh8vQa7ssQHTZId1vp";s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}
|
||||||
|
|
@ -1 +1 @@
|
||||||
a:3:{s:6:"_token";s:40:"t5tSxFFxrw8kCvXMMnooHkX0NhKW5aNAwkO8uPBB";s:7:"success";s:21:"Anda berhasil logout.";s:6:"_flash";a:2:{s:3:"new";a:0:{}s:3:"old";a:1:{i:0;s:7:"success";}}}
|
a:3:{s:6:"_token";s:40:"ZTBgiiGeYoqwMPjNlKTIa9PQHvxJyaZ2AbTWrRai";s:7:"success";s:21:"Anda berhasil logout.";s:6:"_flash";a:2:{s:3:"new";a:0:{}s:3:"old";a:1:{i:0;s:7:"success";}}}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
a:6:{s:6:"_token";s:40:"LZAqcpFS2fB4m84laS20fBE0FqWERZJkaiz347hS";s:50:"login_web_59ba36addc2b2f9401580f014c7f58ea4e30989d";i:1;s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}s:17:"password_hash_web";s:60:"$2y$12$XttGMQ4a3W5o.R9EH843WuKQN.kuq1EbhYhHCXgp1ti3MNBdX/N4W";s:13:"last_activity";i:1771294661;s:9:"_previous";a:1:{s:3:"url";s:41:"http://127.0.0.1:8000/admin/berita/create";}}
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php $__env->startSection('title', __('Not Found')); ?>
|
||||||
|
<?php $__env->startSection('code', '404'); ?>
|
||||||
|
<?php $__env->startSection('message', __('Not Found')); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('errors::minimal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions/views/404.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-rss"></i> Aktivitas Terbaru</h3>
|
||||||
|
<div class="content-box">
|
||||||
|
<?php if($feed->isEmpty()): ?>
|
||||||
|
<p class="text-muted">Belum ada aktivitas tercatat.</p>
|
||||||
|
<?php else: ?>
|
||||||
|
<ul class="feed-list">
|
||||||
|
<?php $__currentLoopData = $feed; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<li class="feed-item">
|
||||||
|
<span class="feed-icon feed-icon-<?php echo e($item->color); ?>">
|
||||||
|
<i class="fas <?php echo e($item->icon); ?>"></i>
|
||||||
|
</span>
|
||||||
|
<div class="feed-body">
|
||||||
|
<p><?php echo e($item->text); ?></p>
|
||||||
|
<small class="text-muted"><?php echo e($item->time->diffForHumans()); ?></small>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_feed-aktivitas.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
<title><?php echo $__env->yieldContent('title', 'SIM Santri'); ?></title>
|
<title><?php echo $__env->yieldContent('title', 'SIM Santri'); ?></title>
|
||||||
<!-- Link ke Font Awesome untuk ikon -->
|
<!-- Link ke Font Awesome untuk ikon -->
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
|
<!-- Google Font Cinzel untuk splash screen -->
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@700&display=swap" rel="stylesheet">
|
||||||
<!-- Link ke file CSS utama -->
|
<!-- Link ke file CSS utama -->
|
||||||
<link rel="stylesheet" href="<?php echo e(asset('css/app.css')); ?>">
|
<link rel="stylesheet" href="<?php echo e(asset('css/app.css')); ?>">
|
||||||
<!-- Tambahkan CSS untuk memastikan smooth transition -->
|
<!-- Tambahkan CSS untuk memastikan smooth transition -->
|
||||||
|
|
@ -21,8 +25,8 @@
|
||||||
<!-- 1. SPLASH SCREEN -->
|
<!-- 1. SPLASH SCREEN -->
|
||||||
<div id="splash-screen" class="splash-screen">
|
<div id="splash-screen" class="splash-screen">
|
||||||
<div class="splash-content">
|
<div class="splash-content">
|
||||||
<h1>SIM Santri</h1>
|
<img src="<?php echo e(asset('images/logo.png')); ?>" alt="Logo PKPPS Riyadlul Jannah" class="splash-logo">
|
||||||
<p>Monitoring Santri Berbasis Web</p>
|
<p class="splash-title">PKPPS RIYADLUL JANNAH</p>
|
||||||
<div class="spinner"></div>
|
<div class="spinner"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,295 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Kegiatan Baru</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="<?php echo e(route('admin.kegiatan.store')); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="kegiatan_id">
|
||||||
|
<i class="fas fa-hashtag form-icon"></i>
|
||||||
|
ID Kegiatan (Otomatis)
|
||||||
|
</label>
|
||||||
|
<input type="text" class="form-control" value="<?php echo e($nextId); ?>" disabled>
|
||||||
|
<small class="form-text">ID akan dibuat otomatis saat disimpan</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="kategori_id">
|
||||||
|
<i class="fas fa-list-alt form-icon"></i>
|
||||||
|
Kategori Kegiatan <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<select name="kategori_id" id="kategori_id" class="form-control <?php $__errorArgs = ['kategori_id'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Kategori --</option>
|
||||||
|
<?php $__currentLoopData = $kategoris; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($kat->kategori_id); ?>" <?php echo e(old('kategori_id') == $kat->kategori_id ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($kat->nama_kategori); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['kategori_id'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nama_kegiatan">
|
||||||
|
<i class="fas fa-calendar-check form-icon"></i>
|
||||||
|
Nama Kegiatan <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="text"
|
||||||
|
name="nama_kegiatan"
|
||||||
|
id="nama_kegiatan"
|
||||||
|
class="form-control <?php $__errorArgs = ['nama_kegiatan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('nama_kegiatan')); ?>"
|
||||||
|
placeholder="Contoh: Kajian Tafsir Al-Quran"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['nama_kegiatan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="hari">
|
||||||
|
<i class="fas fa-calendar-day form-icon"></i>
|
||||||
|
Hari <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<select name="hari" id="hari" class="form-control <?php $__errorArgs = ['hari'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Hari --</option>
|
||||||
|
<?php $__currentLoopData = $hariList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $h): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($h); ?>" <?php echo e(old('hari') == $h ? 'selected' : ''); ?>><?php echo e($h); ?></option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['hari'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px;">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="waktu_mulai">
|
||||||
|
<i class="fas fa-clock form-icon"></i>
|
||||||
|
Waktu Mulai <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="time"
|
||||||
|
name="waktu_mulai"
|
||||||
|
id="waktu_mulai"
|
||||||
|
class="form-control <?php $__errorArgs = ['waktu_mulai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('waktu_mulai')); ?>"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['waktu_mulai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="waktu_selesai">
|
||||||
|
<i class="fas fa-clock form-icon"></i>
|
||||||
|
Waktu Selesai <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="time"
|
||||||
|
name="waktu_selesai"
|
||||||
|
id="waktu_selesai"
|
||||||
|
class="form-control <?php $__errorArgs = ['waktu_selesai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('waktu_selesai')); ?>"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['waktu_selesai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="materi">
|
||||||
|
<i class="fas fa-book form-icon"></i>
|
||||||
|
Materi/Topik
|
||||||
|
</label>
|
||||||
|
<input type="text"
|
||||||
|
name="materi"
|
||||||
|
id="materi"
|
||||||
|
class="form-control <?php $__errorArgs = ['materi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('materi')); ?>"
|
||||||
|
placeholder="Contoh: Surat Al-Baqarah Ayat 1-10">
|
||||||
|
<?php $__errorArgs = ['materi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label">
|
||||||
|
<i class="fas fa-layer-group form-icon"></i>
|
||||||
|
Kelas yang Mengikuti Kegiatan
|
||||||
|
</label>
|
||||||
|
<small class="text-muted d-block mb-3" style="margin-top: -8px;">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
Kosongkan jika kegiatan untuk semua santri (umum).
|
||||||
|
Pilih satu atau lebih kelas yang akan mengikuti kegiatan ini.
|
||||||
|
</small>
|
||||||
|
|
||||||
|
<?php $__currentLoopData = $kelompokKelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelompok): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<div class="card mb-2" style="border: 1px solid #E8F7F2;">
|
||||||
|
<div class="card-header py-2" style="background: linear-gradient(135deg, #E8F7F2 0%, #D4F1E3 100%);">
|
||||||
|
<strong style="color: var(--primary-dark);">
|
||||||
|
<i class="fas fa-folder-open"></i> <?php echo e($kelompok->nama_kelompok); ?>
|
||||||
|
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
<div class="card-body py-2">
|
||||||
|
<div class="row">
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $kelompok->kelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<div class="col-md-3 col-sm-4 col-6 mb-2">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
name="kelas_ids[]"
|
||||||
|
value="<?php echo e($kelas->id); ?>"
|
||||||
|
id="kelas<?php echo e($kelas->id); ?>"
|
||||||
|
<?php echo e(in_array($kelas->id, old('kelas_ids', [])) ? 'checked' : ''); ?>>
|
||||||
|
<label class="form-check-label" for="kelas<?php echo e($kelas->id); ?>">
|
||||||
|
<?php echo e($kelas->nama_kelas); ?>
|
||||||
|
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<div class="col-12">
|
||||||
|
<small class="text-muted">Tidak ada kelas aktif</small>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keterangan">
|
||||||
|
<i class="fas fa-align-left form-icon"></i>
|
||||||
|
Keterangan
|
||||||
|
</label>
|
||||||
|
<textarea name="keterangan"
|
||||||
|
id="keterangan"
|
||||||
|
class="form-control <?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Catatan tambahan tentang kegiatan ini..."><?php echo e(old('keterangan')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success">
|
||||||
|
<i class="fas fa-save"></i> Simpan
|
||||||
|
</button>
|
||||||
|
<a href="<?php echo e(route('admin.kegiatan.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/kegiatan/data/create.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -6,223 +6,138 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if(session('success')): ?>
|
<?php if(session('success')): ?>
|
||||||
<div class="alert alert-success" id="success-alert">
|
<div class="alert alert-success"><i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?></div>
|
||||||
<i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if(session('error')): ?>
|
<?php if(session('error')): ?>
|
||||||
<div class="alert alert-danger" id="error-alert">
|
<div class="alert alert-danger"><i class="fas fa-exclamation-circle"></i> <?php echo e(session('error')); ?></div>
|
||||||
<i class="fas fa-exclamation-circle"></i> <?php echo e(session('error')); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
|
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px;">
|
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:10px;">
|
||||||
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
<a href="<?php echo e(route('admin.uang-saku.create')); ?>" class="btn btn-primary">
|
||||||
<a href="<?php echo e(route('admin.uang-saku.create')); ?>" class="btn btn-primary">
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
<i class="fas fa-plus"></i> Tambah Transaksi
|
</a>
|
||||||
</a>
|
<form method="GET" action="<?php echo e(route('admin.uang-saku.index')); ?>" style="display:flex; gap:8px;">
|
||||||
</div>
|
<input type="text" name="search" class="form-control" placeholder="Cari nama / ID santri..."
|
||||||
|
value="<?php echo e(request('search')); ?>" style="width:250px;">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm"><i class="fas fa-search"></i></button>
|
||||||
|
<?php if(request('search')): ?>
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.index')); ?>" class="btn btn-secondary btn-sm"><i class="fas fa-redo"></i></a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<form method="GET" action="<?php echo e(route('admin.uang-saku.index')); ?>" id="filterForm" style="margin-bottom: 20px;">
|
<?php if($santriList->count() > 0): ?>
|
||||||
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; align-items: end;">
|
<?php $__currentLoopData = $santriList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
<div class="content-box" style="margin-bottom:12px; padding:16px;">
|
||||||
<input type="text"
|
|
||||||
name="search"
|
<div style="display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; cursor:pointer;"
|
||||||
class="form-control"
|
onclick="toggleDetail('detail-<?php echo e($santri->id_santri); ?>', this)">
|
||||||
placeholder="Cari ID, santri, atau keterangan..."
|
<div style="display:flex; align-items:center; gap:12px;">
|
||||||
value="<?php echo e(request('search')); ?>"
|
<i class="fas fa-chevron-right toggle-arrow" style="transition:transform .2s; color:var(--text-light);"></i>
|
||||||
id="searchInput">
|
<div>
|
||||||
|
<strong><?php echo e($santri->nama_lengkap); ?></strong>
|
||||||
|
<small class="text-muted" style="margin-left:6px;"><?php echo e($santri->id_santri); ?></small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; align-items:center; gap:20px; flex-wrap:wrap;">
|
||||||
|
<span style="font-weight:700; font-size:1.1rem; color:<?php echo e($santri->saldo_terakhir >= 0 ? '#6FBA9D' : '#FF8B94'); ?>;">
|
||||||
|
Rp <?php echo e(number_format($santri->saldo_terakhir, 0, ',', '.')); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<span class="badge badge-info"><?php echo e($santri->transaksi_bulan_ini); ?> transaksi bln ini</span>
|
||||||
|
<div style="display:flex; gap:6px;">
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.riwayat', $santri->id_santri)); ?>" class="btn btn-primary btn-sm" title="Riwayat Lengkap" onclick="event.stopPropagation();">
|
||||||
|
<i class="fas fa-history"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
|
||||||
<select name="id_santri" class="form-control" onchange="document.getElementById('filterForm').submit();">
|
|
||||||
<option value="">Semua Santri</option>
|
|
||||||
<?php $__currentLoopData = $santriList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<option value="<?php echo e($santri->id_santri); ?>" <?php echo e(request('id_santri') == $santri->id_santri ? 'selected' : ''); ?>>
|
|
||||||
<?php echo e($santri->nama_lengkap); ?>
|
|
||||||
|
|
||||||
</option>
|
<div id="detail-<?php echo e($santri->id_santri); ?>" style="display:none; margin-top:12px; border-top:1px solid var(--primary-light); padding-top:12px;">
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
<?php if($santri->transaksi_terbaru->isNotEmpty()): ?>
|
||||||
</select>
|
<table class="data-table">
|
||||||
</div>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Tanggal</th>
|
||||||
|
<th>Jenis</th>
|
||||||
|
<th>Nominal</th>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<th>Saldo</th>
|
||||||
|
<th class="text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $santri->transaksi_terbaru; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tx): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($tx->tanggal_transaksi->format('d/m/Y')); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($tx->jenis_transaksi === 'pemasukan'): ?>
|
||||||
|
<span class="badge badge-success"><i class="fas fa-arrow-down"></i> Masuk</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="badge badge-danger"><i class="fas fa-arrow-up"></i> Keluar</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td class="nominal-highlight"><?php echo e($tx->nominal_format); ?></td>
|
||||||
|
<td><div class="content-preview"><?php echo e($tx->keterangan ?? '-'); ?></div></td>
|
||||||
|
<td style="color:<?php echo e($tx->saldo_sesudah >= 0 ? '#6FBA9D' : '#FF8B94'); ?>; font-weight:600;">
|
||||||
|
Rp <?php echo e(number_format($tx->saldo_sesudah, 0, ',', '.')); ?>
|
||||||
|
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
</td>
|
||||||
<select name="jenis_transaksi" class="form-control" onchange="document.getElementById('filterForm').submit();">
|
<td class="text-center">
|
||||||
<option value="">Semua Jenis</option>
|
<div style="display:flex; gap:4px; justify-content:center;">
|
||||||
<option value="pemasukan" <?php echo e(request('jenis_transaksi') == 'pemasukan' ? 'selected' : ''); ?>>Pemasukan</option>
|
<a href="<?php echo e(route('admin.uang-saku.show', $tx->id)); ?>" class="btn btn-primary btn-sm"><i class="fas fa-eye"></i></a>
|
||||||
<option value="pengeluaran" <?php echo e(request('jenis_transaksi') == 'pengeluaran' ? 'selected' : ''); ?>>Pengeluaran</option>
|
<a href="<?php echo e(route('admin.uang-saku.edit', $tx->id)); ?>" class="btn btn-warning btn-sm"><i class="fas fa-edit"></i></a>
|
||||||
</select>
|
<form action="<?php echo e(route('admin.uang-saku.destroy', $tx->id)); ?>" method="POST" style="display:inline;" onsubmit="return confirm('Yakin hapus?')">
|
||||||
</div>
|
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
|
||||||
|
<button class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></button>
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
</form>
|
||||||
<input type="date"
|
</div>
|
||||||
name="tanggal_dari"
|
</td>
|
||||||
class="form-control"
|
</tr>
|
||||||
placeholder="Dari Tanggal"
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
value="<?php echo e(request('tanggal_dari')); ?>"
|
</tbody>
|
||||||
onchange="document.getElementById('filterForm').submit();">
|
</table>
|
||||||
</div>
|
<?php if($santri->transaksi_terbaru->count() >= 5): ?>
|
||||||
|
<div style="text-align:center; margin-top:8px;">
|
||||||
<div class="form-group" style="margin-bottom: 0;">
|
<a href="<?php echo e(route('admin.uang-saku.riwayat', $santri->id_santri)); ?>" class="btn btn-secondary btn-sm">
|
||||||
<input type="date"
|
<i class="fas fa-arrow-right"></i> Lihat Semua Riwayat
|
||||||
name="tanggal_sampai"
|
</a>
|
||||||
class="form-control"
|
</div>
|
||||||
placeholder="Sampai Tanggal"
|
<?php endif; ?>
|
||||||
value="<?php echo e(request('tanggal_sampai')); ?>"
|
<?php else: ?>
|
||||||
onchange="document.getElementById('filterForm').submit();">
|
<p class="text-muted">Belum ada transaksi.</p>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="display: flex; gap: 10px;">
|
|
||||||
<button type="submit" class="btn btn-primary">
|
|
||||||
<i class="fas fa-search"></i> Filter
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<?php if(request()->hasAny(['search', 'id_santri', 'jenis_transaksi', 'tanggal_dari', 'tanggal_sampai'])): ?>
|
|
||||||
<a href="<?php echo e(route('admin.uang-saku.index')); ?>" class="btn btn-secondary">
|
|
||||||
<i class="fas fa-redo"></i> Reset
|
|
||||||
</a>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
|
||||||
|
<div style="margin-top:20px;"><?php echo e($santriList->links()); ?></div>
|
||||||
<?php if($transaksi->count() > 0): ?>
|
|
||||||
<table class="data-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 5%;">No</th>
|
|
||||||
<th style="width: 10%;">ID Transaksi</th>
|
|
||||||
<th style="width: 15%;">Santri</th>
|
|
||||||
<th style="width: 10%;">Tanggal</th>
|
|
||||||
<th style="width: 10%;">Jenis</th>
|
|
||||||
<th style="width: 12%;">Nominal</th>
|
|
||||||
<th style="width: 20%;">Keterangan</th>
|
|
||||||
<th style="width: 12%;">Saldo</th>
|
|
||||||
<th style="width: 6%;" class="text-center">Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $__currentLoopData = $transaksi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
<tr>
|
|
||||||
<td><?php echo e($transaksi->firstItem() + $index); ?></td>
|
|
||||||
<td><strong><?php echo e($item->id_uang_saku); ?></strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="<?php echo e(route('admin.uang-saku.riwayat', $item->id_santri)); ?>"
|
|
||||||
class="link-primary"
|
|
||||||
title="Lihat Riwayat">
|
|
||||||
<?php echo e($item->santri->nama_lengkap); ?>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td><?php echo e($item->tanggal_transaksi->format('d/m/Y')); ?></td>
|
|
||||||
<td>
|
|
||||||
<?php if($item->jenis_transaksi === 'pemasukan'): ?>
|
|
||||||
<span class="badge badge-success">
|
|
||||||
<i class="fas fa-arrow-down"></i> Pemasukan
|
|
||||||
</span>
|
|
||||||
<?php else: ?>
|
|
||||||
<span class="badge badge-danger">
|
|
||||||
<i class="fas fa-arrow-up"></i> Pengeluaran
|
|
||||||
</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
<td class="nominal-highlight">
|
|
||||||
<?php echo e($item->nominal_format); ?>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="content-preview">
|
|
||||||
<?php echo e($item->keterangan ?? '-'); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<strong style="color: <?php echo e($item->saldo_sesudah >= 0 ? '#6FBA9D' : '#FF8B94'); ?>">
|
|
||||||
<?php echo e($item->saldo_sesudah_format); ?>
|
|
||||||
|
|
||||||
</strong>
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<div style="display: flex; gap: 5px; justify-content: center;">
|
|
||||||
<a href="<?php echo e(route('admin.uang-saku.show', $item->id)); ?>"
|
|
||||||
class="btn btn-primary btn-sm"
|
|
||||||
title="Detail">
|
|
||||||
<i class="fas fa-eye"></i>
|
|
||||||
</a>
|
|
||||||
<a href="<?php echo e(route('admin.uang-saku.edit', $item->id)); ?>"
|
|
||||||
class="btn btn-warning btn-sm"
|
|
||||||
title="Edit">
|
|
||||||
<i class="fas fa-edit"></i>
|
|
||||||
</a>
|
|
||||||
<form action="<?php echo e(route('admin.uang-saku.destroy', $item->id)); ?>"
|
|
||||||
method="POST"
|
|
||||||
style="display: inline;"
|
|
||||||
onsubmit="return confirm('Yakin ingin menghapus transaksi ini?')">
|
|
||||||
<?php echo csrf_field(); ?>
|
|
||||||
<?php echo method_field('DELETE'); ?>
|
|
||||||
<button type="submit" class="btn btn-danger btn-sm" title="Hapus">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div style="margin-top: 20px;">
|
|
||||||
<?php echo e($transaksi->links()); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="empty-state">
|
<div class="empty-state">
|
||||||
<i class="fas fa-wallet"></i>
|
<i class="fas fa-wallet"></i>
|
||||||
<h3>Belum Ada Transaksi</h3>
|
<h3>Belum Ada Data</h3>
|
||||||
<p>Belum ada transaksi uang saku yang tercatat. Tambahkan transaksi pertama!</p>
|
<p>Belum ada santri dengan transaksi uang saku.</p>
|
||||||
<a href="<?php echo e(route('admin.uang-saku.create')); ?>" class="btn btn-success">
|
<a href="<?php echo e(route('admin.uang-saku.create')); ?>" class="btn btn-success"><i class="fas fa-plus"></i> Tambah Transaksi</a>
|
||||||
<i class="fas fa-plus"></i> Tambah Transaksi
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Auto hide alerts after 5 seconds
|
function toggleDetail(id, el) {
|
||||||
setTimeout(function() {
|
var detail = document.getElementById(id);
|
||||||
const successAlert = document.getElementById('success-alert');
|
var arrow = el.querySelector('.toggle-arrow');
|
||||||
const errorAlert = document.getElementById('error-alert');
|
if (detail.style.display === 'none') {
|
||||||
|
detail.style.display = 'block';
|
||||||
if (successAlert) {
|
arrow.style.transform = 'rotate(90deg)';
|
||||||
successAlert.style.transition = 'opacity 0.5s ease';
|
} else {
|
||||||
successAlert.style.opacity = '0';
|
detail.style.display = 'none';
|
||||||
setTimeout(() => successAlert.remove(), 500);
|
arrow.style.transform = 'rotate(0deg)';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (errorAlert) {
|
|
||||||
errorAlert.style.transition = 'opacity 0.5s ease';
|
|
||||||
errorAlert.style.opacity = '0';
|
|
||||||
setTimeout(() => errorAlert.remove(), 500);
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
|
|
||||||
// Auto submit on search (debounce)
|
|
||||||
let searchTimeout;
|
|
||||||
document.getElementById('searchInput').addEventListener('input', function() {
|
|
||||||
clearTimeout(searchTimeout);
|
|
||||||
searchTimeout = setTimeout(() => {
|
|
||||||
document.getElementById('filterForm').submit();
|
|
||||||
}, 800);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<?php $__env->stopSection(); ?>
|
<?php $__env->stopSection(); ?>
|
||||||
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/uang-saku/index.blade.php ENDPATH**/ ?>
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/uang-saku/index.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Riwayat Pembayaran SPP'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-history"></i> Riwayat Pembayaran SPP</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Info Santri -->
|
||||||
|
<div class="content-box" style="margin-bottom: 25px;">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;">
|
||||||
|
<div>
|
||||||
|
<h3 style="margin: 0; color: var(--primary-color);"><?php echo e($santri->nama_lengkap); ?></h3>
|
||||||
|
<p style="margin: 5px 0 0 0; color: var(--text-light);">
|
||||||
|
<?php echo e($santri->id_santri); ?> • <?php echo e($santri->nis ?? '-'); ?> • <?php echo e($santri->kelas_lengkap); ?>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="<?php echo e(route('admin.santri.show', $santri->id)); ?>" class="btn btn-primary btn-sm">
|
||||||
|
<i class="fas fa-user"></i> Profil Santri
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.pembayaran-spp.index')); ?>" class="btn btn-secondary btn-sm">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Statistik -->
|
||||||
|
<div class="row-cards" style="margin-bottom: 25px;">
|
||||||
|
<div class="card card-success">
|
||||||
|
<h3>Total Terbayar</h3>
|
||||||
|
<div class="card-value"><?php echo e('Rp ' . number_format($totalBayar, 0, ',', '.')); ?></div>
|
||||||
|
<i class="fas fa-check-circle card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card card-danger">
|
||||||
|
<h3>Total Tunggakan</h3>
|
||||||
|
<div class="card-value"><?php echo e('Rp ' . number_format($totalTunggakan, 0, ',', '.')); ?></div>
|
||||||
|
<i class="fas fa-exclamation-triangle card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card card-warning">
|
||||||
|
<h3>Pembayaran Telat</h3>
|
||||||
|
<div class="card-value"><?php echo e($jumlahTelat); ?></div>
|
||||||
|
<i class="fas fa-clock card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tabel Riwayat -->
|
||||||
|
<div class="content-box">
|
||||||
|
<h4 style="margin-bottom: 20px; color: var(--primary-dark);">
|
||||||
|
<i class="fas fa-list"></i> Daftar Pembayaran
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<div style="overflow-x: auto;">
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>No</th>
|
||||||
|
<th>ID Pembayaran</th>
|
||||||
|
<th>Periode</th>
|
||||||
|
<th>Nominal</th>
|
||||||
|
<th>Batas Bayar</th>
|
||||||
|
<th>Tanggal Bayar</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th class="text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $pembayaranSpp; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $spp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($pembayaranSpp->firstItem() + $index); ?></td>
|
||||||
|
<td><strong><?php echo e($spp->id_pembayaran); ?></strong></td>
|
||||||
|
<td><?php echo e($spp->periode_lengkap); ?></td>
|
||||||
|
<td><strong><?php echo e($spp->nominal_format); ?></strong></td>
|
||||||
|
<td>
|
||||||
|
<?php echo e($spp->batas_bayar->format('d/m/Y')); ?>
|
||||||
|
|
||||||
|
<?php if($spp->isTelat()): ?>
|
||||||
|
<br><small style="color: #FF8B94;">
|
||||||
|
<i class="fas fa-exclamation-triangle"></i> Telat
|
||||||
|
</small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php if($spp->tanggal_bayar): ?>
|
||||||
|
<?php echo e($spp->tanggal_bayar->format('d/m/Y')); ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-muted">-</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td><?php echo $spp->status_badge; ?></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="<?php echo e(route('admin.pembayaran-spp.show', $spp->id)); ?>"
|
||||||
|
class="btn btn-sm btn-primary"
|
||||||
|
title="Detail">
|
||||||
|
<i class="fas fa-eye"></i>
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.pembayaran-spp.edit', $spp->id)); ?>"
|
||||||
|
class="btn btn-sm btn-warning"
|
||||||
|
title="Edit">
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="8" class="text-center" style="padding: 40px;">
|
||||||
|
<i class="fas fa-inbox" style="font-size: 3rem; color: #ccc; display: block; margin-bottom: 15px;"></i>
|
||||||
|
<p style="color: #999;">Belum ada riwayat pembayaran untuk santri ini.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Pagination -->
|
||||||
|
<?php if($pembayaranSpp->hasPages()): ?>
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<?php echo e($pembayaranSpp->links()); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/pembayaran-spp/riwayat.blade.php ENDPATH**/ ?>
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php $__env->startSection('title', __('Page Expired')); ?>
|
||||||
|
<?php $__env->startSection('code', '419'); ?>
|
||||||
|
<?php $__env->startSection('message', __('Page Expired')); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('errors::minimal', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions/views/419.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,291 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Edit Pembayaran SPP'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-edit"></i> Edit Pembayaran SPP</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('error')): ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<i class="fas fa-exclamation-circle"></i> <?php echo e(session('error')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<form action="<?php echo e(route('admin.pembayaran-spp.update', $pembayaranSpp->id)); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<?php echo method_field('PUT'); ?>
|
||||||
|
|
||||||
|
<!-- ID Pembayaran (Read Only) -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-hashtag form-icon"></i> ID Pembayaran</label>
|
||||||
|
<input type="text" class="form-control" value="<?php echo e($pembayaranSpp->id_pembayaran); ?>" disabled>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Pilih Santri -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-user form-icon"></i> Pilih Santri <span style="color: red;">*</span></label>
|
||||||
|
<select name="id_santri" class="form-control <?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Santri --</option>
|
||||||
|
<?php $__currentLoopData = $santris; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($santri->id_santri); ?>"
|
||||||
|
<?php echo e(old('id_santri', $pembayaranSpp->id_santri) == $santri->id_santri ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($santri->id_santri); ?> - <?php echo e($santri->nama_lengkap); ?> (<?php echo e($santri->kelas); ?>)
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
<!-- Bulan -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar form-icon"></i> Bulan <span style="color: red;">*</span></label>
|
||||||
|
<select name="bulan" class="form-control <?php $__errorArgs = ['bulan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Bulan --</option>
|
||||||
|
<?php for($i = 1; $i <= 12; $i++): ?>
|
||||||
|
<option value="<?php echo e($i); ?>"
|
||||||
|
<?php echo e(old('bulan', $pembayaranSpp->bulan) == $i ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e(DateTime::createFromFormat('!m', $i)->format('F')); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['bulan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tahun -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar-alt form-icon"></i> Tahun <span style="color: red;">*</span></label>
|
||||||
|
<input type="number"
|
||||||
|
name="tahun"
|
||||||
|
class="form-control <?php $__errorArgs = ['tahun'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tahun', $pembayaranSpp->tahun)); ?>"
|
||||||
|
min="2020"
|
||||||
|
max="2100"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['tahun'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
<!-- Nominal -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-money-bill-wave form-icon"></i> Nominal (Rp) <span style="color: red;">*</span></label>
|
||||||
|
<input type="number"
|
||||||
|
name="nominal"
|
||||||
|
class="form-control <?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('nominal', $pembayaranSpp->nominal)); ?>"
|
||||||
|
min="0"
|
||||||
|
step="1000"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Batas Bayar -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-clock form-icon"></i> Batas Bayar <span style="color: red;">*</span></label>
|
||||||
|
<input type="date"
|
||||||
|
name="batas_bayar"
|
||||||
|
class="form-control <?php $__errorArgs = ['batas_bayar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('batas_bayar', $pembayaranSpp->batas_bayar->format('Y-m-d'))); ?>"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['batas_bayar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
<!-- Status -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-info-circle form-icon"></i> Status <span style="color: red;">*</span></label>
|
||||||
|
<select name="status" class="form-control <?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="Belum Lunas" <?php echo e(old('status', $pembayaranSpp->status) == 'Belum Lunas' ? 'selected' : ''); ?>>
|
||||||
|
Belum Lunas
|
||||||
|
</option>
|
||||||
|
<option value="Lunas" <?php echo e(old('status', $pembayaranSpp->status) == 'Lunas' ? 'selected' : ''); ?>>
|
||||||
|
Lunas
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tanggal Bayar -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar-check form-icon"></i> Tanggal Bayar</label>
|
||||||
|
<input type="date"
|
||||||
|
name="tanggal_bayar"
|
||||||
|
class="form-control <?php $__errorArgs = ['tanggal_bayar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_bayar', $pembayaranSpp->tanggal_bayar ? $pembayaranSpp->tanggal_bayar->format('Y-m-d') : '')); ?>">
|
||||||
|
<?php $__errorArgs = ['tanggal_bayar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">Kosongkan jika belum dibayar.</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Keterangan -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-comment form-icon"></i> Keterangan</label>
|
||||||
|
<textarea name="keterangan"
|
||||||
|
class="form-control <?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
rows="3"
|
||||||
|
placeholder="Catatan tambahan (opsional)"><?php echo e(old('keterangan', $pembayaranSpp->keterangan)); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<div style="display: flex; gap: 10px; margin-top: 25px;">
|
||||||
|
<button type="submit" class="btn btn-success hover-shadow">
|
||||||
|
<i class="fas fa-save"></i> Update Data
|
||||||
|
</button>
|
||||||
|
<a href="<?php echo e(route('admin.pembayaran-spp.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php $__env->startPush('scripts'); ?>
|
||||||
|
<script>
|
||||||
|
// Auto-fill tanggal bayar jika status diubah ke Lunas
|
||||||
|
document.querySelector('select[name="status"]').addEventListener('change', function() {
|
||||||
|
const tanggalBayar = document.querySelector('input[name="tanggal_bayar"]');
|
||||||
|
if (this.value === 'Lunas' && !tanggalBayar.value) {
|
||||||
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
tanggalBayar.value = today;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php $__env->stopPush(); ?>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/pembayaran-spp/edit.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Detail Santri: ' . $santri->nama_lengkap); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-user"></i> Detail Santri</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="detail-header">
|
||||||
|
<div style="display: flex; align-items: center; gap: 20px;">
|
||||||
|
|
||||||
|
<?php if($santri->foto): ?>
|
||||||
|
<img src="<?php echo e(asset('storage/' . $santri->foto)); ?>"
|
||||||
|
alt="Foto <?php echo e($santri->nama_lengkap); ?>"
|
||||||
|
style="width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-color); flex-shrink: 0;"
|
||||||
|
loading="lazy">
|
||||||
|
<?php else: ?>
|
||||||
|
<div style="width: 80px; height: 80px; border-radius: 50%; background: var(--primary-color); display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem; font-weight: bold; flex-shrink: 0;">
|
||||||
|
<?php echo e(strtoupper(substr($santri->nama_lengkap, 0, 1))); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h3><?php echo e($santri->nama_lengkap); ?></h3>
|
||||||
|
<p style="color: #7F8C8D; margin: 5px 0 0 0;">
|
||||||
|
<i class="fas fa-id-badge"></i> <?php echo e($santri->id_santri); ?>
|
||||||
|
|
||||||
|
<?php if($santri->nis): ?>
|
||||||
|
| <i class="fas fa-barcode"></i> NIS: <?php echo e($santri->nis); ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; gap: 10px;">
|
||||||
|
<a href="<?php echo e(route('admin.santri.edit', $santri)); ?>" class="btn btn-warning">
|
||||||
|
<i class="fas fa-edit"></i> Edit
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.santri.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr style="border: none; border-top: 2px solid #E8F7F2; margin: 25px 0;">
|
||||||
|
|
||||||
|
<div class="detail-section">
|
||||||
|
<h4><i class="fas fa-id-card"></i> Informasi Dasar</h4>
|
||||||
|
<table class="detail-table">
|
||||||
|
<tr>
|
||||||
|
<th width="200">ID Santri</th>
|
||||||
|
<td><strong><?php echo e($santri->id_santri); ?></strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>NIS</th>
|
||||||
|
<td><?php echo e($santri->nis ?? '-'); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Nama Lengkap</th>
|
||||||
|
<td><strong><?php echo e($santri->nama_lengkap); ?></strong></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Jenis Kelamin</th>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->jenis_kelamin == 'Laki-laki'): ?>
|
||||||
|
<i class="fas fa-mars" style="color: #81C6E8;"></i> <?php echo e($santri->jenis_kelamin); ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<i class="fas fa-venus" style="color: #FF8B94;"></i> <?php echo e($santri->jenis_kelamin); ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Kelas yang Diikuti</th>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->kelasSantri && $santri->kelasSantri->count() > 0): ?>
|
||||||
|
<?php
|
||||||
|
// Group kelas by kelompok
|
||||||
|
$grouped = $santri->kelasSantri
|
||||||
|
->filter(fn($sk) => $sk->kelas && $sk->kelas->kelompok)
|
||||||
|
->groupBy(fn($sk) => $sk->kelas->kelompok->nama_kelompok)
|
||||||
|
->sortBy(fn($items, $key) => $items->first()->kelas->kelompok->urutan ?? 99);
|
||||||
|
?>
|
||||||
|
<div style="display: flex; flex-direction: column; gap: 15px;">
|
||||||
|
<?php $__currentLoopData = $grouped; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelompokName => $items): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<div style="padding: 12px; background: linear-gradient(135deg, #F8FBF9 0%, #E8F7F2 100%); border-radius: 8px; border-left: 4px solid #6FBA9D;">
|
||||||
|
<div style="font-weight: 600; color: #2C5F4F; margin-bottom: 8px; display: flex; align-items: center; gap: 6px;">
|
||||||
|
<i class="fas fa-layer-group"></i>
|
||||||
|
<?php echo e($kelompokName); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; flex-direction: column; gap: 6px;">
|
||||||
|
<?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sk): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<div style="display: flex; align-items: center; gap: 8px;">
|
||||||
|
<span style="width: 8px; height: 8px; background: #6FBA9D; border-radius: 50%; flex-shrink: 0;"></span>
|
||||||
|
<strong style="color: #555; font-size: 0.95rem;"><?php echo e($sk->kelas->nama_kelas); ?></strong>
|
||||||
|
<span style="color: #7F8C8D; font-size: 0.8rem;">(<?php echo e($sk->kelas->kode_kelas); ?>)</span>
|
||||||
|
<?php if($sk->is_primary): ?>
|
||||||
|
<span style="padding: 2px 8px; border-radius: 4px; font-size: 0.72rem; font-weight: 600; background: #FFF3CD; color: #856404;">
|
||||||
|
<i class="fas fa-star"></i> Utama
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-muted"><em>Belum Ada Kelas</em></span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->status == 'Aktif'): ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E8F7F2 0%, #D4F1E3 100%); color: #2C5F4F; display: inline-block;">
|
||||||
|
<i class="fas fa-check-circle"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php elseif($santri->status == 'Lulus'): ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E3F2FD 0%, #D1E9F9 100%); color: #2D4A7C; display: inline-block;">
|
||||||
|
<i class="fas fa-graduation-cap"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E8ECF0 0%, #D1D8E0 100%); color: #555; display: inline-block;">
|
||||||
|
<i class="fas fa-times-circle"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="detail-section">
|
||||||
|
<h4><i class="fas fa-map-marker-alt"></i> Alamat & Asal</h4>
|
||||||
|
<table class="detail-table">
|
||||||
|
<tr>
|
||||||
|
<th width="200">Alamat Santri</th>
|
||||||
|
<td><?php echo e($santri->alamat_santri ?? '-'); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Daerah Asal</th>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->daerah_asal): ?>
|
||||||
|
<i class="fas fa-map-pin" style="color: #6FBA9D;"></i> <?php echo e($santri->daerah_asal); ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
-
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="detail-section">
|
||||||
|
<h4><i class="fas fa-users"></i> Data Orang Tua / Wali</h4>
|
||||||
|
<table class="detail-table">
|
||||||
|
<tr>
|
||||||
|
<th width="200">Nama Orang Tua</th>
|
||||||
|
<td><?php echo e($santri->nama_orang_tua ?? '-'); ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Nomor HP Orang Tua</th>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->nomor_hp_ortu): ?>
|
||||||
|
<i class="fas fa-phone" style="color: #6FBA9D;"></i>
|
||||||
|
<a href="tel:<?php echo e($santri->nomor_hp_ortu); ?>" style="color: #6FBA9D; text-decoration: none;">
|
||||||
|
<?php echo e($santri->nomor_hp_ortu); ?>
|
||||||
|
|
||||||
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
|
-
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="detail-section">
|
||||||
|
<h4><i class="fas fa-clock"></i> Informasi Sistem</h4>
|
||||||
|
<table class="detail-table">
|
||||||
|
<tr>
|
||||||
|
<th width="200">Tanggal Dibuat</th>
|
||||||
|
<td>
|
||||||
|
<i class="fas fa-calendar-plus" style="color: #81C6E8;"></i>
|
||||||
|
<?php echo e($santri->created_at->format('d M Y, H:i')); ?> WIB
|
||||||
|
<span style="color: #7F8C8D; font-size: 0.85rem;">
|
||||||
|
(<?php echo e($santri->created_at->diffForHumans()); ?>)
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Terakhir Diupdate</th>
|
||||||
|
<td>
|
||||||
|
<i class="fas fa-calendar-check" style="color: #FFD56B;"></i>
|
||||||
|
<?php echo e($santri->updated_at->format('d M Y, H:i')); ?> WIB
|
||||||
|
<span style="color: #7F8C8D; font-size: 0.85rem;">
|
||||||
|
(<?php echo e($santri->updated_at->diffForHumans()); ?>)
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-top: 30px; padding: 20px; background: linear-gradient(135deg, #F8FBF9 0%, #E8F7F2 100%); border-radius: 8px; border-left: 4px solid #6FBA9D;">
|
||||||
|
<p style="margin: 0; color: #2C5F4F; font-size: 0.9rem;">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<strong>Informasi:</strong> Data santri ini dapat diedit atau dihapus melalui halaman index atau menggunakan tombol Edit di atas.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/santri/show.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
<div class="content-box dash-chart-box">
|
||||||
|
<h4><i class="fas fa-chart-line"></i> Tren Kehadiran (4 Minggu)</h4>
|
||||||
|
<div class="chart-container">
|
||||||
|
<canvas id="trenKehadiranChart"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_tren-kehadiran.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Manajemen Akun Wali Santri'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-mobile-alt"></i> Manajemen Akun Wali Santri (Mobile App)</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success"><?php echo session('success'); ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if(session('error')): ?>
|
||||||
|
<div class="alert alert-danger"><?php echo e(session('error')); ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<i class="fas fa-info-circle"></i> <strong>Info:</strong> Akun wali digunakan oleh orang tua/wali untuk login di aplikasi mobile dan melihat data santri (anaknya).<br>
|
||||||
|
<strong>Format Login:</strong> Username = Nama Santri, Password = NIS Santri
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-header-flex">
|
||||||
|
<a href="<?php echo e(route('admin.users.wali_create')); ?>" class="btn btn-primary"><i class="fas fa-plus"></i> Buat Akun Wali</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Daftar Akun Wali Santri (<?php echo e($users->count()); ?>)</h3>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID Santri</th>
|
||||||
|
<th>Nama Santri</th>
|
||||||
|
<th>NIS</th>
|
||||||
|
<th>Username (Login)</th>
|
||||||
|
<th>Password</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($user->role_id); ?></td>
|
||||||
|
<td><?php echo e($user->santri->nama_lengkap ?? '-'); ?></td>
|
||||||
|
<td><?php echo e($user->santri->nis ?? '-'); ?></td>
|
||||||
|
<td><code><?php echo e($user->username); ?></code></td>
|
||||||
|
<td><span class="text-muted">NIS: <?php echo e($user->santri->nis ?? '-'); ?></span></td>
|
||||||
|
<td>
|
||||||
|
<form action="<?php echo e(route('admin.users.wali_reset_password', $user->id)); ?>" method="POST" style="display:inline;">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-warning" onclick="return confirm('Reset password akun <?php echo e($user->name); ?> ke NIS?')">
|
||||||
|
<i class="fas fa-key"></i> Reset
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<form action="<?php echo e(route('admin.users.wali_destroy', $user->id)); ?>" method="POST" style="display:inline;">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Yakin hapus akun wali <?php echo e($user->name); ?>?')">
|
||||||
|
<i class="fas fa-trash"></i> Hapus
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="6" class="text-center">Belum ada akun Wali Santri yang terdaftar.</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3 style="margin-top: 30px;">Santri Belum Memiliki Akun Wali (<?php echo e($santris_tanpa_wali->count()); ?>)</h3>
|
||||||
|
<p>Daftar santri yang belum dibuatkan akun wali untuk login di aplikasi mobile.</p>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID Santri</th>
|
||||||
|
<th>NIS</th>
|
||||||
|
<th>Nama Santri</th>
|
||||||
|
<th>Kelas</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $santris_tanpa_wali; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($santri->id_santri); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->nis): ?>
|
||||||
|
<?php echo e($santri->nis); ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-danger">Belum ada NIS</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td><?php echo e($santri->nama_lengkap); ?></td>
|
||||||
|
<td><?php echo e($santri->kelas); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->nis): ?>
|
||||||
|
<a href="<?php echo e(route('admin.users.wali_create')); ?>" class="btn btn-sm btn-primary">
|
||||||
|
<i class="fas fa-user-plus"></i> Buat Akun
|
||||||
|
</a>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="text-muted">Isi NIS dulu</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5" class="text-center text-success"><i class="fas fa-check"></i> Semua santri sudah memiliki akun wali.</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/users/wali_accounts.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Manajemen Akun Santri'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-user-cog"></i> Manajemen Akun Santri</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success"><?php echo e(session('success')); ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div class="content-header-flex">
|
||||||
|
<a href="<?php echo e(route('admin.users.santri_create')); ?>" class="btn btn-primary"><i class="fas fa-plus"></i> Buat Akun Santri</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>Daftar Akun Santri (<?php echo e($users->count()); ?>)</h3>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID Santri</th>
|
||||||
|
<th>Nama</th>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($user->role_id); ?></td>
|
||||||
|
<td><?php echo e($user->name); ?></td>
|
||||||
|
<td><?php echo e($user->username); ?></td>
|
||||||
|
<td>
|
||||||
|
<form action="<?php echo e(route('admin.users.santri_reset_password', $user->id)); ?>" method="POST" style="display:inline;">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-warning" onclick="return confirm('Reset password akun <?php echo e($user->name); ?> ke NIS?')">
|
||||||
|
<i class="fas fa-key"></i> Reset Password
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<form action="<?php echo e(route('admin.users.santri_destroy', $user->id)); ?>" method="POST" style="display:inline;">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Yakin hapus akun santri <?php echo e($user->name); ?>?')">
|
||||||
|
<i class="fas fa-trash"></i> Hapus Akun
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center">Belum ada akun Santri yang terdaftar.</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h3 style="margin-top: 30px;">Data Santri Tanpa Akun (<?php echo e($santris_tanpa_akun->count()); ?>)</h3>
|
||||||
|
<p>Berikut adalah data santri yang sudah terdaftar di Data Santri namun belum memiliki akun login. Mereka dapat dipilih saat Anda membuat akun baru.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/users/santri_accounts.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,173 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<style>
|
||||||
|
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
|
||||||
|
.page-header h2 { margin: 0; color: var(--primary-dark); font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
|
||||||
|
.btn-back { padding: 8px 16px; background: #6B7280; color: #fff; border: none; border-radius: 8px; font-size: 0.85rem; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: background 0.2s; }
|
||||||
|
.btn-back:hover { background: #4B5563; color: #fff; }
|
||||||
|
.filter-box { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
|
||||||
|
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
|
||||||
|
.form-group { margin: 0; }
|
||||||
|
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 5px; color: var(--text-light); font-weight: 500; }
|
||||||
|
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.85rem; }
|
||||||
|
.btn-filter { background: var(--primary-color); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
|
||||||
|
.btn-filter:hover { background: #059669; transform: translateY(-1px); }
|
||||||
|
.btn-reset { background: #6B7280; color: #fff; border: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
|
||||||
|
.btn-reset:hover { background: #4B5563; }
|
||||||
|
.data-table { width: 100%; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
|
||||||
|
.data-table thead { background: linear-gradient(135deg, var(--primary-color), #059669); color: #fff; }
|
||||||
|
.data-table th { padding: 14px 16px; text-align: left; font-weight: 600; font-size: 0.85rem; }
|
||||||
|
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
|
||||||
|
.data-table tbody tr:hover { background: #f8fafc; }
|
||||||
|
.data-table tbody tr:last-child td { border-bottom: none; }
|
||||||
|
.badge { padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
|
||||||
|
.badge-success { background: #D1FAE5; color: #065F46; }
|
||||||
|
.btn-detail { padding: 6px 12px; background: var(--primary-color); color: #fff; border: none; border-radius: 6px; font-size: 0.8rem; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: all 0.2s; }
|
||||||
|
.btn-detail:hover { background: #059669; color: #fff; transform: translateY(-1px); }
|
||||||
|
.stat-mini { font-size: 0.78rem; color: var(--text-light); margin-top: 3px; }
|
||||||
|
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
|
||||||
|
.empty-state i { font-size: 4rem; margin-bottom: 16px; opacity: 0.3; }
|
||||||
|
.empty-state h3 { margin: 0 0 8px; font-size: 1.2rem; }
|
||||||
|
.empty-state p { margin: 0; }
|
||||||
|
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; }
|
||||||
|
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.82rem; text-decoration: none; color: var(--text-dark); transition: all 0.2s; }
|
||||||
|
.pagination a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
|
||||||
|
.pagination .active { background: var(--primary-color); color: #fff; border-color: var(--primary-color); font-weight: 600; }
|
||||||
|
.pagination .disabled { color: #cbd5e1; cursor: not-allowed; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-history"></i> Riwayat Kegiatan & Absensi</h2>
|
||||||
|
<a href="<?php echo e(route('admin.laporan-kegiatan.index')); ?>" class="btn-back">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success">
|
||||||
|
<i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- Filter -->
|
||||||
|
<div class="filter-box">
|
||||||
|
<form method="GET">
|
||||||
|
<div class="filter-grid">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="kategori_id">Kategori</label>
|
||||||
|
<select name="kategori_id" id="kategori_id" class="form-control">
|
||||||
|
<option value="">-- Semua Kategori --</option>
|
||||||
|
<?php $__currentLoopData = $kategoris; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($k->kategori_id); ?>" <?php echo e(request('kategori_id') == $k->kategori_id ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($k->nama_kategori); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal_dari">Tanggal Dari</label>
|
||||||
|
<input type="date" name="tanggal_dari" id="tanggal_dari" class="form-control" value="<?php echo e(request('tanggal_dari')); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal_sampai">Tanggal Sampai</label>
|
||||||
|
<input type="date" name="tanggal_sampai" id="tanggal_sampai" class="form-control" value="<?php echo e(request('tanggal_sampai')); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="bulan">Atau Pilih Bulan</label>
|
||||||
|
<input type="month" name="bulan" id="bulan" class="form-control" value="<?php echo e(request('bulan')); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; align-items: flex-end; gap: 10px;">
|
||||||
|
<button type="submit" class="btn-filter" style="flex: 1;">
|
||||||
|
<i class="fas fa-filter"></i> Filter
|
||||||
|
</button>
|
||||||
|
<?php if(request()->hasAny(['kategori_id', 'tanggal_dari', 'tanggal_sampai', 'bulan'])): ?>
|
||||||
|
<a href="<?php echo e(route('admin.riwayat-kegiatan.index')); ?>" class="btn-reset">
|
||||||
|
<i class="fas fa-times"></i>
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tabel Kegiatan -->
|
||||||
|
<?php if($kegiatans->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 50px;">No</th>
|
||||||
|
<th>Nama Kegiatan</th>
|
||||||
|
<th style="width: 150px;">Kategori</th>
|
||||||
|
<th style="width: 200px;">Waktu & Hari</th>
|
||||||
|
<th style="width: 180px; text-align: center;">Statistik Absensi</th>
|
||||||
|
<th style="width: 120px; text-align: center;">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $kegiatans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $kegiatan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($kegiatans->firstItem() + $index); ?></td>
|
||||||
|
<td>
|
||||||
|
<strong><?php echo e($kegiatan->nama_kegiatan); ?></strong>
|
||||||
|
<?php if($kegiatan->kelasKegiatan->count() > 0): ?>
|
||||||
|
<div class="stat-mini">
|
||||||
|
<i class="fas fa-users"></i>
|
||||||
|
<?php echo e($kegiatan->kelasKegiatan->pluck('nama_kelas')->implode(', ')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="stat-mini"><i class="fas fa-globe"></i> Umum</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span class="badge badge-success"><?php echo e($kegiatan->kategori->nama_kategori); ?></span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<i class="fas fa-clock"></i> <?php echo e($kegiatan->waktu_mulai); ?> - <?php echo e($kegiatan->waktu_selesai); ?><br>
|
||||||
|
<span class="stat-mini"><?php echo e($kegiatan->hari); ?></span>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<?php if($kegiatan->total_absensi > 0): ?>
|
||||||
|
<div style="font-size: 0.8rem;">
|
||||||
|
<span style="color: #10B981;"><i class="fas fa-check-circle"></i> <?php echo e($kegiatan->hadir); ?></span> |
|
||||||
|
<span style="color: #F59E0B;"><i class="fas fa-info-circle"></i> <?php echo e($kegiatan->izin); ?></span> |
|
||||||
|
<span style="color: #3B82F6;"><i class="fas fa-heartbeat"></i> <?php echo e($kegiatan->sakit); ?></span> |
|
||||||
|
<span style="color: #EF4444;"><i class="fas fa-times-circle"></i> <?php echo e($kegiatan->alpa); ?></span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-mini">Total: <?php echo e($kegiatan->total_absensi); ?> record</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<span style="color: #9CA3AF; font-size: 0.8rem;">Belum ada data</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<a href="<?php echo e(route('admin.riwayat-kegiatan.show', $kegiatan->id)); ?>" class="btn-detail">
|
||||||
|
<i class="fas fa-eye"></i> Detail
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="pagination">
|
||||||
|
<?php echo $kegiatans->links('pagination::simple-bootstrap-4'); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="fas fa-inbox"></i>
|
||||||
|
<h3>Tidak Ada Data</h3>
|
||||||
|
<p>Belum ada kegiatan yang tercatat.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/kegiatan/riwayat/index.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-calendar-alt"></i> Manajemen Semester</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success">
|
||||||
|
<i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if(session('error')): ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<i class="fas fa-exclamation-circle"></i> <?php echo e(session('error')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-header-flex">
|
||||||
|
<a href="<?php echo e(route('admin.semester.create')); ?>" class="btn btn-success">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Semester
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<?php if($semesters->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 5%;">No</th>
|
||||||
|
<th style="width: 10%;">ID Semester</th>
|
||||||
|
<th style="width: 25%;">Nama Semester</th>
|
||||||
|
<th style="width: 15%;">Tahun Ajaran</th>
|
||||||
|
<th style="width: 10%;">Periode</th>
|
||||||
|
<th style="width: 15%;">Tanggal</th>
|
||||||
|
<th style="width: 10%;">Status</th>
|
||||||
|
<th class="text-center" style="width: 10%;">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $semesters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $semester): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($semesters->firstItem() + $index); ?></td>
|
||||||
|
<td><strong><?php echo e($semester->id_semester); ?></strong></td>
|
||||||
|
<td><?php echo e($semester->nama_semester); ?></td>
|
||||||
|
<td><?php echo e($semester->tahun_ajaran); ?></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<span class="badge <?php echo e($semester->periode == 1 ? 'badge-info' : 'badge-warning'); ?>">
|
||||||
|
Semester <?php echo e($semester->periode); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<small>
|
||||||
|
<?php echo e($semester->tanggal_mulai->format('d/m/Y')); ?> -<br>
|
||||||
|
<?php echo e($semester->tanggal_akhir->format('d/m/Y')); ?>
|
||||||
|
|
||||||
|
</small>
|
||||||
|
</td>
|
||||||
|
<td><?php echo $semester->status_badge; ?></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div style="display: flex; justify-content: center; align-items: center; gap: 8px;">
|
||||||
|
<a href="<?php echo e(route('admin.semester.show', $semester)); ?>"
|
||||||
|
class="btn btn-sm btn-info" title="Detail">
|
||||||
|
<i class="fas fa-eye"></i>
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.semester.edit', $semester)); ?>"
|
||||||
|
class="btn btn-sm btn-warning" title="Edit">
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
|
<form action="<?php echo e(route('admin.semester.destroy', $semester)); ?>"
|
||||||
|
method="POST" style="margin: 0;"
|
||||||
|
onsubmit="return confirm('Yakin ingin menghapus semester ini?')">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<?php echo method_field('DELETE'); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-danger" title="Hapus">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<?php echo e($semesters->links()); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="fas fa-calendar-times"></i>
|
||||||
|
<h3>Belum Ada Semester</h3>
|
||||||
|
<p>Silakan tambahkan semester terlebih dahulu sebelum mengelola capaian santri.</p>
|
||||||
|
<a href="<?php echo e(route('admin.semester.create')); ?>" class="btn btn-primary">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Semester Pertama
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/semester/index.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Transaksi Keuangan</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="<?php echo e(route('admin.keuangan.store')); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="jenis"><i class="fas fa-exchange-alt form-icon"></i> Jenis Transaksi <span style="color:red;">*</span></label>
|
||||||
|
<select name="jenis" id="jenis" class="form-control <?php $__errorArgs = ['jenis'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Jenis --</option>
|
||||||
|
<option value="pemasukan" <?php echo e(old('jenis')=='pemasukan'?'selected':''); ?>>Pemasukan (Kas Masuk)</option>
|
||||||
|
<option value="pengeluaran" <?php echo e(old('jenis')=='pengeluaran'?'selected':''); ?>>Pengeluaran (Kas Keluar)</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['jenis'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nominal"><i class="fas fa-money-bill-wave form-icon"></i> Nominal (Rp) <span style="color:red;">*</span></label>
|
||||||
|
<input type="number" name="nominal" id="nominal" class="form-control <?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('nominal')); ?>" placeholder="Contoh: 500000" min="1" step="1" required>
|
||||||
|
<?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal"><i class="fas fa-calendar form-icon"></i> Tanggal <span style="color:red;">*</span></label>
|
||||||
|
<input type="date" name="tanggal" id="tanggal" class="form-control <?php $__errorArgs = ['tanggal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal', date('Y-m-d'))); ?>" required>
|
||||||
|
<?php $__errorArgs = ['tanggal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keterangan"><i class="fas fa-sticky-note form-icon"></i> Keterangan</label>
|
||||||
|
<textarea name="keterangan" id="keterangan" class="form-control <?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
rows="3" placeholder="Contoh: Pembelian beras 50kg"><?php echo e(old('keterangan')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> <div class="invalid-feedback"><?php echo e($message); ?></div> <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success hover-lift"><i class="fas fa-save"></i> Simpan</button>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.index')); ?>" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/keuangan/create.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,169 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Data Santri'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-users"></i> Data Santri</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success">
|
||||||
|
<i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<!-- Header Actions -->
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 20px; flex-wrap: wrap;">
|
||||||
|
<!-- Tombol Tambah -->
|
||||||
|
<a href="<?php echo e(route('admin.santri.create')); ?>" class="btn btn-primary btn-sm">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Santri
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Form Search & Filter -->
|
||||||
|
<form action="<?php echo e(route('admin.santri.index')); ?>" method="GET" style="display: flex; gap: 8px; flex-wrap: wrap; align-items: center;">
|
||||||
|
<input type="text" name="search" class="form-control" placeholder="Cari nama, NIS, atau ID..." value="<?php echo e(request('search')); ?>" style="width: 220px; height: 38px;">
|
||||||
|
|
||||||
|
<select name="status" class="form-control" style="width: 150px; height: 38px;">
|
||||||
|
<option value="">⚪ Semua Status</option>
|
||||||
|
<option value="Aktif" <?php echo e(request('status') == 'Aktif' ? 'selected' : ''); ?>>✅ Aktif</option>
|
||||||
|
<option value="Lulus" <?php echo e(request('status') == 'Lulus' ? 'selected' : ''); ?>>🎓 Lulus</option>
|
||||||
|
<option value="Tidak Aktif" <?php echo e(request('status') == 'Tidak Aktif' ? 'selected' : ''); ?>>❌ Tidak Aktif</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select name="id_kelas" class="form-control" style="width: 180px; height: 38px;">
|
||||||
|
<option value="">📚 Semua Kelas</option>
|
||||||
|
<?php $__currentLoopData = $kelompokKelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelompok): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<?php if($kelompok->kelas && $kelompok->kelas->count() > 0): ?>
|
||||||
|
<optgroup label="<?php echo e($kelompok->nama_kelompok); ?>">
|
||||||
|
<?php $__currentLoopData = $kelompok->kelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($kelas->id); ?>" <?php echo e(request('id_kelas') == $kelas->id ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($kelas->nama_kelas); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</optgroup>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm" style="height: 38px; padding: 0 16px;">
|
||||||
|
<i class="fas fa-search"></i> Cari
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<?php if(request('search') || request('status') || request('id_kelas')): ?>
|
||||||
|
<a href="<?php echo e(route('admin.santri.index')); ?>" class="btn btn-secondary btn-sm" style="height: 38px; padding: 0 16px; display: inline-flex; align-items: center;">
|
||||||
|
<i class="fas fa-redo"></i> Reset
|
||||||
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>No</th>
|
||||||
|
<th>Foto</th>
|
||||||
|
<th>ID Santri</th>
|
||||||
|
<th>NIS</th>
|
||||||
|
<th>Nama Lengkap</th>
|
||||||
|
<th>Jenis Kelamin</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__empty_1 = true; $__currentLoopData = $santris; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($santris->firstItem() + $index); ?></td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<?php if($santri->foto): ?>
|
||||||
|
<img src="<?php echo e(asset('storage/' . $santri->foto)); ?>"
|
||||||
|
alt="Foto <?php echo e($santri->nama_lengkap); ?>"
|
||||||
|
style="width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-color);"
|
||||||
|
loading="lazy">
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="santri-avatar-initial" style="width: 40px; height: 40px; border-radius: 50%; background: var(--primary-color); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 0.9rem;">
|
||||||
|
<?php echo e(strtoupper(substr($santri->nama_lengkap, 0, 1))); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td><strong><?php echo e($santri->id_santri); ?></strong></td>
|
||||||
|
<td><?php echo e($santri->nis ?? '-'); ?></td>
|
||||||
|
<td><?php echo e($santri->nama_lengkap); ?></td>
|
||||||
|
<td><?php echo e($santri->jenis_kelamin); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($santri->status == 'Aktif'): ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E8F7F2 0%, #D4F1E3 100%); color: #2C5F4F; display: inline-block;">
|
||||||
|
<i class="fas fa-check-circle"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php elseif($santri->status == 'Lulus'): ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E3F2FD 0%, #D1E9F9 100%); color: #2D4A7C; display: inline-block;">
|
||||||
|
<i class="fas fa-graduation-cap"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span style="padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; background: linear-gradient(135deg, #E8ECF0 0%, #D1D8E0 100%); color: #555; display: inline-block;">
|
||||||
|
<i class="fas fa-times-circle"></i> <?php echo e($santri->status); ?>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="<?php echo e(route('admin.santri.show', $santri)); ?>" class="btn btn-sm btn-primary">
|
||||||
|
<i class="fas fa-eye"></i></a>
|
||||||
|
<a href="<?php echo e(route('admin.santri.edit', $santri)); ?>" class="btn btn-sm btn-warning">
|
||||||
|
<i class="fas fa-edit"></i></a>
|
||||||
|
<form action="<?php echo e(route('admin.santri.destroy', $santri)); ?>" method="POST" style="display:inline;">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<?php echo method_field('DELETE'); ?>
|
||||||
|
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Yakin ingin menghapus data santri <?php echo e($santri->nama_lengkap); ?>?')">
|
||||||
|
<i class="fas fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="8" class="text-center" style="padding: 40px;">
|
||||||
|
<i class="fas fa-inbox" style="font-size: 3rem; color: #ccc; margin-bottom: 15px; display: block;"></i>
|
||||||
|
<?php if(request('search') || request('status') || request('id_kelas')): ?>
|
||||||
|
<strong>Data tidak ditemukan.</strong><br>
|
||||||
|
<small>Coba ubah kata kunci pencarian atau filter yang digunakan.</small>
|
||||||
|
<?php else: ?>
|
||||||
|
<strong>Belum ada data santri.</strong><br>
|
||||||
|
<small>Klik tombol "Tambah Santri" untuk menambahkan data baru.</small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php if($santris->count() > 0): ?>
|
||||||
|
<div style="margin-top: 20px; padding-top: 20px; border-top: 1px solid #E8F7F2;">
|
||||||
|
<p style="color: #7F8C8D; font-size: 0.9rem;">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
Menampilkan <strong><?php echo e($santris->count()); ?></strong> dari <strong><?php echo e($santris->total()); ?></strong> data santri
|
||||||
|
<?php if(request('search') || request('status') || request('id_kelas')): ?>
|
||||||
|
(hasil pencarian/filter)
|
||||||
|
<?php endif; ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- Pagination -->
|
||||||
|
<?php if(method_exists($santris, 'links')): ?>
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<?php echo e($santris->links()); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/santri/index.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
|
||||||
|
<div class="row-cards row-cards-5">
|
||||||
|
<div class="card card-info">
|
||||||
|
<h3>Santri Aktif</h3>
|
||||||
|
<p class="card-value"><?php echo e($kpi['totalSantriAktif']); ?></p>
|
||||||
|
<i class="fas fa-user-graduate card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card <?php echo e($kpi['belumAbsensi'] > 0 ? 'card-warning' : 'card-success'); ?>">
|
||||||
|
<h3>Kegiatan Hari Ini</h3>
|
||||||
|
<p class="card-value"><?php echo e($kpi['totalKegiatan']); ?></p>
|
||||||
|
<span class="card-sub"><?php echo e($kpi['sudahAbsensi']); ?> sudah absen · <?php echo e($kpi['belumAbsensi']); ?> belum</span>
|
||||||
|
<i class="fas fa-calendar-check card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card <?php echo e($kpi['santriSakit'] > 0 ? 'card-danger' : 'card-success'); ?>">
|
||||||
|
<h3>Santri di UKP</h3>
|
||||||
|
<p class="card-value"><?php echo e($kpi['santriSakit']); ?></p>
|
||||||
|
<span class="card-sub">sedang dirawat</span>
|
||||||
|
<i class="fas fa-briefcase-medical card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card <?php echo e($kpi['kepulanganMenunggu'] > 0 ? 'card-warning' : 'card-success'); ?>">
|
||||||
|
<h3>Menunggu Approval</h3>
|
||||||
|
<p class="card-value"><?php echo e($kpi['kepulanganMenunggu']); ?></p>
|
||||||
|
<span class="card-sub">pengajuan kepulangan</span>
|
||||||
|
<i class="fas fa-clock card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card <?php echo e($kpi['santriTanpaWali'] > 0 ? 'card-secondary' : 'card-success'); ?>">
|
||||||
|
<h3>Belum Ada Akun Wali</h3>
|
||||||
|
<p class="card-value"><?php echo e($kpi['santriTanpaWali']); ?></p>
|
||||||
|
<span class="card-sub">santri tanpa wali mobile</span>
|
||||||
|
<i class="fas fa-user-plus card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_kpi-cards.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,143 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Semester Baru</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="<?php echo e(route('admin.semester.store')); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<div class="info-box">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<strong>ID Semester Selanjutnya:</strong> <?php echo e($nextIdSemester); ?> (Auto-generated)
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-graduation-cap form-icon"></i> Tahun Ajaran <span style="color: red;">*</span></label>
|
||||||
|
<input type="text" name="tahun_ajaran" class="form-control <?php $__errorArgs = ['tahun_ajaran'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tahun_ajaran')); ?>" placeholder="Contoh: 2024/2025" required>
|
||||||
|
<small class="form-text">Format: YYYY/YYYY</small>
|
||||||
|
<?php $__errorArgs = ['tahun_ajaran'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar form-icon"></i> Periode <span style="color: red;">*</span></label>
|
||||||
|
<select name="periode" class="form-control <?php $__errorArgs = ['periode'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Periode --</option>
|
||||||
|
<option value="1" <?php echo e(old('periode') == 1 ? 'selected' : ''); ?>>Semester 1 (Ganjil)</option>
|
||||||
|
<option value="2" <?php echo e(old('periode') == 2 ? 'selected' : ''); ?>>Semester 2 (Genap)</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['periode'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar-check form-icon"></i> Tanggal Mulai <span style="color: red;">*</span></label>
|
||||||
|
<input type="date" name="tanggal_mulai" class="form-control <?php $__errorArgs = ['tanggal_mulai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_mulai')); ?>" required>
|
||||||
|
<?php $__errorArgs = ['tanggal_mulai'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label><i class="fas fa-calendar-times form-icon"></i> Tanggal Akhir <span style="color: red;">*</span></label>
|
||||||
|
<input type="date" name="tanggal_akhir" class="form-control <?php $__errorArgs = ['tanggal_akhir'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_akhir')); ?>" required>
|
||||||
|
<?php $__errorArgs = ['tanggal_akhir'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<span class="invalid-feedback"><?php echo e($message); ?></span>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||||
|
<input type="checkbox" name="is_active" value="1" <?php echo e(old('is_active') ? 'checked' : ''); ?>
|
||||||
|
style="margin-right: 10px; width: 20px; height: 20px;">
|
||||||
|
<span><i class="fas fa-toggle-on form-icon"></i> Jadikan Semester Aktif</span>
|
||||||
|
</label>
|
||||||
|
<small class="form-text">Hanya 1 semester yang bisa aktif. Jika dicentang, semester lain akan otomatis non-aktif.</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success">
|
||||||
|
<i class="fas fa-save"></i> Simpan Semester
|
||||||
|
</button>
|
||||||
|
<a href="<?php echo e(route('admin.semester.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/semester/create.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Edit Santri: ' . $santri->nama_lengkap); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-user-edit"></i> Edit Data Santri</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<?php if($errors->any()): ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<strong><i class="fas fa-exclamation-triangle"></i> Terdapat kesalahan:</strong>
|
||||||
|
<ul style="margin: 10px 0 0 20px;">
|
||||||
|
<?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<li><?php echo e($error); ?></li>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div style="background: linear-gradient(135deg, #E3F2FD 0%, #D1E9F9 100%); padding: 20px; border-radius: 8px; border-left: 4px solid #81C6E8; margin-bottom: 25px;">
|
||||||
|
<div style="display: flex; align-items: center; gap: 15px;">
|
||||||
|
<?php if($santri->foto): ?>
|
||||||
|
<img src="<?php echo e(asset('storage/' . $santri->foto)); ?>"
|
||||||
|
alt="Foto <?php echo e($santri->nama_lengkap); ?>"
|
||||||
|
style="width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid #81C6E8;"
|
||||||
|
loading="lazy">
|
||||||
|
<?php else: ?>
|
||||||
|
<div style="width: 60px; height: 60px; border-radius: 50%; background: #81C6E8; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 1.5rem;">
|
||||||
|
<?php echo e(strtoupper(substr($santri->nama_lengkap, 0, 1))); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p style="margin: 0; color: #2D4A7C; font-size: 0.9rem;">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<strong>Sedang mengedit data:</strong>
|
||||||
|
</p>
|
||||||
|
<p style="margin: 5px 0 0 0; color: #2D4A7C; font-weight: 600; font-size: 1.1rem;">
|
||||||
|
<?php echo e($santri->nama_lengkap); ?> (<?php echo e($santri->id_santri); ?>)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php echo $__env->make('admin.santri.form', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/santri/edit.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
|
||||||
|
<?php if($alerts['santriAlpaBeruntun']->isNotEmpty() || $alerts['sppJatuhTempo']->isNotEmpty() || $alerts['kepulanganPending']->isNotEmpty()): ?>
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-exclamation-circle"></i> Peringatan & Tindak Lanjut</h3>
|
||||||
|
<div class="dash-alerts">
|
||||||
|
|
||||||
|
|
||||||
|
<?php if($alerts['santriAlpaBeruntun']->isNotEmpty()): ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-user-times"></i> Santri Alpa Beruntun (7 Hari Terakhir)</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
<?php $__currentLoopData = $alerts['santriAlpaBeruntun']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<li><?php echo e($s->nama); ?> <span class="badge badge-danger badge-sm"><?php echo e($s->total_alpa); ?>x alpa</span></li>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if($alerts['sppJatuhTempo']->isNotEmpty()): ?>
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-file-invoice-dollar"></i> SPP Jatuh Tempo</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
<?php $__currentLoopData = $alerts['sppJatuhTempo']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<li>
|
||||||
|
<?php echo e($s->santri->nama_lengkap ?? '-'); ?>
|
||||||
|
|
||||||
|
— Bln <?php echo e($s->bulan); ?>/<?php echo e($s->tahun); ?>
|
||||||
|
|
||||||
|
<small>(jatuh tempo <?php echo e($s->batas_bayar->translatedFormat('d M Y')); ?>)</small>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if($alerts['kepulanganPending']->isNotEmpty()): ?>
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<div class="alert-body">
|
||||||
|
<strong><i class="fas fa-home"></i> Pengajuan Kepulangan Menunggu Review</strong>
|
||||||
|
<ul class="alert-list">
|
||||||
|
<?php $__currentLoopData = $alerts['kepulanganPending']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<li>
|
||||||
|
<?php echo e($k->santri->nama_lengkap ?? '-'); ?>
|
||||||
|
|
||||||
|
— <?php echo e($k->tanggal_pulang->translatedFormat('d M')); ?> s.d <?php echo e($k->tanggal_kembali->translatedFormat('d M Y')); ?>
|
||||||
|
|
||||||
|
<small>(<?php echo e($k->alasan); ?>)</small>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_alert-panel.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-cash-register"></i> Kas & Keuangan Pondok</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if(session('success')): ?>
|
||||||
|
<div class="alert alert-success"><i class="fas fa-check-circle"></i> <?php echo e(session('success')); ?></div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px;">
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.create')); ?>" class="btn btn-primary">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.laporan')); ?>" class="btn btn-info">
|
||||||
|
<i class="fas fa-chart-bar"></i> Laporan Neraca
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<form method="GET" action="<?php echo e(route('admin.keuangan.index')); ?>" id="filterForm" style="margin-bottom: 20px;">
|
||||||
|
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end;">
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<input type="text" name="search" class="form-control" placeholder="Cari ID / keterangan..."
|
||||||
|
value="<?php echo e(request('search')); ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<select name="jenis" class="form-control" onchange="this.form.submit()">
|
||||||
|
<option value="">Semua Jenis</option>
|
||||||
|
<option value="pemasukan" <?php echo e(request('jenis')=='pemasukan'?'selected':''); ?>>Pemasukan</option>
|
||||||
|
<option value="pengeluaran" <?php echo e(request('jenis')=='pengeluaran'?'selected':''); ?>>Pengeluaran</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<select name="bulan" class="form-control" onchange="this.form.submit()">
|
||||||
|
<option value="">Semua Bulan</option>
|
||||||
|
<?php for($i = 1; $i <= 12; $i++): ?>
|
||||||
|
<option value="<?php echo e($i); ?>" <?php echo e(request('bulan')==$i?'selected':''); ?>>
|
||||||
|
<?php echo e(\Carbon\Carbon::create()->month($i)->translatedFormat('F')); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<input type="number" name="tahun" class="form-control" placeholder="Tahun"
|
||||||
|
value="<?php echo e(request('tahun', date('Y'))); ?>" min="2020" max="2100">
|
||||||
|
</div>
|
||||||
|
<div style="display:flex; gap:8px;">
|
||||||
|
<button type="submit" class="btn btn-primary btn-sm"><i class="fas fa-search"></i> Filter</button>
|
||||||
|
<?php if(request()->hasAny(['search','jenis','bulan','tahun'])): ?>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.index')); ?>" class="btn btn-secondary btn-sm"><i class="fas fa-redo"></i></a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php if($transaksi->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width:5%;">No</th>
|
||||||
|
<th style="width:10%;">ID</th>
|
||||||
|
<th style="width:12%;">Tanggal</th>
|
||||||
|
<th style="width:10%;">Jenis</th>
|
||||||
|
<th style="width:15%;">Nominal</th>
|
||||||
|
<th>Keterangan</th>
|
||||||
|
<th style="width:10%;" class="text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $transaksi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($transaksi->firstItem() + $i); ?></td>
|
||||||
|
<td><strong><?php echo e($item->id_keuangan); ?></strong></td>
|
||||||
|
<td><?php echo e($item->tanggal->format('d/m/Y')); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($item->jenis === 'pemasukan'): ?>
|
||||||
|
<span class="badge badge-success"><i class="fas fa-arrow-down"></i> Masuk</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="badge badge-danger"><i class="fas fa-arrow-up"></i> Keluar</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td class="nominal-highlight"><?php echo e($item->nominal_format); ?></td>
|
||||||
|
<td><div class="content-preview"><?php echo e($item->keterangan ?? '-'); ?></div></td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div style="display:flex; gap:4px; justify-content:center;">
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.show', $item->id)); ?>" class="btn btn-primary btn-sm" title="Detail"><i class="fas fa-eye"></i></a>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.edit', $item->id)); ?>" class="btn btn-warning btn-sm" title="Edit"><i class="fas fa-edit"></i></a>
|
||||||
|
<form action="<?php echo e(route('admin.keuangan.destroy', $item->id)); ?>" method="POST" style="display:inline;" onsubmit="return confirm('Yakin hapus transaksi ini?')">
|
||||||
|
<?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
|
||||||
|
<button class="btn btn-danger btn-sm" title="Hapus"><i class="fas fa-trash"></i></button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div style="margin-top:20px;"><?php echo e($transaksi->links()); ?></div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="fas fa-cash-register"></i>
|
||||||
|
<h3>Belum Ada Transaksi</h3>
|
||||||
|
<p>Tambahkan transaksi keuangan pondok pertama.</p>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.create')); ?>" class="btn btn-success"><i class="fas fa-plus"></i> Tambah</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/keuangan/index.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,363 @@
|
||||||
|
<?php
|
||||||
|
$isEdit = isset($santri);
|
||||||
|
?>
|
||||||
|
|
||||||
|
<form action="<?php echo e($isEdit ? route('admin.santri.update', $santri) : route('admin.santri.store')); ?>" method="POST" class="data-form" enctype="multipart/form-data">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
<?php if($isEdit): ?>
|
||||||
|
<?php echo method_field('PUT'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="id_santri">ID Santri</label>
|
||||||
|
<input type="text" id="id_santri" name="id_santri" value="<?php echo e($isEdit ? $santri->id_santri : $nextIdSantri ?? 'Otomatis Dibuat'); ?>" class="form-control" disabled>
|
||||||
|
<small class="form-text text-muted"><?php echo e($isEdit ? 'ID Santri tidak dapat diubah.' : 'ID akan otomatis di-generate (Contoh: ' . ($nextIdSantri ?? 'S001') . ')'); ?></small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="foto">
|
||||||
|
<i class="fas fa-image form-icon"></i>
|
||||||
|
Foto Santri
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<?php if($isEdit && $santri->foto): ?>
|
||||||
|
<div style="margin-bottom: 10px;">
|
||||||
|
<img src="<?php echo e(asset('storage/' . $santri->foto)); ?>"
|
||||||
|
alt="Foto <?php echo e($santri->nama_lengkap); ?>"
|
||||||
|
style="max-width: 150px; max-height: 150px; border-radius: 8px; border: 2px solid var(--primary-light); object-fit: cover;"
|
||||||
|
loading="lazy">
|
||||||
|
<p style="margin-top: 5px; font-size: 0.85rem; color: var(--text-light);">
|
||||||
|
<i class="fas fa-info-circle"></i> Foto saat ini
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<input type="file"
|
||||||
|
id="foto"
|
||||||
|
name="foto"
|
||||||
|
class="form-control <?php $__errorArgs = ['foto'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
accept="image/jpeg,image/jpg,image/png"
|
||||||
|
onchange="previewImage(event)">
|
||||||
|
|
||||||
|
<?php $__errorArgs = ['foto'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
|
||||||
|
<small class="form-text text-muted">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
Format: JPG, JPEG, atau PNG. Maksimal 2 MB.
|
||||||
|
<?php if($isEdit): ?>
|
||||||
|
Upload foto baru akan mengganti foto lama.
|
||||||
|
<?php endif; ?>
|
||||||
|
</small>
|
||||||
|
|
||||||
|
|
||||||
|
<img id="preview"
|
||||||
|
style="display: none; margin-top: 10px; max-width: 150px; max-height: 150px; border-radius: 8px; border: 2px solid var(--primary-color); object-fit: cover;"
|
||||||
|
loading="lazy">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nis">NIS (Nomor Induk Santri)</label>
|
||||||
|
<input type="text" id="nis" name="nis" value="<?php echo e(old('nis', $isEdit ? $santri->nis : '')); ?>" class="form-control <?php $__errorArgs = ['nis'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" placeholder="Masukkan NIS">
|
||||||
|
<?php $__errorArgs = ['nis'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nama_lengkap">Nama Lengkap *</label>
|
||||||
|
<input type="text" id="nama_lengkap" name="nama_lengkap" value="<?php echo e(old('nama_lengkap', $isEdit ? $santri->nama_lengkap : '')); ?>" class="form-control <?php $__errorArgs = ['nama_lengkap'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required placeholder="Masukkan nama lengkap">
|
||||||
|
<?php $__errorArgs = ['nama_lengkap'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="jenis_kelamin">Jenis Kelamin *</label>
|
||||||
|
<select id="jenis_kelamin" name="jenis_kelamin" class="form-control <?php $__errorArgs = ['jenis_kelamin'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">Pilih Jenis Kelamin</option>
|
||||||
|
<option value="Laki-laki" <?php echo e(old('jenis_kelamin', $isEdit ? $santri->jenis_kelamin : '') == 'Laki-laki' ? 'selected' : ''); ?>>Laki-laki</option>
|
||||||
|
<option value="Perempuan" <?php echo e(old('jenis_kelamin', $isEdit ? $santri->jenis_kelamin : '') == 'Perempuan' ? 'selected' : ''); ?>>Perempuan</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['jenis_kelamin'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<h4><i class="fas fa-layer-group"></i> Kelas Santri</h4>
|
||||||
|
<small class="form-text text-muted" style="margin-bottom: 15px; display: block;">
|
||||||
|
<i class="fas fa-info-circle"></i> Pilih kelas untuk setiap kelompok. Santri bisa mengikuti beberapa kelas dalam 1 kelompok.
|
||||||
|
</small>
|
||||||
|
<?php $__errorArgs = ['kelas_ids'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="alert alert-danger" style="padding: 8px 12px; font-size: 0.9rem;">
|
||||||
|
<i class="fas fa-exclamation-triangle"></i> <?php echo e($message); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
|
||||||
|
<?php $__currentLoopData = $kelompokKelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $kelompok): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<?php
|
||||||
|
$existingKelasIds = [];
|
||||||
|
if ($isEdit && $santri->kelasSantri) {
|
||||||
|
$existingKelasIds = $santri->kelasSantri
|
||||||
|
->filter(fn($sk) => $sk->kelas && $sk->kelas->id_kelompok === $kelompok->id_kelompok)
|
||||||
|
->pluck('id_kelas')
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
// Support old() untuk setiap kelompok
|
||||||
|
$selectedIds = old('kelas_ids.' . $kelompok->id_kelompok, $existingKelasIds);
|
||||||
|
if (!is_array($selectedIds)) {
|
||||||
|
$selectedIds = $selectedIds ? [$selectedIds] : [];
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="form-group" style="padding: 15px; border-left: 4px solid <?php echo e($index === 0 ? '#6FBA9D' : '#81C6E8'); ?>; background: <?php echo e($index % 2 === 0 ? '#FAFFFE' : '#F8FBFD'); ?>; border-radius: 0 8px 8px 0; margin-bottom: 15px;">
|
||||||
|
<label style="font-weight: 600; margin-bottom: 10px; display: block;">
|
||||||
|
<i class="fas fa-bookmark" style="color: <?php echo e($index === 0 ? '#6FBA9D' : '#81C6E8'); ?>;"></i>
|
||||||
|
<?php echo e($kelompok->nama_kelompok); ?>
|
||||||
|
|
||||||
|
<?php if($kelompok->deskripsi): ?>
|
||||||
|
<small style="font-weight: normal; color: #7F8C8D; display: block; margin-top: 3px;"><?php echo e($kelompok->deskripsi); ?></small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<?php if($kelompok->kelas && $kelompok->kelas->count() > 0): ?>
|
||||||
|
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px;">
|
||||||
|
<?php $__currentLoopData = $kelompok->kelas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $kelas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<label style="display: flex; align-items: center; padding: 8px 12px; background: white; border: 2px solid <?php echo e(in_array($kelas->id, $selectedIds) ? '#6FBA9D' : '#E8ECF0'); ?>; border-radius: 6px; cursor: pointer; transition: all 0.2s; margin: 0;">
|
||||||
|
<input type="checkbox"
|
||||||
|
name="kelas_ids[<?php echo e($kelompok->id_kelompok); ?>][]"
|
||||||
|
value="<?php echo e($kelas->id); ?>"
|
||||||
|
<?php echo e(in_array($kelas->id, $selectedIds) ? 'checked' : ''); ?>
|
||||||
|
|
||||||
|
style="margin-right: 8px; width: 18px; height: 18px; cursor: pointer;"
|
||||||
|
onchange="this.parentElement.style.borderColor = this.checked ? '#6FBA9D' : '#E8ECF0';">
|
||||||
|
<span style="font-size: 0.9rem; flex: 1;"><?php echo e($kelas->nama_kelas); ?></span>
|
||||||
|
</label>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</div>
|
||||||
|
<small class="form-text text-muted" style="margin-top: 8px; display: block;">
|
||||||
|
<i class="fas fa-hand-pointer"></i> Klik untuk memilih. Bisa pilih lebih dari 1 kelas.
|
||||||
|
</small>
|
||||||
|
<?php else: ?>
|
||||||
|
<p style="color: #7F8C8D; font-style: italic; margin: 0;">Belum ada kelas tersedia di kelompok ini.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="status">Status *</label>
|
||||||
|
<select id="status" name="status" class="form-control <?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">Pilih Status</option>
|
||||||
|
<option value="Aktif" <?php echo e(old('status', $isEdit ? $santri->status : 'Aktif') == 'Aktif' ? 'selected' : ''); ?>>Aktif</option>
|
||||||
|
<option value="Lulus" <?php echo e(old('status', $isEdit ? $santri->status : '') == 'Lulus' ? 'selected' : ''); ?>>Lulus</option>
|
||||||
|
<option value="Tidak Aktif" <?php echo e(old('status', $isEdit ? $santri->status : '') == 'Tidak Aktif' ? 'selected' : ''); ?>>Tidak Aktif</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="alamat_santri">Alamat Santri</label>
|
||||||
|
<textarea id="alamat_santri" name="alamat_santri" class="form-control <?php $__errorArgs = ['alamat_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" rows="3" placeholder="Masukkan alamat lengkap"><?php echo e(old('alamat_santri', $isEdit ? $santri->alamat_santri : '')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['alamat_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="daerah_asal">Daerah Asal</label>
|
||||||
|
<input type="text" id="daerah_asal" name="daerah_asal" value="<?php echo e(old('daerah_asal', $isEdit ? $santri->daerah_asal : '')); ?>" class="form-control <?php $__errorArgs = ['daerah_asal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" placeholder="Contoh: Yogyakarta">
|
||||||
|
<?php $__errorArgs = ['daerah_asal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<h4><i class="fas fa-users"></i> Data Orang Tua / Wali</h4>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nama_orang_tua">Nama Orang Tua</label>
|
||||||
|
<input type="text" id="nama_orang_tua" name="nama_orang_tua" value="<?php echo e(old('nama_orang_tua', $isEdit ? $santri->nama_orang_tua : '')); ?>" class="form-control <?php $__errorArgs = ['nama_orang_tua'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" placeholder="Masukkan nama orang tua">
|
||||||
|
<?php $__errorArgs = ['nama_orang_tua'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nomor_hp_ortu">Nomor HP Orang Tua</label>
|
||||||
|
<input type="text" id="nomor_hp_ortu" name="nomor_hp_ortu" value="<?php echo e(old('nomor_hp_ortu', $isEdit ? $santri->nomor_hp_ortu : '')); ?>" class="form-control <?php $__errorArgs = ['nomor_hp_ortu'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" placeholder="Contoh: 08123456789">
|
||||||
|
<?php $__errorArgs = ['nomor_hp_ortu'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-top: 30px; display: flex; gap: 10px;">
|
||||||
|
<button type="submit" class="btn btn-success">
|
||||||
|
<i class="fas fa-save"></i> <?php echo e($isEdit ? 'Update Data' : 'Simpan Santri'); ?>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
<a href="<?php echo e(route('admin.santri.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-times"></i> Batal
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function previewImage(event) {
|
||||||
|
const preview = document.getElementById('preview');
|
||||||
|
const file = event.target.files[0];
|
||||||
|
|
||||||
|
if (file) {
|
||||||
|
// Validasi ukuran file (2 MB = 2097152 bytes)
|
||||||
|
if (file.size > 2097152) {
|
||||||
|
alert('Ukuran file terlalu besar! Maksimal 2 MB.');
|
||||||
|
event.target.value = '';
|
||||||
|
preview.style.display = 'none';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validasi tipe file
|
||||||
|
const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png'];
|
||||||
|
if (!allowedTypes.includes(file.type)) {
|
||||||
|
alert('Format file tidak valid! Hanya JPG, JPEG, dan PNG yang diperbolehkan.');
|
||||||
|
event.target.value = '';
|
||||||
|
preview.style.display = 'none';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
preview.src = e.target.result;
|
||||||
|
preview.style.display = 'block';
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
} else {
|
||||||
|
preview.style.display = 'none';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/santri/form.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php if($paginator->hasPages()): ?>
|
||||||
|
<nav>
|
||||||
|
<ul class="pagination">
|
||||||
|
|
||||||
|
<?php if($paginator->onFirstPage()): ?>
|
||||||
|
<li class="page-item disabled" aria-disabled="true">
|
||||||
|
<span class="page-link"><?php echo app('translator')->get('pagination.previous'); ?></span>
|
||||||
|
</li>
|
||||||
|
<?php else: ?>
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="<?php echo e($paginator->previousPageUrl()); ?>" rel="prev"><?php echo app('translator')->get('pagination.previous'); ?></a>
|
||||||
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if($paginator->hasMorePages()): ?>
|
||||||
|
<li class="page-item">
|
||||||
|
<a class="page-link" href="<?php echo e($paginator->nextPageUrl()); ?>" rel="next"><?php echo app('translator')->get('pagination.next'); ?></a>
|
||||||
|
</li>
|
||||||
|
<?php else: ?>
|
||||||
|
<li class="page-item disabled" aria-disabled="true">
|
||||||
|
<span class="page-link"><?php echo app('translator')->get('pagination.next'); ?></span>
|
||||||
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/vendor/pagination/simple-bootstrap-4.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,229 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Transaksi Uang Saku</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<form action="<?php echo e(route('admin.uang-saku.store')); ?>" method="POST" id="transaksiForm">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="id_santri">
|
||||||
|
<i class="fas fa-user form-icon"></i>
|
||||||
|
Pilih Santri <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<select name="id_santri" id="id_santri" class="form-control <?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Santri --</option>
|
||||||
|
<?php $__currentLoopData = $santriList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $santri): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($santri->id_santri); ?>"
|
||||||
|
<?php echo e((old('id_santri', request('id_santri')) == $santri->id_santri) ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($santri->id_santri); ?> - <?php echo e($santri->nama_lengkap); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="santri-info" style="display:none; margin-bottom:20px;">
|
||||||
|
<div class="content-box" style="padding:16px; background:var(--primary-light);">
|
||||||
|
<div style="display:grid; grid-template-columns:repeat(3, 1fr); gap:12px; margin-bottom:12px;">
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Saldo Terakhir</small>
|
||||||
|
<div id="info-saldo" style="font-weight:700; font-size:1.1rem;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pemasukan Bln Ini</small>
|
||||||
|
<div id="info-masuk" style="font-weight:600; color:#6FBA9D;"></div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<small class="text-muted">Pengeluaran Bln Ini</small>
|
||||||
|
<div id="info-keluar" style="font-weight:600; color:#FF8B94;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="info-riwayat"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="jenis_transaksi">
|
||||||
|
<i class="fas fa-exchange-alt form-icon"></i>
|
||||||
|
Jenis Transaksi <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<select name="jenis_transaksi" id="jenis_transaksi" class="form-control <?php $__errorArgs = ['jenis_transaksi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Jenis --</option>
|
||||||
|
<option value="pemasukan" <?php echo e(old('jenis_transaksi') == 'pemasukan' ? 'selected' : ''); ?>>
|
||||||
|
Pemasukan (Terima Uang Saku)
|
||||||
|
</option>
|
||||||
|
<option value="pengeluaran" <?php echo e(old('jenis_transaksi') == 'pengeluaran' ? 'selected' : ''); ?>>
|
||||||
|
Pengeluaran (Gunakan Uang Saku)
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['jenis_transaksi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nominal">
|
||||||
|
<i class="fas fa-money-bill-wave form-icon"></i>
|
||||||
|
Nominal (Rp) <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="number" name="nominal" id="nominal" class="form-control <?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('nominal')); ?>" placeholder="Contoh: 50000" min="1" step="1" required>
|
||||||
|
<?php $__errorArgs = ['nominal'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">Masukkan nominal tanpa titik atau koma</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal_transaksi">
|
||||||
|
<i class="fas fa-calendar form-icon"></i>
|
||||||
|
Tanggal Transaksi <span style="color: red;">*</span>
|
||||||
|
</label>
|
||||||
|
<input type="date" name="tanggal_transaksi" id="tanggal_transaksi"
|
||||||
|
class="form-control <?php $__errorArgs = ['tanggal_transaksi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_transaksi', date('Y-m-d'))); ?>" required>
|
||||||
|
<?php $__errorArgs = ['tanggal_transaksi'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keterangan">
|
||||||
|
<i class="fas fa-sticky-note form-icon"></i>
|
||||||
|
Keterangan
|
||||||
|
</label>
|
||||||
|
<textarea name="keterangan" id="keterangan" class="form-control <?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
rows="4" placeholder="Contoh: Uang saku bulan Januari 2025"><?php echo e(old('keterangan')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['keterangan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">Opsional - Jelaskan detail transaksi</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="submit" class="btn btn-success hover-lift">
|
||||||
|
<i class="fas fa-save"></i> Simpan Transaksi
|
||||||
|
</button>
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('id_santri').addEventListener('change', function() {
|
||||||
|
var infoBox = document.getElementById('santri-info');
|
||||||
|
var val = this.value;
|
||||||
|
if (!val) { infoBox.style.display = 'none'; return; }
|
||||||
|
|
||||||
|
fetch('<?php echo e(url("admin/uang-saku/santri-info")); ?>/' + val)
|
||||||
|
.then(function(r) { return r.json(); })
|
||||||
|
.then(function(d) {
|
||||||
|
var saldoColor = d.saldo_raw >= 0 ? '#6FBA9D' : '#FF8B94';
|
||||||
|
document.getElementById('info-saldo').innerHTML = '<span style="color:' + saldoColor + '">Rp ' + d.saldo_terakhir + '</span>';
|
||||||
|
document.getElementById('info-masuk').textContent = 'Rp ' + d.total_pemasukan_bulan_ini;
|
||||||
|
document.getElementById('info-keluar').textContent = 'Rp ' + d.total_pengeluaran_bulan_ini;
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
if (d.transaksi_terakhir.length > 0) {
|
||||||
|
html = '<small class="text-muted">3 Transaksi Terakhir:</small><table class="data-table" style="margin-top:6px;font-size:.85rem;"><thead><tr><th>Tanggal</th><th>Jenis</th><th>Nominal</th><th>Ket</th></tr></thead><tbody>';
|
||||||
|
d.transaksi_terakhir.forEach(function(t) {
|
||||||
|
var badge = t.jenis === 'pemasukan'
|
||||||
|
? '<span class="badge badge-success">Masuk</span>'
|
||||||
|
: '<span class="badge badge-danger">Keluar</span>';
|
||||||
|
html += '<tr><td>' + t.tanggal + '</td><td>' + badge + '</td><td>Rp ' + t.nominal + '</td><td>' + t.keterangan + '</td></tr>';
|
||||||
|
});
|
||||||
|
html += '</tbody></table>';
|
||||||
|
}
|
||||||
|
document.getElementById('info-riwayat').innerHTML = html;
|
||||||
|
infoBox.style.display = 'block';
|
||||||
|
})
|
||||||
|
.catch(function() { infoBox.style.display = 'none'; });
|
||||||
|
});
|
||||||
|
|
||||||
|
// Trigger on page load if santri pre-selected
|
||||||
|
if (document.getElementById('id_santri').value) {
|
||||||
|
document.getElementById('id_santri').dispatchEvent(new Event('change'));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/uang-saku/create.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
<div class="content-box dash-chart-box">
|
||||||
|
<h4><i class="fas fa-wallet"></i> SPP Bulan Ini</h4>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$total = $spp['lunas'] + $spp['belum'];
|
||||||
|
$persenLunas = $total > 0 ? round(($spp['lunas'] / $total) * 100) : 0;
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="chart-container chart-container-sm">
|
||||||
|
<canvas id="sppDonutChart"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spp-summary">
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Lunas</span>
|
||||||
|
<strong class="text-success"><?php echo e($spp['lunas']); ?> santri (<?php echo e($persenLunas); ?>%)</strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Belum Lunas</span>
|
||||||
|
<strong class="text-danger"><?php echo e($spp['belum']); ?> santri</strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Terkumpul</span>
|
||||||
|
<strong>Rp <?php echo e(number_format($spp['terkumpul'], 0, ',', '.')); ?></strong>
|
||||||
|
</div>
|
||||||
|
<div class="spp-stat">
|
||||||
|
<span class="spp-label">Total Tagihan</span>
|
||||||
|
<strong>Rp <?php echo e(number_format($spp['totalTagihan'], 0, ',', '.')); ?></strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_ringkasan-spp.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,392 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-history"></i> Riwayat Uang Saku - <?php echo e($santri->nama_lengkap); ?></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-box" style="margin-bottom: 20px;">
|
||||||
|
<form method="GET" action="<?php echo e(route('admin.uang-saku.riwayat', $santri->id_santri)); ?>" id="filterPeriode">
|
||||||
|
<div style="display: flex; align-items: end; gap: 15px; flex-wrap: wrap;">
|
||||||
|
<div class="form-group" style="margin-bottom: 0; flex: 1; min-width: 200px;">
|
||||||
|
<label for="tanggal_dari" style="display: block; margin-bottom: 5px; font-weight: 600;">
|
||||||
|
<i class="fas fa-calendar-alt"></i> Dari Tanggal
|
||||||
|
</label>
|
||||||
|
<input type="date"
|
||||||
|
name="tanggal_dari"
|
||||||
|
id="tanggal_dari"
|
||||||
|
class="form-control"
|
||||||
|
value="<?php echo e($tanggalDari); ?>"
|
||||||
|
max="<?php echo e(date('Y-m-d')); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group" style="margin-bottom: 0; flex: 1; min-width: 200px;">
|
||||||
|
<label for="tanggal_sampai" style="display: block; margin-bottom: 5px; font-weight: 600;">
|
||||||
|
<i class="fas fa-calendar-check"></i> Sampai Tanggal
|
||||||
|
</label>
|
||||||
|
<input type="date"
|
||||||
|
name="tanggal_sampai"
|
||||||
|
id="tanggal_sampai"
|
||||||
|
class="form-control"
|
||||||
|
value="<?php echo e($tanggalSampai); ?>"
|
||||||
|
max="<?php echo e(date('Y-m-d')); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: flex; gap: 10px;">
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
<i class="fas fa-filter"></i> Terapkan
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-success" onclick="setBulanIni()">
|
||||||
|
<i class="fas fa-calendar-day"></i> Bulan Ini
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.riwayat', $santri->id_santri)); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-redo"></i> Reset
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="info-box" style="margin-bottom: 20px;">
|
||||||
|
<p style="margin: 0;">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<strong>Periode:</strong>
|
||||||
|
<?php echo e($periodeDari->format('d F Y')); ?> - <?php echo e($periodeSampai->format('d F Y')); ?>
|
||||||
|
|
||||||
|
(<?php echo e($periodeDari->diffInDays($periodeSampai) + 1); ?> hari)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Summary Cards -->
|
||||||
|
<div class="row-cards">
|
||||||
|
<div class="card card-success hover-lift">
|
||||||
|
<h3>Total Pemasukan</h3>
|
||||||
|
<div class="card-value">Rp <?php echo e(number_format($totalPemasukan, 0, ',', '.')); ?></div>
|
||||||
|
<p style="margin: 10px 0 0 0; font-size: 0.85rem; color: var(--text-light);">
|
||||||
|
Periode yang dipilih
|
||||||
|
</p>
|
||||||
|
<i class="fas fa-arrow-down card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card card-danger hover-lift">
|
||||||
|
<h3>Total Pengeluaran</h3>
|
||||||
|
<div class="card-value">Rp <?php echo e(number_format($totalPengeluaran, 0, ',', '.')); ?></div>
|
||||||
|
<p style="margin: 10px 0 0 0; font-size: 0.85rem; color: var(--text-light);">
|
||||||
|
Periode yang dipilih
|
||||||
|
</p>
|
||||||
|
<i class="fas fa-arrow-up card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card card-info hover-lift">
|
||||||
|
<h3>Selisih</h3>
|
||||||
|
<div class="card-value" style="color: <?php echo e(($totalPemasukan - $totalPengeluaran) >= 0 ? '#6FBA9D' : '#FF8B94'); ?>">
|
||||||
|
Rp <?php echo e(number_format($totalPemasukan - $totalPengeluaran, 0, ',', '.')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p style="margin: 10px 0 0 0; font-size: 0.85rem; color: var(--text-light);">
|
||||||
|
Pemasukan - Pengeluaran
|
||||||
|
</p>
|
||||||
|
<i class="fas fa-chart-line card-icon"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card card-primary hover-lift">
|
||||||
|
<h3>Saldo Saat Ini</h3>
|
||||||
|
<div class="card-value" style="color: <?php echo e($saldoTerakhir >= 0 ? '#6FBA9D' : '#FF8B94'); ?>">
|
||||||
|
Rp <?php echo e(number_format($saldoTerakhir, 0, ',', '.')); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<p style="margin: 10px 0 0 0; font-size: 0.85rem; color: var(--text-light);">
|
||||||
|
Total keseluruhan
|
||||||
|
</p>
|
||||||
|
<i class="fas fa-wallet card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Grafik -->
|
||||||
|
<div class="content-box" style="margin-bottom: 30px;">
|
||||||
|
<h3 style="margin-bottom: 20px; color: var(--primary-color);">
|
||||||
|
<i class="fas fa-chart-line"></i> Grafik Arus Uang Saku
|
||||||
|
</h3>
|
||||||
|
<canvas id="chartUangSaku" style="max-height: 400px;"></canvas>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Action Buttons -->
|
||||||
|
<div class="content-box" style="margin-bottom: 20px;">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;">
|
||||||
|
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali ke Daftar
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.santri.show', $santri->id)); ?>" class="btn btn-primary">
|
||||||
|
<i class="fas fa-user"></i> Profil Santri
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.create')); ?>?id_santri=<?php echo e($santri->id_santri); ?>" class="btn btn-success">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tabel Riwayat -->
|
||||||
|
<div class="content-box">
|
||||||
|
<h3 style="margin-bottom: 15px; color: var(--text-color);">
|
||||||
|
<i class="fas fa-list"></i> Daftar Transaksi
|
||||||
|
<?php if($transaksi->total() > 0): ?>
|
||||||
|
<span style="color: var(--text-light);">(<?php echo e($transaksi->total()); ?> transaksi)</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<?php if($transaksi->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 5%;">No</th>
|
||||||
|
<th style="width: 12%;">ID Transaksi</th>
|
||||||
|
<th style="width: 12%;">Tanggal</th>
|
||||||
|
<th style="width: 12%;">Jenis</th>
|
||||||
|
<th style="width: 15%;">Nominal</th>
|
||||||
|
<th style="width: 13%;">Saldo Sebelum</th>
|
||||||
|
<th style="width: 13%;">Saldo Sesudah</th>
|
||||||
|
<th style="width: 12%;">Keterangan</th>
|
||||||
|
<th style="width: 6%;" class="text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $transaksi; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($transaksi->firstItem() + $index); ?></td>
|
||||||
|
<td><strong><?php echo e($item->id_uang_saku); ?></strong></td>
|
||||||
|
<td><?php echo e($item->tanggal_transaksi->format('d/m/Y')); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php if($item->jenis_transaksi === 'pemasukan'): ?>
|
||||||
|
<span class="badge badge-success">
|
||||||
|
<i class="fas fa-arrow-down"></i> Pemasukan
|
||||||
|
</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="badge badge-danger">
|
||||||
|
<i class="fas fa-arrow-up"></i> Pengeluaran
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td class="nominal-highlight">
|
||||||
|
<?php echo e($item->nominal_format); ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
Rp <?php echo e(number_format($item->saldo_sebelum, 0, ',', '.')); ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<strong style="color: <?php echo e($item->saldo_sesudah >= 0 ? '#6FBA9D' : '#FF8B94'); ?>">
|
||||||
|
<?php echo e($item->saldo_sesudah_format); ?>
|
||||||
|
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="content-preview">
|
||||||
|
<?php echo e($item->keterangan ?? '-'); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<div style="display: flex; gap: 5px; justify-content: center;">
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.show', $item->id)); ?>"
|
||||||
|
class="btn btn-primary btn-sm"
|
||||||
|
title="Detail">
|
||||||
|
<i class="fas fa-eye"></i>
|
||||||
|
</a>
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.edit', $item->id)); ?>"
|
||||||
|
class="btn btn-warning btn-sm"
|
||||||
|
title="Edit">
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div style="margin-top: 20px;">
|
||||||
|
<?php echo e($transaksi->links()); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="empty-state">
|
||||||
|
<i class="fas fa-calendar-times"></i>
|
||||||
|
<h3>Tidak Ada Transaksi</h3>
|
||||||
|
<p>Tidak ada transaksi pada periode <?php echo e($periodeDari->format('d F Y')); ?> - <?php echo e($periodeSampai->format('d F Y')); ?></p>
|
||||||
|
<a href="<?php echo e(route('admin.uang-saku.create')); ?>?id_santri=<?php echo e($santri->id_santri); ?>" class="btn btn-success">
|
||||||
|
<i class="fas fa-plus"></i> Tambah Transaksi
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Chart.js Library -->
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Data untuk grafik dari Laravel
|
||||||
|
const dataGrafik = <?php echo json_encode($dataGrafik, 15, 512) ?>;
|
||||||
|
|
||||||
|
// Format data untuk Chart.js (per hari)
|
||||||
|
const labels = dataGrafik.map(item => {
|
||||||
|
const date = new Date(item.tanggal);
|
||||||
|
return date.toLocaleDateString('id-ID', { day: 'numeric', month: 'short' });
|
||||||
|
});
|
||||||
|
|
||||||
|
const pemasukan = dataGrafik.map(item => parseFloat(item.pemasukan));
|
||||||
|
const pengeluaran = dataGrafik.map(item => parseFloat(item.pengeluaran));
|
||||||
|
|
||||||
|
// Konfigurasi Chart
|
||||||
|
const ctx = document.getElementById('chartUangSaku').getContext('2d');
|
||||||
|
const chartUangSaku = new Chart(ctx, {
|
||||||
|
type: 'line',
|
||||||
|
data: {
|
||||||
|
labels: labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Pemasukan',
|
||||||
|
data: pemasukan,
|
||||||
|
borderColor: '#6FBA9D',
|
||||||
|
backgroundColor: 'rgba(111, 186, 157, 0.1)',
|
||||||
|
borderWidth: 3,
|
||||||
|
fill: true,
|
||||||
|
tension: 0.4,
|
||||||
|
pointRadius: 5,
|
||||||
|
pointHoverRadius: 7,
|
||||||
|
pointBackgroundColor: '#6FBA9D',
|
||||||
|
pointBorderColor: '#fff',
|
||||||
|
pointBorderWidth: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Pengeluaran',
|
||||||
|
data: pengeluaran,
|
||||||
|
borderColor: '#FF8B94',
|
||||||
|
backgroundColor: 'rgba(255, 139, 148, 0.1)',
|
||||||
|
borderWidth: 3,
|
||||||
|
fill: true,
|
||||||
|
tension: 0.4,
|
||||||
|
pointRadius: 5,
|
||||||
|
pointHoverRadius: 7,
|
||||||
|
pointBackgroundColor: '#FF8B94',
|
||||||
|
pointBorderColor: '#fff',
|
||||||
|
pointBorderWidth: 2
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: true,
|
||||||
|
interaction: {
|
||||||
|
intersect: false,
|
||||||
|
mode: 'index'
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
display: true,
|
||||||
|
position: 'top',
|
||||||
|
labels: {
|
||||||
|
padding: 15,
|
||||||
|
font: {
|
||||||
|
size: 13,
|
||||||
|
family: "'Inter', sans-serif"
|
||||||
|
},
|
||||||
|
usePointStyle: true,
|
||||||
|
pointStyle: 'circle'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
||||||
|
padding: 12,
|
||||||
|
titleFont: {
|
||||||
|
size: 14,
|
||||||
|
weight: 'bold'
|
||||||
|
},
|
||||||
|
bodyFont: {
|
||||||
|
size: 13
|
||||||
|
},
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
let label = context.dataset.label || '';
|
||||||
|
if (label) {
|
||||||
|
label += ': ';
|
||||||
|
}
|
||||||
|
label += 'Rp ' + new Intl.NumberFormat('id-ID').format(context.parsed.y);
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
beginAtZero: true,
|
||||||
|
ticks: {
|
||||||
|
callback: function(value) {
|
||||||
|
return 'Rp ' + new Intl.NumberFormat('id-ID', {
|
||||||
|
notation: 'compact',
|
||||||
|
compactDisplay: 'short'
|
||||||
|
}).format(value);
|
||||||
|
},
|
||||||
|
font: {
|
||||||
|
size: 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
color: 'rgba(111, 186, 157, 0.1)',
|
||||||
|
drawBorder: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
grid: {
|
||||||
|
display: false,
|
||||||
|
drawBorder: false
|
||||||
|
},
|
||||||
|
ticks: {
|
||||||
|
font: {
|
||||||
|
size: 11
|
||||||
|
},
|
||||||
|
maxRotation: 45,
|
||||||
|
minRotation: 45
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
duration: 1500,
|
||||||
|
easing: 'easeInOutQuart'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Function untuk set bulan ini
|
||||||
|
function setBulanIni() {
|
||||||
|
const today = new Date();
|
||||||
|
const firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||||
|
const lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||||
|
|
||||||
|
document.getElementById('tanggal_dari').value = firstDay.toISOString().split('T')[0];
|
||||||
|
document.getElementById('tanggal_sampai').value = lastDay.toISOString().split('T')[0];
|
||||||
|
|
||||||
|
document.getElementById('filterPeriode').submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validasi tanggal
|
||||||
|
document.getElementById('tanggal_sampai').addEventListener('change', function() {
|
||||||
|
const dari = document.getElementById('tanggal_dari').value;
|
||||||
|
const sampai = this.value;
|
||||||
|
|
||||||
|
if (dari && sampai && sampai < dari) {
|
||||||
|
alert('Tanggal sampai tidak boleh lebih kecil dari tanggal dari!');
|
||||||
|
this.value = dari;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/uang-saku/riwayat.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
|
||||||
|
<div class="content-section">
|
||||||
|
<h3><i class="fas fa-list-alt"></i> Jadwal Kegiatan — <?php echo e($hari); ?></h3>
|
||||||
|
<div class="content-box">
|
||||||
|
<?php if($kegiatan->isEmpty()): ?>
|
||||||
|
<p class="text-muted">Tidak ada kegiatan terjadwal hari ini.</p>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Kegiatan</th>
|
||||||
|
<th>Kategori</th>
|
||||||
|
<th>Waktu</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Kehadiran</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $kegiatan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $k): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr class="<?php echo e($k->belum_input ? 'row-danger' : ''); ?>">
|
||||||
|
<td>
|
||||||
|
<strong><?php echo e($k->nama_kegiatan); ?></strong>
|
||||||
|
<?php if($k->belum_input): ?>
|
||||||
|
<span class="badge badge-danger badge-sm">Belum input absensi!</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td><?php echo e($k->kategori->nama_kategori ?? '-'); ?></td>
|
||||||
|
<td>
|
||||||
|
<?php echo e(is_string($k->waktu_mulai) ? $k->waktu_mulai : $k->waktu_mulai->format('H:i')); ?>
|
||||||
|
|
||||||
|
—
|
||||||
|
<?php echo e(is_string($k->waktu_selesai) ? $k->waktu_selesai : $k->waktu_selesai->format('H:i')); ?>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php if($k->status_kegiatan === 'berlangsung'): ?>
|
||||||
|
<span class="badge badge-info">Berlangsung</span>
|
||||||
|
<?php elseif($k->status_kegiatan === 'selesai'): ?>
|
||||||
|
<span class="badge badge-success">Selesai</span>
|
||||||
|
<?php else: ?>
|
||||||
|
<span class="badge badge-secondary">Belum Mulai</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php if($k->total_absensi > 0): ?>
|
||||||
|
<div class="progress-bar-wrap">
|
||||||
|
<div class="progress-bar-fill" style="width: <?php echo e($k->persen_kehadiran); ?>%"></div>
|
||||||
|
</div>
|
||||||
|
<small><?php echo e($k->persen_kehadiran); ?>% (<?php echo e($k->total_absensi); ?> data)</small>
|
||||||
|
<?php else: ?>
|
||||||
|
<small class="text-muted">—</small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboard/_jadwal-kegiatan.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -119,7 +119,7 @@ class="<?php echo e(Request::routeIs('admin.riwayat-pelanggaran.*') ? 'active' :
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- ADMINISTRASI -->
|
<!-- ADMINISTRASI -->
|
||||||
<li class="menu-toggle <?php echo e(Request::is('admin/pembayaran-spp*') || Request::is('admin/uang-saku*') ? 'active' : ''); ?>">
|
<li class="menu-toggle <?php echo e(Request::is('admin/pembayaran-spp*') || Request::is('admin/uang-saku*') || Request::is('admin/keuangan*') ? 'active' : ''); ?>">
|
||||||
<a href="javascript:void(0)" class="menu-parent">
|
<a href="javascript:void(0)" class="menu-parent">
|
||||||
<i class="fas fa-money-bill-wave"></i><span>Administrasi</span>
|
<i class="fas fa-money-bill-wave"></i><span>Administrasi</span>
|
||||||
<i class="fas fa-chevron-down toggle-icon"></i>
|
<i class="fas fa-chevron-down toggle-icon"></i>
|
||||||
|
|
@ -131,6 +131,12 @@ class="<?php echo e(Request::is('admin/pembayaran-spp*') ? 'active' : ''); ?>">
|
||||||
<i class="fas fa-file-invoice-dollar"></i><span>Pembayaran SPP</span>
|
<i class="fas fa-file-invoice-dollar"></i><span>Pembayaran SPP</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.index')); ?>"
|
||||||
|
class="<?php echo e(Request::is('admin/keuangan*') ? 'active' : ''); ?>">
|
||||||
|
<i class="fas fa-cash-register"></i><span>Kas & Keuangan</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo e(route('admin.uang-saku.index')); ?>"
|
<a href="<?php echo e(route('admin.uang-saku.index')); ?>"
|
||||||
class="<?php echo e(Request::is('admin/uang-saku*') ? 'active' : ''); ?>">
|
class="<?php echo e(Request::is('admin/uang-saku*') ? 'active' : ''); ?>">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<?php
|
||||||
|
$namaBulan = \Carbon\Carbon::create()->month($bulan)->translatedFormat('F');
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-chart-bar"></i> Laporan Neraca Keuangan</h2>
|
||||||
|
<p>Periode: <?php echo e($namaBulan); ?> <?php echo e($tahun); ?></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-box" style="margin-bottom:20px;">
|
||||||
|
<form method="GET" action="<?php echo e(route('admin.keuangan.laporan')); ?>" style="display:flex; gap:12px; align-items:end; flex-wrap:wrap;">
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<label>Bulan</label>
|
||||||
|
<select name="bulan" class="form-control">
|
||||||
|
<?php for($i = 1; $i <= 12; $i++): ?>
|
||||||
|
<option value="<?php echo e($i); ?>" <?php echo e($bulan==$i?'selected':''); ?>>
|
||||||
|
<?php echo e(\Carbon\Carbon::create()->month($i)->translatedFormat('F')); ?>
|
||||||
|
|
||||||
|
</option>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" style="margin-bottom:0;">
|
||||||
|
<label>Tahun</label>
|
||||||
|
<input type="number" name="tahun" class="form-control" value="<?php echo e($tahun); ?>" min="2020" max="2100" style="width:100px;">
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary"><i class="fas fa-search"></i> Tampilkan</button>
|
||||||
|
<a href="<?php echo e(route('admin.keuangan.index')); ?>" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Kembali</a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row-cards" style="grid-template-columns: repeat(4, 1fr);">
|
||||||
|
<div class="card card-info">
|
||||||
|
<h3>SPP Terkumpul</h3>
|
||||||
|
<p class="card-value-small">Rp <?php echo e(number_format($sppTerkumpul, 0, ',', '.')); ?></p>
|
||||||
|
<i class="fas fa-file-invoice-dollar card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card card-success">
|
||||||
|
<h3>Pemasukan Lain</h3>
|
||||||
|
<p class="card-value-small">Rp <?php echo e(number_format($pemasukanPondok, 0, ',', '.')); ?></p>
|
||||||
|
<i class="fas fa-arrow-down card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card card-danger">
|
||||||
|
<h3>Total Pengeluaran</h3>
|
||||||
|
<p class="card-value-small">Rp <?php echo e(number_format($pengeluaranPondok, 0, ',', '.')); ?></p>
|
||||||
|
<i class="fas fa-arrow-up card-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="card <?php echo e($sisaKas >= 0 ? 'card-primary' : 'card-danger'); ?>">
|
||||||
|
<h3>Sisa Kas</h3>
|
||||||
|
<p class="card-value-small">Rp <?php echo e(number_format($sisaKas, 0, ',', '.')); ?></p>
|
||||||
|
<i class="fas fa-wallet card-icon"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div style="display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:24px;">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<h4 style="margin-bottom:12px;"><i class="fas fa-arrow-up" style="color:var(--danger-color);"></i> Pengeluaran Terbesar</h4>
|
||||||
|
<?php if($detailPengeluaran->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead><tr><th>Tanggal</th><th>Keterangan</th><th>Nominal</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $detailPengeluaran; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($item->tanggal->format('d/m')); ?></td>
|
||||||
|
<td><?php echo e($item->keterangan ?? '-'); ?></td>
|
||||||
|
<td class="nominal-highlight"><?php echo e($item->nominal_format); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="text-muted">Tidak ada pengeluaran bulan ini.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-box">
|
||||||
|
<h4 style="margin-bottom:12px;"><i class="fas fa-arrow-down" style="color:var(--success-color);"></i> Pemasukan Non-SPP</h4>
|
||||||
|
<?php if($detailPemasukan->count() > 0): ?>
|
||||||
|
<table class="data-table">
|
||||||
|
<thead><tr><th>Tanggal</th><th>Keterangan</th><th>Nominal</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $__currentLoopData = $detailPemasukan; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<tr>
|
||||||
|
<td><?php echo e($item->tanggal->format('d/m')); ?></td>
|
||||||
|
<td><?php echo e($item->keterangan ?? '-'); ?></td>
|
||||||
|
<td class="nominal-highlight"><?php echo e($item->nominal_format); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="text-muted">Tidak ada pemasukan non-SPP bulan ini.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/keuangan/laporan.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!-- views/admin/dashboardAdmin.blade.php -->
|
|
||||||
|
|
||||||
|
|
||||||
<?php $__env->startSection('title', 'Dashboard Admin'); ?>
|
<?php $__env->startSection('title', 'Dashboard Admin'); ?>
|
||||||
|
|
@ -6,32 +6,94 @@
|
||||||
<?php $__env->startSection('content'); ?>
|
<?php $__env->startSection('content'); ?>
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h2>Dashboard Admin</h2>
|
<h2>Dashboard Admin</h2>
|
||||||
<p>Selamat datang di Sistem Informasi Monitoring Santri.</p>
|
<p><?php echo e($hariIni); ?>, <?php echo e($today->translatedFormat('d F Y')); ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-cards">
|
|
||||||
<div class="card card-info">
|
|
||||||
<h3>Total Santri</h3>
|
|
||||||
<p class="card-value"><?php echo e($data['total_santri']); ?></p>
|
|
||||||
<i class="fas fa-user-graduate card-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div class="card card-success">
|
|
||||||
<h3>Total Wali Santri</h3>
|
|
||||||
<p class="card-value"><?php echo e($data['total_wali']); ?></p>
|
|
||||||
<i class="fas fa-user-shield card-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div class="card card-warning">
|
|
||||||
<h3>Kegiatan Hari Ini</h3>
|
|
||||||
<p class="card-value"><?php echo e($data['kegiatan_hari_ini']); ?></p>
|
|
||||||
<i class="fas fa-calendar-alt card-icon"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content-section">
|
<?php echo $__env->make('admin.dashboard._kpi-cards', ['kpi' => $kpiCards], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
<h3>Statistik & Grafik</h3>
|
|
||||||
<div class="content-box">
|
|
||||||
<p>Area untuk menempatkan statistik dan grafik sistem.</p>
|
<?php echo $__env->make('admin.dashboard._jadwal-kegiatan', ['kegiatan' => $kegiatanHariIni, 'hari' => $hariIni], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<?php echo $__env->make('admin.dashboard._alert-panel', ['alerts' => $alerts], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="dash-grid-2">
|
||||||
|
|
||||||
|
<?php echo $__env->make('admin.dashboard._tren-kehadiran', ['trenKehadiran' => $trenKehadiran], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php echo $__env->make('admin.dashboard._ringkasan-spp', ['spp' => $sppBulanIni], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php echo $__env->make('admin.dashboard._feed-aktivitas', ['feed' => $feedAktivitas], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('scripts'); ?>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@4/dist/chart.umd.min.js"></script>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
// ── Tren Kehadiran (Line Chart) ──
|
||||||
|
const trenCtx = document.getElementById('trenKehadiranChart');
|
||||||
|
if (trenCtx) {
|
||||||
|
const trenData = <?php echo json_encode($trenKehadiran, 15, 512) ?>;
|
||||||
|
const colors = ['#6FBA9D', '#FF8B94', '#81C6E8', '#FFD56B', '#B39DDB', '#FFAB91'];
|
||||||
|
const datasets = Object.keys(trenData.series).map((label, i) => ({
|
||||||
|
label: label,
|
||||||
|
data: trenData.series[label],
|
||||||
|
borderColor: colors[i % colors.length],
|
||||||
|
backgroundColor: colors[i % colors.length] + '20',
|
||||||
|
tension: 0.3,
|
||||||
|
fill: true,
|
||||||
|
pointRadius: 4,
|
||||||
|
pointHoverRadius: 6,
|
||||||
|
}));
|
||||||
|
|
||||||
|
new Chart(trenCtx, {
|
||||||
|
type: 'line',
|
||||||
|
data: { labels: trenData.labels, datasets },
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
plugins: {
|
||||||
|
legend: { position: 'bottom', labels: { padding: 16, usePointStyle: true } },
|
||||||
|
tooltip: { callbacks: { label: ctx => ctx.dataset.label + ': ' + ctx.parsed.y + '%' } }
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
y: { beginAtZero: true, max: 100, ticks: { callback: v => v + '%' } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Ringkasan SPP (Donut Chart) ──
|
||||||
|
const sppCtx = document.getElementById('sppDonutChart');
|
||||||
|
if (sppCtx) {
|
||||||
|
const sppData = <?php echo json_encode($sppBulanIni, 15, 512) ?>;
|
||||||
|
new Chart(sppCtx, {
|
||||||
|
type: 'doughnut',
|
||||||
|
data: {
|
||||||
|
labels: ['Lunas', 'Belum Lunas'],
|
||||||
|
datasets: [{
|
||||||
|
data: [sppData.lunas, sppData.belum],
|
||||||
|
backgroundColor: ['#6FBA9D', '#FF8B94'],
|
||||||
|
borderWidth: 2,
|
||||||
|
borderColor: '#fff',
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
maintainAspectRatio: false,
|
||||||
|
cutout: '65%',
|
||||||
|
plugins: {
|
||||||
|
legend: { position: 'bottom', labels: { padding: 16, usePointStyle: true } },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<?php $__env->stopSection(); ?>
|
<?php $__env->stopSection(); ?>
|
||||||
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboardAdmin.blade.php ENDPATH**/ ?>
|
<?php echo $__env->make('layouts.app', ['isAdmin' => true], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/dashboardAdmin.blade.php ENDPATH**/ ?>
|
||||||
|
|
@ -0,0 +1,280 @@
|
||||||
|
|
||||||
|
|
||||||
|
<?php $__env->startSection('title', 'Tambah Data Kesehatan Santri'); ?>
|
||||||
|
|
||||||
|
<?php $__env->startSection('content'); ?>
|
||||||
|
<div class="page-header">
|
||||||
|
<h2><i class="fas fa-plus-circle"></i> Tambah Data Kesehatan Santri</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Content Box -->
|
||||||
|
<div class="content-box">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||||
|
<h3 style="margin: 0; color: var(--primary-color);">
|
||||||
|
<i class="fas fa-file-medical"></i> Form Data Kesehatan
|
||||||
|
</h3>
|
||||||
|
<a href="<?php echo e(route('admin.kesehatan-santri.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-arrow-left"></i> Kembali
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form action="<?php echo e(route('admin.kesehatan-santri.store')); ?>" method="POST">
|
||||||
|
<?php echo csrf_field(); ?>
|
||||||
|
|
||||||
|
<!-- Pilih Santri -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="id_santri"><i class="fas fa-user form-icon"></i>Santri *</label>
|
||||||
|
<select name="id_santri" id="id_santri" class="form-control <?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Santri --</option>
|
||||||
|
<?php $__currentLoopData = $santri; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
<option value="<?php echo e($s->id_santri); ?>" <?php echo e(old('id_santri') == $s->id_santri ? 'selected' : ''); ?>>
|
||||||
|
<?php echo e($s->id_santri); ?> - <?php echo e($s->nama_lengkap); ?> (<?php echo e($s->kelas); ?>)
|
||||||
|
</option>
|
||||||
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['id_santri'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px;">
|
||||||
|
<!-- Tanggal Masuk -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="tanggal_masuk"><i class="fas fa-calendar-plus form-icon"></i>Tanggal Masuk UKP *</label>
|
||||||
|
<input type="date"
|
||||||
|
name="tanggal_masuk"
|
||||||
|
id="tanggal_masuk"
|
||||||
|
class="form-control <?php $__errorArgs = ['tanggal_masuk'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_masuk', date('Y-m-d'))); ?>"
|
||||||
|
max="<?php echo e(date('Y-m-d')); ?>"
|
||||||
|
required>
|
||||||
|
<?php $__errorArgs = ['tanggal_masuk'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Status -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="status"><i class="fas fa-info-circle form-icon"></i>Status *</label>
|
||||||
|
<select name="status" id="status" class="form-control <?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>" required>
|
||||||
|
<option value="">-- Pilih Status --</option>
|
||||||
|
<option value="dirawat" <?php echo e(old('status') == 'dirawat' ? 'selected' : ''); ?>>Dirawat</option>
|
||||||
|
<option value="sembuh" <?php echo e(old('status') == 'sembuh' ? 'selected' : ''); ?>>Sembuh</option>
|
||||||
|
<option value="izin" <?php echo e(old('status') == 'izin' ? 'selected' : ''); ?>>Izin Pulang</option>
|
||||||
|
</select>
|
||||||
|
<?php $__errorArgs = ['status'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tanggal Keluar (Hidden by default) -->
|
||||||
|
<div id="tanggal_keluar_group" class="form-group" style="display: none;">
|
||||||
|
<label for="tanggal_keluar"><i class="fas fa-calendar-check form-icon"></i>Tanggal Keluar UKP</label>
|
||||||
|
<input type="date"
|
||||||
|
name="tanggal_keluar"
|
||||||
|
id="tanggal_keluar"
|
||||||
|
class="form-control <?php $__errorArgs = ['tanggal_keluar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
value="<?php echo e(old('tanggal_keluar')); ?>"
|
||||||
|
max="<?php echo e(date('Y-m-d')); ?>">
|
||||||
|
<?php $__errorArgs = ['tanggal_keluar'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">
|
||||||
|
<i class="fas fa-info-circle"></i> Kosongkan jika santri masih dirawat
|
||||||
|
</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Keluhan -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="keluhan"><i class="fas fa-notes-medical form-icon"></i>Keluhan *</label>
|
||||||
|
<textarea name="keluhan"
|
||||||
|
id="keluhan"
|
||||||
|
rows="4"
|
||||||
|
class="form-control <?php $__errorArgs = ['keluhan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
placeholder="Tuliskan keluhan atau gejala yang dialami santri..."
|
||||||
|
required><?php echo e(old('keluhan')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['keluhan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">Maksimal 1000 karakter</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Catatan -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="catatan"><i class="fas fa-clipboard form-icon"></i>Catatan Petugas</label>
|
||||||
|
<textarea name="catatan"
|
||||||
|
id="catatan"
|
||||||
|
rows="3"
|
||||||
|
class="form-control <?php $__errorArgs = ['catatan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>"
|
||||||
|
placeholder="Catatan tambahan dari petugas kesehatan..."><?php echo e(old('catatan')); ?></textarea>
|
||||||
|
<?php $__errorArgs = ['catatan'];
|
||||||
|
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
|
||||||
|
if ($__bag->has($__errorArgs[0])) :
|
||||||
|
if (isset($message)) { $__messageOriginal = $message; }
|
||||||
|
$message = $__bag->first($__errorArgs[0]); ?>
|
||||||
|
<div class="invalid-feedback"><?php echo e($message); ?></div>
|
||||||
|
<?php unset($message);
|
||||||
|
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
|
||||||
|
endif;
|
||||||
|
unset($__errorArgs, $__bag); ?>
|
||||||
|
<small class="form-text">Maksimal 1000 karakter (opsional)</small>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<div style="display: flex; gap: 10px; justify-content: flex-end; margin-top: 30px;">
|
||||||
|
<a href="<?php echo e(route('admin.kesehatan-santri.index')); ?>" class="btn btn-secondary">
|
||||||
|
<i class="fas fa-times"></i> Batal
|
||||||
|
</a>
|
||||||
|
<button type="submit" class="btn btn-primary">
|
||||||
|
<i class="fas fa-save"></i> Simpan Data
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const statusSelect = document.getElementById('status');
|
||||||
|
const tanggalKeluarGroup = document.getElementById('tanggal_keluar_group');
|
||||||
|
const tanggalKeluarInput = document.getElementById('tanggal_keluar');
|
||||||
|
const tanggalMasukInput = document.getElementById('tanggal_masuk');
|
||||||
|
|
||||||
|
// Function to toggle tanggal keluar visibility
|
||||||
|
function toggleTanggalKeluar() {
|
||||||
|
if (statusSelect.value === 'dirawat') {
|
||||||
|
tanggalKeluarGroup.style.display = 'none';
|
||||||
|
tanggalKeluarInput.value = '';
|
||||||
|
tanggalKeluarInput.removeAttribute('required');
|
||||||
|
} else {
|
||||||
|
tanggalKeluarGroup.style.display = 'block';
|
||||||
|
if (statusSelect.value === 'sembuh' || statusSelect.value === 'izin') {
|
||||||
|
tanggalKeluarInput.setAttribute('required', 'required');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set minimum date for tanggal_keluar based on tanggal_masuk
|
||||||
|
function setMinTanggalKeluar() {
|
||||||
|
if (tanggalMasukInput.value) {
|
||||||
|
tanggalKeluarInput.min = tanggalMasukInput.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event listeners
|
||||||
|
statusSelect.addEventListener('change', toggleTanggalKeluar);
|
||||||
|
tanggalMasukInput.addEventListener('change', setMinTanggalKeluar);
|
||||||
|
|
||||||
|
// Initialize on page load
|
||||||
|
toggleTanggalKeluar();
|
||||||
|
setMinTanggalKeluar();
|
||||||
|
|
||||||
|
// Character counter
|
||||||
|
function setupCharacterCounter(textareaId, maxLength) {
|
||||||
|
const textarea = document.getElementById(textareaId);
|
||||||
|
const counter = document.createElement('div');
|
||||||
|
counter.style.cssText = 'text-align: right; font-size: 0.85em; color: #7F8C8D; margin-top: 5px;';
|
||||||
|
|
||||||
|
function updateCounter() {
|
||||||
|
const remaining = maxLength - textarea.value.length;
|
||||||
|
counter.textContent = `${textarea.value.length}/${maxLength} karakter`;
|
||||||
|
counter.style.color = remaining < 50 ? '#E74C3C' : '#7F8C8D';
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea.addEventListener('input', updateCounter);
|
||||||
|
|
||||||
|
// Insert counter after the last sibling (after form-text if exists)
|
||||||
|
const lastSibling = textarea.parentNode.lastElementChild;
|
||||||
|
if (lastSibling.classList && lastSibling.classList.contains('form-text')) {
|
||||||
|
lastSibling.parentNode.appendChild(counter);
|
||||||
|
} else {
|
||||||
|
textarea.parentNode.appendChild(counter);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCounter();
|
||||||
|
}
|
||||||
|
|
||||||
|
setupCharacterCounter('keluhan', 1000);
|
||||||
|
setupCharacterCounter('catatan', 1000);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php $__env->stopSection(); ?>
|
||||||
|
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\TugasAkhir\sim-pkpps\resources\views/admin/kesehatan-santri/create.blade.php ENDPATH**/ ?>
|
||||||
Loading…
Reference in New Issue