diff --git a/app/Http/Controllers/AturanController.php b/app/Http/Controllers/AturanController.php new file mode 100644 index 0000000..05c0a6c --- /dev/null +++ b/app/Http/Controllers/AturanController.php @@ -0,0 +1,70 @@ +get(); + return view("aturan.aturan", compact('aturan','gejalas')); + } + + /** + * Show the form for creating a new resource. + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + */ + public function show(string $id) + { + // + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/app/Http/Controllers/GejalaController.php b/app/Http/Controllers/GejalaController.php new file mode 100644 index 0000000..4a047c3 --- /dev/null +++ b/app/Http/Controllers/GejalaController.php @@ -0,0 +1,65 @@ +belongsTo(Gejala::class, 'id_gejala'); + } + + // Relasi ke model Penyakit + public function penyakit() + { + return $this->belongsTo(Penyakit::class, 'id_penyakit'); + } } diff --git a/app/Models/Gejala.php b/app/Models/Gejala.php index b3d88d6..519ccc6 100644 --- a/app/Models/Gejala.php +++ b/app/Models/Gejala.php @@ -8,4 +8,6 @@ class Gejala extends Model { use HasFactory; + protected $table='gejala'; + protected $primaryKey='id_gejala'; } diff --git a/app/Models/Penyakit.php b/app/Models/Penyakit.php index 421ddee..85cf31c 100644 --- a/app/Models/Penyakit.php +++ b/app/Models/Penyakit.php @@ -8,4 +8,6 @@ class Penyakit extends Model { use HasFactory; + protected $table="penyakit"; + protected $primaryKey="id_penyakit"; } diff --git a/database/migrations/2024_02_13_014922_create_gejala_table.php b/database/migrations/2024_02_13_014922_create_gejala_table.php index a40449e..c154f93 100644 --- a/database/migrations/2024_02_13_014922_create_gejala_table.php +++ b/database/migrations/2024_02_13_014922_create_gejala_table.php @@ -1,5 +1,4 @@ increments('id_gejala'); + $table->id('id_gejala'); $table->string('kode_gejala'); $table->string('gejala'); + $table->timestamps(); }); } @@ -24,6 +24,6 @@ public function up(): void */ public function down(): void { - Schema::dropIfExists('gejalas'); + Schema::dropIfExists('gejala'); // Menghapus tabel gejala } }; diff --git a/database/migrations/2024_02_13_015937_create_penyakit_table.php b/database/migrations/2024_02_13_015637_create_penyakit_table.php similarity index 100% rename from database/migrations/2024_02_13_015937_create_penyakit_table.php rename to database/migrations/2024_02_13_015637_create_penyakit_table.php diff --git a/database/migrations/2024_02_13_015750_create_aturan_table.php b/database/migrations/2024_02_13_015750_create_aturan_table.php index c5284c6..0404954 100644 --- a/database/migrations/2024_02_13_015750_create_aturan_table.php +++ b/database/migrations/2024_02_13_015750_create_aturan_table.php @@ -13,8 +13,15 @@ public function up(): void { Schema::create('aturan', function (Blueprint $table) { $table->id('id_aturan'); + $table->unsignedBigInteger('id_gejala'); + $table->unsignedBigInteger('id_penyakit'); + $table->float('belief'); + + $table->foreign('id_gejala')->references('id_gejala')->on('gejala')->onDelete('cascade'); + $table->foreign('id_penyakit')->references('id_penyakit')->on('penyakit')->onDelete('cascade'); }); + } /** diff --git a/resources/views/aturan.blade.php b/resources/views/aturan.blade.php deleted file mode 100644 index c5b86ab..0000000 --- a/resources/views/aturan.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -@extends('layouts.master') -@section('title', 'aturan') - -@section('konten') - -@endsection diff --git a/resources/views/aturan/aturan.blade.php b/resources/views/aturan/aturan.blade.php new file mode 100644 index 0000000..a644c57 --- /dev/null +++ b/resources/views/aturan/aturan.blade.php @@ -0,0 +1,43 @@ +@extends('layouts.master') +@section('title', 'aturan') + +@section('konten') + + + + + + + + + + + + + + + + @php + $gejalaGroups = $aturan->groupBy('gejala_id'); + @endphp + @foreach ($gejalaGroups as $gejalaId => $group) + + + + + + + + + @endforeach + +
NoKode GejalaGejalaPenyakitNilai KepercayaanAction
{{ $loop->iteration }}{{ optional($group->first()->gejala)->kode_gejala}}{{ optional($group->first()->gejala)->gejala}} + @foreach ($group as $data) + {{ $data->penyakit->nama_penyakit }} ({{ $data->penyakit->kode_penyakit }})
+ @endforeach +
{{ $group->first()->belief }} + + + +
+@endsection diff --git a/resources/views/gejala.blade.php b/resources/views/gejala.blade.php index c6370dd..04d4cd6 100644 --- a/resources/views/gejala.blade.php +++ b/resources/views/gejala.blade.php @@ -2,24 +2,16 @@ @section('title', 'gejala') @section('konten')
-

Gejala Penyakit Mulut dan Kuku Pada Sapi

- +

Gejala Penyakit Mulut dan Kuku Pada Sapi

+
-{{--

Gejala PMK

--}}
    -
  1. Terdapat ulcer atau luka di lidah, bibir, mulut, dan kuku kaki.
  2. -
  3. Sapi mengalami demam dan lesu.
  4. -
  5. Sapi mengalami kehilangan nafsu makan
  6. -
  7. Produksi susu sapi menurun
  8. -
  9. Sapi mengalami kesulitan bergerak atau berjalan karena rasa sakit yang dialami.
  10. -
  11. Kuku kaki mengalami pembengkakan dan kerusakan.
  12. -
  13. keluar air liur yang berlebihan
  14. -
  15. Ambruk atau tidak dapat berdiri
  16. -
  17. Kondisi fisik yang kurus atau menurun.
  18. -
  19. Terjadi tanda-tanda pernapasan yang abnormal, seperti kesulitan bernapas dan batuk.
  20. -
  21. Luka atau bisul pada kuku atau jari kaki.
  22. -
  23. Terlihat cairan atau nanah keluar dari kuku atau jari kaki.
  24. -
+ @foreach ($gejala as $gejalaItem) +
  • {{ $gejalaItem ->gejala}} {{"{".$gejalaItem ->kode_gejala."}" }}
  • + + @endforeach + +
    @endsection diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 632cacb..6bd21fb 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -49,16 +49,11 @@ - + + +
    Login diff --git a/resources/views/penyakit.blade.php b/resources/views/penyakit.blade.php deleted file mode 100644 index daefe95..0000000 --- a/resources/views/penyakit.blade.php +++ /dev/null @@ -1,6 +0,0 @@ -@extends('layouts.master') -@section('title', 'penyakit') - -@section('konten') - -@endsection diff --git a/resources/views/penyakit/penyakit.blade.php b/resources/views/penyakit/penyakit.blade.php new file mode 100644 index 0000000..9a5a27a --- /dev/null +++ b/resources/views/penyakit/penyakit.blade.php @@ -0,0 +1,20 @@ +@extends('layouts.master') +@section('title', 'penyakit') + + +@section('konten') +
    +

    Penyakit Mulut dan Kuku Pada Sapi

    + +
    +
    +
      + @foreach ($penyakit as $penyakitItem) +
    1. {{ $penyakitItem ->nama_penyakit}}
      {{ $penyakitItem ->deskripsi_penyakit}}
    2. + + + @endforeach +
    +
    +@endsection + diff --git a/routes/web.php b/routes/web.php index adc4b56..a5a0199 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,8 +1,11 @@