fixing banyak
This commit is contained in:
parent
d3a166b60e
commit
d29c283a50
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Aturan;
|
||||
use App\Models\Gejala;
|
||||
use App\Models\Penyakit;
|
||||
class AturanController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$aturan = Aturan::all();
|
||||
$Gejala = Gejala::all();
|
||||
$Penyakit = Penyakit::all();
|
||||
$gejalas = Gejala::orderBy('id_gejala')->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)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Gejala;
|
||||
class GejalaController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$gejala=Gejala::all();
|
||||
return view("gejala",compact("gejala"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Penyakit;
|
||||
|
||||
class PenyakitController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$penyakit = Penyakit::all();
|
||||
return view("penyakit.penyakit", compact("penyakit"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
@ -8,4 +7,18 @@
|
|||
class Aturan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'aturan';
|
||||
|
||||
// Relasi ke model Gejala
|
||||
public function gejala()
|
||||
{
|
||||
return $this->belongsTo(Gejala::class, 'id_gejala');
|
||||
}
|
||||
|
||||
// Relasi ke model Penyakit
|
||||
public function penyakit()
|
||||
{
|
||||
return $this->belongsTo(Penyakit::class, 'id_penyakit');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
class Gejala extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table='gejala';
|
||||
protected $primaryKey='id_gejala';
|
||||
}
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
class Penyakit extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table="penyakit";
|
||||
protected $primaryKey="id_penyakit";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
@ -12,10 +11,11 @@
|
|||
public function up(): void
|
||||
{
|
||||
Schema::create('gejala', function (Blueprint $table) {
|
||||
$table->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
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
@extends('layouts.master')
|
||||
@section('title', 'aturan')
|
||||
|
||||
@section('konten')
|
||||
|
||||
@endsection
|
|
@ -0,0 +1,43 @@
|
|||
@extends('layouts.master')
|
||||
@section('title', 'aturan')
|
||||
|
||||
@section('konten')
|
||||
<table class="table table-striped" id="table-1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">No</th>
|
||||
<th>Kode Gejala</th>
|
||||
<th>Gejala</th>
|
||||
<th>Penyakit</th>
|
||||
<th>Nilai Kepercayaan</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<!-- footer content -->
|
||||
</tfoot>
|
||||
<tbody>
|
||||
@php
|
||||
$gejalaGroups = $aturan->groupBy('gejala_id');
|
||||
@endphp
|
||||
@foreach ($gejalaGroups as $gejalaId => $group)
|
||||
<tr>
|
||||
<td class="text-center">{{ $loop->iteration }}</td>
|
||||
<td>{{ optional($group->first()->gejala)->kode_gejala}}</td>
|
||||
<td>{{ optional($group->first()->gejala)->gejala}}</td>
|
||||
<td>
|
||||
@foreach ($group as $data)
|
||||
{{ $data->penyakit->nama_penyakit }} ({{ $data->penyakit->kode_penyakit }}) <br>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>{{ $group->first()->belief }}</td>
|
||||
<td>
|
||||
<a href="#" class="edit-button" data-bs-toggle="modal" data-bs-target="#edit-user" data-id_user="{{ $group->first()->id_user }}" data-name="{{ $group->first()->name }}" data-email="{{ $group->first()->email }}" data-area="{{ $group->first()->area }}" data-no_hp="{{ $group->first()->no_hp }}" data-kelas="{{ $group->first()->kelas }}">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
|
@ -6,20 +6,12 @@
|
|||
<img src="img/gejala/gejalaPMK.png" alt="" id="gambarGejala">
|
||||
</div>
|
||||
<div id="listGejala">
|
||||
{{-- <h1>Gejala PMK </h1> --}}
|
||||
<ol>
|
||||
<li>Terdapat ulcer atau luka di lidah, bibir, mulut, dan kuku kaki.</li>
|
||||
<li>Sapi mengalami demam dan lesu.</li>
|
||||
<li>Sapi mengalami kehilangan nafsu makan</li>
|
||||
<li> Produksi susu sapi menurun</li>
|
||||
<li>Sapi mengalami kesulitan bergerak atau berjalan karena rasa sakit yang dialami.</li>
|
||||
<li>Kuku kaki mengalami pembengkakan dan kerusakan.</li>
|
||||
<li>keluar air liur yang berlebihan</li>
|
||||
<li> Ambruk atau tidak dapat berdiri</li>
|
||||
<li> Kondisi fisik yang kurus atau menurun.</li>
|
||||
<li>Terjadi tanda-tanda pernapasan yang abnormal, seperti kesulitan bernapas dan batuk.</li>
|
||||
<li>Luka atau bisul pada kuku atau jari kaki.</li>
|
||||
<li>Terlihat cairan atau nanah keluar dari kuku atau jari kaki.</li>
|
||||
@foreach ($gejala as $gejalaItem)
|
||||
<li>{{ $gejalaItem ->gejala}} {{"{".$gejalaItem ->kode_gejala."}" }}</li>
|
||||
|
||||
@endforeach
|
||||
</ol>
|
||||
<input type="submit" id="btn-tambahGejala" value="Tambah Gejala">
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
@ -49,16 +49,11 @@
|
|||
<li class="nav-item mx-2">
|
||||
<a class="nav-link @if(request()->is('gejala')) active @endif" href="/gejala">Gejala</a>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Kategori
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" href="#">Kategori 1</a></li>
|
||||
<li><a class="dropdown-item" href="#">Kategori 2</a></li>
|
||||
<li><a class="dropdown-item" href="#">Kategori 3</a></li>
|
||||
</ul>
|
||||
|
||||
<li class="nav-item mx-2">
|
||||
<a class="nav-link @if(request()->is('aturan')) active @endif" href="/aturan">Aturan</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="ml-2">
|
||||
<a href="#" id="loginNav" class="btn btn-outline-success mr-3 mx-2">Login</a>
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
@extends('layouts.master')
|
||||
@section('title', 'penyakit')
|
||||
|
||||
@section('konten')
|
||||
|
||||
@endsection
|
|
@ -0,0 +1,20 @@
|
|||
@extends('layouts.master')
|
||||
@section('title', 'penyakit')
|
||||
|
||||
|
||||
@section('konten')
|
||||
<div class="container">
|
||||
<h1 id="h1Gejala"> Penyakit Mulut dan Kuku Pada Sapi </h1>
|
||||
<img src="img/gejala/gejalaPMK.png" alt="" id="gambarGejala">
|
||||
</div>
|
||||
<div id="listGejala">
|
||||
<ol>
|
||||
@foreach ($penyakit as $penyakitItem)
|
||||
<li>{{ $penyakitItem ->nama_penyakit}} </br>{{ $penyakitItem ->deskripsi_penyakit}} </li>
|
||||
|
||||
|
||||
@endforeach
|
||||
</ol>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
use App\Http\Controllers\GejalaController;
|
||||
use App\Http\Controllers\PenyakitController;
|
||||
use App\Http\Controllers\AturanController;
|
||||
/*
|
||||
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -22,14 +25,14 @@
|
|||
return view('gejala');
|
||||
});
|
||||
|
||||
Route::get('/aturan', function () {
|
||||
return view('aturan');
|
||||
});
|
||||
Route::get('/gejala', [GejalaController::class, 'index']);
|
||||
|
||||
Route::get('/penyakit', function () {
|
||||
return view('penyakit');
|
||||
});
|
||||
|
||||
Route::get('/penyakit', [PenyakitController::class, 'index']);
|
||||
|
||||
Route::get('/konsultasi', function () {
|
||||
return view('konsultasi');
|
||||
});
|
||||
|
||||
//Aturan
|
||||
Route::get('/aturan', [AturanController::class, 'index']);
|
||||
|
|
Loading…
Reference in New Issue