Fix Auth Logic, User Roles & Update Core Modules (Laporan, Dashboard, Pengumuman)
MAJOR UPDATES: 1. Auth & Security (Login): - Fix User Model (unguard attributes for Role assignment). - Fix WaliMuridController (Transaction & Role 'wali_murid'). - Implement Web Login Protection (Block 'wali_murid' access to Web Dashboard). - Fix Error "Column not found" on user creation. 2. Laporan Perkembangan (Features): - Implement/Update fitur Catatan Anekdot. - Implement/Update fitur Hasil Karya. - Implement/Update fitur Ceklis Capaian. 3. General UI/UX: - Update Dashboard layout & logic. - Update fitur Pengumuman (CRUD & View). - Fix minor bugs on Admin Panel.
This commit is contained in:
parent
ec9b09eedc
commit
d8a8ce647a
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Anekdot;
|
||||
use App\Models\Siswa;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class AnekdotController extends Controller
|
||||
{
|
||||
// Menampilkan form tambah anekdot
|
||||
public function create($siswa_id)
|
||||
{
|
||||
$siswa = Siswa::findOrFail($siswa_id);
|
||||
|
||||
return view('admin.anekdot.create', compact('siswa'));
|
||||
}
|
||||
|
||||
// Menyimpan data anekdot
|
||||
public function store(Request $request, $siswa_id)
|
||||
{
|
||||
// 1. Validasi
|
||||
$request->validate([
|
||||
'tanggal' => 'required|date',
|
||||
'waktu' => 'required|string|max:50',
|
||||
'tempat' => 'required|string|max:255',
|
||||
'uraian_kejadian' => 'required|string',
|
||||
'analisis_capaian' => 'nullable|string',
|
||||
'foto' => 'nullable|image|mimes:jpg,jpeg,png|max:2048',
|
||||
]);
|
||||
|
||||
// 2. Ambil data mentah lalu tambahkan manual
|
||||
$data = $request->all();
|
||||
$data['siswa_id'] = $siswa_id;
|
||||
$data['guru_id'] = auth()->id();
|
||||
$data['kejadian_teramati'] = $request->uraian_kejadian; // ISI PAKSA
|
||||
|
||||
// 3. Upload foto
|
||||
if ($request->hasFile('foto')) {
|
||||
$data['foto'] = $request->file('foto')->store('anekdot', 'public');
|
||||
}
|
||||
|
||||
// 4. Simpan (Akan berhasil jika Model sudah diupdate fillable-nya)
|
||||
Anekdot::create($data);
|
||||
|
||||
return redirect()
|
||||
->route('perkembangan.show', $siswa_id)
|
||||
->with('success', 'Catatan anekdot berhasil disimpan!');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,10 @@
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Guru;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class GuruController extends Controller
|
||||
{
|
||||
|
|
@ -20,19 +23,41 @@ public function create()
|
|||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Validasi disesuaikan dengan kolom database
|
||||
$request->validate([
|
||||
'nama_guru' => 'required|string|max:100',
|
||||
'email' => 'nullable|email|max:100',
|
||||
'no_hp' => 'nullable|string|max:20',
|
||||
'jenis_guru' => 'required|in:guru_kelas,shadow_abk', // UBAH 'bidang' JADI 'jenis_guru'
|
||||
]);
|
||||
|
||||
Guru::create($request->all());
|
||||
|
||||
return redirect()->route('guru.index')->with('success', 'Data guru berhasil ditambahkan.');
|
||||
}
|
||||
{
|
||||
// 1. Validasi
|
||||
$request->validate([
|
||||
'nama_guru' => 'required',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'password' => 'required|min:6',
|
||||
]);
|
||||
|
||||
DB::transaction(function () use ($request) {
|
||||
|
||||
// A. SIMPAN KE TABEL USERS (Disini tempatnya Email & Password)
|
||||
$user = User::create([
|
||||
'name' => $request->nama_guru,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
'role' => 'guru',
|
||||
]);
|
||||
|
||||
// B. SIMPAN KE TABEL GURU (HANYA DATA PROFIL)
|
||||
Guru::create([
|
||||
'user_id' => $user->id,
|
||||
'nama_guru' => $request->nama_guru,
|
||||
'nip' => $request->nip,
|
||||
'jenis_guru' => $request->jenis_guru, // Pastikan kolom ini ada di tabel guru kamu
|
||||
'no_hp' => $request->no_hp,
|
||||
'alamat' => $request->alamat,
|
||||
|
||||
// ❌ JANGAN ADA baris 'email' => ... disini
|
||||
// ❌ JANGAN ADA baris 'password' => ... disini
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
return redirect()->route('guru.index')->with('success', 'Berhasil menambahkan Guru!');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\HasilKarya;
|
||||
use App\Models\Siswa;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HasilKaryaController extends Controller
|
||||
{
|
||||
public function create($siswa_id)
|
||||
{
|
||||
$siswa = Siswa::findOrFail($siswa_id);
|
||||
return view('admin.hasil_karya.create', compact('siswa'));
|
||||
}
|
||||
|
||||
public function store(Request $request, $siswa_id)
|
||||
{
|
||||
$request->validate([
|
||||
'tanggal' => 'required|date',
|
||||
'foto' => 'required|image|max:2048', // Foto wajib ada untuk hasil karya
|
||||
'deskripsi_foto' => 'required', // Sesuai nama kolom di DB kamu
|
||||
'analisis_capaian' => 'nullable',
|
||||
]);
|
||||
|
||||
$data = $request->all();
|
||||
$data['siswa_id'] = $siswa_id;
|
||||
$data['guru_id'] = auth()->id();
|
||||
|
||||
if ($request->hasFile('foto')) {
|
||||
$file = $request->file('foto');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$file->storeAs('public/hasil_karya', $filename);
|
||||
$data['foto'] = $filename;
|
||||
}
|
||||
|
||||
HasilKarya::create($data);
|
||||
|
||||
return redirect()->route('perkembangan.show', $siswa_id)
|
||||
->with('success', 'Hasil Karya berhasil diupload!');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\PenilaianCeklis; // Pakai model yang benar
|
||||
use App\Models\Siswa;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PenilaianCeklisController extends Controller
|
||||
{
|
||||
public function create($siswa_id)
|
||||
{
|
||||
$siswa = Siswa::findOrFail($siswa_id);
|
||||
// Pastikan view-nya mengarah ke folder yang benar
|
||||
return view('admin.ceklis.create', compact('siswa'));
|
||||
}
|
||||
|
||||
public function store(Request $request, $siswa_id)
|
||||
{
|
||||
$request->validate([
|
||||
'tanggal' => 'required|date',
|
||||
'indikator' => 'required|string',
|
||||
'hasil' => 'required|in:BB,MB,BSH,BSB', // Validasi 'hasil'
|
||||
'keterangan' => 'nullable|string',
|
||||
]);
|
||||
|
||||
$data = $request->all();
|
||||
$data['siswa_id'] = $siswa_id;
|
||||
$data['guru_id'] = auth()->id();
|
||||
|
||||
PenilaianCeklis::create($data);
|
||||
|
||||
return redirect()->route('perkembangan.show', $siswa_id)
|
||||
->with('success', 'Data penilaian ceklis berhasil disimpan!');
|
||||
}
|
||||
}
|
||||
|
|
@ -10,71 +10,61 @@
|
|||
class RapotController extends Controller
|
||||
{
|
||||
public function create($siswa_id)
|
||||
{
|
||||
$siswa = \App\Models\Siswa::findOrFail($siswa_id);
|
||||
|
||||
// PERBAIKAN: Ambil data dari Model 'Guru', bukan 'User'
|
||||
// Kita ambil semua guru, diurutkan berdasarkan nama
|
||||
$gurus = \App\Models\Guru::orderBy('nama_guru', 'asc')->get();
|
||||
|
||||
return view('admin.rapot.create', compact('siswa', 'gurus'));
|
||||
}
|
||||
{
|
||||
$siswa = Siswa::findOrFail($siswa_id);
|
||||
return view('admin.rapot.create', compact('siswa'));
|
||||
}
|
||||
|
||||
// 2. SIMPAN DATA RAPOT KE DATABASE
|
||||
public function store(Request $request, $siswa_id)
|
||||
{
|
||||
$request->validate([
|
||||
'semester' => 'required',
|
||||
'tahun_ajaran' => 'required',
|
||||
'tanggal_rapot' => 'required|date',
|
||||
'nama_guru' => 'required',
|
||||
'nama_kepala_sekolah' => 'required',
|
||||
]);
|
||||
|
||||
Rapot::create([
|
||||
'siswa_id' => $siswa_id,
|
||||
'semester' => $request->semester,
|
||||
'tahun_ajaran' => $request->tahun_ajaran,
|
||||
'tanggal_rapot' => $request->tanggal_rapot,
|
||||
|
||||
// Urutan A-E Sesuai PDF
|
||||
'narasi_aik' => $request->narasi_aik,
|
||||
'narasi_nilai_agama' => $request->narasi_nilai_agama,
|
||||
'narasi_jati_diri' => $request->narasi_jati_diri,
|
||||
'narasi_literasi' => $request->narasi_literasi,
|
||||
'narasi_kokurikuler' => $request->narasi_kokurikuler, // Kolom Baru
|
||||
|
||||
// Fisik & Kehadiran
|
||||
'tinggi_badan' => $request->tinggi_badan,
|
||||
'berat_badan' => $request->berat_badan,
|
||||
'lingkar_kepala' => $request->lingkar_kepala,
|
||||
'lingkar_lengan' => $request->lingkar_lengan,
|
||||
'sakit' => $request->sakit ?? 0,
|
||||
'izin' => $request->izin ?? 0,
|
||||
'alpha' => $request->alpha ?? 0,
|
||||
|
||||
// Refleksi & TTD
|
||||
'refleksi_orang_tua' => $request->refleksi_orang_tua,
|
||||
'nama_guru' => $request->nama_guru,
|
||||
'nama_kepala_sekolah' => $request->nama_kepala_sekolah,
|
||||
'nbm_kepala_sekolah' => $request->nbm_kepala_sekolah,
|
||||
]);
|
||||
|
||||
return redirect()->route('perkembangan.show', $siswa_id)
|
||||
->with('success', 'Rapot berhasil dibuat!');
|
||||
}
|
||||
{
|
||||
$request->validate([
|
||||
'tahun_ajaran' => 'required',
|
||||
'semester' => 'required',
|
||||
'tanggal_rapot' => 'required|date',
|
||||
'narasi_agama' => 'required',
|
||||
'narasi_budi_pekerti' => 'required',
|
||||
'narasi_jati_diri' => 'required',
|
||||
'narasi_literasi' => 'required',
|
||||
'narasi_kokurikuler' => 'required', // E Wajib
|
||||
]);
|
||||
|
||||
Rapot::create([
|
||||
'siswa_id' => $siswa_id,
|
||||
'tahun_ajaran' => $request->tahun_ajaran,
|
||||
'semester' => $request->semester,
|
||||
'tanggal_rapot' => $request->tanggal_rapot,
|
||||
|
||||
// Narasi A-E
|
||||
'narasi_agama' => $request->narasi_agama,
|
||||
'narasi_budi_pekerti' => $request->narasi_budi_pekerti,
|
||||
'narasi_jati_diri' => $request->narasi_jati_diri,
|
||||
'narasi_literasi' => $request->narasi_literasi,
|
||||
'narasi_kokurikuler' => $request->narasi_kokurikuler,
|
||||
|
||||
// TTD & Refleksi
|
||||
'refleksi_orang_tua' => $request->refleksi_orang_tua,
|
||||
'nama_guru' => $request->nama_guru,
|
||||
'nipy_guru' => $request->nipy_guru,
|
||||
'nama_kepala_sekolah' => $request->nama_kepala_sekolah,
|
||||
'nipy_kepala_sekolah' => $request->nipy_kepala_sekolah,
|
||||
|
||||
// Fisik
|
||||
'tinggi_badan' => $request->tinggi_badan,
|
||||
'berat_badan' => $request->berat_badan,
|
||||
'lingkar_kepala' => $request->lingkar_kepala,
|
||||
'sakit' => $request->sakit ?? 0,
|
||||
'izin' => $request->izin ?? 0,
|
||||
'alpha' => $request->alpha ?? 0,
|
||||
]);
|
||||
|
||||
return redirect()->route('perkembangan.show', $siswa_id)->with('success', 'Rapot Berhasil Dibuat!');
|
||||
}
|
||||
|
||||
// 3. LIHAT DETAIL RAPOT (PREVIEW SEBELUM CETAK)
|
||||
public function show($id)
|
||||
{
|
||||
$rapot = Rapot::with('siswa')->findOrFail($id);
|
||||
return view('admin.rapot.show', compact('rapot'));
|
||||
}
|
||||
|
||||
// 4. CETAK PDF (Nanti kita bahas fitur ini)
|
||||
public function print($id)
|
||||
{
|
||||
$rapot = Rapot::with('siswa')->findOrFail($id);
|
||||
return view('admin.rapot.print', compact('rapot'));
|
||||
}
|
||||
|
||||
// Edit & Update bisa menyesuaikan strukturnya sama dengan Store
|
||||
}
|
||||
|
|
@ -4,85 +4,69 @@
|
|||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\WaliMurid;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class WaliMuridController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$walis = WaliMurid::latest()->get();
|
||||
return view('admin.wali.index', compact('walis'));
|
||||
$walis = WaliMurid::with('user')->latest()->get();
|
||||
|
||||
// PERBAIKAN DI SINI: Sesuaikan dengan nama folder 'wali'
|
||||
return view('admin.wali.index', compact('walis'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// PERBAIKAN DI SINI JUGA
|
||||
return view('admin.wali.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_wali' => 'required|string|max:100',
|
||||
'no_hp' => 'nullable|string|max:20',
|
||||
'alamat' => 'nullable|string',
|
||||
'nama_wali' => 'required',
|
||||
'email' => 'required|email|unique:users,email',
|
||||
'password' => 'required|min:6',
|
||||
'no_hp' => 'required',
|
||||
]);
|
||||
|
||||
WaliMurid::create($request->all());
|
||||
|
||||
return redirect()->route('wali-murid.index')->with('success', 'Data Wali Murid berhasil ditambahkan.');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
// Kita pakai nama variable $data biar netral dan pasti beda
|
||||
$data = WaliMurid::with('user')->findOrFail($id);
|
||||
DB::transaction(function () use ($request) {
|
||||
|
||||
// Kirim ke view dengan nama 'data'
|
||||
return view('admin.wali.edit', compact('data'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$data = WaliMurid::findOrFail($id);
|
||||
|
||||
$request->validate([
|
||||
'nama_wali' => 'required|string|max:255',
|
||||
// Cek email unik kecuali user ini ($data->user_id)
|
||||
'email' => 'nullable|email|unique:users,email,' . ($data->user_id ?? 0),
|
||||
'no_hp' => 'nullable|string',
|
||||
'alamat' => 'nullable|string',
|
||||
// 1. Buat User Login
|
||||
$user = User::create([
|
||||
'name' => $request->nama_wali,
|
||||
'email' => $request->email,
|
||||
'password' => Hash::make($request->password),
|
||||
'role' => 'wali_murid',
|
||||
]);
|
||||
|
||||
// 1. Update User (Jika ada)
|
||||
if ($data->user) {
|
||||
$data->user->update([
|
||||
'name' => $request->nama_wali,
|
||||
'email' => $request->email,
|
||||
]);
|
||||
}
|
||||
|
||||
// 2. Update Data Wali
|
||||
$data->update([
|
||||
|
||||
// 2. Buat Profil Wali
|
||||
WaliMurid::create([
|
||||
'user_id' => $user->id,
|
||||
'nama_wali' => $request->nama_wali,
|
||||
'no_hp' => $request->no_hp,
|
||||
'alamat' => $request->alamat,
|
||||
'alamat' => $request->alamat,
|
||||
'pekerjaan' => $request->pekerjaan,
|
||||
]);
|
||||
|
||||
return redirect()->route('wali-murid.index')->with('success', 'Data Wali Murid berhasil diperbarui!');
|
||||
}
|
||||
|
||||
// --- DELETE (Perbaikan Hapus User juga) ---
|
||||
public function destroy($id)
|
||||
{
|
||||
$waliMurid = WaliMurid::findOrFail($id);
|
||||
|
||||
// Hapus akun loginnya juga biar bersih
|
||||
if ($waliMurid->user) {
|
||||
$waliMurid->user->delete();
|
||||
}
|
||||
|
||||
$waliMurid->delete();
|
||||
|
||||
return redirect()->route('wali-murid.index')->with('success', 'Data Wali Murid berhasil dihapus!');
|
||||
});
|
||||
|
||||
return redirect()->route('wali-murid.index')->with('success', 'Berhasil! Akun Wali Murid siap digunakan.');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$wali = WaliMurid::findOrFail($id);
|
||||
|
||||
if($wali->user) {
|
||||
$wali->user->delete();
|
||||
} else {
|
||||
$wali->delete();
|
||||
}
|
||||
|
||||
return redirect()->route('wali-murid.index')->with('success', 'Data Wali Murid berhasil dihapus');
|
||||
}
|
||||
}
|
||||
|
|
@ -12,26 +12,36 @@ public function showLogin()
|
|||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function login(Request $request)
|
||||
{
|
||||
$credentials = $request->only('email', 'password');
|
||||
|
||||
if (Auth::guard('web')->attempt($credentials)) {
|
||||
$request->session()->regenerate();
|
||||
return redirect()->intended('/dashboard');on()->regenerate();
|
||||
|
||||
// cek role di sini
|
||||
if (Auth::user()->role === 'admin') {
|
||||
return redirect()->intended('/dashboard');
|
||||
} else {
|
||||
Auth::logout();
|
||||
return back()->with('error', 'Hanya admin yang bisa login di website.');
|
||||
public function login(Request $request)
|
||||
{
|
||||
// 1. Ambil input email & password
|
||||
$credentials = $request->only('email', 'password');
|
||||
|
||||
// 2. Coba Login
|
||||
if (Auth::guard('web')->attempt($credentials)) {
|
||||
$request->session()->regenerate();
|
||||
|
||||
// --- 🛡️ SATPAM (LOGIKA BLOKIR) ---
|
||||
|
||||
// Cek Role User yang baru saja login
|
||||
$user = Auth::user();
|
||||
|
||||
// Jika role-nya 'wali_murid', TOLAK!
|
||||
if ($user->role === 'wali_murid') {
|
||||
Auth::logout(); // Logout paksa
|
||||
$request->session()->invalidate();
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
return back()->with('error', 'Maaf, Wali Murid hanya bisa login lewat Aplikasi Android!');
|
||||
}
|
||||
|
||||
// Jika Admin ATAU Guru, lolos ke Dashboard
|
||||
return redirect()->intended('/dashboard');
|
||||
}
|
||||
|
||||
// 3. Kalau email atau password salah
|
||||
return back()->with('error', 'Username atau password salah!');
|
||||
}
|
||||
}
|
||||
|
||||
// kalau email atau password salah
|
||||
return back()->with('error', 'Username atau password salah!');
|
||||
}
|
||||
public function logout(Request $request)
|
||||
{
|
||||
Auth::logout();
|
||||
|
|
|
|||
|
|
@ -5,20 +5,34 @@
|
|||
use Illuminate\Http\Request;
|
||||
use App\Models\Guru;
|
||||
use App\Models\Siswa;
|
||||
use App\Models\WaliMurid;
|
||||
use App\Models\Kelas;
|
||||
use App\Models\Kelas; // Pastikan model ini ada
|
||||
use App\Models\Pengumuman;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$pengumuman = Pengumuman::orderBy('created_at', 'desc')->first();
|
||||
$aktivitas = [
|
||||
(object)['deskripsi' => 'Admin menambahkan data guru', 'created_at' => now()],
|
||||
(object)['deskripsi' => 'Admin membuat pengumuman baru', 'created_at' => now()->subHour()],
|
||||
];
|
||||
// 1. STATISTIK
|
||||
$totalSiswa = Siswa::count();
|
||||
$totalGuru = Guru::count();
|
||||
// Cek dulu tabel kelas ada atau belum, kalau belum kasih 0
|
||||
$totalKelas = \Schema::hasTable('kelas') ? Kelas::count() : 0;
|
||||
|
||||
return view('dashboard', compact('pengumuman','aktivitas'));
|
||||
}
|
||||
// 2. PENGUMUMAN (Ambil 3 Terbaru yang Statusnya Aktif/1)
|
||||
$pengumuman = Pengumuman::where('status', 1)
|
||||
->orderBy('created_at', 'desc')
|
||||
->take(3)
|
||||
->get();
|
||||
|
||||
// 3. SISWA BARU (Untuk Tabel)
|
||||
$siswaBaru = Siswa::latest()->take(5)->get();
|
||||
|
||||
return view('dashboard', compact(
|
||||
'totalSiswa',
|
||||
'totalGuru',
|
||||
'totalKelas',
|
||||
'pengumuman',
|
||||
'siswaBaru'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -2,9 +2,24 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Anekdot extends Model
|
||||
{
|
||||
//
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "anekdots"; // Pastikan nama tabelnya sesuai
|
||||
|
||||
protected $fillable = [
|
||||
'siswa_id',
|
||||
'guru_id',
|
||||
'tanggal',
|
||||
'waktu',
|
||||
'tempat',
|
||||
'uraian_kejadian',
|
||||
'kejadian_teramati', // TAMBAHKAN INI
|
||||
'analisis_capaian',
|
||||
'foto',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,15 +9,13 @@ class Guru extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'guru'; // Sesuai DB kamu
|
||||
protected $table = 'guru'; // ✅ Sudah Benar (Sesuai tabelmu)
|
||||
|
||||
protected $fillable = [
|
||||
'nama_guru', // SEBELUMNYA 'nama' (SALAH), HARUS 'nama_guru'
|
||||
'jenis_guru', // SEBELUMNYA 'jenis_guru' (SUDAH BENAR TAPI INPUT FORM SALAH)
|
||||
'no_hp',
|
||||
'email',
|
||||
'user_id',
|
||||
];
|
||||
// ❌ HAPUS variable $fillable yang lama
|
||||
|
||||
// ✅ PAKAI INI SAJA (Jurus Anti Ribet)
|
||||
// Artinya: Izinkan semua data masuk ke database
|
||||
protected $guarded = [];
|
||||
|
||||
public function user()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,9 +2,21 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class HasilKarya extends Model
|
||||
{
|
||||
//
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "hasil_karyas"; // Pastikan nama tabelnya sesuai
|
||||
|
||||
protected $fillable = [
|
||||
'siswa_id',
|
||||
'guru_id',
|
||||
'tanggal',
|
||||
'foto',
|
||||
'deskripsi_foto', // Pastikan ini sama persis dengan DB
|
||||
'analisis_capaian'
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ class Pengumuman extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'pengumuman'; // <- perbaikan disini
|
||||
// Karena nama tabelnya 'pengumuman' (bukan pengumumans)
|
||||
protected $table = 'pengumuman';
|
||||
|
||||
protected $fillable = [
|
||||
'judul',
|
||||
|
|
@ -18,5 +19,11 @@ class Pengumuman extends Model
|
|||
'tanggal_selesai',
|
||||
'status',
|
||||
];
|
||||
}
|
||||
|
||||
// Casting agar tanggal otomatis jadi Carbon (bisa diformat tgl-bln-thn)
|
||||
protected $casts = [
|
||||
'tanggal_mulai' => 'date',
|
||||
'tanggal_selesai' => 'date',
|
||||
'status' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
|
@ -2,9 +2,27 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PenilaianCeklis extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
use HasFactory;
|
||||
|
||||
// Arahkan ke nama tabel yang benar
|
||||
protected $table = 'penilaian_ceklis';
|
||||
|
||||
protected $fillable = [
|
||||
'siswa_id',
|
||||
'guru_id',
|
||||
'indikator', // Sekarang sudah jadi teks
|
||||
'tanggal',
|
||||
'hasil', // Ingat, di database kamu namanya 'hasil'
|
||||
'keterangan'
|
||||
];
|
||||
|
||||
public function siswa()
|
||||
{
|
||||
return $this->belongsTo(Siswa::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,10 +9,29 @@ class Rapot extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
// Ini kuncinya biar semua kolom bisa diisi
|
||||
protected $guarded = [];
|
||||
protected $fillable = [
|
||||
'siswa_id', 'tahun_ajaran', 'semester', 'tanggal_rapot',
|
||||
|
||||
// NARASI A-E (Sesuai PDF)
|
||||
'narasi_agama', // A. AIK
|
||||
'narasi_budi_pekerti', // B. Budi Pekerti
|
||||
'narasi_jati_diri', // C. Jati Diri
|
||||
'narasi_literasi', // D. Literasi
|
||||
'narasi_kokurikuler', // E. Kokurikuler (Panjang)
|
||||
|
||||
// REFLEKSI & TTD
|
||||
'refleksi_orang_tua',
|
||||
'nama_guru', 'nipy_guru',
|
||||
'nama_kepala_sekolah', 'nipy_kepala_sekolah',
|
||||
|
||||
// FISIK & KEHADIRAN
|
||||
'tinggi_badan', 'berat_badan', 'lingkar_kepala',
|
||||
'sakit', 'izin', 'alpha',
|
||||
|
||||
// SISA (Biarkan p5 ada jika nanti butuh)
|
||||
'p5_tema', 'p5_judul', 'p5_narasi'
|
||||
];
|
||||
|
||||
// Relasi balik ke Siswa
|
||||
public function siswa()
|
||||
{
|
||||
return $this->belongsTo(Siswa::class);
|
||||
|
|
|
|||
|
|
@ -17,4 +17,19 @@ public function wali_murid()
|
|||
{
|
||||
return $this->belongsTo(WaliMurid::class, 'wali_murid_id');
|
||||
}
|
||||
|
||||
public function anekdots()
|
||||
{
|
||||
return $this->hasMany(Anekdot::class, 'siswa_id');
|
||||
}
|
||||
|
||||
public function hasilKaryas()
|
||||
{
|
||||
return $this->hasMany(HasilKarya::class, 'siswa_id');
|
||||
}
|
||||
|
||||
public function penilaianCeklis()
|
||||
{
|
||||
return $this->hasMany(PenilaianCeklis::class, 'siswa_id');
|
||||
}
|
||||
}
|
||||
|
|
@ -10,17 +10,16 @@
|
|||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
* GANTI FILLABLE DENGAN GUARDED
|
||||
* Agar kolom 'role' bisa diisi oleh Controller
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
];
|
||||
// protected $fillable = [ ... ]; <-- HAPUS ATAU KOMENTAR INI
|
||||
|
||||
// ✅ PAKAI INI (Jurus Open Gate):
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
|
|
@ -55,4 +54,4 @@ protected function casts(): array
|
|||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,22 +9,17 @@ class WaliMurid extends Model
|
|||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'wali_murids'; // Default laravel biasanya plural
|
||||
// Nama tabel di database kamu (Sesuai screenshot)
|
||||
protected $table = 'wali_murids';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'nama_wali', // Pastikan kolom di DB 'nama_wali', bukan 'nama'
|
||||
'no_hp',
|
||||
'alamat',
|
||||
'pekerjaan', // Opsional, jaga-jaga kalau butuh
|
||||
];
|
||||
// ✅ JURUS OPEN GATE: Izinkan semua data masuk (Alamat, Pekerjaan, dll)
|
||||
protected $guarded = [];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
// Relasi ke Siswa (Satu wali bisa punya banyak anak)
|
||||
public function siswas()
|
||||
{
|
||||
return $this->hasMany(Siswa::class, 'wali_id');
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public function up()
|
|||
Schema::create('siswas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nis')->nullable();
|
||||
$table->string('nama');
|
||||
$table->string('nama_siswa');
|
||||
$table->enum('jenis_kelamin', ['L', 'P'])->nullable();
|
||||
$table->date('tanggal_lahir')->nullable();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,21 +9,18 @@
|
|||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->enum('role', ['admin','guru','wali'])->default('wali');
|
||||
$table->string('phone')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
// Defaultnya 'admin' biar aman, atau 'guru'
|
||||
$table->string('role')->default('guru')->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('role');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,28 +6,29 @@
|
|||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('penilaian_ceklis', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('siswa_id')->constrained('siswas')->onDelete('cascade');
|
||||
$table->foreignId('guru_id')->constrained('users')->onDelete('cascade');
|
||||
$table->foreignId('indikator_id')->constrained('indikators')->onDelete('cascade');
|
||||
$table->date('tanggal');
|
||||
$table->enum('hasil', ['BSB', 'BSH', 'MB', 'BB']); // Skala Penilaian
|
||||
$table->text('keterangan')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
public function up(): void
|
||||
{
|
||||
// Kita gunakan nama tabel sesuai file kamu: 'penilaian_ceklis'
|
||||
Schema::create('penilaian_ceklis', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('siswa_id')->constrained('siswas')->onDelete('cascade');
|
||||
$table->foreignId('guru_id')->constrained('users')->onDelete('cascade');
|
||||
|
||||
// UBAH INI: Dari ID jadi Text supaya bisa copy-paste dari Word
|
||||
$table->text('indikator');
|
||||
|
||||
$table->date('tanggal');
|
||||
|
||||
// Sesuai screenshot kamu, namanya 'hasil' bukan 'skala'
|
||||
$table->enum('hasil', ['BSB', 'BSH', 'MB', 'BB']);
|
||||
|
||||
$table->text('keterangan')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('penilaian_ceklis');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// Cek tabel anekdots
|
||||
if (Schema::hasTable('anekdots')) {
|
||||
if (!Schema::hasColumn('anekdots', 'foto')) {
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
$table->string('foto')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Cek tabel hasil_karyas
|
||||
if (Schema::hasTable('hasil_karyas')) {
|
||||
if (!Schema::hasColumn('hasil_karyas', 'foto')) {
|
||||
Schema::table('hasil_karyas', function (Blueprint $table) {
|
||||
$table->string('foto')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('anekdots', 'foto')) {
|
||||
$table->dropColumn('foto');
|
||||
}
|
||||
});
|
||||
|
||||
Schema::table('hasil_karyas', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('hasil_karyas', 'foto')) {
|
||||
$table->dropColumn('foto');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
// Tambahkan kolom waktu setelah kolom tanggal
|
||||
$table->string('waktu')->after('tanggal')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
$table->dropColumn('waktu');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('anekdots', 'tanggal')) $table->date('tanggal')->nullable()->after('siswa_id');
|
||||
if (!Schema::hasColumn('anekdots', 'waktu')) $table->string('waktu')->nullable()->after('tanggal');
|
||||
if (!Schema::hasColumn('anekdots', 'tempat')) $table->string('tempat')->nullable()->after('waktu');
|
||||
if (!Schema::hasColumn('anekdots', 'uraian_kejadian')) $table->text('uraian_kejadian')->nullable()->after('tempat');
|
||||
if (!Schema::hasColumn('anekdots', 'analisis_capaian')) $table->text('analisis_capaian')->nullable()->after('uraian_kejadian');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('anekdots', function (Blueprint $table) {
|
||||
$table->dropColumn(['tanggal', 'waktu', 'tempat', 'uraian_kejadian', 'analisis_capaian']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('rapots', function (Blueprint $table) {
|
||||
|
||||
// 1. Cek Kolom A (Agama). Kalau belum ada, kita buat.
|
||||
// Kita hapus 'after' supaya aman dan tidak error.
|
||||
if (!Schema::hasColumn('rapots', 'narasi_agama')) {
|
||||
$table->text('narasi_agama')->nullable();
|
||||
}
|
||||
|
||||
// 2. Cek Kolom B (Budi Pekerti). Kalau belum ada, buat.
|
||||
if (!Schema::hasColumn('rapots', 'narasi_budi_pekerti')) {
|
||||
$table->text('narasi_budi_pekerti')->nullable();
|
||||
}
|
||||
|
||||
// 3. Cek Kolom E (Kokurikuler) sekalian.
|
||||
if (!Schema::hasColumn('rapots', 'narasi_kokurikuler')) {
|
||||
$table->text('narasi_kokurikuler')->nullable();
|
||||
}
|
||||
|
||||
// 4. Pastikan kolom C & D juga aman
|
||||
if (!Schema::hasColumn('rapots', 'narasi_jati_diri')) {
|
||||
$table->text('narasi_jati_diri')->nullable();
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'narasi_literasi')) {
|
||||
$table->text('narasi_literasi')->nullable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Kosongkan saja agar aman saat rollback
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('rapots', function (Blueprint $table) {
|
||||
|
||||
// 1. Cek Kolom Refleksi
|
||||
if (!Schema::hasColumn('rapots', 'refleksi_orang_tua')) {
|
||||
$table->text('refleksi_orang_tua')->nullable();
|
||||
}
|
||||
|
||||
// 2. Cek Kolom Nama Guru
|
||||
if (!Schema::hasColumn('rapots', 'nama_guru')) {
|
||||
$table->string('nama_guru')->nullable();
|
||||
}
|
||||
|
||||
// 3. Cek Kolom NIPY Guru
|
||||
if (!Schema::hasColumn('rapots', 'nipy_guru')) {
|
||||
$table->string('nipy_guru')->nullable();
|
||||
}
|
||||
|
||||
// 4. Cek Kolom Kepala Sekolah
|
||||
if (!Schema::hasColumn('rapots', 'nama_kepala_sekolah')) {
|
||||
$table->string('nama_kepala_sekolah')->nullable();
|
||||
}
|
||||
|
||||
// 5. Cek Kolom NIPY Kepala Sekolah
|
||||
if (!Schema::hasColumn('rapots', 'nipy_kepala_sekolah')) {
|
||||
$table->string('nipy_kepala_sekolah')->nullable();
|
||||
}
|
||||
|
||||
// 6. Pastikan Tanggal Rapot tipe Date (ubah kalau perlu)
|
||||
if (Schema::hasColumn('rapots', 'tanggal_rapot')) {
|
||||
$table->date('tanggal_rapot')->nullable()->change();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Kosongkan agar aman saat rollback
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::table('rapots', function (Blueprint $table) {
|
||||
// Kita tambahkan kolom jika belum ada
|
||||
if (!Schema::hasColumn('rapots', 'narasi_budi_pekerti')) {
|
||||
$table->text('narasi_budi_pekerti')->nullable()->after('narasi_agama');
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'narasi_kokurikuler')) {
|
||||
$table->text('narasi_kokurikuler')->nullable()->after('narasi_literasi');
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'refleksi_orang_tua')) {
|
||||
$table->text('refleksi_orang_tua')->nullable();
|
||||
}
|
||||
// Data Tanda Tangan
|
||||
if (!Schema::hasColumn('rapots', 'nama_guru')) {
|
||||
$table->string('nama_guru')->nullable();
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'nipy_guru')) {
|
||||
$table->string('nipy_guru')->nullable();
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'nama_kepala_sekolah')) {
|
||||
$table->string('nama_kepala_sekolah')->nullable();
|
||||
}
|
||||
if (!Schema::hasColumn('rapots', 'nipy_kepala_sekolah')) {
|
||||
$table->string('nipy_kepala_sekolah')->nullable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
// Tidak perlu drop column agar data aman
|
||||
}
|
||||
};
|
||||
|
|
@ -29,6 +29,14 @@ public function run(): void
|
|||
SiswaSeeder::class, // Data Siswa (Fixed)
|
||||
]);
|
||||
|
||||
// 2. Buat Akun GURU (Contoh: Bu Dwi)
|
||||
User::create([
|
||||
'name' => 'Dwi Lestari, S.Pd',
|
||||
'email' => 'guru@gmail.com',
|
||||
'password' => Hash::make('password'),
|
||||
'role' => 'guru',
|
||||
]);
|
||||
|
||||
// CATATAN: Jangan panggil MasterSeeder lagi karena kodenya usang.
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ public function run()
|
|||
// Data diambil dari CSV yang kamu kirim (Sample 5 Siswa dulu biar cepat)
|
||||
$siswas = [
|
||||
[
|
||||
'nama' => 'Abdila Kaivan Baihaqi Alzafa',
|
||||
'nama_siswa' => 'Abdila Kaivan Baihaqi Alzafa', // SUDAH DIPERBAIKI (nama -> nama_siswa)
|
||||
'nis' => '2024247',
|
||||
'jenis_kelamin' => 'L',
|
||||
'tanggal_lahir' => '2018-03-10',
|
||||
|
|
@ -20,7 +20,7 @@ public function run()
|
|||
'kelompok_id' => 1
|
||||
],
|
||||
[
|
||||
'nama' => 'Hanifah Syafi\'a', // Pakai backslash (\) sebelum tanda petik satu
|
||||
'nama_siswa' => 'Hanifah Syafi\'a',
|
||||
'nis' => '2024268',
|
||||
'jenis_kelamin' => 'P',
|
||||
'tanggal_lahir' => '2019-05-12',
|
||||
|
|
@ -28,7 +28,7 @@ public function run()
|
|||
'kelompok_id' => 1
|
||||
],
|
||||
[
|
||||
'nama' => 'Abrizam Rafka Danindra',
|
||||
'nama_siswa' => 'Abrizam Rafka Danindra',
|
||||
'nis' => '2024271',
|
||||
'jenis_kelamin' => 'L',
|
||||
'tanggal_lahir' => '2019-07-15',
|
||||
|
|
@ -36,7 +36,7 @@ public function run()
|
|||
'kelompok_id' => 1
|
||||
],
|
||||
[
|
||||
'nama' => 'Achazia Nakhi Shankara',
|
||||
'nama_siswa' => 'Achazia Nakhi Shankara',
|
||||
'nis' => '222285',
|
||||
'jenis_kelamin' => 'L',
|
||||
'tanggal_lahir' => '2021-03-30',
|
||||
|
|
@ -44,7 +44,7 @@ public function run()
|
|||
'kelompok_id' => 1
|
||||
],
|
||||
[
|
||||
'nama' => 'Ahmad Farzan Wisanggeni',
|
||||
'nama_siswa' => 'Ahmad Farzan Wisanggeni',
|
||||
'nis' => '2023233',
|
||||
'jenis_kelamin' => 'L',
|
||||
'tanggal_lahir' => '2019-01-10',
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
|
|
@ -0,0 +1,83 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-4xl mx-auto py-8 px-4">
|
||||
<div class="flex items-center justify-between mb-8">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-800">📝 Catatan Anekdot Baru</h1>
|
||||
<p class="text-sm text-gray-500">Mencatat peristiwa penting perkembangan siswa</p>
|
||||
</div>
|
||||
{{-- Ganti yang error tadi dengan ini --}}
|
||||
<a href="{{ route('perkembangan.show', $siswa->id) }}" class="flex items-center text-gray-600 hover:text-green-600 transition">
|
||||
<i class="fas fa-arrow-left mr-2"></i> Kembali ke Profil Siswa
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-green-50 border-l-4 border-green-500 p-4 mb-6 rounded-r-lg shadow-sm">
|
||||
<div class="flex items-center">
|
||||
<div class="bg-green-100 p-3 rounded-full mr-4 text-2xl">🧒</div>
|
||||
<div>
|
||||
<p class="text-xs text-green-700 font-bold uppercase tracking-wider">Siswa:</p>
|
||||
<p class="text-lg font-bold text-green-900">{{ $siswa->nama_siswa }}</p>
|
||||
<p class="text-sm text-green-600">NIS: {{ $siswa->nis }} | Kelompok: {{ $siswa->kelompok_id ?? '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('anekdot.store', $siswa->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
<div class="p-6 md:p-8 space-y-6">
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📅 Tanggal Kejadian</label>
|
||||
<input type="date" name="tanggal" value="{{ date('Y-m-d') }}" class="w-full border border-gray-300 rounded-lg p-2.5 focus:ring-2 focus:ring-green-500 focus:outline-none" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">⏰ Waktu / Jam</label>
|
||||
<select name="waktu" class="w-full border border-gray-300 rounded-lg p-2.5 focus:ring-2 focus:ring-green-500 focus:outline-none" required>
|
||||
<option value="Pagi (Datang)">Pagi (Datang)</option>
|
||||
<option value="Kegiatan Inti">Kegiatan Inti</option>
|
||||
<option value="Istirahat / Makan">Istirahat / Makan</option>
|
||||
<option value="Siang (Pulang)">Siang (Pulang)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📍 Tempat Kejadian</label>
|
||||
<input type="text" name="tempat" placeholder="Contoh: Taman Bermain" class="w-full border border-gray-300 rounded-lg p-2.5 focus:ring-2 focus:ring-green-500 focus:outline-none" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="border-gray-100">
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📖 Uraian Kejadian (Fakta)</label>
|
||||
<p class="text-xs text-gray-400 mb-2">*Tuliskan apa yang dilihat dan didengar secara objektif tanpa opini.</p>
|
||||
<textarea name="uraian_kejadian" rows="5" class="w-full border border-gray-300 rounded-lg p-3 focus:ring-2 focus:ring-green-500 focus:outline-none" placeholder="Contoh: Saat istirahat, Budi membagikan bekalnya kepada temannya yang tidak membawa makanan..." required></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">🧠 Analisis Capaian (Capaian Pembelajaran)</label>
|
||||
<p class="text-xs text-gray-400 mb-2">*Tuliskan nilai agama, jati diri, atau literasi yang muncul dari kejadian ini.</p>
|
||||
<textarea name="analisis_capaian" rows="3" class="w-full border border-gray-300 rounded-lg p-3 focus:ring-2 focus:ring-green-500 focus:outline-none" placeholder="Contoh: Muncul perilaku positif dalam berbagi (Nilai Agama dan Budi Pekerti)..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="bg-gray-50 p-6 rounded-xl border-2 border-dashed border-gray-200">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📸 Foto Dokumentasi (Opsional)</label>
|
||||
<div class="flex items-center justify-center w-full mt-2">
|
||||
<input type="file" name="foto" class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-green-50 file:text-green-700 hover:file:bg-green-100 transition">
|
||||
</div>
|
||||
<p class="text-[10px] text-gray-400 mt-2 italic">*Hanya file gambar (JPG, PNG). Ukuran maksimal 2MB.</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bg-gray-50 px-6 py-4 flex justify-end">
|
||||
<button type="submit" class="bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-8 rounded-xl shadow-lg transition transform hover:-translate-y-1 active:scale-95">
|
||||
💾 Simpan Catatan Anekdot
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-4xl mx-auto py-8 px-4">
|
||||
<div class="flex items-center justify-between mb-8">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-800">✅ Input Penilaian Ceklis</h1>
|
||||
<p class="text-sm text-gray-500">Siswa: {{ $siswa->nama_siswa }}</p>
|
||||
</div>
|
||||
<a href="{{ route('perkembangan.show', $siswa->id) }}" class="text-gray-600 hover:text-orange-600 transition">
|
||||
← Kembali
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('ceklis.store', $siswa->id) }}" method="POST" class="bg-white shadow-xl rounded-2xl overflow-hidden border border-gray-100 p-6">
|
||||
@csrf
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📅 Tanggal</label>
|
||||
<input type="date" name="tanggal" value="{{ date('Y-m-d') }}" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-orange-500" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">🎯 Indikator (Salin dari Word)</label>
|
||||
<textarea name="indikator" rows="2" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-orange-500" placeholder="Contoh: Anak disiplin mengikuti upacara..." required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-4">📊 Hasil Capaian (Pilih Satu)</label>
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<label class="cursor-pointer">
|
||||
<input type="radio" name="hasil" value="BB" class="peer sr-only" required>
|
||||
<div class="p-4 rounded-lg border-2 border-gray-200 peer-checked:border-red-500 peer-checked:bg-red-50 hover:bg-gray-50 text-center transition">
|
||||
<span class="block text-xl mb-1">🔴</span><span class="font-bold text-red-600">BB</span>
|
||||
</div>
|
||||
</label>
|
||||
<label class="cursor-pointer">
|
||||
<input type="radio" name="hasil" value="MB" class="peer sr-only">
|
||||
<div class="p-4 rounded-lg border-2 border-gray-200 peer-checked:border-yellow-500 peer-checked:bg-yellow-50 hover:bg-gray-50 text-center transition">
|
||||
<span class="block text-xl mb-1">🟡</span><span class="font-bold text-yellow-600">MB</span>
|
||||
</div>
|
||||
</label>
|
||||
<label class="cursor-pointer">
|
||||
<input type="radio" name="hasil" value="BSH" class="peer sr-only">
|
||||
<div class="p-4 rounded-lg border-2 border-gray-200 peer-checked:border-blue-500 peer-checked:bg-blue-50 hover:bg-gray-50 text-center transition">
|
||||
<span class="block text-xl mb-1">🔵</span><span class="font-bold text-blue-600">BSH</span>
|
||||
</div>
|
||||
</label>
|
||||
<label class="cursor-pointer">
|
||||
<input type="radio" name="hasil" value="BSB" class="peer sr-only">
|
||||
<div class="p-4 rounded-lg border-2 border-gray-200 peer-checked:border-green-500 peer-checked:bg-green-50 hover:bg-gray-50 text-center transition">
|
||||
<span class="block text-xl mb-1">🟢</span><span class="font-bold text-green-600">BSB</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-8">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📝 Keterangan / Kejadian Teramati</label>
|
||||
<textarea name="keterangan" rows="3" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-orange-500" placeholder="Salin dari kolom keterangan file Word..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="bg-orange-500 hover:bg-orange-600 text-white font-bold py-3 px-8 rounded-xl shadow-lg transition transform hover:-translate-y-1">
|
||||
💾 Simpan
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,38 +1,81 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-xl mx-auto">
|
||||
<h1 class="text-xl font-semibold text-gray-700 mb-4">➕ Tambah Guru</h1>
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-2xl mx-auto mt-10">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-xl font-bold text-gray-700">➕ Tambah Guru Baru</h1>
|
||||
<a href="{{ route('guru.index') }}" class="text-gray-500 hover:text-gray-700">← Kembali</a>
|
||||
</div>
|
||||
|
||||
{{-- Tampilkan Error Validasi --}}
|
||||
@if ($errors->any())
|
||||
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4">
|
||||
<ul class="list-disc list-inside">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{ route('guru.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">Nama Guru</label>
|
||||
{{-- Name harus 'nama_guru', bukan 'nama' --}}
|
||||
<input type="text" name="nama_guru" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300" required>
|
||||
<div class="mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 border-b pb-2 mb-4">Biodata Guru</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Nama Lengkap</label>
|
||||
<input type="text" name="nama_guru" value="{{ old('nama_guru') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none" required placeholder="Contoh: Siti Aminah, S.Pd">
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Jenis Guru</label>
|
||||
<select name="jenis_guru" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
<option value="guru_kelas">Guru Kelas</option>
|
||||
<option value="shadow_abk">Shadow ABK</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">No HP / WA</label>
|
||||
<input type="text" name="no_hp" value="{{ old('no_hp') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none" placeholder="0812...">
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">NIP (Opsional)</label>
|
||||
<input type="text" name="nip" value="{{ old('nip') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Alamat Rumah</label>
|
||||
<textarea name="alamat" rows="2" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">{{ old('alamat') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">Jenis Guru</label>
|
||||
{{-- Ganti input text 'bidang' jadi Select 'jenis_guru' sesuai Enum DB --}}
|
||||
<select name="jenis_guru" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300">
|
||||
<option value="guru_kelas">Guru Kelas</option>
|
||||
<option value="shadow_abk">Shadow ABK</option>
|
||||
</select>
|
||||
<div class="bg-blue-50 p-4 rounded-lg border border-blue-200 mb-6">
|
||||
<h2 class="text-lg font-bold text-blue-800 mb-2 flex items-center gap-2">🔐 Buat Akun Login</h2>
|
||||
<p class="text-sm text-gray-600 mb-4">Data ini digunakan guru untuk masuk ke dalam aplikasi.</p>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Email</label>
|
||||
<input type="email" name="email" value="{{ old('email') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-blue-500 focus:outline-none" required placeholder="guru@sekolah.com">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Password</label>
|
||||
<input type="password" name="password" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-blue-500 focus:outline-none" required placeholder="Minimal 6 karakter">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">No HP</label>
|
||||
<input type="text" name="no_hp" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300">
|
||||
<div class="flex justify-end gap-3">
|
||||
<button type="submit" class="bg-green-600 text-white font-semibold px-6 py-2 rounded-lg hover:bg-green-700 transition shadow-md">
|
||||
💾 Simpan Data
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">Email</label>
|
||||
<input type="email" name="email" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300">
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">Simpan</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-xl mx-auto mt-10">
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-2xl mx-auto mt-10">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-xl font-bold text-gray-700">✏️ Edit Data Guru</h1>
|
||||
<a href="{{ route('guru.index') }}" class="text-gray-500 hover:text-gray-700">← Kembali</a>
|
||||
</div>
|
||||
|
||||
{{-- Cek Error --}}
|
||||
@if ($errors->any())
|
||||
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4" role="alert">
|
||||
<p class="font-bold">Gagal Menyimpan:</p>
|
||||
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4">
|
||||
<ul class="list-disc list-inside">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
|
|
@ -22,53 +20,59 @@
|
|||
<form action="{{ route('guru.update', $guru->id) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700 font-medium mb-1">Nama Guru</label>
|
||||
{{-- Ambil langsung dari tabel guru kolom nama_guru --}}
|
||||
<input type="text" name="nama_guru"
|
||||
value="{{ old('nama_guru', $guru->nama_guru) }}"
|
||||
class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700 font-medium mb-1">Email</label>
|
||||
<input type="email" name="email"
|
||||
value="{{ old('email', $guru->email) }}"
|
||||
class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none"
|
||||
required>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700 font-medium mb-1">No HP</label>
|
||||
<input type="text" name="no_hp"
|
||||
value="{{ old('no_hp', $guru->no_hp) }}"
|
||||
class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
</div>
|
||||
<div class="mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 border-b pb-2 mb-4">Biodata Guru</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Nama Lengkap</label>
|
||||
<input type="text" name="nama_guru" value="{{ old('nama_guru', $guru->nama_guru) }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Jenis Guru</label>
|
||||
<select name="jenis_guru" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
|
||||
{{-- Opsi 1: Guru Kelas --}}
|
||||
<option value="guru_kelas"
|
||||
{{ old('jenis_guru', $guru->jenis_guru) == 'guru_kelas' ? 'selected' : '' }}>
|
||||
Guru Kelas
|
||||
</option>
|
||||
|
||||
{{-- Opsi 2: Shadow ABK --}}
|
||||
<option value="shadow_abk"
|
||||
{{ old('jenis_guru', $guru->jenis_guru) == 'shadow_abk' ? 'selected' : '' }}>
|
||||
Shadow ABK
|
||||
</option>
|
||||
|
||||
<option value="guru_kelas" {{ $guru->jenis_guru == 'guru_kelas' ? 'selected' : '' }}>Guru Kelas</option>
|
||||
<option value="shadow_abk" {{ $guru->jenis_guru == 'shadow_abk' ? 'selected' : '' }}>Shadow ABK</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-6 gap-3">
|
||||
<button type="submit"
|
||||
class="bg-green-600 text-white font-semibold px-6 py-2 rounded-lg hover:bg-green-700 transition duration-200 shadow-md">
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">No HP / WA</label>
|
||||
<input type="text" name="no_hp" value="{{ old('no_hp', $guru->no_hp) }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">NIP (Opsional)</label>
|
||||
<input type="text" name="nip" value="{{ old('nip', $guru->nip) }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Alamat Rumah</label>
|
||||
<textarea name="alamat" rows="2" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">{{ old('alamat', $guru->alamat) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-yellow-50 p-4 rounded-lg border border-yellow-200 mb-6">
|
||||
<h2 class="text-lg font-bold text-yellow-800 mb-2 flex items-center gap-2">🔐 Pengaturan Akun Login</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Email Login</label>
|
||||
<input type="email" name="email" value="{{ old('email', $guru->email) }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-yellow-500 focus:outline-none" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Password Baru</label>
|
||||
<input type="password" name="password" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-yellow-500 focus:outline-none" placeholder="Kosongkan jika tidak ingin ganti">
|
||||
<p class="text-xs text-gray-500 mt-1">*Isi hanya jika ingin mengganti password login.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<button type="submit" class="bg-green-600 text-white font-semibold px-6 py-2 rounded-lg hover:bg-green-700 transition shadow-md">
|
||||
💾 Simpan Perubahan
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-4xl mx-auto py-8 px-4">
|
||||
<div class="flex items-center justify-between mb-8">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-800">🎨 Upload Hasil Karya</h1>
|
||||
<p class="text-sm text-gray-500">Siswa: {{ $siswa->nama_siswa }}</p>
|
||||
</div>
|
||||
<a href="{{ route('perkembangan.show', $siswa->id) }}" class="text-gray-600 hover:text-purple-600 transition">
|
||||
← Kembali
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('hasil-karya.store', $siswa->id) }}" method="POST" enctype="multipart/form-data" class="bg-white shadow-xl rounded-2xl overflow-hidden border border-gray-100 p-6">
|
||||
@csrf
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📅 Tanggal Karya</label>
|
||||
<input type="date" name="tanggal" value="{{ date('Y-m-d') }}" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-purple-500" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📸 Foto Karya</label>
|
||||
<div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center bg-gray-50 hover:bg-gray-100 transition">
|
||||
<input type="file" name="foto" class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:bg-purple-50 file:text-purple-700 hover:file:bg-purple-100" required>
|
||||
<p class="text-xs text-gray-400 mt-2">*Format: JPG/PNG. Wajib diisi.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">📝 Deskripsi Karya (Apa yang anak buat?)</label>
|
||||
<textarea name="deskripsi_foto" rows="3" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-purple-500" placeholder="Contoh: Menggambar pemandangan gunung dengan krayon..." required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-6">
|
||||
<label class="block text-sm font-bold text-gray-700 mb-2">🧠 Analisis Capaian (Opsional)</label>
|
||||
<textarea name="analisis_capaian" rows="3" class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-purple-500" placeholder="Contoh: Ananda sudah mampu memadukan warna dengan baik..."></textarea>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button type="submit" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 px-8 rounded-xl shadow-lg transition transform hover:-translate-y-1">
|
||||
💾 Simpan Karya
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6 mb-6 flex justify-between items-center border-l-4 border-green-600">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-800">{{ $siswa->nama_siswa }}</h1>
|
||||
|
|
@ -16,43 +16,48 @@
|
|||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
|
||||
{{-- Tombol Anekdot --}}
|
||||
<a href="#" class="bg-blue-50 hover:bg-blue-100 text-blue-700 font-semibold py-4 px-6 rounded-lg border border-blue-200 shadow-sm transition flex flex-col items-center justify-center gap-1">
|
||||
<span class="flex items-center gap-2 text-lg">📝 Catatan Anekdot</span>
|
||||
<span class="text-xs bg-blue-200 text-blue-800 px-2 py-1 rounded-full">{{ $anekdots->count() }} Data</span>
|
||||
</a>
|
||||
|
||||
{{-- Tombol Hasil Karya --}}
|
||||
<a href="#" class="bg-purple-50 hover:bg-purple-100 text-purple-700 font-semibold py-4 px-6 rounded-lg border border-purple-200 shadow-sm transition flex flex-col items-center justify-center gap-1">
|
||||
<span class="flex items-center gap-2 text-lg">🎨 Hasil Karya</span>
|
||||
<span class="text-xs bg-purple-200 text-purple-800 px-2 py-1 rounded-full">{{ $karyas->count() }} Data</span>
|
||||
</a>
|
||||
|
||||
{{-- Tombol Ceklis --}}
|
||||
<a href="#" class="bg-orange-50 hover:bg-orange-100 text-orange-700 font-semibold py-4 px-6 rounded-lg border border-orange-200 shadow-sm transition flex flex-col items-center justify-center gap-1">
|
||||
<span class="flex items-center gap-2 text-lg">✅ Ceklis Capaian</span>
|
||||
<span class="text-xs bg-orange-200 text-orange-800 px-2 py-1 rounded-full">{{ $ceklis->count() }} Data</span>
|
||||
</a>
|
||||
</div>
|
||||
{{-- 1. Tombol Anekdot --}}
|
||||
<a href="{{ route('anekdot.create', $siswa->id) }}" class="flex flex-col items-center p-4 bg-blue-500 text-white rounded-lg shadow hover:bg-blue-600 transition relative overflow-hidden group">
|
||||
<span class="text-2xl mb-2 group-hover:scale-110 transition">📝</span>
|
||||
<span class="font-bold">Catatan Anekdot</span>
|
||||
<span class="text-xs bg-blue-700 text-white px-3 py-1 rounded-full mt-2 shadow-sm border border-blue-400">
|
||||
{{ $siswa->anekdots->count() }} Data
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<div class="bg-white shadow-lg rounded-xl overflow-hidden">
|
||||
{{-- 2. Tombol Hasil Karya --}}
|
||||
<a href="{{ route('hasil-karya.create', $siswa->id) }}" class="flex flex-col items-center p-4 bg-purple-500 text-white rounded-lg shadow hover:bg-purple-600 transition relative overflow-hidden group">
|
||||
<span class="text-2xl mb-2 group-hover:scale-110 transition">🎨</span>
|
||||
<span class="font-bold">Hasil Karya</span>
|
||||
<span class="text-xs bg-purple-700 text-white px-3 py-1 rounded-full mt-2 shadow-sm border border-purple-400">
|
||||
{{ $siswa->hasilKaryas->count() }} Data
|
||||
</span>
|
||||
</a>
|
||||
|
||||
{{-- 3. Tombol Ceklis --}}
|
||||
<a href="{{ route('ceklis.create', $siswa->id) }}" class="flex flex-col items-center p-4 bg-orange-500 text-white rounded-lg shadow hover:bg-orange-600 transition relative overflow-hidden group">
|
||||
<span class="text-2xl mb-2 group-hover:scale-110 transition">✅</span>
|
||||
<span class="font-bold">Ceklis Capaian</span>
|
||||
<span class="text-xs bg-orange-700 text-white px-3 py-1 rounded-full mt-2 shadow-sm border border-orange-400">
|
||||
{{ $siswa->penilaianCeklis->count() }} Data
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow-lg rounded-xl overflow-hidden mb-10">
|
||||
<div class="bg-gray-800 text-white p-4 flex justify-between items-center">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2">
|
||||
🎓 Riwayat Rapot Semester
|
||||
</h2>
|
||||
<h2 class="text-lg font-bold flex items-center gap-2">🎓 Riwayat Rapot Semester</h2>
|
||||
<a href="{{ route('rapot.create', $siswa->id) }}" class="bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded shadow transition duration-200 text-sm flex items-center gap-2">
|
||||
➕ Buat Rapot Baru
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="p-0">
|
||||
<div class="p-0 overflow-x-auto">
|
||||
<table class="min-w-full bg-white">
|
||||
<thead class="bg-gray-100 text-gray-600 uppercase text-xs font-bold">
|
||||
<tr>
|
||||
<th class="py-3 px-6 text-left">Tahun Ajaran</th>
|
||||
<th class="py-3 px-6 text-center">Semester</th>
|
||||
<th class="py-3 px-6 text-center">Tanggal Rapot</th>
|
||||
<th class="py-3 px-6 text-center">Status P5</th>
|
||||
<th class="py-3 px-6 text-center">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -60,45 +65,172 @@
|
|||
@forelse($rapots as $rapot)
|
||||
<tr class="border-b hover:bg-gray-50 transition">
|
||||
<td class="py-4 px-6 font-medium">{{ $rapot->tahun_ajaran }}</td>
|
||||
<td class="py-4 px-6 text-center">
|
||||
<span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs font-bold">
|
||||
Semester {{ $rapot->semester }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="py-4 px-6 text-center">
|
||||
{{ \Carbon\Carbon::parse($rapot->tanggal_rapot)->translatedFormat('d F Y') }}
|
||||
</td>
|
||||
<td class="py-4 px-6 text-center">
|
||||
@if($rapot->p5_tema)
|
||||
<span class="text-xs text-green-600 font-semibold">✅ Ada Projek</span>
|
||||
@else
|
||||
<span class="text-xs text-gray-400">-</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="py-4 px-6 text-center"><span class="bg-blue-100 text-blue-800 px-2 py-1 rounded text-xs font-bold">Semester {{ $rapot->semester }}</span></td>
|
||||
<td class="py-4 px-6 text-center">{{ \Carbon\Carbon::parse($rapot->tanggal_rapot)->translatedFormat('d F Y') }}</td>
|
||||
<td class="py-4 px-6 text-center flex justify-center gap-2">
|
||||
<a href="{{ route('rapot.show', $rapot->id) }}" class="text-blue-500 hover:text-blue-700 font-semibold border border-blue-500 hover:bg-blue-50 px-3 py-1 rounded transition">
|
||||
👁️ Lihat
|
||||
</a>
|
||||
<a href="#" class="text-red-500 hover:text-red-700 font-semibold border border-red-500 hover:bg-red-50 px-3 py-1 rounded transition">
|
||||
🖨️ PDF
|
||||
</a>
|
||||
<a href="{{ route('rapot.show', $rapot->id) }}" class="text-blue-500 hover:text-blue-700 font-semibold border border-blue-500 px-3 py-1 rounded transition">👁️ Lihat</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="text-center py-8 text-gray-400">
|
||||
<div class="flex flex-col items-center">
|
||||
<span class="text-4xl mb-2">📄</span>
|
||||
<p>Belum ada rapot yang dibuat untuk siswa ini.</p>
|
||||
<p class="text-xs mt-1">Klik tombol <b>"Buat Rapot Baru"</b> di pojok kanan atas.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="4" class="text-center py-8 text-gray-400">Belum ada rapot.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mb-10">
|
||||
<div class="bg-blue-600 text-white p-4 rounded-t-xl">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2">📝 Riwayat Catatan Anekdot</h2>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$anekdotGroup = $siswa->anekdots->sortByDesc('tanggal')->groupBy(function($item) {
|
||||
return \Carbon\Carbon::parse($item->tanggal)->translatedFormat('F Y');
|
||||
});
|
||||
@endphp
|
||||
|
||||
<div class="bg-white border-x border-b border-gray-200 rounded-b-xl p-4">
|
||||
@forelse($anekdotGroup as $bulan => $items)
|
||||
<details class="group mb-2" open>
|
||||
<summary class="flex justify-between items-center font-medium cursor-pointer list-none bg-blue-50 hover:bg-blue-100 p-3 rounded-lg text-blue-800">
|
||||
<span class="flex items-center gap-2">
|
||||
<span class="transition group-open:rotate-90">▶</span> 📂 {{ $bulan }}
|
||||
</span>
|
||||
<span class="text-xs bg-white text-blue-600 px-2 py-1 rounded-full border border-blue-200">{{ $items->count() }} Data</span>
|
||||
</summary>
|
||||
<div class="text-gray-500 mt-2 pl-4 space-y-4 pb-4 border-l-2 border-blue-100 ml-3">
|
||||
@foreach($items as $ad)
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm border border-gray-100 relative">
|
||||
<div class="absolute -left-[25px] top-4 w-4 h-4 bg-blue-500 rounded-full border-4 border-white"></div>
|
||||
<p class="text-xs text-gray-400 mb-1">📅 {{ \Carbon\Carbon::parse($ad->tanggal)->translatedFormat('d F Y') }} | ⏰ {{ $ad->waktu }}</p>
|
||||
<p class="font-bold text-gray-800">"{{ $ad->uraian_kejadian }}"</p>
|
||||
@if($ad->foto)
|
||||
<img src="{{ asset('storage/anekdot/' . $ad->foto) }}" class="mt-2 w-32 h-32 object-cover rounded-lg border">
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</details>
|
||||
@empty
|
||||
<div class="text-center py-6 text-gray-400">Belum ada catatan anekdot.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-10">
|
||||
<div class="bg-purple-600 text-white p-4 rounded-t-xl">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2">🎨 Riwayat Hasil Karya</h2>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$karyaGroup = $siswa->hasilKaryas->sortByDesc('tanggal')->groupBy(function($item) {
|
||||
return \Carbon\Carbon::parse($item->tanggal)->translatedFormat('F Y');
|
||||
});
|
||||
@endphp
|
||||
|
||||
<div class="bg-white border-x border-b border-gray-200 rounded-b-xl p-4">
|
||||
@forelse($karyaGroup as $bulan => $items)
|
||||
<details class="group mb-2">
|
||||
<summary class="flex justify-between items-center font-medium cursor-pointer list-none bg-purple-50 hover:bg-purple-100 p-3 rounded-lg text-purple-800">
|
||||
<span class="flex items-center gap-2">
|
||||
<span class="transition group-open:rotate-90">▶</span> 📂 {{ $bulan }}
|
||||
</span>
|
||||
<span class="text-xs bg-white text-purple-600 px-2 py-1 rounded-full border border-purple-200">{{ $items->count() }} Data</span>
|
||||
</summary>
|
||||
<div class="text-gray-500 mt-2 pl-4 grid grid-cols-1 md:grid-cols-2 gap-4 pb-4">
|
||||
@foreach($items as $hk)
|
||||
<div class="flex gap-4 p-3 bg-white rounded-lg border border-purple-100 shadow-sm">
|
||||
@if($hk->foto)
|
||||
<img src="{{ asset('storage/hasil_karya/' . $hk->foto) }}" class="w-20 h-20 object-cover rounded-lg flex-shrink-0">
|
||||
@endif
|
||||
<div>
|
||||
<p class="text-xs font-bold text-purple-600">{{ \Carbon\Carbon::parse($hk->tanggal)->translatedFormat('d M Y') }}</p>
|
||||
<p class="text-sm text-gray-800 line-clamp-2">"{{ $hk->deskripsi_foto }}"</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</details>
|
||||
@empty
|
||||
<div class="text-center py-6 text-gray-400">Belum ada data hasil karya.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-10">
|
||||
<div class="bg-orange-500 text-white p-4 rounded-t-xl">
|
||||
<h2 class="text-lg font-bold flex items-center gap-2">✅ Riwayat Ceklis Capaian</h2>
|
||||
</div>
|
||||
|
||||
@php
|
||||
// Mengambil data dan mengelompokkan per bulan
|
||||
$ceklisGroup = $siswa->penilaianCeklis->sortByDesc('tanggal')->groupBy(function($item) {
|
||||
return \Carbon\Carbon::parse($item->tanggal)->translatedFormat('F Y');
|
||||
});
|
||||
@endphp
|
||||
|
||||
<div class="bg-white border-x border-b border-gray-200 rounded-b-xl p-4">
|
||||
@forelse($ceklisGroup as $bulan => $items)
|
||||
<details class="group mb-2" open>
|
||||
<summary class="flex justify-between items-center font-medium cursor-pointer list-none bg-orange-50 hover:bg-orange-100 p-3 rounded-lg text-orange-800 transition">
|
||||
<span class="flex items-center gap-2">
|
||||
<span class="transition-transform duration-200 group-open:rotate-90 text-orange-400">▶</span>
|
||||
📂 {{ $bulan }}
|
||||
</span>
|
||||
<span class="text-xs bg-white text-orange-600 px-2 py-1 rounded-full border border-orange-200 font-bold">
|
||||
{{ $items->count() }} Data
|
||||
</span>
|
||||
</summary>
|
||||
|
||||
<div class="mt-2 overflow-x-auto border rounded-lg">
|
||||
<table class="min-w-full bg-white text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600 font-bold border-b">
|
||||
<tr>
|
||||
<th class="py-2 px-4 text-left w-24">Tgl</th>
|
||||
<th class="py-2 px-4 text-left">Indikator & Catatan</th>
|
||||
<th class="py-2 px-4 text-center w-24">Hasil</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
@foreach($items as $cc)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="py-3 px-4 font-medium text-gray-500 align-top">
|
||||
{{ \Carbon\Carbon::parse($cc->tanggal)->format('d/m') }}
|
||||
</td>
|
||||
<td class="py-3 px-4 align-top">
|
||||
<p class="font-bold text-gray-800 mb-1">{{ $cc->indikator }}</p>
|
||||
@if($cc->keterangan)
|
||||
<p class="text-xs text-gray-500 italic bg-gray-50 p-2 rounded border border-gray-100">
|
||||
"{{ $cc->keterangan }}"
|
||||
</p>
|
||||
@endif
|
||||
</td>
|
||||
<td class="py-3 px-4 text-center align-top">
|
||||
@php
|
||||
$colors = [
|
||||
'BB' => 'bg-red-100 text-red-700 border-red-200',
|
||||
'MB' => 'bg-yellow-100 text-yellow-700 border-yellow-200',
|
||||
'BSH' => 'bg-blue-100 text-blue-700 border-blue-200',
|
||||
'BSB' => 'bg-green-100 text-green-700 border-green-200',
|
||||
];
|
||||
$colorClass = $colors[$cc->hasil] ?? 'bg-gray-100 text-gray-700';
|
||||
@endphp
|
||||
<span class="px-2 py-1 rounded text-xs font-bold border {{ $colorClass }}">
|
||||
{{ $cc->hasil }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
@empty
|
||||
<div class="text-center py-6 text-gray-400">Belum ada data ceklis.</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,105 +1,179 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<h1 class="text-2xl font-bold text-gray-800 mb-6">📝 Input Rapot (Format Baru)</h1>
|
||||
<link rel="stylesheet" type="text/css" href="https://unpkg.com/trix@2.0.8/dist/trix.css">
|
||||
<script type="text/javascript" src="https://unpkg.com/trix@2.0.8/dist/trix.umd.min.js"></script>
|
||||
|
||||
<form action="{{ route('rapot.store', $siswa->id) }}" method="POST" class="bg-white shadow-lg rounded-xl overflow-hidden">
|
||||
<style>
|
||||
/* CSS PERBAIKAN TRIX EDITOR */
|
||||
trix-editor {
|
||||
min-height: 200px;
|
||||
background: white;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
/* Paksa tombol toolbar muncul dan rapi */
|
||||
trix-toolbar .trix-button_group {
|
||||
display: inline-flex !important;
|
||||
background: #f3f4f6;
|
||||
border-radius: 4px;
|
||||
margin-right: 5px;
|
||||
border: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
trix-toolbar .trix-button {
|
||||
background: white;
|
||||
width: 30px; /* Lebar tombol */
|
||||
height: 30px;
|
||||
border-right: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
trix-toolbar .trix-button.trix-active {
|
||||
background: #bfdbfe; /* Warna biru saat aktif */
|
||||
}
|
||||
|
||||
/* Sembunyikan tombol upload file & code block yang jarang dipakai */
|
||||
.trix-button--icon-attach,
|
||||
.trix-button--icon-code { display: none !important; }
|
||||
|
||||
/* KONFIGURASI LIST AGAR MUNCUL DI PREVIEW EDITOR */
|
||||
.trix-content ul { list-style-type: disc; margin-left: 1.5rem; }
|
||||
.trix-content ol { list-style-type: decimal; margin-left: 1.5rem; }
|
||||
|
||||
/* Styling Card Form */
|
||||
.form-card {
|
||||
background: white;
|
||||
padding: 1.5rem;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
margin-bottom: 2rem;
|
||||
border-top: 4px solid #3b82f6; /* Garis Atas Biru */
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="max-w-5xl mx-auto py-8 px-4 bg-gray-100 min-h-screen">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold text-gray-800">📝 Buat Rapot Baru</h1>
|
||||
<p class="text-gray-600">Siswa: {{ $siswa->nama_siswa }}</p>
|
||||
</div>
|
||||
<a href="{{ route('perkembangan.show', $siswa->id) }}" class="bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded shadow">
|
||||
← Kembali
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-yellow-50 border-l-4 border-yellow-400 p-4 mb-4">
|
||||
<p class="font-bold text-yellow-800">Tips Menulis:</p>
|
||||
<p class="text-sm text-yellow-700">
|
||||
• Tidak perlu menekan tombol <strong>TAB</strong> untuk paragraf baru (sistem akan otomatis membuat tulisan menjorok di PDF).<br>
|
||||
• Gunakan tombol <strong>List Angka</strong> atau <strong>List Bulat</strong> di toolbar editor untuk membuat poin-poin.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form action="{{ route('rapot.store', $siswa->id) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="bg-green-50 p-6 border-b border-green-100 grid grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="font-bold text-sm">Tahun Ajaran</label>
|
||||
<input type="text" name="tahun_ajaran" value="2025/2026" class="w-full border rounded p-2">
|
||||
</div>
|
||||
<div>
|
||||
<label class="font-bold text-sm">Semester</label>
|
||||
<select name="semester" class="w-full border rounded p-2">
|
||||
<option value="1 (Satu)">1 (Satu)</option>
|
||||
<option value="2 (Dua)">2 (Dua)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="font-bold text-sm">Tanggal Rapot</label>
|
||||
<input type="date" name="tanggal_rapot" value="{{ date('Y-m-d') }}" class="w-full border rounded p-2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-6 space-y-6">
|
||||
|
||||
<div>
|
||||
<label class="font-bold block mb-1">A. PENGEMBANGAN AL ISLAM, KE'AISYIYAHAN DAN KEMUHAMMADIYAHAN (AIK)</label>
|
||||
<textarea name="narasi_aik" rows="5" class="w-full border rounded p-2" placeholder="Isi narasi AIK..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="font-bold block mb-1">B. CAPAIAN PEMBELAJARAN NILAI AGAMA DAN BUDI PEKERTI</label>
|
||||
<textarea name="narasi_nilai_agama" rows="5" class="w-full border rounded p-2" placeholder="Isi narasi Nilai Agama..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="font-bold block mb-1">C. CAPAIAN PEMBELAJARAN JATI DIRI</label>
|
||||
<textarea name="narasi_jati_diri" rows="5" class="w-full border rounded p-2" placeholder="Isi narasi Jati Diri..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="font-bold block mb-1">D. CAPAIAN PEMBELAJARAN DASAR-DASAR LITERASI, MATEMATIKA, SAINS, TEKNOLOGI, REKAYASA, SENI</label>
|
||||
<textarea name="narasi_literasi" rows="5" class="w-full border rounded p-2" placeholder="Isi narasi STEAM..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="font-bold block mb-1">E. KOKURIKULER</label>
|
||||
<textarea name="narasi_kokurikuler" rows="5" class="w-full border rounded p-2 bg-yellow-50" placeholder="Isi narasi Kokurikuler..."></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="p-6 border-t bg-gray-50 grid grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="font-bold mb-2">Pertumbuhan Fisik</h3>
|
||||
<input type="text" name="berat_badan" placeholder="Berat Badan (kg)" class="w-full mb-2 border rounded p-2">
|
||||
<input type="text" name="tinggi_badan" placeholder="Tinggi Badan (cm)" class="w-full mb-2 border rounded p-2">
|
||||
<input type="text" name="lingkar_kepala" placeholder="Lingkar Kepala (cm)" class="w-full mb-2 border rounded p-2">
|
||||
<input type="text" name="lingkar_lengan" placeholder="Lingkar Lengan (cm)" class="w-full border rounded p-2">
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="font-bold mb-2">Kehadiran (Hari)</h3>
|
||||
<input type="number" name="sakit" placeholder="Sakit" class="w-full mb-2 border rounded p-2">
|
||||
<input type="number" name="izin" placeholder="Izin" class="w-full mb-2 border rounded p-2">
|
||||
<input type="number" name="alpha" placeholder="Alpha" class="w-full border rounded p-2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-6 border-t">
|
||||
<div class="mb-4">
|
||||
<label class="font-bold block mb-1">Refleksi Orang Tua</label>
|
||||
<textarea name="refleksi_orang_tua" rows="2" class="w-full border rounded p-2"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-6">
|
||||
<div class="form-card">
|
||||
<h2 class="text-lg font-bold text-gray-800 mb-4 border-b pb-2">📂 Identitas Rapot</h2>
|
||||
<div class="grid grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label class="font-bold block mb-1">Nama Kepala Sekolah (Pengelola)</label>
|
||||
<input type="text" name="nama_kepala_sekolah" value="TRI MARYA ENDARWATI, M.Pd" class="w-full border rounded p-2 bg-blue-50">
|
||||
<input type="text" name="nbm_kepala_sekolah" value="NBM. 1420476" class="w-full border rounded p-2 mt-2 text-sm" placeholder="NBM/NIP">
|
||||
<label class="block font-bold text-sm mb-1">Tahun Ajaran</label>
|
||||
<select name="tahun_ajaran" class="w-full border p-2 rounded">
|
||||
<option value="2025/2026">2025/2026</option>
|
||||
<option value="2026/2027">2026/2027</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="font-bold block mb-1">Nama Guru Kelas</label>
|
||||
|
||||
<select name="nama_guru" class="w-full border rounded p-2 bg-blue-50 focus:ring-green-500 focus:border-green-500" required>
|
||||
<option value="">-- Pilih Guru Kelas --</option>
|
||||
@foreach($gurus as $guru)
|
||||
<option value="{{ $guru->nama_guru }}">
|
||||
{{ $guru->nama_guru }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="text-xs text-gray-500 mt-1">*Pilih nama guru kelas dari daftar.</p>
|
||||
</div>
|
||||
<label class="block font-bold text-sm mb-1">Semester</label>
|
||||
<select name="semester" class="w-full border p-2 rounded">
|
||||
<option value="1">1 (Ganjil)</option>
|
||||
<option value="2">2 (Genap)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block font-bold text-sm mb-1">Tanggal Rapot</label>
|
||||
<input type="date" name="tanggal_rapot" value="{{ date('Y-m-d') }}" class="w-full border p-2 rounded">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-6 bg-gray-100 flex justify-end">
|
||||
<button type="submit" class="bg-green-600 text-white font-bold py-3 px-8 rounded shadow">💾 Simpan Rapot</button>
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-4">I. Capaian Pembelajaran</h2>
|
||||
|
||||
<div class="form-card">
|
||||
<label class="block text-xl font-bold text-blue-800 mb-2">A. Nilai Agama (AIK)</label>
|
||||
<input id="narasi_agama" type="hidden" name="narasi_agama">
|
||||
<trix-editor input="narasi_agama" placeholder="Tulis narasi..."></trix-editor>
|
||||
</div>
|
||||
|
||||
<div class="form-card">
|
||||
<label class="block text-xl font-bold text-blue-800 mb-2">B. Budi Pekerti</label>
|
||||
<input id="narasi_budi_pekerti" type="hidden" name="narasi_budi_pekerti">
|
||||
<trix-editor input="narasi_budi_pekerti" placeholder="Tulis narasi..."></trix-editor>
|
||||
</div>
|
||||
|
||||
<div class="form-card">
|
||||
<label class="block text-xl font-bold text-blue-800 mb-2">C. Jati Diri</label>
|
||||
<input id="narasi_jati_diri" type="hidden" name="narasi_jati_diri">
|
||||
<trix-editor input="narasi_jati_diri" placeholder="Tulis narasi..."></trix-editor>
|
||||
</div>
|
||||
|
||||
<div class="form-card">
|
||||
<label class="block text-xl font-bold text-blue-800 mb-2">D. Literasi & STEAM</label>
|
||||
<input id="narasi_literasi" type="hidden" name="narasi_literasi">
|
||||
<trix-editor input="narasi_literasi" placeholder="Tulis narasi..."></trix-editor>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-4">II. Kokurikuler</h2>
|
||||
<div class="form-card" style="border-top-color: #10b981;">
|
||||
<label class="block text-xl font-bold text-green-800 mb-2">E. KOKURIKULER</label>
|
||||
<p class="text-sm text-gray-500 mb-2">Salin teks kokurikuler di sini.</p>
|
||||
<input id="narasi_kokurikuler" type="hidden" name="narasi_kokurikuler">
|
||||
<trix-editor input="narasi_kokurikuler" placeholder="Paste teks..."></trix-editor>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-bold text-gray-800 mb-4">III. Data Akhir</h2>
|
||||
<div class="form-card" style="border-top-color: #f59e0b;">
|
||||
<h3 class="font-bold mb-4">Data Pertumbuhan & Kehadiran</h3>
|
||||
<div class="grid grid-cols-3 gap-6 mb-6">
|
||||
<div><label>Berat (kg)</label><input type="number" step="0.1" name="berat_badan" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Tinggi (cm)</label><input type="number" step="0.1" name="tinggi_badan" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Lingkar Kpl (cm)</label><input type="number" step="0.1" name="lingkar_kepala" class="w-full border p-2 rounded"></div>
|
||||
</div>
|
||||
<div class="grid grid-cols-3 gap-6 mb-6">
|
||||
<div><label>Sakit</label><input type="number" name="sakit" value="0" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Izin</label><input type="number" name="izin" value="0" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Alpha</label><input type="number" name="alpha" value="0" class="w-full border p-2 rounded"></div>
|
||||
</div>
|
||||
|
||||
<hr class="my-6">
|
||||
|
||||
<h3 class="font-bold mb-4">Refleksi & Tanda Tangan</h3>
|
||||
<div class="mb-4">
|
||||
<label class="block font-bold mb-2">Refleksi Orang Tua (Opsional)</label>
|
||||
<textarea name="refleksi_orang_tua" rows="3" class="w-full border p-2 rounded bg-gray-50"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-600">Nama Guru Kelas</label>
|
||||
<input type="text" name="nama_guru" value="Dwi Lestari, S.Pd" class="w-full border p-2 rounded mb-2">
|
||||
<label class="block text-sm font-bold text-gray-600">NIP/NBM</label>
|
||||
<input type="text" name="nipy_guru" placeholder="-" class="w-full border p-2 rounded">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-bold text-gray-600">Nama Kepala Sekolah</label>
|
||||
<input type="text" name="nama_kepala_sekolah" value="Tri Marya Endarwati, M.Pd" class="w-full border p-2 rounded mb-2">
|
||||
<label class="block text-sm font-bold text-gray-600">NIP/NBM</label>
|
||||
<input type="text" name="nipy_kepala_sekolah" placeholder="-" class="w-full border p-2 rounded">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-4 px-6 rounded-lg shadow-lg text-lg">
|
||||
💾 SIMPAN RAPOT
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="max-w-4xl mx-auto py-8 px-4">
|
||||
<h1 class="text-2xl font-bold mb-6">Edit Rapot: {{ $rapot->siswa->nama_siswa }}</h1>
|
||||
|
||||
<form action="{{ route('rapot.update', $rapot->id) }}" method="POST" class="bg-white p-6 rounded-lg shadow">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 mb-6">
|
||||
<div>
|
||||
<label class="block font-bold">Tahun Ajaran</label>
|
||||
<select name="tahun_ajaran" class="w-full border p-2 rounded">
|
||||
<option value="2025/2026" {{ $rapot->tahun_ajaran == '2025/2026' ? 'selected' : '' }}>2025/2026</option>
|
||||
<option value="2026/2027" {{ $rapot->tahun_ajaran == '2026/2027' ? 'selected' : '' }}>2026/2027</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block font-bold">Semester</label>
|
||||
<select name="semester" class="w-full border p-2 rounded">
|
||||
<option value="1" {{ $rapot->semester == 1 ? 'selected' : '' }}>Semester 1 (Ganjil)</option>
|
||||
<option value="2" {{ $rapot->semester == 2 ? 'selected' : '' }}>Semester 2 (Genap)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-xl font-bold mb-4 mt-6">Capaian Pembelajaran (A-E)</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block font-bold">A. Nilai Agama & Budi Pekerti (AIK)</label>
|
||||
<textarea name="narasi_agama" rows="4" class="w-full border p-2 rounded">{{ $rapot->narasi_agama }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block font-bold">B. Capaian Pembelajaran Budi Pekerti</label>
|
||||
<textarea name="narasi_budi_pekerti" rows="4" class="w-full border p-2 rounded">{{ $rapot->narasi_budi_pekerti }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block font-bold">C. Jati Diri</label>
|
||||
<textarea name="narasi_jati_diri" rows="4" class="w-full border p-2 rounded">{{ $rapot->narasi_jati_diri }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block font-bold">D. Literasi & STEAM</label>
|
||||
<textarea name="narasi_literasi" rows="4" class="w-full border p-2 rounded">{{ $rapot->narasi_literasi }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-4 bg-gray-50 p-4 rounded border">
|
||||
<label class="block font-bold">E. Kokurikuler / P5</label>
|
||||
<div class="grid grid-cols-2 gap-4 mb-2">
|
||||
<input type="text" name="p5_tema" value="{{ $rapot->p5_tema }}" placeholder="Tema P5" class="border p-2 rounded">
|
||||
<input type="text" name="p5_judul" value="{{ $rapot->p5_judul }}" placeholder="Judul Topik" class="border p-2 rounded">
|
||||
</div>
|
||||
<textarea name="narasi_kokurikuler" rows="4" class="w-full border p-2 rounded">{{ $rapot->narasi_kokurikuler }}</textarea>
|
||||
</div>
|
||||
|
||||
<h2 class="text-xl font-bold mb-4 mt-6">Data Fisik</h2>
|
||||
<div class="grid grid-cols-3 gap-4 mb-6">
|
||||
<div><label>Berat (kg)</label><input type="number" step="0.1" name="berat_badan" value="{{ $rapot->berat_badan }}" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Tinggi (cm)</label><input type="number" step="0.1" name="tinggi_badan" value="{{ $rapot->tinggi_badan }}" class="w-full border p-2 rounded"></div>
|
||||
<div><label>Lingkar Kpl (cm)</label><input type="number" step="0.1" name="lingkar_kepala" value="{{ $rapot->lingkar_kepala }}" class="w-full border p-2 rounded"></div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bg-green-600 text-white px-6 py-3 rounded font-bold hover:bg-green-700 w-full">Update Rapot</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,221 +1,201 @@
|
|||
@extends('layouts.app')
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Rapot - {{ $rapot->siswa->nama_siswa }}</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Times+New+Roman&display=swap');
|
||||
body { background: #525659; font-family: 'Times New Roman', Times, serif; color: black; margin: 0; padding: 0; }
|
||||
|
||||
/* SETTINGAN KERTAS A4 (Layar) */
|
||||
.page {
|
||||
background: white; width: 210mm; height: 297mm;
|
||||
padding: 2cm; margin: 1cm auto;
|
||||
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
||||
position: relative; overflow: hidden; display: block;
|
||||
}
|
||||
|
||||
/* HEADER POIN (KOTAK JUDUL) */
|
||||
.judul-poin {
|
||||
background-color: #e5e7eb;
|
||||
border: 1px solid black;
|
||||
padding: 8px 10px;
|
||||
font-weight: bold;
|
||||
font-size: 11pt;
|
||||
margin-bottom: 10px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
@section('content')
|
||||
<div class="container mx-auto px-4 py-6 bg-gray-100 min-h-screen">
|
||||
<div class="flex justify-between items-center mb-6 no-print max-w-[21cm] mx-auto">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-800">📄 Preview Rapot</h1>
|
||||
/* NARASI */
|
||||
.narasi { font-size: 11pt; line-height: 1.3; text-align: justify; margin-bottom: 10px; }
|
||||
.narasi p { text-indent: 1cm; margin-top: 0; margin-bottom: 5px; }
|
||||
.narasi ul { list-style-type: disc; margin-left: 25px; text-indent: 0; }
|
||||
.narasi ol { list-style-type: decimal; margin-left: 25px; text-indent: 0; }
|
||||
|
||||
/* TABEL */
|
||||
.table-data th { background: #eee; border: 1px solid black; padding: 2px; text-align: center; font-size: 10pt; font-weight: bold; }
|
||||
.table-data td { border: 1px solid black; padding: 2px; font-size: 10pt; }
|
||||
|
||||
.garis-kop { border-top: 3px solid black; border-bottom: 1px solid black; height: 3px; margin: 5px 0 15px 0; }
|
||||
.header-hal { text-align: right; font-size: 9pt; font-style: italic; color: #888; border-bottom: 1px solid #ddd; margin-bottom: 10px; }
|
||||
.footer-hal { position: absolute; bottom: 1cm; right: 2cm; font-size: 9pt; color: #888; }
|
||||
|
||||
/* SETTINGAN KHUSUS PRINT (ANTI BLANK PAGE) */
|
||||
@media print {
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 0; /* Hapus margin default browser */
|
||||
}
|
||||
|
||||
html, body {
|
||||
width: 210mm;
|
||||
height: 297mm;
|
||||
background: white;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.page {
|
||||
margin: 0 !important;
|
||||
border: initial;
|
||||
border-radius: initial;
|
||||
width: 210mm;
|
||||
height: 297mm; /* Tinggi fix */
|
||||
box-shadow: none;
|
||||
page-break-after: always; /* Paksa ganti halaman tiap div .page */
|
||||
overflow: hidden; /* Potong konten berlebih */
|
||||
}
|
||||
|
||||
/* SOLUSI: Halaman terakhir DILARANG ganti halaman */
|
||||
.page:last-of-type {
|
||||
page-break-after: avoid !important;
|
||||
page-break-inside: avoid !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.no-print { display: none !important; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="no-print fixed top-0 left-0 w-full bg-white shadow-md p-3 flex justify-between z-50">
|
||||
<span class="font-bold text-gray-700 ml-4">Preview Rapot: {{ $rapot->siswa->nama_siswa }}</span>
|
||||
<button onclick="window.print()" class="bg-blue-600 text-white px-6 py-2 rounded font-bold mr-4 hover:bg-blue-700">🖨️ Cetak PDF</button>
|
||||
</div>
|
||||
<div class="h-16 no-print"></div>
|
||||
|
||||
<div class="page">
|
||||
<div class="text-center">
|
||||
<h2 class="font-bold text-xl uppercase m-0">PAUD 'AISYIYAH KARTOHARJO</h2>
|
||||
<h3 class="font-bold text-lg uppercase m-0">KOTA MADIUN</h3>
|
||||
<p class="text-sm italic m-0">Jl. Sarana Mulya, Kartoharjo, Kec. Kartoharjo, Kota Madiun</p>
|
||||
</div>
|
||||
<div class="flex gap-3">
|
||||
<a href="{{ route('perkembangan.show', $rapot->siswa_id) }}" class="bg-gray-500 hover:bg-gray-600 text-white font-bold py-2 px-4 rounded shadow transition">
|
||||
← Kembali
|
||||
</a>
|
||||
<button onclick="window.print()" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded shadow flex items-center gap-2 transition">
|
||||
🖨️ Cetak / Simpan PDF
|
||||
</button>
|
||||
<div class="garis-kop"></div>
|
||||
<div class="text-center mb-4"><h2 class="font-bold text-lg underline">LAPORAN PERKEMBANGAN ANAK DIDIK</h2></div>
|
||||
|
||||
<table class="w-full font-bold mb-6 text-[11pt]">
|
||||
<tr><td width="20%">NAMA ANAK</td><td width="2%">:</td><td width="40%">{{ $rapot->siswa->nama_siswa }}</td><td width="15%">KELOMPOK</td><td width="2%">:</td><td>SHINTA</td></tr>
|
||||
<tr><td>NIS</td><td>:</td><td>{{ $rapot->siswa->nis }}</td><td>SEMESTER</td><td>:</td><td>{{ $rapot->semester == 1 ? '1 (Satu)' : '2 (Dua)' }}</td></tr>
|
||||
<tr><td>USIA</td><td>:</td><td>{{ \Carbon\Carbon::parse($rapot->siswa->tanggal_lahir)->age }} Tahun</td><td>TAHUN</td><td>:</td><td>{{ $rapot->tahun_ajaran }}</td></tr>
|
||||
</table>
|
||||
|
||||
<div class="judul-poin">A. PENGEMBANGAN AL ISLAM, KE’AISYIYAHAN (AIK)</div>
|
||||
<div class="narasi">{!! $rapot->narasi_agama !!}</div>
|
||||
<div class="footer-hal">Hal. 1</div>
|
||||
</div>
|
||||
|
||||
<div class="page">
|
||||
<div class="header-hal">{{ $rapot->siswa->nama_siswa }} - Hal. 2</div>
|
||||
<div class="judul-poin">B. CAPAIAN PEMBELAJARAN BUDI PEKERTI</div>
|
||||
<div class="narasi">{!! $rapot->narasi_budi_pekerti !!}</div>
|
||||
<div class="footer-hal">Hal. 2</div>
|
||||
</div>
|
||||
|
||||
<div class="page">
|
||||
<div class="header-hal">{{ $rapot->siswa->nama_siswa }} - Hal. 3</div>
|
||||
<div class="judul-poin">C. CAPAIAN PEMBELAJARAN JATI DIRI</div>
|
||||
<div class="narasi">{!! $rapot->narasi_jati_diri !!}</div>
|
||||
<div class="footer-hal">Hal. 3</div>
|
||||
</div>
|
||||
|
||||
<div class="page">
|
||||
<div class="header-hal">{{ $rapot->siswa->nama_siswa }} - Hal. 4</div>
|
||||
<div class="judul-poin">D. CAPAIAN PEMBELAJARAN LITERASI & STEAM</div>
|
||||
<div class="narasi">{!! $rapot->narasi_literasi !!}</div>
|
||||
<div class="footer-hal">Hal. 4</div>
|
||||
</div>
|
||||
|
||||
<div class="page">
|
||||
<div class="header-hal">{{ $rapot->siswa->nama_siswa }} - Hal. 5</div>
|
||||
<div class="judul-poin">E. KOKURIKULER</div>
|
||||
<div class="narasi">{!! $rapot->narasi_kokurikuler !!}</div>
|
||||
<div class="footer-hal">Hal. 5</div>
|
||||
</div>
|
||||
|
||||
<div class="page">
|
||||
<div class="header-hal">{{ $rapot->siswa->nama_siswa }} - Hal. 6</div>
|
||||
|
||||
<div class="text-center mb-1"><h3 style="border:none; margin:0; text-decoration:none;">REFLEKSI ORANG TUA</h3></div>
|
||||
<div class="border border-black p-2 mb-4" style="min-height: 2cm;">
|
||||
@if($rapot->refleksi_orang_tua)
|
||||
<p class="text-justify font-serif text-[10pt] m-0">{{ $rapot->refleksi_orang_tua }}</p>
|
||||
@else
|
||||
<p class="text-gray-400 italic text-sm text-center mt-4">(Mohon Ayah/Bunda menuliskan masukan/harapan...)</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 mb-6">
|
||||
<div class="w-1/2">
|
||||
<table class="table-data w-full">
|
||||
<thead><tr><th colspan="2">PERTUMBUHAN</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td width="60%">Berat Badan</td><td class="text-center font-bold">{{ $rapot->berat_badan }} kg</td></tr>
|
||||
<tr><td>Tinggi Badan</td><td class="text-center font-bold">{{ $rapot->tinggi_badan }} cm</td></tr>
|
||||
<tr><td>Lingkar Kepala</td><td class="text-center font-bold">{{ $rapot->lingkar_kepala }} cm</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<table class="table-data w-full">
|
||||
<thead><tr><th colspan="2">KEHADIRAN</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td width="60%">Sakit</td><td class="text-center font-bold">{{ $rapot->sakit }} hari</td></tr>
|
||||
<tr><td>Izin</td><td class="text-center font-bold">{{ $rapot->izin }} hari</td></tr>
|
||||
<tr><td>Alpha</td><td class="text-center font-bold">{{ $rapot->alpha }} hari</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px;">
|
||||
<div class="text-right mb-1 mr-10 font-serif text-[10pt]">Madiun, {{ \Carbon\Carbon::parse($rapot->tanggal_rapot)->translatedFormat('d F Y') }}</div>
|
||||
|
||||
<table class="w-full text-center font-bold text-[10pt]">
|
||||
<tr>
|
||||
<td width="50%" valign="top">Orang Tua / Wali Murid<br>
|
||||
<div style="height: 60px;"></div>
|
||||
(.............................................)
|
||||
</td>
|
||||
<td width="50%" valign="top">Guru Kelas<br>
|
||||
<div style="height: 60px;"></div>
|
||||
<span style="text-decoration: underline;">{{ $rapot->nama_guru }}</span><br>
|
||||
<span class="font-normal text-xs">NIP. {{ $rapot->nipy_guru ?? '-' }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="pt-4">Mengetahui,<br>Pengelola PAUD 'Aisyiyah Kartoharjo</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="height: 70px; vertical-align: bottom;">
|
||||
<span style="text-decoration: underline;">{{ $rapot->nama_kepala_sekolah }}</span><br>
|
||||
<span class="font-normal text-xs">NIP. {{ $rapot->nipy_kepala_sekolah ?? '-' }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white mx-auto max-w-[21cm] shadow-xl text-black relative print:shadow-none print:m-0 print:w-full"
|
||||
style="min-height: 29.7cm; font-family: 'Times New Roman', Times, serif; border: 4px solid #000; padding: 3px;">
|
||||
|
||||
<div style="border: 1px solid #000; height: 100%; padding: 40px;">
|
||||
|
||||
<div class="text-center mb-8">
|
||||
<h2 class="text-xl font-bold uppercase tracking-wider mb-2">Laporan Perkembangan Anak Didik</h2>
|
||||
<h3 class="text-2xl font-bold uppercase mb-1">PAUD 'Aisyiyah Kartoharjo</h3>
|
||||
<p class="text-base">Jln. Ciliwung II No. 22, Kartoharjo, Madiun</p>
|
||||
<div style="border-bottom: 3px double black; margin-top: 1rem;"></div>
|
||||
</div>
|
||||
|
||||
<div class="mb-8">
|
||||
<table class="w-full text-base leading-loose">
|
||||
<tr>
|
||||
<td class="font-bold w-32">Nama Anak</td>
|
||||
<td class="w-4">:</td>
|
||||
<td class="uppercase font-semibold">{{ $rapot->siswa->nama_siswa }}</td>
|
||||
<td class="font-bold w-32 text-right pl-4">Semester</td>
|
||||
<td class="w-4 text-center">:</td>
|
||||
<td>{{ $rapot->semester }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="font-bold">NIS / NISN</td>
|
||||
<td>:</td>
|
||||
<td>{{ $rapot->siswa->nis }} / {{ $rapot->siswa->nisn ?? '-' }}</td>
|
||||
<td class="font-bold text-right pl-4">Tahun Ajaran</td>
|
||||
<td class="text-center">:</td>
|
||||
<td>{{ $rapot->tahun_ajaran }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="font-bold">Kelompok</td>
|
||||
<td>:</td>
|
||||
<td>{{ $rapot->siswa->kelompok_id ?? '-' }}</td>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="space-y-6 text-justify leading-relaxed text-lg">
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-2">A. PENGEMBANGAN AL ISLAM, KE'AISYIYAHAN DAN KEMUHAMMADIYAHAN (AIK)</h3>
|
||||
<div class="pl-8">
|
||||
{!! nl2br(e($rapot->narasi_aik ?? '-')) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-2">B. CAPAIAN PEMBELAJARAN NILAI AGAMA DAN BUDI PEKERTI</h3>
|
||||
<div class="pl-8">
|
||||
{!! nl2br(e($rapot->narasi_nilai_agama ?? '-')) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-2">C. CAPAIAN PEMBELAJARAN JATI DIRI</h3>
|
||||
<div class="pl-8">
|
||||
{!! nl2br(e($rapot->narasi_jati_diri ?? '-')) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-2">D. CAPAIAN PEMBELAJARAN DASAR-DASAR LITERASI, MATEMATIKA, SAINS, TEKNOLOGI, REKAYASA, SENI</h3>
|
||||
<div class="pl-8">
|
||||
{!! nl2br(e($rapot->narasi_literasi ?? '-')) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-2">E. KOKURIKULER</h3>
|
||||
<div class="pl-8">
|
||||
{!! nl2br(e($rapot->narasi_kokurikuler ?? '-')) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="print:break-after-page mt-10"></div>
|
||||
|
||||
<div class="mt-8 grid grid-cols-2 gap-10">
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-4 uppercase text-center" style="text-decoration: underline;">Pertumbuhan</h3>
|
||||
<table class="w-full border-collapse border border-black text-base">
|
||||
<tr class="bg-gray-200 print:bg-gray-300">
|
||||
<td class="border border-black p-2 font-bold text-center">Aspek</td>
|
||||
<td class="border border-black p-2 font-bold text-center">Hasil</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Berat Badan</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->berat_badan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Tinggi Badan</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->tinggi_badan }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Lingkar Kepala</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->lingkar_kepala }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Lingkar Lengan</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->lingkar_lengan }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="font-bold text-lg mb-4 uppercase text-center" style="text-decoration: underline;">Kehadiran Anak</h3>
|
||||
<table class="w-full border-collapse border border-black text-base">
|
||||
<tr class="bg-gray-200 print:bg-gray-300">
|
||||
<td class="border border-black p-2 font-bold text-center">Keterangan</td>
|
||||
<td class="border border-black p-2 font-bold text-center">Jumlah</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Sakit</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->sakit }} Hari</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Izin</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->izin }} Hari</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="border border-black p-2 pl-4">Tanpa Keterangan</td>
|
||||
<td class="border border-black p-2 text-center font-semibold">{{ $rapot->alpha }} Hari</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-12">
|
||||
<h3 class="font-bold text-lg mb-2 uppercase">Refleksi Orang Tua</h3>
|
||||
<div class="border-2 border-black p-4 h-32 rounded">
|
||||
<p class="italic text-lg">{{ $rapot->refleksi_orang_tua ?? '' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-end mt-20 text-center text-base">
|
||||
|
||||
<div class="w-1/3 flex flex-col items-center">
|
||||
<p class="mb-24">Orang Tua / Wali</p>
|
||||
<p class="font-bold border-b border-black w-40"></p>
|
||||
</div>
|
||||
|
||||
<div class="w-1/3 flex flex-col items-center">
|
||||
<p>Mengetahui,</p>
|
||||
<p class="mb-1 font-bold">Pengelola</p>
|
||||
<p class="mb-16 font-bold">PAUD 'Aisyiyah Kartoharjo</p>
|
||||
<p class="font-bold underline uppercase">{{ $rapot->nama_kepala_sekolah }}</p>
|
||||
<p class="font-bold">NBM. {{ $rapot->nbm_kepala_sekolah }}</p>
|
||||
</div>
|
||||
|
||||
<div class="w-1/3 flex flex-col items-center">
|
||||
<p class="mb-1">Madiun, {{ \Carbon\Carbon::parse($rapot->tanggal_rapot)->translatedFormat('d F Y') }}</p>
|
||||
<p class="mb-24">Guru Kelas</p>
|
||||
|
||||
<p class="font-bold border-b border-black w-40 uppercase">
|
||||
{{ $rapot->nama_guru }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> </div> </div>
|
||||
|
||||
{{-- CSS KHUSUS UNTUK PRINT & TAMPILAN KERTAS --}}
|
||||
<style>
|
||||
/* Mengatur agar tampilan web meniru kertas */
|
||||
body {
|
||||
background-color: #f3f4f6; /* Abu-abu muda di web */
|
||||
}
|
||||
|
||||
/* Saat tombol CETAK diklik */
|
||||
@media print {
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 1cm; /* Margin kertas saat diprint */
|
||||
}
|
||||
body {
|
||||
background-color: white; /* Latar belakang putih saat print */
|
||||
margin: 0;
|
||||
}
|
||||
.no-print {
|
||||
display: none !important; /* Sembunyikan tombol saat print */
|
||||
}
|
||||
/* Paksa background warna (untuk tabel abu-abu) tercetak */
|
||||
* {
|
||||
-webkit-print-color-adjust: exact !important;
|
||||
print-color-adjust: exact !important;
|
||||
}
|
||||
.shadow-xl {
|
||||
box-shadow: none !important; /* Hilangkan bayangan saat print */
|
||||
}
|
||||
/* Pastikan bingkai tetap tercetak */
|
||||
.max-w-\[21cm\] {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
border: 4px solid #000 !important; /* Pastikan border luar tercetak tebal */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,29 +1,72 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-xl mx-auto">
|
||||
<h1 class="text-xl font-semibold text-gray-700 mb-4">➕ Tambah Wali Murid</h1>
|
||||
<div class="bg-white shadow-md rounded-lg p-6 max-w-2xl mx-auto mt-10">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-xl font-bold text-gray-700">➕ Tambah Wali Murid</h1>
|
||||
<a href="{{ route('wali-murid.index') }}" class="text-gray-500 hover:text-gray-700">← Kembali</a>
|
||||
</div>
|
||||
|
||||
{{-- Error Handling --}}
|
||||
@if ($errors->any())
|
||||
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4">
|
||||
<ul class="list-disc list-inside text-sm">
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- PERBAIKAN: route('wali-murid.store') --}}
|
||||
<form action="{{ route('wali-murid.store') }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">Nama Wali</label>
|
||||
<input type="text" name="nama_wali" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300" required>
|
||||
<div class="mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-800 border-b pb-2 mb-4 italic">Biodata Orang Tua / Wali</h2>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Nama Wali</label>
|
||||
<input type="text" name="nama_wali" value="{{ old('nama_wali') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none" required placeholder="Nama Ayah / Ibu">
|
||||
</div>
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">No. HP / WhatsApp</label>
|
||||
<input type="text" name="no_hp" value="{{ old('no_hp') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none" required placeholder="08123...">
|
||||
</div>
|
||||
|
||||
<div class="mb-2 md:col-span-2">
|
||||
<label class="block text-gray-700 font-medium mb-1">Alamat Lengkap</label>
|
||||
<textarea name="alamat" rows="2" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-green-500 focus:outline-none">{{ old('alamat') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">No HP</label>
|
||||
<input type="text" name="no_hp" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300">
|
||||
<div class="bg-indigo-50 p-4 rounded-lg border border-indigo-200 mb-6 shadow-inner">
|
||||
<h2 class="text-lg font-bold text-indigo-800 mb-2 flex items-center gap-2">
|
||||
📱 Akun Login Mobile
|
||||
</h2>
|
||||
<p class="text-xs text-indigo-600 mb-4 font-medium">
|
||||
* Berikan Email & Password ini kepada Orang Tua agar mereka bisa login di Aplikasi Mobile.
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Email Login</label>
|
||||
<input type="email" name="email" value="{{ old('email') }}" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none" required placeholder="email@contoh.com">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-gray-700 font-medium mb-1">Password</label>
|
||||
<input type="password" name="password" class="w-full border border-gray-300 rounded-lg p-2 focus:ring-2 focus:ring-indigo-500 focus:outline-none" required placeholder="Minimal 6 karakter">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700">Alamat</label>
|
||||
<textarea name="alamat" class="w-full border rounded px-3 py-2 focus:ring focus:ring-green-300" rows="3"></textarea>
|
||||
<div class="flex justify-end gap-3">
|
||||
<button type="submit" class="bg-green-600 text-white font-semibold px-6 py-2 rounded-lg hover:bg-green-700 transition shadow-md">
|
||||
💾 Simpan Data Wali
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">Simpan</button>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,56 +1,101 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="p-6">
|
||||
<h1 class="text-2xl font-semibold mb-6">Hai, Admin 👋</h1>
|
||||
|
||||
<!-- Baris 1: Pengumuman (full width) -->
|
||||
<div class="mb-6">
|
||||
<div class="bg-white shadow rounded-lg p-4">
|
||||
<h2 class="text-lg font-semibold flex items-center mb-2">📢 Pengumuman Terbaru</h2>
|
||||
@if($pengumuman)
|
||||
<h4>{{ $pengumuman->judul }}</h4>
|
||||
<p>{{ $pengumuman->isi }}</p>
|
||||
<small>
|
||||
Periode: {{ $pengumuman->tanggal_mulai }} - {{ $pengumuman->tanggal_selesai }}
|
||||
@if(now()->between($pengumuman->tanggal_mulai, $pengumuman->tanggal_selesai))
|
||||
<span class="badge bg-success">Aktif</span>
|
||||
@else
|
||||
<span class="badge bg-secondary">Belum aktif</span>
|
||||
@endif
|
||||
</small>
|
||||
@else
|
||||
<p>Belum ada pengumuman.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Baris 2: Jadwal & Aktivitas -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
|
||||
<!-- Jadwal -->
|
||||
<div class="bg-white shadow rounded-lg p-4">
|
||||
<div class="flex justify-between items-center mb-2">
|
||||
<h2 class="text-lg font-semibold flex items-center">📅 Jadwal</h2>
|
||||
<a href="#" class="text-red-500 text-sm">See all</a>
|
||||
<div class="py-12">
|
||||
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
|
||||
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h2 class="text-2xl font-bold text-gray-800">📊 Dashboard Utama</h2>
|
||||
<p class="text-sm text-gray-500">Ringkasan aktivitas dan informasi sekolah.</p>
|
||||
</div>
|
||||
<p class="text-gray-400">Belum ada jadwal.</p>
|
||||
|
||||
@if(Auth::user()->role == 'admin')
|
||||
<a href="{{ route('pengumuman.index') }}" class="bg-indigo-600 text-white px-4 py-2 rounded shadow hover:bg-indigo-700 text-sm font-bold flex items-center gap-2">
|
||||
<span>📢</span> Buat Pengumuman
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Aktivitas -->
|
||||
<div class="bg-white shadow rounded-lg p-4">
|
||||
<h2 class="text-lg font-semibold flex items-center mb-2">📌 Aktivitas Terbaru</h2>
|
||||
<ul class="space-y-1 text-gray-600 text-sm">
|
||||
@forelse($aktivitas as $item)
|
||||
<li>• {{ $item->deskripsi }}
|
||||
<span class="text-gray-400"> - {{ $item->created_at->diffForHumans() }}</span>
|
||||
</li>
|
||||
@empty
|
||||
<li class="text-gray-400">Tidak ada aktivitas terbaru.</li>
|
||||
@endforelse
|
||||
</ul>
|
||||
<div class="mb-8">
|
||||
<h3 class="text-lg font-bold text-gray-700 mb-3 flex items-center">
|
||||
<svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5.882V19.24a1.76 1.76 0 01-3.417.592l-2.147-6.15M18 13a3 3 0 100-6M5.436 13.683A4.001 4.001 0 017 6h1.832c4.1 0 7.625-1.234 9.168-3v14c-1.543-1.766-5.067-3-9.168-3H7a3.988 3.988 0 01-1.564-.317z"></path></svg>
|
||||
Papan Pengumuman
|
||||
</h3>
|
||||
|
||||
@forelse($pengumuman as $info)
|
||||
<div class="bg-white border-l-4 border-indigo-500 shadow-sm rounded-r-lg p-4 mb-4 relative">
|
||||
<div class="flex justify-between items-start">
|
||||
<div>
|
||||
<h4 class="text-lg font-bold text-gray-800">{{ $info->judul }}</h4>
|
||||
<p class="text-gray-600 mt-1 text-sm">{{ Str::limit($info->isi, 150) }}</p>
|
||||
|
||||
<div class="mt-2 text-xs text-gray-500 flex items-center bg-gray-100 w-fit px-2 py-1 rounded">
|
||||
📅
|
||||
@if($info->tanggal_mulai)
|
||||
{{ \Carbon\Carbon::parse($info->tanggal_mulai)->format('d M Y') }}
|
||||
s/d
|
||||
{{ \Carbon\Carbon::parse($info->tanggal_selesai)->format('d M Y') }}
|
||||
@else
|
||||
Permanen
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-xs text-gray-400 italic">
|
||||
{{ $info->created_at->diffForHumans() }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="bg-gray-50 border border-gray-200 rounded-lg p-6 text-center text-gray-500">
|
||||
Belum ada pengumuman aktif saat ini.
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
|
||||
<div class="bg-white overflow-hidden shadow rounded-lg p-5 border-b-4 border-blue-500">
|
||||
<div class="text-gray-500 text-sm font-bold uppercase">Total Siswa</div>
|
||||
<div class="text-3xl font-bold text-gray-800">{{ $totalSiswa }}</div>
|
||||
</div>
|
||||
<div class="bg-white overflow-hidden shadow rounded-lg p-5 border-b-4 border-green-500">
|
||||
<div class="text-gray-500 text-sm font-bold uppercase">Total Guru</div>
|
||||
<div class="text-3xl font-bold text-gray-800">{{ $totalGuru }}</div>
|
||||
</div>
|
||||
<div class="bg-white overflow-hidden shadow rounded-lg p-5 border-b-4 border-purple-500">
|
||||
<div class="text-gray-500 text-sm font-bold uppercase">Total Kelas</div>
|
||||
<div class="text-3xl font-bold text-gray-800">{{ $totalKelas }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<div class="px-6 py-4 border-b border-gray-200 font-bold text-gray-700">
|
||||
Siswa Terbaru
|
||||
</div>
|
||||
<table class="min-w-full divide-y divide-gray-200">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Nama</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">NIS</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="bg-white divide-y divide-gray-200">
|
||||
@foreach($siswaBaru as $siswa)
|
||||
<tr>
|
||||
<td class="px-6 py-4 whitespace-nowrap">{{ $siswa->nama_siswa }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">{{ $siswa->nis }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap">
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
|
||||
Aktif
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@endsection
|
||||
|
|
@ -10,54 +10,52 @@
|
|||
|
||||
<!-- Sidebar -->
|
||||
<aside class="w-64 bg-green-600 text-white min-h-screen p-6 shadow-xl">
|
||||
<h2 class="text-2xl font-bold mb-10">Simpaud Kartoharjo</h2>
|
||||
|
||||
<nav class="space-y-4 text-sm">
|
||||
<a href="{{ route('dashboard') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-home mr-3"></i> Home
|
||||
</a>
|
||||
|
||||
<div>
|
||||
<p class="font-semibold uppercase text-xs mb-2">Data Master</p>
|
||||
<ul class="ml-4 space-y-1">
|
||||
<li><a href="{{ route('guru.index') }}" class="block p-2 hover:bg-green-700 rounded">👨🏫 Guru</a></li>
|
||||
<li><a href="{{ route('wali-murid.index') }}"class="block p-2 hover:bg-green-700 rounded">👪 Wali Murid</a></li>
|
||||
<li><a href="{{ route('siswa.index') }}" class="block p-2 hover:bg-green-700 rounded">🧒 Peserta Didik</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.perkembangan.index') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-chart-line mr-3"></i> Laporan Perkembangan
|
||||
</a>
|
||||
|
||||
<a href="{{ route('pengumuman.index') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-bullhorn mr-3"></i> Menu Pengumuman
|
||||
</a>
|
||||
|
||||
<div>
|
||||
<p class="font-semibold uppercase text-xs mb-2">Menu Akun</p>
|
||||
<ul class="ml-4 space-y-1">
|
||||
<li>
|
||||
<a href="{{ route('akun.index') }}"
|
||||
class="block p-2 hover:bg-green-700 rounded">
|
||||
👥 Manajemen Akun
|
||||
<h2 class="text-2xl font-bold mb-10">Simpaud Kartoharjo</h2>
|
||||
|
||||
<nav class="space-y-4 text-sm">
|
||||
<a href="{{ route('dashboard') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-home mr-3"></i> Home
|
||||
</a>
|
||||
|
||||
@if(auth()->user()->role == 'admin')
|
||||
<div>
|
||||
<p class="font-semibold uppercase text-xs mb-2 text-green-200">Data Master</p>
|
||||
<ul class="ml-4 space-y-1">
|
||||
<li><a href="{{ route('guru.index') }}" class="block p-2 hover:bg-green-700 rounded text-white">👨🏫 Guru</a></li>
|
||||
<li><a href="{{ route('wali-murid.index') }}" class="block p-2 hover:bg-green-700 rounded text-white">👪 Wali Murid</a></li>
|
||||
<li><a href="{{ route('siswa.index') }}" class="block p-2 hover:bg-green-700 rounded text-white">🧒 Peserta Didik</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
<p class="font-semibold uppercase text-xs mb-2 text-green-200">Laporan & Info</p>
|
||||
<div class="space-y-1">
|
||||
<a href="{{ route('admin.perkembangan.index') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-chart-line mr-3"></i> Laporan Perkembangan
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('penjemputan.index') }}" class="flex items-center ...">
|
||||
<i class="fas fa-bus me-2"></i> Penjemputan
|
||||
</a>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
@if(auth()->user()->role == 'admin')
|
||||
<a href="{{ route('pengumuman.index') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-bullhorn mr-3"></i> Menu Pengumuman
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a href="{{ route('penjemputan.index') }}" class="flex items-center p-2 rounded-lg hover:bg-green-700 transition">
|
||||
<i class="fas fa-bus mr-3"></i> Penjemputan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="flex-1 flex flex-col">
|
||||
|
||||
<!-- Navbar -->
|
||||
<header class="flex items-center justify-between bg-white px-6 py-4 shadow">
|
||||
<h1 class="text-lg font-semibold">Hai, Admin 👋</h1>
|
||||
Hai, {{ Auth::user()->name }}
|
||||
<div class="flex items-center space-x-4">
|
||||
<input type="text" placeholder="Search Class, Documents, Activities..."
|
||||
class="px-4 py-2 rounded-lg border focus:ring-2 focus:ring-green-400 w-72 text-sm">
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@
|
|||
use App\Http\Controllers\Admin\PerkembanganController;
|
||||
use App\Http\Controllers\Admin\AkunController;
|
||||
use App\Http\Controllers\Admin\PenjemputanController;
|
||||
use App\Http\Controllers\Admin\AnekdotController;
|
||||
use App\Http\Controllers\Admin\HasilKaryaController;
|
||||
use App\Http\Controllers\Admin\PenilaianCeklisController;
|
||||
|
||||
// Login routes
|
||||
Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
|
||||
|
|
@ -55,7 +58,18 @@
|
|||
Route::delete('/penjemputan/{id}', [PenjemputanController::class, 'destroy'])->name('penjemputan.destroy');
|
||||
|
||||
// === ROUTE RAPOT ===
|
||||
//
|
||||
Route::get('/anekdot/create/{siswa}', [App\Http\Controllers\Admin\AnekdotController::class, 'create'])->name('anekdot.create');
|
||||
Route::post('/admin/anekdot/store/{siswa}', [App\Http\Controllers\Admin\AnekdotController::class, 'store'])->name('anekdot.store');
|
||||
|
||||
Route::get('/hasil-karya/create/{siswa}', [App\Http\Controllers\Admin\HasilKaryaController::class, 'create'])->name('hasil-karya.create');
|
||||
Route::post('/hasil-karya/store/{siswa}', [App\Http\Controllers\Admin\HasilKaryaController::class, 'store'])->name('hasil-karya.store');
|
||||
|
||||
Route::get('/ceklis/create/{siswa}', [PenilaianCeklisController::class, 'create'])->name('ceklis.create');
|
||||
Route::post('/ceklis/store/{siswa}', [PenilaianCeklisController::class, 'store'])->name('ceklis.store');
|
||||
// Form Input Rapot Baru
|
||||
//
|
||||
//
|
||||
Route::get('/siswa/{id}/rapot/create', [App\Http\Controllers\Admin\RapotController::class, 'create'])->name('rapot.create');
|
||||
|
||||
// Simpan Data Rapot
|
||||
|
|
|
|||
Loading…
Reference in New Issue