This commit is contained in:
parent
92a3cd66d1
commit
e3b641115f
|
@ -86,7 +86,7 @@ public function process(Request $request)
|
|||
$riwayat = RiwayatDiagnosa::create([
|
||||
'id_user' => Auth::user()->id,
|
||||
'id_penyakit' => $terbesar['penyakit']->id,
|
||||
'nilai' => round($terbesar['nilai'] * 100, 2) . '%',
|
||||
'nilai' => ($terbesar['nilai'] * 100) . '%',
|
||||
'tanggal' => now(),
|
||||
]);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ public function index()
|
|||
|
||||
public function detail($id)
|
||||
{
|
||||
$role = auth()->user()->role;
|
||||
// Ambil data RiwayatDiagnosa berdasarkan ID
|
||||
$riwayat = RiwayatDiagnosa::with('penyakit', 'user')->findOrFail($id);
|
||||
|
||||
|
@ -39,13 +40,16 @@ public function detail($id)
|
|||
}
|
||||
|
||||
// Kirim data ke tampilan
|
||||
return view('layouts.diagnosa.hasildiagnosa', compact('riwayat'));
|
||||
return view('layouts.diagnosa.hasildiagnosa', compact('riwayat', 'role'));
|
||||
}
|
||||
|
||||
public function print($id)
|
||||
{
|
||||
$riwayat = \App\Models\RiwayatDiagnosa::with('penyakit', 'user')->findOrFail($id);
|
||||
|
||||
return view('layouts.diagnosa.print', compact('riwayat'));
|
||||
$role = auth()->user()->role;
|
||||
|
||||
// Kirim data riwayat dan role ke tampilan
|
||||
return view('layouts.diagnosa.print', compact('riwayat', 'role'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,19 +4,27 @@
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\Penyakit; // Pastikan model Penyakit ada
|
||||
use App\Models\Penyakit;
|
||||
use App\Models\Gejala; // Import model Gejala
|
||||
|
||||
class PenyakitController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$penyakit = DB::table('penyakit')->get();
|
||||
$penyakit = DB::table('penyakit')->get();
|
||||
return view('layouts.diagnosa.detailpenyakit', compact('penyakit'));
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$penyakit = Penyakit::findOrFail($id); // Hanya ambil satu penyakit berdasarkan ID
|
||||
return view('layouts.diagnosa.rinciandetailpenyakit', compact('penyakit'));
|
||||
$penyakit = Penyakit::findOrFail($id); // Ambil data penyakit berdasarkan ID
|
||||
|
||||
// Ambil ID gejala yang terkait dengan penyakit ini
|
||||
$gejala_ids = explode(',', $penyakit->gejala);
|
||||
|
||||
// Ambil nama gejala berdasarkan ID
|
||||
$gejala_list = Gejala::whereIn('id', $gejala_ids)->pluck('nama_gejala');
|
||||
|
||||
return view('layouts.diagnosa.rinciandetailpenyakit', compact('penyakit', 'gejala_list'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,19 +3,65 @@
|
|||
namespace App\Http\Controllers\admin;
|
||||
|
||||
use App\Models\Penyakit;
|
||||
use App\Models\Gejala;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class DaftarPenyakitController extends Controller
|
||||
{
|
||||
//
|
||||
public function index()
|
||||
{
|
||||
$penyakit_list = DB::table('penyakit')->get();
|
||||
$gejala = Gejala::all(); // Ambil semua gejala
|
||||
return view('layouts.admin.daftarpenyakit', compact('penyakit_list', 'gejala'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// Validasi form
|
||||
$request->validate([
|
||||
'kode_penyakit' => 'required|string|max:10|unique:penyakit',
|
||||
'nama_penyakit' => 'required|string|max:100',
|
||||
'subjudul' => 'required|string|max:150',
|
||||
'deskripsi' => 'required|string',
|
||||
'penanganan' => 'required|string',
|
||||
'gambar' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
|
||||
'gejala' => 'required|array', // Memastikan gejala yang dipilih adalah array
|
||||
'gejala.*' => 'exists:gejala,id', // Memastikan ID gejala ada di tabel gejala
|
||||
]);
|
||||
|
||||
// Upload gambar
|
||||
$gambar = $request->file('gambar');
|
||||
$namaGambar = time() . '_' . $gambar->getClientOriginalName();
|
||||
$gambar->move(public_path('assets/images'), $namaGambar);
|
||||
|
||||
// Mengambil ID gejala yang dipilih dan mengubahnya menjadi string
|
||||
$gejalaIds = implode(',', $request->gejala);
|
||||
|
||||
// Simpan data penyakit ke database
|
||||
Penyakit::create([
|
||||
'kode_penyakit' => $request->kode_penyakit,
|
||||
'nama_penyakit' => $request->nama_penyakit,
|
||||
'subjudul' => $request->subjudul,
|
||||
'deskripsi' => $request->deskripsi,
|
||||
'penanganan' => $request->penanganan,
|
||||
'gambar' => $namaGambar,
|
||||
'gejala' => $gejalaIds, // Simpan ID gejala dalam bentuk string
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Data penyakit berhasil ditambahkan!');
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// HAPUS ini: dd($request->all()); // <-- Hapus baris ini
|
||||
|
||||
$penyakit = Penyakit::findOrFail($id);
|
||||
|
||||
|
||||
$request->validate([
|
||||
'kode_penyakit' => 'required|string|max:10|unique:penyakit,kode_penyakit,' . $penyakit->id,
|
||||
'nama_penyakit' => 'required|string|max:100',
|
||||
|
@ -23,21 +69,25 @@ public function update(Request $request, $id)
|
|||
'deskripsi' => 'required|string',
|
||||
'penanganan' => 'required|string',
|
||||
'gambar' => 'nullable|image|mimes:jpeg,png,jpg,gif|max:2048',
|
||||
'gejala' => 'required|array', // Validasi gejala yang dipilih
|
||||
'gejala.*' => 'exists:gejala,id',
|
||||
]);
|
||||
|
||||
// Update field
|
||||
// Menyimpan log dengan memeriksa apakah gejala ada
|
||||
Log::info('Gejala yang diterima: ', ['gejala' => $request->gejala]); // Menyimpan data dalam array
|
||||
|
||||
// Update data penyakit
|
||||
$penyakit->kode_penyakit = $request->kode_penyakit;
|
||||
$penyakit->nama_penyakit = $request->nama_penyakit;
|
||||
$penyakit->subjudul = $request->subjudul;
|
||||
$penyakit->deskripsi = $request->deskripsi;
|
||||
$penyakit->penanganan = $request->penanganan;
|
||||
|
||||
// Kalau upload gambar baru
|
||||
// Jika ada gambar baru, upload dan ganti gambar
|
||||
if ($request->hasFile('gambar')) {
|
||||
// Hapus gambar lama
|
||||
$gambarPath = public_path('assets/images/' . $penyakit->gambar);
|
||||
if (file_exists($gambarPath)) {
|
||||
unlink($gambarPath);
|
||||
unlink($gambarPath); // Hapus gambar lama
|
||||
}
|
||||
|
||||
// Upload gambar baru
|
||||
|
@ -48,21 +98,21 @@ public function update(Request $request, $id)
|
|||
$penyakit->gambar = $namaGambar;
|
||||
}
|
||||
|
||||
// Menyinkronkan gejala yang dipilih
|
||||
if ($request->has('gejala')) {
|
||||
$penyakit->gejala = implode(',', $request->gejala); // Simpan ID yang dipilih dalam format string
|
||||
Log::info('Gejala yang dipilih disimpan: ', ['gejala' => $penyakit->gejala]); // Menampilkan gejala yang disimpan
|
||||
} else {
|
||||
$penyakit->gejala = ''; // Jika tidak ada gejala yang dipilih
|
||||
}
|
||||
|
||||
// Simpan perubahan penyakit
|
||||
$penyakit->save();
|
||||
|
||||
return redirect()->back()->with('success', 'Data penyakit berhasil diperbarui!');
|
||||
}
|
||||
|
||||
|
||||
public function daftarpenyakit()
|
||||
{
|
||||
return view('layouts.admin.daftarpenyakit');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$penyakit_list = DB::table('penyakit')->get();
|
||||
return view('layouts.admin.daftarpenyakit')->with('penyakit_list', $penyakit_list);
|
||||
}
|
||||
public function destroy($id)
|
||||
{
|
||||
$penyakit = Penyakit::findOrFail($id);
|
||||
|
@ -78,34 +128,4 @@ public function destroy($id)
|
|||
|
||||
return redirect()->back()->with('success', 'Data penyakit berhasil dihapus beserta gambarnya.');
|
||||
}
|
||||
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'kode_penyakit' => 'required|string|max:10|unique:penyakit',
|
||||
'nama_penyakit' => 'required|string|max:100',
|
||||
'subjudul' => 'required|string|max:150',
|
||||
'deskripsi' => 'required|string',
|
||||
'penanganan' => 'required|string',
|
||||
'gambar' => 'required|image|mimes:jpeg,png,jpg,gif|max:2048',
|
||||
]);
|
||||
|
||||
// Upload gambar
|
||||
$gambar = $request->file('gambar');
|
||||
$namaGambar = time() . '_' . $gambar->getClientOriginalName();
|
||||
$gambar->move(public_path('assets/images'), $namaGambar);
|
||||
|
||||
// Simpan data ke database
|
||||
Penyakit::create([
|
||||
'kode_penyakit' => $request->kode_penyakit,
|
||||
'nama_penyakit' => $request->nama_penyakit,
|
||||
'subjudul' => $request->subjudul,
|
||||
'deskripsi' => $request->deskripsi,
|
||||
'penanganan' => $request->penanganan,
|
||||
'gambar' => $namaGambar,
|
||||
]);
|
||||
|
||||
return redirect()->back()->with('success', 'Data penyakit berhasil ditambahkan!');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -45,6 +45,11 @@ public function dashboard()
|
|||
return $item->count; // Jumlah pendaftar per bulan
|
||||
});
|
||||
|
||||
$riwayatDiagnosa = RiwayatDiagnosa::with(['user', 'penyakit'])
|
||||
->orderBy('tanggal', 'desc')
|
||||
->take(10) // ambil 10 data terbaru, bisa diubah sesuai kebutuhan
|
||||
->get();
|
||||
|
||||
return view('layouts.admin.dashboard', compact(
|
||||
'labelsDiagnosa',
|
||||
'dataDiagnosa',
|
||||
|
@ -53,7 +58,8 @@ public function dashboard()
|
|||
'totalUser',
|
||||
'totalDiagnosa',
|
||||
'totalPenyakit',
|
||||
'totalGejala'
|
||||
'totalGejala',
|
||||
'riwayatDiagnosa'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ class Penyakit extends Model
|
|||
'deskripsi',
|
||||
'penanganan',
|
||||
'gambar',
|
||||
'gejala',
|
||||
];
|
||||
|
||||
// Relasi ke tabel 'rules'
|
||||
|
|
|
@ -225,9 +225,9 @@ .section-container h2{
|
|||
}
|
||||
|
||||
.section-container p{
|
||||
color: #03a4ed;
|
||||
color: #cb2d3e;
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -257,6 +257,7 @@ @media (min-width: 768px) {
|
|||
.section-text {
|
||||
font-size: inherit;
|
||||
line-height: 1.6;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 491 KiB |
Binary file not shown.
After Width: | Height: | Size: 491 KiB |
|
@ -36,6 +36,7 @@
|
|||
<th>Nama Penyakit</th>
|
||||
<th>Sub Judul</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Gejala</th>
|
||||
<th>Penanganan</th>
|
||||
<th>Gambar</th>
|
||||
<th>Aksi</th>
|
||||
|
@ -47,6 +48,7 @@
|
|||
<th>Nama Penyakit</th>
|
||||
<th>Sub Judul</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Gejala</th>
|
||||
<th>Penanganan</th>
|
||||
<th>Gambar</th>
|
||||
<th>Aksi</th>
|
||||
|
@ -60,6 +62,21 @@
|
|||
<td>{{ $penyakit->nama_penyakit }}</td>
|
||||
<td>{{ $penyakit->subjudul }}</td>
|
||||
<td>{{ $penyakit->deskripsi }}</td>
|
||||
<td>
|
||||
@php
|
||||
$id_gejala = explode(',', $penyakit->gejala);
|
||||
$nama_gejala = collect($id_gejala)->map(function ($id) use ($gejala) {
|
||||
$gejala = $gejala->firstWhere('id', (int)$id);
|
||||
return $gejala ? $gejala->nama_gejala : null;
|
||||
})->filter();
|
||||
@endphp
|
||||
<ul>
|
||||
@foreach ($nama_gejala as $nama)
|
||||
<li>{{ $nama }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
<td>{{ $penyakit->penanganan }}</td>
|
||||
<td>
|
||||
<img src="{{ asset('assets/images/' . $penyakit->gambar) }}" width="100" alt="Gambar Penyakit">
|
||||
|
@ -77,6 +94,7 @@
|
|||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="editModal{{ $penyakit->id }}" tabindex="-1" aria-labelledby="editModalLabel{{ $penyakit->id }}" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
|
@ -114,6 +132,36 @@
|
|||
<input type="file" class="form-control" name="gambar" accept="image/*">
|
||||
<small class="form-text text-muted">Gambar saat ini: <br><img src="{{ asset('assets/images/' . $penyakit->gambar) }}" width="100"></small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Gejala</label>
|
||||
<div class="gejala-select-container">
|
||||
@php
|
||||
$selected_gejala = explode(',', $penyakit->gejala); // Ambil gejala yang sudah ada
|
||||
@endphp
|
||||
|
||||
<div class="mb-2">
|
||||
<button type="button" class="btn btn-sm btn-info pilih-semua-gejala" data-penyakit-id="{{ $penyakit->id }}">Pilih Semua</button>
|
||||
<button type="button" class="btn btn-sm btn-warning hapus-semua-gejala" data-penyakit-id="{{ $penyakit->id }}">Hapus Semua</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@foreach($gejala as $item)
|
||||
<div class="col-md-6 mb-2">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input gejala-checkbox" type="checkbox"
|
||||
name="gejala[]" value="{{ $item->id }}"
|
||||
id="gejala{{ $penyakit->id }}_{{ $item->id }}"
|
||||
data-penyakit-id="{{ $penyakit->id }}"
|
||||
{{ in_array($item->id, $selected_gejala) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="gejala{{ $penyakit->id }}_{{ $item->id }}">
|
||||
{{ $item->nama_gejala }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
|
@ -129,12 +177,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Modal Tambah Penyakit -->
|
||||
<!-- Form Tambah Penyakit -->
|
||||
<div class="modal fade" id="tambahUserModal" tabindex="-1" aria-labelledby="tambahUserModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg"> <!-- modal-lg untuk form yang lebih lebar -->
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="tambahUserModalLabel">Tambah Penyakit</h5>
|
||||
|
@ -143,6 +189,7 @@
|
|||
<form action="{{ route('penyakit.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-body">
|
||||
<!-- Form Input Penyakit -->
|
||||
<div class="mb-3">
|
||||
<label for="kode_penyakit" class="form-label">Kode Penyakit</label>
|
||||
<input type="text" class="form-control" id="kode_penyakit" name="kode_penyakit" required>
|
||||
|
@ -167,6 +214,33 @@
|
|||
<label for="gambar" class="form-label">Gambar</label>
|
||||
<input type="file" class="form-control" id="gambar" name="gambar" accept="image/*" required>
|
||||
</div>
|
||||
|
||||
<!-- Form Input Gejala sebagai Checkbox -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Gejala</label>
|
||||
<div class="gejala-select-container">
|
||||
<div class="mb-2">
|
||||
<button type="button" class="btn btn-sm btn-info pilih-semua-gejala" data-penyakit-id="tambah">Pilih Semua</button>
|
||||
<button type="button" class="btn btn-sm btn-warning hapus-semua-gejala" data-penyakit-id="tambah">Hapus Semua</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@foreach($gejala as $item)
|
||||
<div class="col-md-6 mb-2">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input gejala-checkbox" type="checkbox"
|
||||
name="gejala[]" value="{{ $item->id }}"
|
||||
id="gejalaTambah_{{ $item->id }}"
|
||||
data-penyakit-id="tambah">
|
||||
<label class="form-check-label" for="gejalaTambah_{{ $item->id }}">
|
||||
{{ $item->nama_gejala }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
|
@ -177,4 +251,67 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.custom-select-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
border: 2px solid #ccc;
|
||||
border-radius: 10px;
|
||||
background-color: #fff;
|
||||
font-size: 14px;
|
||||
font-family: Arial, sans-serif;
|
||||
box-sizing: border-box;
|
||||
resize: none;
|
||||
transition: all 0.3s ease;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.custom-select-box:focus {
|
||||
border-color: #4caf50;
|
||||
outline: none;
|
||||
box-shadow: 0 0 5px rgba(76, 175, 80, 0.6);
|
||||
}
|
||||
|
||||
.custom-select-box option {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.custom-select-box option:checked {
|
||||
background-color: #4caf50;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.gejala-select-container {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Handler untuk tombol "Pilih Semua"
|
||||
document.querySelectorAll('.pilih-semua-gejala').forEach(function(button) {
|
||||
button.addEventListener('click', function() {
|
||||
const penyakitId = this.getAttribute('data-penyakit-id');
|
||||
document.querySelectorAll(`.gejala-checkbox[data-penyakit-id="${penyakitId}"]`).forEach(function(checkbox) {
|
||||
checkbox.checked = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Handler untuk tombol "Hapus Semua"
|
||||
document.querySelectorAll('.hapus-semua-gejala').forEach(function(button) {
|
||||
button.addEventListener('click', function() {
|
||||
const penyakitId = this.getAttribute('data-penyakit-id');
|
||||
document.querySelectorAll(`.gejala-checkbox[data-penyakit-id="${penyakitId}"]`).forEach(function(checkbox) {
|
||||
checkbox.checked = false;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
|
@ -90,42 +90,38 @@
|
|||
<table id="datatablesSimple">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
<th>Nama</th>
|
||||
<th>Penyakit</th>
|
||||
<th>nilai</th>
|
||||
<th>Tanggal Diagnosa</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Position</th>
|
||||
<th>Office</th>
|
||||
<th>Age</th>
|
||||
<th>Start date</th>
|
||||
<th>Salary</th>
|
||||
<th>Nama</th>
|
||||
<th>Penyakit</th>
|
||||
<th>nilai</th>
|
||||
<th>Tanggal Diagnosa</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
@foreach ($riwayatDiagnosa as $riwayat)
|
||||
<tr>
|
||||
<td>Michael Bruce</td>
|
||||
<td>Javascript Developer</td>
|
||||
<td>Singapore</td>
|
||||
<td>29</td>
|
||||
<td>2011/06/27</td>
|
||||
<td>$183,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Donna Snider</td>
|
||||
<td>Customer Support</td>
|
||||
<td>New York</td>
|
||||
<td>27</td>
|
||||
<td>2011/01/25</td>
|
||||
<td>$112,000</td>
|
||||
<td>{{ $riwayat->user->username }}</td>
|
||||
<td>{{ $riwayat->penyakit->nama_penyakit }}</td>
|
||||
<td>{{ $riwayat->nilai }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($riwayat->tanggal)->format('d M Y') }}</td>
|
||||
<td>
|
||||
<a href="{{ route('history.print', $riwayat->id_riwayat) }}" class="btn btn-sm btn-primary">
|
||||
Detail
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -74,6 +74,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
<link rel="stylesheet" href="{{ asset('assets/css/owl.css') }}">
|
||||
|
||||
<style>
|
||||
.main-red-button {
|
||||
margin-right: 10px;
|
||||
/* Memberikan jarak kanan antar tombol */
|
||||
}
|
||||
|
||||
.popup-box h2 {
|
||||
margin-bottom: 20px !important;
|
||||
font-weight: 600 !important;
|
||||
|
@ -185,14 +190,14 @@
|
|||
<li class="{{ request()->routeIs('history') ? 'active' : '' }}">
|
||||
<a href="{{ route('history') }}">Riwayat</a>
|
||||
</li>
|
||||
<li class="d-flex align-items-center">
|
||||
<li class="d-flex align-items-center ">
|
||||
@if(Auth::check())
|
||||
<a href="javascript:void(0);" class="main-red-button" onclick="togglePopup()">Profil</a>
|
||||
<a href="javascript:void(0);" class="main-red-button " onclick="togglePopup()">Profil</a>
|
||||
<a href="#" class="main-red-button"
|
||||
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
|
||||
Logout
|
||||
</a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
<form id="logout-form" class="" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
@csrf
|
||||
</form>
|
||||
@else
|
||||
|
@ -222,6 +227,16 @@ class="overlay-container">
|
|||
Username:
|
||||
</label>
|
||||
<p>{{ Auth::user()->username ?? 'Guest' }}</p>
|
||||
<label class="form-label"
|
||||
for="name">
|
||||
Umur:
|
||||
</label>
|
||||
<p>{{ Auth::user()->umur ?? 'Guest' }}</p>
|
||||
<label class="form-label"
|
||||
for="name">
|
||||
Telp:
|
||||
</label>
|
||||
<p>{{ Auth::user()->telp ?? 'Guest' }}</p>
|
||||
<label class="form-label"
|
||||
for="name">
|
||||
Email:
|
||||
|
@ -279,7 +294,7 @@ function togglePopup() {
|
|||
<script src="assets/js/animation.js"></script>
|
||||
<script src="assets/js/imagesloaded.js"></script>
|
||||
<script src="assets/js/templatemo-custom.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,5 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Cetak Hasil Diagnosa</title>
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/print.css') }}">
|
||||
|
@ -15,7 +16,8 @@
|
|||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th, td {
|
||||
th,
|
||||
td {
|
||||
padding: 10px;
|
||||
border: 1px solid #000;
|
||||
text-align: left;
|
||||
|
@ -38,12 +40,13 @@
|
|||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h2>Hasil Diagnosa Penyakit Bawang Merah</h2>
|
||||
|
||||
@php
|
||||
$nilai_angka = isset($riwayat->nilai) ? preg_replace('/[^0-9.]/', '', $riwayat->nilai) : null;
|
||||
$nilai_angka = isset($riwayat->nilai) ? preg_replace('/[^0-9.]/', '', $riwayat->nilai) : null;
|
||||
@endphp
|
||||
|
||||
<table>
|
||||
|
@ -88,15 +91,20 @@
|
|||
</table>
|
||||
|
||||
<div class="text-center mt-4 no-print">
|
||||
<a href="{{ route('history') }}" class="btn btn-secondary">Kembali</a>
|
||||
@if ($role === 'admin')
|
||||
<a href="{{ route('admin.dashboard') }}" class="btn btn-secondary">Kembali ke Dashboard</a>
|
||||
@else
|
||||
<a href="{{ route('history') }}" class="btn btn-secondary">Kembali ke Riwayat</a>
|
||||
@endif
|
||||
<button onclick="window.print()" class="btn btn-primary">Cetak</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
window.onload = function() {
|
||||
window.print();
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
|
@ -12,7 +12,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<title>Detail Penyakit</title>
|
||||
<link rel="stylesheet" href="{{ asset('assets/css/rinciandetailpenyakit.css') }}">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -46,10 +46,21 @@
|
|||
</section>
|
||||
|
||||
<section class="section-container">
|
||||
<h2 class="section-title">Penanganan</h>
|
||||
<p class="section-text">
|
||||
{{$penyakit->penanganan}}
|
||||
</p>
|
||||
<h2 class="section-title">Gejala</h2>
|
||||
<ol class="section-text" style="font-weight: 600; font-size: 15px;">
|
||||
@foreach($gejala_list as $gejala)
|
||||
<li>{{ $gejala }}</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section class="section-container">
|
||||
<h2 class="section-title">Penanganan</h2>
|
||||
<ol class="section-text" style="font-weight: 600; font-size: 15px;">
|
||||
@foreach(explode("\n", $penyakit->penanganan) as $item)
|
||||
<li>{{ $item }}</li>
|
||||
@endforeach
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
Route::middleware('admin')->group(function () {
|
||||
// Dashboard Admin
|
||||
Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard')->middleware('auth');
|
||||
Route::get('/admin/dashboard', [DashboardController::class, 'dashboard'])->name('admin.dashboard');
|
||||
|
||||
|
||||
// Daftar User
|
||||
Route::get('/daftaruser', [DaftarUserController::class, 'index'])->name('daftaruser')->middleware('auth');
|
||||
|
|
Loading…
Reference in New Issue