Skip to content

Commit

Permalink
memeperbaiki route
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrian17 authored and canggihwr committed Nov 24, 2023
1 parent 375d148 commit 06f3173
Show file tree
Hide file tree
Showing 71 changed files with 206 additions and 223 deletions.
33 changes: 14 additions & 19 deletions app/Http/Controllers/DiagnosaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use App\Models\Kode_Gejala;
use App\Models\KondisiUser;
use App\Models\TingkatDepresi;
use GuzzleHttp\Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
Expand All @@ -27,12 +28,11 @@ class DiagnosaController extends Controller
*/
public function index()
{
$data = [
'gejala' => Gejala::all(),
'kondisi_user' => KondisiUser::all()
];
$diagnosa = Diagnosa::all();

return view('clients.form_diagnosa', $data);
return view('admin.diagnosa.admin_semua_diagnosa', [
"diagnosa" => $diagnosa,
]);
}

/**
Expand All @@ -42,18 +42,13 @@ public function index()
*/
public function create()
{
//
}









$data = [
'gejala' => Gejala::all(),
'kondisi_user' => KondisiUser::all()
];

return view('clients.form_diagnosa', $data);
}

/**
* Store a newly created resource in storage.
Expand All @@ -63,11 +58,11 @@ public function create()
*/
public function store(StoreDiagnosaRequest $request)
{
$filteredArray= $request->post('kondisi');
$kondisi = array_filter($filteredArray, function($value) {
$filteredArray = $request->post('kondisi');
$kondisi = array_filter($filteredArray, function ($value) {
return $value !== null;
});

// dd($kondisi);
$kodeGejala = [];
$bobotPilihan = [];
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public function __construct()
*/
public function index()
{
return view('home');
return view('admin.dashboard');
}
}
2 changes: 1 addition & 1 deletion app/Models/Artikel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function fillTabel()
$artikel = [
[
"kode_depresi" => "P001",
"url_gambar" => 'https://unsplash.com/photos/w818vRg6pdY',
"url_gambar" => 'https://plus.unsplash.com/premium_photo-1668062843172-0129f25a1276?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80',
"judul" => 'Gangguan Mood',
"isi" => 'Ganggguan mood yang terjadi pada seseorang ini umumnya terjadi karena banyaknya tekanan yang menimpa dirinya dan cenderung terlarut dalam tekanan dapat meningkatkan resiko berkembangnya gangguan mood yang kemudian dapat berubah menjadi depresi terutama depresi mayor. Hal ini terbukti pada suatu penelitian yang menemukan bahwa dalam sekitar empat dari lima kasus, depresi mayor diawali oleh peristiwa kehidupan yang penuh tekanan.'
],
Expand Down
2 changes: 1 addition & 1 deletion database/factories/UserFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class UserFactory extends Factory
public function definition()
{
return [
'name' => fake()->name(),
'name' => 'admin',
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
Expand Down
2 changes: 1 addition & 1 deletion database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// \App\Models\User::factory(10)->create();
\App\Models\User::factory(3)->create();
Artikel::factory(4)->create();

// \App\Models\User::factory()->create([
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
6 changes: 3 additions & 3 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
|
*/

if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) {
require $maintenance;
}

Expand All @@ -31,7 +31,7 @@
|
*/

require __DIR__.'/../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
Expand All @@ -44,7 +44,7 @@
|
*/

$app = require_once __DIR__.'/../bootstrap/app.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

Expand Down
90 changes: 45 additions & 45 deletions resources/views/admin/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,53 @@
<h1>Dashboard</h1>
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item"><a href="/dashboard">Home</a></li>
<li class="breadcrumb-item active">Dashboard</li>
</ol>
</nav>
</div><!-- End Page Title -->

<section class="section dashboard">
<div class="row">

<!-- Left side columns -->
<div class="col-lg-12">
<div class="row">

<!-- Sales Card -->
<div class="col-xxl-4 col-md-6">
<div class="card info-card sales-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>
</div>

<div class="card-body">
<h5 class="card-title">Daftar <span>| Gejala</span></h5>

<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="bi bi-activity"></i>
</div>
<div class="ps-3">
<h6>{{$gejala->count()}}</h6>
<span class="text-success small pt-1 fw-bold">{{$gejala->count()}}</span> <span class="text-muted small pt-2 ps-1">gejala</span>

</div>
</div>
</div>

</div>
</div><!-- End Sales Card -->

<!-- Revenue Card -->
<div class="col-xxl-4 col-md-6">
<div class="card info-card revenue-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
Expand All @@ -65,30 +65,30 @@
</li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Gangguan <span>| Depresi</span></h5>

<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="bi bi-x"></i>
</div>
<div class="ps-3">
<h6>{{$tingkat_depresi->count()}}</h6>
<span class="text-success small pt-1 fw-bold">{{$gejala->count()}}</span> <span class="text-muted small pt-2 ps-1">depresi</span>

</div>
</div>
</div>

</div>
</div><!-- End Revenue Card -->

<!-- Customers Card -->
<div class="col-xxl-4 col-xl-12">

<div class="card info-card customers-card">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
Expand All @@ -97,32 +97,32 @@
</li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Jumlah <span>| Admin</span></h5>

<div class="d-flex align-items-center">
<div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
<i class="bi bi-people"></i>
</div>
<div class="ps-3">
<h6>{{$user->count()}}</h6>
<span class="text-danger small pt-1 fw-bold">{{$user->count()}}</span> <span class="text-muted small pt-2 ps-1">admin</span>

</div>
</div>

</div>
</div>

</div><!-- End Customers Card -->



<!-- Recent Sales -->
<div class="col-12">
<div class="card recent-sales overflow-auto">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
Expand All @@ -131,10 +131,10 @@
</li>
</ul>
</div>

<div class="card-body">
<h5 class="card-title">Daftar <span>| Gejala</span></h5>

<table class="table table-borderless datatable">
<thead>
<tr>
Expand All @@ -153,32 +153,32 @@
@endforeach
</tbody>
</table>

</div>

</div>
</div><!-- End Recent Sales -->

<!-- Top Selling -->
<div class="col-12">
<div class="card top-selling overflow-auto">

<div class="filter">
<a class="icon" href="#" data-bs-toggle="dropdown"><i class="bi bi-three-dots"></i></a>
<ul class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
<li class="dropdown-header text-start">
<h6>Filter</h6>
</li>

<li><a class="dropdown-item" href="#">Today</a></li>
<li><a class="dropdown-item" href="#">This Month</a></li>
<li><a class="dropdown-item" href="#">This Year</a></li>
</ul>
</div>

<div class="card-body pb-0">
<h5 class="card-title">Gangguan <span>| Depresi</span></h5>

<table class="table table-borderless">
<thead>
<tr>
Expand All @@ -195,24 +195,24 @@
<td>{{ $item->depresi }}</td>
</tr>
@endforeach

</tbody>
</table>

</div>

</div>
</div><!-- End Top Selling -->

</div>
</div><!-- End Left side columns -->



</div>
</section>

</main><!-- End #main -->


@endsection
Loading

0 comments on commit 06f3173

Please sign in to comment.