From 812fdc6e0679ffe8bf0dd5c0c95cd5b169e7eeab Mon Sep 17 00:00:00 2001 From: Savema <158044968+SavemaAureliandaru@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:20:36 +0700 Subject: [PATCH] pengukuran ibu hamil --- .../app/Http/Controllers/AnakController.php | 65 +-- .../app/Http/Controllers/AuthController.php | 35 +- .../Http/Controllers/DashboardController.php | 30 + .../Http/Controllers/EdukasiController.php | 91 +++ .../Http/Controllers/IbuHamilController.php | 62 +++ .../PengukuranBalitaController.php | 19 + .../PengukuranIbuHamilController.php | 153 +++++ .../app/Http/Controllers/UsersController.php | 84 +++ project/app/Http/Kernel.php | 5 + .../app/Http/Middleware/RoleMiddleware.php | 28 + project/app/Models/Anak.php | 11 +- project/app/Models/Edukasi.php | 25 + project/app/Models/Edukasi2.php | 24 + project/app/Models/IbuHamil.php | 21 + project/app/Models/PengukuranBalita.php | 35 ++ project/app/Models/PengukuranIbuHamil.php | 35 ++ project/app/Models/User.php | 4 +- project/composer.json | 1 + project/composer.lock | 524 +++++++++++++++++- .../2014_10_12_000000_create_users_table.php | 8 +- ...2026_02_03_053322_create_balita_table.php} | 7 +- ...26_02_03_053516_create_ibu_hamil_table.php | 5 +- ..._144151_create_pengukuran_balita_table.php | 49 ++ ...4200_create_pengukuran_ibu_hamil_table.php | 52 ++ ...2_144257_create_template_edukasi_table.php | 40 ++ ...2026_03_02_144304_create_edukasi_table.php | 57 ++ ...026_03_02_144323_create_laporan_table.php} | 13 +- ...19_033504_drop_kolom_pengukuran_balita.php | 36 ++ .../{login-register => auth}/login.blade.php | 30 +- .../{login-register => auth}/register.php | 0 .../resources/views/balita/create.blade.php | 33 +- .../views/balita/data-balita.blade.php | 91 ++- project/resources/views/balita/edit.blade.php | 81 +++ .../resources/views/dashboard/index.blade.php | 92 ++- .../resources/views/edukasi/create.blade.php | 74 +++ .../resources/views/edukasi/edit.blade.php | 111 ++++ .../resources/views/edukasi/edukasi.blade.php | 90 +++ .../views/ibu_hamil/create.blade.php | 69 +++ .../views/ibu_hamil/data-ibuhamil.blade.php | 84 +++ .../resources/views/ibu_hamil/edit.blade.php | 67 +++ .../views/layouts/dashboard.blade.php | 4 +- .../views/partials/sidebar.blade.php | 18 +- .../views/pdf/hasil_ibu_hamil.blade.php | 123 ++++ .../views/pengukuran_balita/data.blade.php | 95 ++++ .../pengukuran_ibuhamil/create.blade.php | 124 +++++ .../views/pengukuran_ibuhamil/data.blade.php | 96 ++++ .../pengukuran_ibuhamil/detail.blade.php | 144 +++++ .../views/petugas/data-petugas.blade.php | 77 --- .../resources/views/users/create.blade.php | 73 +++ project/resources/views/users/edit.blade.php | 72 +++ project/resources/views/users/users.blade.php | 84 +++ project/routes/web.php | 49 +- 52 files changed, 3101 insertions(+), 199 deletions(-) create mode 100644 project/app/Http/Controllers/DashboardController.php create mode 100644 project/app/Http/Controllers/EdukasiController.php create mode 100644 project/app/Http/Controllers/IbuHamilController.php create mode 100644 project/app/Http/Controllers/PengukuranBalitaController.php create mode 100644 project/app/Http/Controllers/PengukuranIbuHamilController.php create mode 100644 project/app/Http/Controllers/UsersController.php create mode 100644 project/app/Http/Middleware/RoleMiddleware.php create mode 100644 project/app/Models/Edukasi.php create mode 100644 project/app/Models/Edukasi2.php create mode 100644 project/app/Models/IbuHamil.php create mode 100644 project/app/Models/PengukuranBalita.php create mode 100644 project/app/Models/PengukuranIbuHamil.php rename project/database/migrations/{2026_02_03_053322_create_anak_table.php => 2026_02_03_053322_create_balita_table.php} (77%) create mode 100644 project/database/migrations/2026_03_02_144151_create_pengukuran_balita_table.php create mode 100644 project/database/migrations/2026_03_02_144200_create_pengukuran_ibu_hamil_table.php create mode 100644 project/database/migrations/2026_03_02_144257_create_template_edukasi_table.php create mode 100644 project/database/migrations/2026_03_02_144304_create_edukasi_table.php rename project/database/migrations/{2026_02_03_053628_create_kategori_edukasi_table.php => 2026_03_02_144323_create_laporan_table.php} (51%) create mode 100644 project/database/migrations/2026_03_19_033504_drop_kolom_pengukuran_balita.php rename project/resources/views/{login-register => auth}/login.blade.php (89%) rename project/resources/views/{login-register => auth}/register.php (100%) create mode 100644 project/resources/views/edukasi/create.blade.php create mode 100644 project/resources/views/edukasi/edit.blade.php create mode 100644 project/resources/views/edukasi/edukasi.blade.php create mode 100644 project/resources/views/ibu_hamil/create.blade.php create mode 100644 project/resources/views/ibu_hamil/data-ibuhamil.blade.php create mode 100644 project/resources/views/ibu_hamil/edit.blade.php create mode 100644 project/resources/views/pdf/hasil_ibu_hamil.blade.php create mode 100644 project/resources/views/pengukuran_balita/data.blade.php create mode 100644 project/resources/views/pengukuran_ibuhamil/create.blade.php create mode 100644 project/resources/views/pengukuran_ibuhamil/data.blade.php create mode 100644 project/resources/views/pengukuran_ibuhamil/detail.blade.php delete mode 100644 project/resources/views/petugas/data-petugas.blade.php create mode 100644 project/resources/views/users/create.blade.php create mode 100644 project/resources/views/users/edit.blade.php create mode 100644 project/resources/views/users/users.blade.php diff --git a/project/app/Http/Controllers/AnakController.php b/project/app/Http/Controllers/AnakController.php index 2afe6cb..3819f12 100644 --- a/project/app/Http/Controllers/AnakController.php +++ b/project/app/Http/Controllers/AnakController.php @@ -12,8 +12,8 @@ class AnakController extends Controller */ public function index() { - $anak = Anak::latest()->get(); - return view('balita.data-balita', compact('anak')); + $balita = Anak::latest()->get(); + return view('balita.data-balita', compact('balita')); } /** @@ -30,61 +30,54 @@ public function create() */ public function store(Request $request) { - $request->validate([ - 'nik' => 'required|unique:anak', - 'nama' => 'required', - 'jenis_kelamin' => 'required', - 'tanggal_lahir' => 'required|date', - ]); + Anak::create([ + 'nik' => $request->nik, + 'nama' => $request->nama, + 'jenis_kelamin' => $request->jenis_kelamin, + 'tgl_lahir' => $request->tgl_lahir, + 'nama_ortu' => $request->nama_ortu, + 'alamat' => $request->alamat + ]); - Anak::create($request->all()); - - return redirect()->route('balita.data-balita') - ->with('success', 'Data balita berhasil ditambahkan'); - } - - /** - * Display the specified resource. - */ - public function show(string $id) - { - // + return redirect()->route('balita.index')->with('success','Data berhasil ditambahkan'); } /** * Show the form for editing the specified resource. */ - public function edit(Anak $anak) + public function edit($id) { - return view('balita.edit', compact('anak')); + $balita = Anak::findOrFail($id); + return view('balita.edit', compact('balita')); } /** * Update the specified resource in storage. */ - public function update(Request $request, Anak $anak) + public function update(Request $request, $id) { - $request->validate([ - 'nik' => 'required|unique:anak,nik,' . $anak->id, - 'nama' => 'required', - 'jenis_kelamin' => 'required', - 'tanggal_lahir' => 'required|date', + $balita = Anak::findOrFail($id); + + $balita->update([ + 'nik' => $request->nik, + 'nama' => $request->nama, + 'jenis_kelamin' => $request->jenis_kelamin, + 'tgl_lahir' => $request->tgl_lahir, + 'nama_ortu' => $request->nama_ortu, + 'alamat' => $request->alamat ]); - $anak->update($request->all()); - - return redirect()->route('balita.data-balita') - ->with('success', 'Data balita berhasil diperbarui'); + return redirect()->route('balita.index')->with('success','Data berhasil diupdate'); } /** * Remove the specified resource from storage. */ - public function destroy(Anak $anak) + public function destroy($id) { - $anak->delete(); + $balita = Anak::findOrFail($id); + $balita->delete(); - return redirect()->route('anak.index') - ->with('success', 'Data anak berhasil dihapus'); + return redirect()->route('balita.index')->with('success','Data berhasil dihapus'); } } diff --git a/project/app/Http/Controllers/AuthController.php b/project/app/Http/Controllers/AuthController.php index b03fb10..ff8abcb 100644 --- a/project/app/Http/Controllers/AuthController.php +++ b/project/app/Http/Controllers/AuthController.php @@ -3,13 +3,40 @@ namespace App\Http\Controllers; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; class AuthController extends Controller { - public function showRegister() { - return view('login-register.register'); + public function login(Request $request) + { + $data = [ + 'email' => $request->email, + 'password' => $request->password + ]; + + if (Auth::attempt($data)) { + + if (auth()->user()->role == 'admin') { + return redirect('/dashboard'); + } + + if (auth()->user()->role == 'petugas') { + return redirect('/dashboard'); + } + + } else { + return back()->with('error', 'Email atau password salah'); + } } - public function showLogin() { - return view('login-register.login'); + + public function logout(Request $request) + { + Auth::logout(); // Menghapus autentikasi user + + $request->session()->invalidate(); // Menghapus semua data session + $request->session()->regenerateToken(); // Mencegah serangan CSRF + + return redirect('/login')->with('success', 'Anda telah berhasil keluar.'); } + } diff --git a/project/app/Http/Controllers/DashboardController.php b/project/app/Http/Controllers/DashboardController.php new file mode 100644 index 0000000..74a6ddb --- /dev/null +++ b/project/app/Http/Controllers/DashboardController.php @@ -0,0 +1,30 @@ +groupBy('bulan') + ->orderBy('bulan') + ->get(); + + return view('dashboard.index', compact( 'total_ibu_hamil', 'total_balita', 'total_petugas', 'grafik')); + } +} diff --git a/project/app/Http/Controllers/EdukasiController.php b/project/app/Http/Controllers/EdukasiController.php new file mode 100644 index 0000000..be61a83 --- /dev/null +++ b/project/app/Http/Controllers/EdukasiController.php @@ -0,0 +1,91 @@ +get(); + return view('edukasi.edukasi', compact('t_edukasi')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + return view('edukasi.create'); + } + + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + if ($request->hasFile('gambar')) { + $gambar = $request->file('gambar')->store('edukasi', 'public'); + } else { + $gambar = null; + } + Edukasi::create([ + 'judul' => $request->judul, + 'konten' => $request->konten, + 'kategori' => $request->kategori, + 'gambar' => $gambar + ]); + + return redirect()->route('edukasi.index')->with('success','Data berhasil ditambahkan'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $t_edukasi = Edukasi::findOrFail($id); + return view('edukasi.edit', compact('t_edukasi')); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id) + { + $t_edukasi = Edukasi::findOrFail($id); + + if ($request->hasFile('gambar')) { + + $gambar = $request->file('gambar')->store('edukasi','public'); + + } else { + + $gambar = $t_edukasi->gambar; + + } + + $t_edukasi->update([ + 'judul' => $request->judul, + 'konten' => $request->konten, + 'kategori' => $request->kategori, + 'gambar' => $gambar + ]); + + return redirect()->route('edukasi.index')->with('success','Data berhasil diupdate'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + $t_edukasi = Edukasi::findOrFail($id); + $t_edukasi->delete(); + + return redirect()->route('edukasi.index')->with('success','Data berhasil dihapus'); + } +} diff --git a/project/app/Http/Controllers/IbuHamilController.php b/project/app/Http/Controllers/IbuHamilController.php new file mode 100644 index 0000000..835b1cc --- /dev/null +++ b/project/app/Http/Controllers/IbuHamilController.php @@ -0,0 +1,62 @@ +get(); + return view('ibu_hamil.data-ibuhamil', compact('ibu_hamil')); + } + + public function create() + { + return view('ibu_hamil.create'); + } + + public function store(Request $request) + { + IbuHamil::create([ + 'nik' => $request->nik, + 'nama' => $request->nama, + 'tgl_lahir' => $request->tgl_lahir, + 'alamat' => $request->alamat, + 'no_hp' => $request->no_hp + ]); + + return redirect()->route('ibu_hamil.index')->with('success','Data berhasil ditambahkan'); + } + + public function edit($id) + { + $ibu_hamil = IbuHamil::findOrFail($id); + return view('ibu_hamil.edit', compact('ibu_hamil')); + } + + public function update(Request $request, $id) + { + $ibu_hamil = IbuHamil::findOrFail($id); + + $ibu_hamil->update([ + 'nik' => $request->nik, + 'nama' => $request->nama, + 'tgl_lahir' => $request->tgl_lahir, + 'alamat' => $request->alamat, + 'no_hp' => $request->no_hp + ]); + + return redirect()->route('ibu_hamil.index')->with('success','Data berhasil diupdate'); + } + + public function destroy($id) + { + $ibu_hamil = IbuHamil::findOrFail($id); + $ibu_hamil->delete(); + + return redirect()->route('ibu_hamil.index')->with('success','Data berhasil dihapus'); + } +} diff --git a/project/app/Http/Controllers/PengukuranBalitaController.php b/project/app/Http/Controllers/PengukuranBalitaController.php new file mode 100644 index 0000000..8182a52 --- /dev/null +++ b/project/app/Http/Controllers/PengukuranBalitaController.php @@ -0,0 +1,19 @@ +get(); + + // $ibu->usia = Carbon::parse($ibu->tgl_lahir)->age; + // return $ibu; + return view('pengukuran_balita.data', compact('p_balita')); + } +} diff --git a/project/app/Http/Controllers/PengukuranIbuHamilController.php b/project/app/Http/Controllers/PengukuranIbuHamilController.php new file mode 100644 index 0000000..917c978 --- /dev/null +++ b/project/app/Http/Controllers/PengukuranIbuHamilController.php @@ -0,0 +1,153 @@ +get(); + + // $ibu->usia = Carbon::parse($ibu->tgl_lahir)->age; + // return $ibu; + return view('pengukuran_ibuhamil.data', compact('p_ibuhamil')); + } + + public function create() + { + $ibu_hamil = IbuHamil::all(); + + return view('pengukuran_ibuhamil.create', compact('ibu_hamil')); + } + + public function store(Request $request) + { + $request->validate([ + 'ibu_hamil_id' => 'required|exists:ibu_hamil,id', + 'berat_badan' => 'required|numeric', + 'tinggi_badan' => 'required|numeric', + 'lila' => 'nullable|numeric', + 'usia_kehamilan' => 'required|integer', + ]); + + DB::transaction(function () use ($request) { + + // Hitung IMT + $tb_meter = $request->tinggi_badan / 100; + + if ($tb_meter <= 0) { + $imt = 0; + } else { + $imt = $request->berat_badan / ($tb_meter * $tb_meter); + } + + // Status Gizi + if ($imt < 18.5) { + $status_gizi = 'ibu hamil gizi kurang'; + } elseif ($imt <= 24.9) { + $status_gizi = 'ibu hamil gizi normal'; + } elseif ($imt <= 29.9) { + $status_gizi = 'ibu hamil gizi lebih'; + } else { + $status_gizi = 'ibu hamil obesitas'; + } + + // Simpan Pengukuran + $pengukuran = PengukuranIbuHamil::create([ + 'ibu_hamil_id' => $request->ibu_hamil_id, + 'user_id' => Auth::id(), + 'tanggal' => now(), + 'berat_badan' => $request->berat_badan, + 'tinggi_badan' => $request->tinggi_badan, + 'lila' => $request->lila, + 'usia_kehamilan' => $request->usia_kehamilan, + 'imt' => round($imt,2), + 'status_gizi' => $status_gizi, + ]); + + // Ambil Template Edukasi + $template = Edukasi::where('kategori', $status_gizi)->get(); + + // Simpan Edukasi Hasil + foreach ($template as $item) { + + Edukasi2::create([ + 'ibu_hamil_id' => $request->ibu_hamil_id, + 'pengukuran_ibu_hamil_id' => $pengukuran->id, + 'judul' => $item->judul, + 'konten' => $item->konten, + 'kategori' => $status_gizi + ]); + + } + + }); + + return redirect()->route('pengukuran_ibu_hamil.index') + ->with('success','Hasil pemeriksaan dan edukasi berhasil disimpan!'); + } + + public function destroy($id) + { + $p_ibuhamil = PengukuranIbuHamil::findOrFail($id); + $p_ibuhamil->delete(); + + return redirect()->route('pengukuran_ibu_hamil.index')->with('success','Data berhasil dihapus'); + } + + public function detail($id) + { + // ambil pengukuran yang dipilih + $pengukuran = PengukuranIbuHamil::with('ibuHamil')->findOrFail($id); + + // ambil semua riwayat pengukuran ibu tersebut + $pengukurans = PengukuranIbuHamil::where('ibu_hamil_id', $pengukuran->ibu_hamil_id) + ->orderBy('tanggal','asc') + ->get(); + + // ambil edukasi + $edukasi = Edukasi2::where('pengukuran_ibu_hamil_id', $id)->get(); + + // data untuk grafik + $tanggal = $pengukurans->pluck('tanggal'); + $bb = $pengukurans->pluck('berat_badan'); + $imt = $pengukurans->pluck('imt'); + + return view('pengukuran_ibuhamil.detail', compact( + 'pengukuran', + 'pengukurans', + 'edukasi', + 'tanggal', + 'bb', + 'imt' + )); + } + + public function cetakPdf(Request $request, $id) + { + $pengukuran = PengukuranIbuHamil::with(['petugas','ibuHamil'])->findOrFail($id); + $edukasi = Edukasi2::where('pengukuran_ibu_hamil_id', $id)->get(); + $chartImage = $request->chartImage; + + $pdf = \Barryvdh\DomPDF\Facade\Pdf::loadView( + 'pdf.hasil_ibu_hamil', + compact('pengukuran','edukasi','chartImage') + ); + + return $pdf->download('laporan_ibu_hamil.pdf'); + } + +} + diff --git a/project/app/Http/Controllers/UsersController.php b/project/app/Http/Controllers/UsersController.php new file mode 100644 index 0000000..e987617 --- /dev/null +++ b/project/app/Http/Controllers/UsersController.php @@ -0,0 +1,84 @@ +get(); + return view('users.users', compact('user')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + return view('users.create'); + } + + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + User::create([ + 'nama' => $request->nama, + 'no_hp' => $request->no_hp, + 'email' => $request->email, + 'password' => bcrypt($request->password), + 'role' => $request->role + + ]); + + return redirect()->route('users.index')->with('success','Data berhasil ditambahkan'); + } + + /** + * Show the form for editing the specified resource. + */ + public function edit($id) + { + $user = User::findOrFail($id); + return view('users.edit', compact('user')); + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, $id) + { + $user = User::findOrFail($id); + + $data = [ + 'nama' => $request->nama, + 'no_hp' => $request->no_hp, + 'email' => $request->email, + 'role' => $request->role + ]; + + if ($request->password) { + $data['password'] = bcrypt($request->password); + } + + $user->update($data); + + return redirect()->route('users.index')->with('success','Data berhasil diupdate'); + } + + /** + * Remove the specified resource from storage. + */ + public function destroy($id) + { + $user = User::findOrFail($id); + $user->delete(); + + return redirect()->route('users.index')->with('success','Data berhasil dihapus'); + } +} diff --git a/project/app/Http/Kernel.php b/project/app/Http/Kernel.php index 494c050..aecfee8 100644 --- a/project/app/Http/Kernel.php +++ b/project/app/Http/Kernel.php @@ -65,4 +65,9 @@ class Kernel extends HttpKernel 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; + + protected $routeMiddleware = [ + 'auth' => \App\Http\Middleware\Authenticate::class, + 'role' => \App\Http\Middleware\RoleMiddleware::class, + ]; } diff --git a/project/app/Http/Middleware/RoleMiddleware.php b/project/app/Http/Middleware/RoleMiddleware.php new file mode 100644 index 0000000..bc41c05 --- /dev/null +++ b/project/app/Http/Middleware/RoleMiddleware.php @@ -0,0 +1,28 @@ +check()) { + return redirect('/login'); + } + + if (auth()->user()->role != $role) { + abort(403); + } + + return $next($request); + } +} diff --git a/project/app/Models/Anak.php b/project/app/Models/Anak.php index 48e204c..362a8a5 100644 --- a/project/app/Models/Anak.php +++ b/project/app/Models/Anak.php @@ -9,12 +9,19 @@ class Anak extends Model { use HasFactory; - protected $table = 'anak'; + protected $table = 'balita'; protected $fillable = [ 'nik', 'nama', 'jenis_kelamin', - 'tanggal_lahir', + 'tgl_lahir', + 'nama_ortu', + 'alamat' ]; + + public function getJenisKelaminTextAttribute() + { + return $this->jenis_kelamin == 1 ? 'Laki-laki' : 'Perempuan'; + } } diff --git a/project/app/Models/Edukasi.php b/project/app/Models/Edukasi.php new file mode 100644 index 0000000..db651e7 --- /dev/null +++ b/project/app/Models/Edukasi.php @@ -0,0 +1,25 @@ +jenis_kelamin == 1 ? 'Laki-laki' : 'Perempuan'; + // } +} diff --git a/project/app/Models/Edukasi2.php b/project/app/Models/Edukasi2.php new file mode 100644 index 0000000..de4ea4a --- /dev/null +++ b/project/app/Models/Edukasi2.php @@ -0,0 +1,24 @@ +belongsTo(IbuHamil::class, 'ibu_hamil_id'); + } + + public function petugas() + { + return $this->belongsTo(User::class, 'user_id'); + } +} diff --git a/project/app/Models/PengukuranIbuHamil.php b/project/app/Models/PengukuranIbuHamil.php new file mode 100644 index 0000000..d92f98c --- /dev/null +++ b/project/app/Models/PengukuranIbuHamil.php @@ -0,0 +1,35 @@ +belongsTo(IbuHamil::class, 'ibu_hamil_id'); + } + + public function petugas() + { + return $this->belongsTo(User::class, 'user_id'); + } +} diff --git a/project/app/Models/User.php b/project/app/Models/User.php index 4d7f70f..046ec4b 100644 --- a/project/app/Models/User.php +++ b/project/app/Models/User.php @@ -18,9 +18,11 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'name', + 'nama', + 'no_hp', 'email', 'password', + 'role' ]; /** diff --git a/project/composer.json b/project/composer.json index 8a3d72d..d33723b 100644 --- a/project/composer.json +++ b/project/composer.json @@ -6,6 +6,7 @@ "license": "MIT", "require": { "php": "^8.1", + "barryvdh/laravel-dompdf": "^3.1", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^10.10", "laravel/sanctum": "^3.3", diff --git a/project/composer.lock b/project/composer.lock index 173a345..435d650 100644 --- a/project/composer.lock +++ b/project/composer.lock @@ -4,8 +4,85 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9c491b8531eec05ba41a11d9276a5749", + "content-hash": "50a9cf43c3c522104b200bfdbe2e0e54", "packages": [ + { + "name": "barryvdh/laravel-dompdf", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-dompdf.git", + "reference": "8e71b99fc53bb8eb77f316c3c452dd74ab7cb25d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/8e71b99fc53bb8eb77f316c3c452dd74ab7cb25d", + "reference": "8e71b99fc53bb8eb77f316c3c452dd74ab7cb25d", + "shasum": "" + }, + "require": { + "dompdf/dompdf": "^3.0", + "illuminate/support": "^9|^10|^11|^12", + "php": "^8.1" + }, + "require-dev": { + "larastan/larastan": "^2.7|^3.0", + "orchestra/testbench": "^7|^8|^9|^10", + "phpro/grumphp": "^2.5", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "PDF": "Barryvdh\\DomPDF\\Facade\\Pdf", + "Pdf": "Barryvdh\\DomPDF\\Facade\\Pdf" + }, + "providers": [ + "Barryvdh\\DomPDF\\ServiceProvider" + ] + }, + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\DomPDF\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "A DOMPDF Wrapper for Laravel", + "keywords": [ + "dompdf", + "laravel", + "pdf" + ], + "support": { + "issues": "https://github.com/barryvdh/laravel-dompdf/issues", + "source": "https://github.com/barryvdh/laravel-dompdf/tree/v3.1.1" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-02-13T15:07:54+00:00" + }, { "name": "brick/math", "version": "0.12.3", @@ -377,6 +454,161 @@ ], "time": "2024-02-05T11:56:58+00:00" }, + { + "name": "dompdf/dompdf", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "shasum": "" + }, + "require": { + "dompdf/php-font-lib": "^1.0.0", + "dompdf/php-svg-lib": "^1.0.0", + "ext-dom": "*", + "ext-mbstring": "*", + "masterminds/html5": "^2.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ext-gd": "*", + "ext-json": "*", + "ext-zip": "*", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.4 || ^5.4 || ^6.2 || ^7.0" + }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance", + "ext-zlib": "Needed for pdf stream compression" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dompdf\\": "src/" + }, + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "The Dompdf Community", + "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "support": { + "issues": "https://github.com/dompdf/dompdf/issues", + "source": "https://github.com/dompdf/dompdf/tree/v3.1.5" + }, + "time": "2026-03-03T13:54:37+00:00" + }, + { + "name": "dompdf/php-font-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-font-lib.git", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11 || ^12" + }, + "type": "library", + "autoload": { + "psr-4": { + "FontLib\\": "src/FontLib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "The FontLib Community", + "homepage": "https://github.com/dompdf/php-font-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/dompdf/php-font-lib", + "support": { + "issues": "https://github.com/dompdf/php-font-lib/issues", + "source": "https://github.com/dompdf/php-font-lib/tree/1.0.2" + }, + "time": "2026-01-20T14:10:26+00:00" + }, + { + "name": "dompdf/php-svg-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabberworm/php-css-parser": "^8.4 || ^9.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Svg\\": "src/Svg" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "The SvgLib Community", + "homepage": "https://github.com/dompdf/php-svg-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse and export to PDF SVG files.", + "homepage": "https://github.com/dompdf/php-svg-lib", + "support": { + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/1.0.2" + }, + "time": "2026-01-02T16:01:13+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.5.0", @@ -1888,6 +2120,73 @@ ], "time": "2024-09-21T08:32:55+00:00" }, + { + "name": "masterminds/html5", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "fcf91eb64359852f00d921887b219479b4f21251" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251", + "reference": "fcf91eb64359852f00d921887b219479b4f21251", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.10.0" + }, + "time": "2025-07-25T09:04:22+00:00" + }, { "name": "monolog/monolog", "version": "3.10.0", @@ -3159,6 +3458,86 @@ }, "time": "2025-12-14T04:43:48+00:00" }, + { + "name": "sabberworm/php-css-parser", + "version": "v9.3.0", + "source": { + "type": "git", + "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^7.2.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "thecodingmachine/safe": "^1.3 || ^2.5 || ^3.4" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/extension-installer": "1.4.3", + "phpstan/phpstan": "1.12.32 || 2.1.32", + "phpstan/phpstan-phpunit": "1.4.2 || 2.0.8", + "phpstan/phpstan-strict-rules": "1.6.2 || 2.0.7", + "phpunit/phpunit": "8.5.52", + "rawr/phpunit-data-provider": "3.3.1", + "rector/rector": "1.2.10 || 2.2.8", + "rector/type-perfect": "1.0.0 || 2.1.0", + "squizlabs/php_codesniffer": "4.0.1", + "thecodingmachine/phpstan-safe-rule": "1.2.0 || 1.4.1" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.4.x-dev" + } + }, + "autoload": { + "files": [ + "src/Rule/Rule.php", + "src/RuleSet/RuleContainer.php" + ], + "psr-4": { + "Sabberworm\\CSS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "support": { + "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v9.3.0" + }, + "time": "2026-03-03T17:31:43+00:00" + }, { "name": "symfony/console", "version": "v6.4.32", @@ -5416,6 +5795,149 @@ ], "time": "2026-01-01T13:34:06+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/705683a25bacf0d4860c7dea4d7947bfd09eea19", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "library", + "autoload": { + "files": [ + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rnp.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/OskarStark", + "type": "github" + }, + { + "url": "https://github.com/shish", + "type": "github" + }, + { + "url": "https://github.com/silasjoisten", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2026-02-04T18:08:13+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.4.0", diff --git a/project/database/migrations/2014_10_12_000000_create_users_table.php b/project/database/migrations/2014_10_12_000000_create_users_table.php index d2d3399..8bf6f63 100644 --- a/project/database/migrations/2014_10_12_000000_create_users_table.php +++ b/project/database/migrations/2014_10_12_000000_create_users_table.php @@ -13,10 +13,10 @@ public function up(): void { Schema::create('users', function (Blueprint $table) { $table->id(); - $table->string('name'); - $table->string('no_hp')->nullable(); - $table->string('email')->unique(); - $table->string('password'); + $table->string('nama', 100); + $table->string('no_hp', 15)->nullable(); + $table->string('email', 100)->unique(); + $table->string('password', 255); $table->enum('role', ['admin', 'petugas']); $table->rememberToken(); $table->timestamps(); diff --git a/project/database/migrations/2026_02_03_053322_create_anak_table.php b/project/database/migrations/2026_02_03_053322_create_balita_table.php similarity index 77% rename from project/database/migrations/2026_02_03_053322_create_anak_table.php rename to project/database/migrations/2026_02_03_053322_create_balita_table.php index 1c93b38..25c5ecc 100644 --- a/project/database/migrations/2026_02_03_053322_create_anak_table.php +++ b/project/database/migrations/2026_02_03_053322_create_balita_table.php @@ -11,12 +11,15 @@ */ public function up(): void { - Schema::create('anak', function (Blueprint $table) { + Schema::create('balita', function (Blueprint $table) { $table->id(); $table->string('nik')->unique(); $table->string('nama', 100); $table->tinyInteger('jenis_kelamin'); // 1 = laki-laki, 0 = perempuan - $table->date('tanggal_lahir'); + $table->date('tgl_lahir'); + $table->string('nama_ortu', 50); + $table->text('alamat'); + $table->timestamps(); }); } diff --git a/project/database/migrations/2026_02_03_053516_create_ibu_hamil_table.php b/project/database/migrations/2026_02_03_053516_create_ibu_hamil_table.php index 00176f7..52a9b3b 100644 --- a/project/database/migrations/2026_02_03_053516_create_ibu_hamil_table.php +++ b/project/database/migrations/2026_02_03_053516_create_ibu_hamil_table.php @@ -15,8 +15,9 @@ public function up(): void $table->id(); $table->string('nik')->unique(); $table->string('nama', 100); - $table->integer('usia'); - $table->integer('usia_kehamilan'); // minggu + $table->date('tgl_lahir'); + $table->text('alamat'); + $table->string('no_hp', 15); $table->timestamps(); }); } diff --git a/project/database/migrations/2026_03_02_144151_create_pengukuran_balita_table.php b/project/database/migrations/2026_03_02_144151_create_pengukuran_balita_table.php new file mode 100644 index 0000000..96fca4f --- /dev/null +++ b/project/database/migrations/2026_03_02_144151_create_pengukuran_balita_table.php @@ -0,0 +1,49 @@ +id(); + $table->foreignId('balita_id') + ->constrained('balita') + ->onDelete('cascade'); + + $table->foreignId('user_id') + ->constrained('users') + ->onDelete('cascade'); + + $table->decimal('berat_badan', 5, 2); // kg + $table->decimal('tinggi_badan', 5, 2); // cm + $table->decimal('lingkar_kepala', 5, 2); // cm + + $table->integer('usia_saat_ukur'); // bulan + $table->date('tanggal'); + + $table->string('hasil'); + $table->decimal('zs_tbu', 5, 2)->nullable(); + $table->decimal('bmi', 5, 2)->nullable(); + $table->decimal('zs_bmi_u', 5, 2)->nullable(); + + $table->string('status_gizi_bmi', 100)->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('pengukuran_balita'); + } +}; diff --git a/project/database/migrations/2026_03_02_144200_create_pengukuran_ibu_hamil_table.php b/project/database/migrations/2026_03_02_144200_create_pengukuran_ibu_hamil_table.php new file mode 100644 index 0000000..c88d8c4 --- /dev/null +++ b/project/database/migrations/2026_03_02_144200_create_pengukuran_ibu_hamil_table.php @@ -0,0 +1,52 @@ +id(); + + $table->foreignId('ibu_hamil_id') + ->constrained('ibu_hamil') + ->onDelete('cascade'); + + $table->foreignId('user_id') + ->constrained('users') + ->onDelete('cascade'); + + $table->decimal('berat_badan', 5, 2); // kg + $table->decimal('tinggi_badan', 5, 2); // cm + $table->decimal('lila', 5, 2)->nullable(); // cm + + $table->integer('usia_kehamilan'); // minggu + $table->date('tanggal'); + + $table->decimal('imt', 5, 2); + + $table->enum('status_gizi', [ + 'ibu hamil gizi kurang', + 'ibu hamil gizi normal', + 'ibu hamil gizi lebih', + 'ibu hamil obesitas' + ])->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('pengukuran_ibu_hamil'); + } +}; diff --git a/project/database/migrations/2026_03_02_144257_create_template_edukasi_table.php b/project/database/migrations/2026_03_02_144257_create_template_edukasi_table.php new file mode 100644 index 0000000..6de4b9a --- /dev/null +++ b/project/database/migrations/2026_03_02_144257_create_template_edukasi_table.php @@ -0,0 +1,40 @@ +id(); + $table->string('judul', 100); + $table->text('konten'); + $table->enum('kategori', [ + 'Resiko tinggi stunting', + 'Stunting', + 'Normal', + 'Resiko gizi lebih', + 'Ibu hamil gizi kurang', + 'Ibu hamil gizi normal', + 'Ibu hamil gizi lebih', + 'Ibu hamil obesitas', + 'Ibu hamil risiko kek' + ])->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('template_edukasi'); + } +}; diff --git a/project/database/migrations/2026_03_02_144304_create_edukasi_table.php b/project/database/migrations/2026_03_02_144304_create_edukasi_table.php new file mode 100644 index 0000000..86f46fd --- /dev/null +++ b/project/database/migrations/2026_03_02_144304_create_edukasi_table.php @@ -0,0 +1,57 @@ +id(); + $table->foreignId('balita_id')->nullable() + ->constrained('balita') + ->onDelete('cascade'); + + $table->foreignId('ibu_hamil_id')->nullable() + ->constrained('ibu_hamil') + ->onDelete('cascade'); + + $table->foreignId('pengukuran_ibu_hamil_id')->nullable() + ->constrained('pengukuran_ibu_hamil') + ->onDelete('cascade'); + + $table->foreignId('pengukuran_balita_id')->nullable() + ->constrained('pengukuran_balita') + ->onDelete('cascade'); + + $table->string('judul', 100); + $table->text('konten'); + $table->enum('kategori', [ + 'Resiko tinggi stunting', + 'Stunting', + 'Normal', + 'Resiko gizi lebih', + 'Ibu hamil gizi kurang', + 'Ibu hamil gizi normal', + 'Ibu hamil gizi lebih', + 'Ibu hamil obesitas', + 'Ibu hamil risiko kek' + ])->nullable(); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('edukasi'); + } +}; diff --git a/project/database/migrations/2026_02_03_053628_create_kategori_edukasi_table.php b/project/database/migrations/2026_03_02_144323_create_laporan_table.php similarity index 51% rename from project/database/migrations/2026_02_03_053628_create_kategori_edukasi_table.php rename to project/database/migrations/2026_03_02_144323_create_laporan_table.php index 434dcc0..77ff843 100644 --- a/project/database/migrations/2026_02_03_053628_create_kategori_edukasi_table.php +++ b/project/database/migrations/2026_03_02_144323_create_laporan_table.php @@ -11,10 +11,15 @@ */ public function up(): void { - Schema::create('kategori_edukasi', function (Blueprint $table) { + Schema::create('laporan', function (Blueprint $table) { $table->id(); - $table->string('nama_kategori'); - $table->enum('target', ['balita', 'ibu_hamil']); + $table->foreignId('pengukuran_ibu_hamil_id') + ->constrained('pengukuran_ibu_hamil') + ->onDelete('cascade'); + + $table->foreignId('pengukuran_balita_id') + ->constrained('pengukuran_balita') + ->onDelete('cascade'); $table->timestamps(); }); } @@ -24,6 +29,6 @@ public function up(): void */ public function down(): void { - Schema::dropIfExists('kategori_edukasi'); + Schema::dropIfExists('laporan'); } }; diff --git a/project/database/migrations/2026_03_19_033504_drop_kolom_pengukuran_balita.php b/project/database/migrations/2026_03_19_033504_drop_kolom_pengukuran_balita.php new file mode 100644 index 0000000..e970051 --- /dev/null +++ b/project/database/migrations/2026_03_19_033504_drop_kolom_pengukuran_balita.php @@ -0,0 +1,36 @@ +dropColumn([ + 'bmi', + 'zs_bmi_u', + 'status_gizi_bmi' + ]); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + { + Schema::table('pengukuran_balita', function (Blueprint $table) { + $table->decimal('bmi', 5, 2)->nullable(); + $table->decimal('zs_bmi_u', 5, 2)->nullable(); + $table->string('status_gizi_bmi', 100)->nullable(); + }); + } + } +}; diff --git a/project/resources/views/login-register/login.blade.php b/project/resources/views/auth/login.blade.php similarity index 89% rename from project/resources/views/login-register/login.blade.php rename to project/resources/views/auth/login.blade.php index 569ba06..568a74b 100644 --- a/project/resources/views/login-register/login.blade.php +++ b/project/resources/views/auth/login.blade.php @@ -321,25 +321,29 @@

Selamat Datang

Silakan masuk untuk melanjutkan

+ + @if(session('error')) +
+ {{ session('error') }} +
+ @endif +
- -
- - -
-
- - -
+ @csrf +
+ + +
+
+ + +
+ -
-
-

Belum punya akun? Daftar

-
diff --git a/project/resources/views/login-register/register.php b/project/resources/views/auth/register.php similarity index 100% rename from project/resources/views/login-register/register.php rename to project/resources/views/auth/register.php diff --git a/project/resources/views/balita/create.blade.php b/project/resources/views/balita/create.blade.php index b1b3538..9f9a963 100644 --- a/project/resources/views/balita/create.blade.php +++ b/project/resources/views/balita/create.blade.php @@ -17,35 +17,46 @@
Tambah Data Balita
-
-
- -
- -
-
+ + @csrf
- +
- +
- +
- + +
+
+
+ +
+ +
+
+
+ +
+
diff --git a/project/resources/views/balita/data-balita.blade.php b/project/resources/views/balita/data-balita.blade.php index 3c81ae8..5605140 100644 --- a/project/resources/views/balita/data-balita.blade.php +++ b/project/resources/views/balita/data-balita.blade.php @@ -27,39 +27,88 @@ - + - + - - - - - - - - - - + @forelse ($balita as $index => $balitas) + + + + + + + + + + + @empty + + + + @endforelse
NoNo Nama BalitaAlamatAlamat Tanggal Lahir Jenis Kelamin Nama Orang Tua Aksi
- - - - -
{{ $index + 1 }}{{ $balitas->nama }}{{ $balitas->alamat }}{{ $balitas->tgl_lahir }} + + {{ $balitas->jenis_kelamin == 1 ? 'Laki-laki' : 'Perempuan' }} + + {{ $balitas->nama_ortu }} + + + + + + + + + @csrf + @method('DELETE') + + + +
+ Belum ada data balita +
+ {{--
+
+
Pagination with icon
+ + + + +
+
--}} diff --git a/project/resources/views/balita/edit.blade.php b/project/resources/views/balita/edit.blade.php index e69de29..290abae 100644 --- a/project/resources/views/balita/edit.blade.php +++ b/project/resources/views/balita/edit.blade.php @@ -0,0 +1,81 @@ +@extends('layouts.dashboard') + +@section('title', 'Edit Data Balita') + +@section('content') + +
+

Edit Data Balita

+
+ +
+
+
+ +
+
+
Edit Data Balita
+ + +
+ @csrf + @method('PUT') +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/dashboard/index.blade.php b/project/resources/views/dashboard/index.blade.php index f238d2f..182bc4a 100644 --- a/project/resources/views/dashboard/index.blade.php +++ b/project/resources/views/dashboard/index.blade.php @@ -24,7 +24,7 @@
-
145
+
{{ $total_balita }}
@@ -36,15 +36,15 @@
- Balita Risiko Stunting | Total + Pengguna | Total
- +
-
335
+
{{ $total_petugas }}
@@ -64,13 +64,95 @@
-
45
+
{{ $total_ibu_hamil }}
+ +
+
+ +
+ + +
+ +
+
Reports /Today
+ + +
+ + + + +
+ +
+
+ diff --git a/project/resources/views/edukasi/create.blade.php b/project/resources/views/edukasi/create.blade.php new file mode 100644 index 0000000..75b502e --- /dev/null +++ b/project/resources/views/edukasi/create.blade.php @@ -0,0 +1,74 @@ +@extends('layouts.dashboard') + +@section('title', 'Form Data Edukasi') + +@section('content') + +
+

Form Data Edukasi

+
+ +
+
+
+ +
+
+
Tambah Data Edukasi
+ + +
+ @csrf + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + {{-- --}} +
+
+ + {{--
+ +
+ +
+
--}} + +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/edukasi/edit.blade.php b/project/resources/views/edukasi/edit.blade.php new file mode 100644 index 0000000..9d07276 --- /dev/null +++ b/project/resources/views/edukasi/edit.blade.php @@ -0,0 +1,111 @@ +@extends('layouts.dashboard') + +@section('title', 'Edit Data Edukasi') + +@section('content') + +
+

Edit Data Edukasi

+
+ +
+
+
+ +
+
+
Edit Data Edukasi
+ + +
+ @csrf + @method('PUT') + +
+ +
+ + +
+
+
+ +
+ +
+
+
+ +
+ + {{-- --}} +
+
+ + {{--
+ +
+ + @if($t_edukasi->gambar) + + @endif + + + +
+
--}} +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/edukasi/edukasi.blade.php b/project/resources/views/edukasi/edukasi.blade.php new file mode 100644 index 0000000..c293539 --- /dev/null +++ b/project/resources/views/edukasi/edukasi.blade.php @@ -0,0 +1,90 @@ +@extends('layouts.dashboard') + +@section('title', 'Data Edukasi') + +@section('content') + + +
+

Data Edukasi

+
+ + +
+
+ + +
+
Daftar Edukasi
+ + + Tambah Data Edukasi + +
+ + +
+ + + + + + + + {{-- --}} + + + + + @forelse ($t_edukasi as $index => $t_edukasis) + + + + + + {{-- --}} + + + + @empty + + + + @endforelse + +
NoKategoriJudulKontenGambarAksi
{{ $index + 1 }}{{ $t_edukasis->kategori }}{{ $t_edukasis->judul }}{{ $t_edukasis->konten }} + @if($t_edukasis->gambar) + + @else + Tidak ada gambar + @endif + + + + + + + + +
+ @csrf + @method('DELETE') + +
+ +
+ Belum ada data edukasi +
+
+ +
+
+ +@endsection diff --git a/project/resources/views/ibu_hamil/create.blade.php b/project/resources/views/ibu_hamil/create.blade.php new file mode 100644 index 0000000..ed50914 --- /dev/null +++ b/project/resources/views/ibu_hamil/create.blade.php @@ -0,0 +1,69 @@ +@extends('layouts.dashboard') + +@section('title', 'Form Data Ibu hamil') + +@section('content') + +
+

Form Data Ibu Hamil

+
+ +
+
+
+ +
+
+
Tambah Data Ibu Hamil
+ + +
+ @csrf +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/ibu_hamil/data-ibuhamil.blade.php b/project/resources/views/ibu_hamil/data-ibuhamil.blade.php new file mode 100644 index 0000000..07f1657 --- /dev/null +++ b/project/resources/views/ibu_hamil/data-ibuhamil.blade.php @@ -0,0 +1,84 @@ +@extends('layouts.dashboard') + +@section('title', 'Data Ibu Hamil') + +@section('content') + + +
+

Data Ibu Hamil

+
+ + +
+
+ + +
+
Daftar Ibu Hamil
+ + + Tambah Data Ibu Hamil + +
+ + +
+ + + + + + + + + + + + + @forelse ($ibu_hamil as $index => $ibu_hamils) + + + + + + + + + + @empty + + + + @endforelse + +
NoNamaTanggal LahirAlamatNo HPAksi
{{ $index + 1 }}{{ $ibu_hamils->nama }}{{ $ibu_hamils->tgl_lahir }}{{ $ibu_hamils->alamat }}{{ $ibu_hamils->no_hp }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ +
+ Belum ada data ibu hamil +
+
+ +
+
+ +@endsection diff --git a/project/resources/views/ibu_hamil/edit.blade.php b/project/resources/views/ibu_hamil/edit.blade.php new file mode 100644 index 0000000..8cd051b --- /dev/null +++ b/project/resources/views/ibu_hamil/edit.blade.php @@ -0,0 +1,67 @@ +@extends('layouts.dashboard') + +@section('title', 'Edit Data Ibu Hamil') + +@section('content') + +
+

Edit Data Ibu Hamil

+
+ +
+
+
+ +
+
+
Edit Data Ibu Hamil
+ + +
+ @csrf + @method('PUT') +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/layouts/dashboard.blade.php b/project/resources/views/layouts/dashboard.blade.php index 3eda231..4371560 100644 --- a/project/resources/views/layouts/dashboard.blade.php +++ b/project/resources/views/layouts/dashboard.blade.php @@ -17,8 +17,9 @@ - + + + + + + +

Laporan Hasil dan Edukasi Ibu Hamil

+

Keterangan:

+

BB: Berat Badan

+

TB: Tinggi Badan

+

LILA: Lingkar Lengan

+

Hasil Pengukuran

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PetugasTanggalNamaUsiaBBTBLILAUsia KehamilanIMTStatus Gizi
{{ $pengukuran->petugas->nama ?? '-' }}{{ $pengukuran->tanggal }}{{ $pengukuran->ibuHamil->nama ?? '-' }}{{ \Carbon\Carbon::parse($pengukuran->ibuHamil->tgl_lahir)->age ?? '-' }}{{ $pengukuran->berat_badan }}{{ $pengukuran->tinggi_badan }}{{ $pengukuran->lila }}{{ $pengukuran->usia_kehamilan }}{{ $pengukuran->imt }}{{ $pengukuran->status_gizi }}
+ + +
+

Grafik Perkembangan Pengukuran

+ @if(!empty($chartImage)) + + @else +

Grafik tidak tersedia

+ @endif +
+ + +
+

Edukasi dan Informasi

+ + @forelse($edukasi as $item) + +
+ {{ $item->judul }} +

{{ $item->konten }}

+
+ + @empty +

Edukasi belum tersedia

+ @endforelse +
+ + + diff --git a/project/resources/views/pengukuran_balita/data.blade.php b/project/resources/views/pengukuran_balita/data.blade.php new file mode 100644 index 0000000..80dd111 --- /dev/null +++ b/project/resources/views/pengukuran_balita/data.blade.php @@ -0,0 +1,95 @@ +@extends('layouts.dashboard') + +@section('title', 'Data Pengukuran Balta') + +@section('content') + + +
+

Data Pengukuran Balita

+
+ + +
+
+ + +
+
Daftar Hasil Pengukuran
+ + + Tambah Pengukuran + +
+ + +
+ + + + + + + + + + + + + + + + + + {{-- @forelse ($p_ibuhamil as $index => $ibu) --}} + + {{-- + + + + + + + + + + --}} + {{-- --}} + + + {{-- @empty --}} + + + + {{-- @endforelse --}} + +
NoPetugasTanggalNamaUsiaBerat BadanTinggi BadanLingkar KepalaHasilZ-score TBUAksi
{{ $index + 1 }}{{ $ibu->petugas->nama ?? '-' }}{{ $ibu->tanggal }}{{ $ibu->ibuHamil->nama ?? '-' }}{{ \Carbon\Carbon::parse($ibu->ibuHamil->tgl_lahir)->age ?? '-' }}{{ $ibu->berat_badan }}{{ $ibu->tinggi_badan }}{{ $ibu->lila }}{{ $ibu->usia_kehamilan }}{{ $ibu->imt }}{{ $ibu->status_gizi }} + + + + + + +
+ @csrf + @method('DELETE') + +
+ +
+ Belum ada data pengukuran +
+
+ +
+
+ +@endsection diff --git a/project/resources/views/pengukuran_ibuhamil/create.blade.php b/project/resources/views/pengukuran_ibuhamil/create.blade.php new file mode 100644 index 0000000..4b0aab1 --- /dev/null +++ b/project/resources/views/pengukuran_ibuhamil/create.blade.php @@ -0,0 +1,124 @@ +@extends('layouts.dashboard') + +@section('title', 'Pengukuran Ibu Hamil') + +@section('content') + +
+

Form Pengukuran Ibu Hamil

+
+ +
+
+
+ +
+
+
Tambah Data Pengukuran
+ + + @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif +
+ @csrf +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ + +@endsection diff --git a/project/resources/views/pengukuran_ibuhamil/data.blade.php b/project/resources/views/pengukuran_ibuhamil/data.blade.php new file mode 100644 index 0000000..daf6bdc --- /dev/null +++ b/project/resources/views/pengukuran_ibuhamil/data.blade.php @@ -0,0 +1,96 @@ +@extends('layouts.dashboard') + +@section('title', 'Data Pengukuran Ibu Hamil') + +@section('content') + + +
+

Data Pengukuran Ibu Hamil

+
+ + +
+
+ + +
+
Daftar Hasil Pengukuran
+ + + Tambah Pengukuran + +
+ + +
+ + + + + + + + + + + + + + + + + + + @forelse ($p_ibuhamil as $index => $ibu) + + + + + + + + + + + + + + + + @empty + + + + @endforelse + +
NoPetugasTanggalNamaUsiaBerat BadanTinggi BadanLilaUsia KehamilanIMTStatus GiziAksi
{{ $index + 1 }}{{ $ibu->petugas->nama ?? '-' }}{{ $ibu->tanggal }}{{ $ibu->ibuHamil->nama ?? '-' }}{{ \Carbon\Carbon::parse($ibu->ibuHamil->tgl_lahir)->age ?? '-' }}{{ $ibu->berat_badan }}{{ $ibu->tinggi_badan }}{{ $ibu->lila }}{{ $ibu->usia_kehamilan }}{{ $ibu->imt }}{{ $ibu->status_gizi }} + + + + + + +
+ @csrf + @method('DELETE') + +
+ +
+ Belum ada data pengukuran +
+
+ +
+
+ +@endsection diff --git a/project/resources/views/pengukuran_ibuhamil/detail.blade.php b/project/resources/views/pengukuran_ibuhamil/detail.blade.php new file mode 100644 index 0000000..4acc59a --- /dev/null +++ b/project/resources/views/pengukuran_ibuhamil/detail.blade.php @@ -0,0 +1,144 @@ +@extends('layouts.dashboard') + +@section('title','Detail Edukasi Ibu Hamil') + +@section('content') + +
+

Detail Edukasi

+
+ + +
+
+
+ + +
+
+
+ @csrf + + + + +
+ +
Hasil Pengukuran
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PetugasTanggalNamaUsiaBerat BadanTinggi BadanLilaUsia KehamilanIMTStatus Gizi
{{ $pengukuran->petugas->nama ?? '-' }}{{ $pengukuran->tanggal }}{{ $pengukuran->ibuHamil->nama ?? '-' }}{{ \Carbon\Carbon::parse($pengukuran->ibuHamil->tgl_lahir)->age ?? '-' }}{{ $pengukuran->berat_badan }}{{ $pengukuran->tinggi_badan }}{{ $pengukuran->lila }}{{ $pengukuran->usia_kehamilan }}{{ $pengukuran->imt }}{{ $pengukuran->status_gizi }}
+
+ + +
Grafik Perkembangan Pengukuran Ibu Hamil
+ +
+
+
Edukasi dan Informasi
+ @forelse($edukasi as $item) + {{ $item->judul }} +

{{ $item->konten }}

+ @empty +

Edukasi belum tersedia

+ @endforelse +
+
+
+
+
+ + + + + + +@endsection diff --git a/project/resources/views/petugas/data-petugas.blade.php b/project/resources/views/petugas/data-petugas.blade.php deleted file mode 100644 index 2aab4fd..0000000 --- a/project/resources/views/petugas/data-petugas.blade.php +++ /dev/null @@ -1,77 +0,0 @@ -@extends('layouts.dashboard') - -@section('title', 'Data Petugas') - -@section('content') - -
-

Data Petugas

-
- -
-
- -
-
Daftar Petugas
- - - Tambah Petugas - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NoNamaEmailRoleAksi
1Dewi Lestaridewi@example.com - Admin - - - -
2Agus Prabowoagus@example.com - Petugas - - - -
-
-
- -
-
- -@endsection diff --git a/project/resources/views/users/create.blade.php b/project/resources/views/users/create.blade.php new file mode 100644 index 0000000..2063185 --- /dev/null +++ b/project/resources/views/users/create.blade.php @@ -0,0 +1,73 @@ +@extends('layouts.dashboard') + +@section('title', 'Form Data Petugas') + +@section('content') + +
+

Form Data Petugas

+
+ +
+
+
+ +
+
+
Tambah Data Petugas
+ + +
+ @csrf +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/users/edit.blade.php b/project/resources/views/users/edit.blade.php new file mode 100644 index 0000000..a3fd71a --- /dev/null +++ b/project/resources/views/users/edit.blade.php @@ -0,0 +1,72 @@ +@extends('layouts.dashboard') + +@section('title', 'Edit Data Petugas') + +@section('content') + +
+

Edit Data Petugas

+
+ +
+
+
+ +
+
+
Edit Data Petugas
+ + +
+ @csrf + @method('PUT') +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + Kosongkan jika tidak ingin mengganti password +
+
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/project/resources/views/users/users.blade.php b/project/resources/views/users/users.blade.php new file mode 100644 index 0000000..7f36bc8 --- /dev/null +++ b/project/resources/views/users/users.blade.php @@ -0,0 +1,84 @@ +@extends('layouts.dashboard') + +@section('title', 'Data Pengguna') + +@section('content') + + +
+

Data Pengguna

+
+ + +
+
+ + +
+
Daftar Pengguna
+ + + Tambah Data Petugas + +
+ + +
+ + + + + + + + + + + + + @forelse ($user as $index => $users) + + + + + + + + + + @empty + + + + @endforelse + +
NoNamaNo HPEmailRoleAksi
{{ $index + 1 }}{{ $users->nama }}{{ $users->no_hp }}{{ $users->email }}{{ $users->role }} + + + + + + + +
+ @csrf + @method('DELETE') + +
+ +
+ Belum ada data petugas +
+
+ +
+
+ +@endsection diff --git a/project/routes/web.php b/project/routes/web.php index 5ed9942..c62a686 100644 --- a/project/routes/web.php +++ b/project/routes/web.php @@ -4,6 +4,12 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\AnakController; use App\Http\Controllers\AuthController; +use App\Http\Controllers\DashboardController; +use App\Http\Controllers\EdukasiController; +use App\Http\Controllers\IbuHamilController; +use App\Http\Controllers\PengukuranBalitaController; +use App\Http\Controllers\PengukuranIbuHamilController; +use App\Http\Controllers\UsersController; /* |-------------------------------------------------------------------------- @@ -20,16 +26,45 @@ return view('landingPage.index'); }); -Route::get('/register', [AuthController::class, 'showRegister']); -Route::get('/login', [AuthController::class, 'showLogin']); +// Route::get('/register', [AuthController::class, 'showRegister']); +// Route::get('/login', [AuthController::class, 'showLogin']); -Route::get('/dashboard', function () { - return view('dashboard.index'); +Route::get('/login', function () { + return view('auth.login'); +})->name('login'); + +Route::post('/proseslogin', [AuthController::class, 'login']); + +Route::post('/logout', [AuthController::class, 'logout'])->name('logout'); + +Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard'); + +Route::middleware(['auth'])->group(function () { + Route::resource('balita', AnakController::class); }); -Route::get('/petugas', function () { - return view('petugas.data-petugas'); +Route::middleware(['auth'])->group(function () { + Route::resource('ibu_hamil', IbuHamilController::class); }); -Route::resource('balita', AnakController::class); +Route::middleware(['auth'])->group(function () { + Route::resource('edukasi', EdukasiController::class); +}); +Route::middleware(['auth','role:admin'])->group(function () { + Route::resource('users', UsersController::class); +}); + +Route::middleware(['auth'])->group(function () { + Route::resource('pengukuran_ibu_hamil', PengukuranIbuHamilController::class); +}); + +Route::get('/pengukuran-ibu-hamil/{id}/detail', + [PengukuranIbuHamilController::class, 'detail']) + ->name('pengukuran_ibu_hamil.detail'); + +Route::post('/cetak-ibu-hamil/{id}', [PengukuranIbuHamilController::class, 'cetakPdf']); + +Route::middleware(['auth'])->group(function () { + Route::resource('pengukuran_balita', PengukuranBalitaController::class); +});