MIF_E31210164/resources/views/pages/dashboard-admin.blade.php

262 lines
11 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.dashboard')
@section('title','dashboard | Admin')
@section('content')
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Dashboard</h1>
</div>
<!-- Content Row -->
<div class="row">
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Data Pegawai</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $user }}</div>
</div>
<div class="col-auto">
<i class="fas fa-user fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-primary shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
Jumlah Pasien Terdaftar</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $pasien }}</div>
</div>
<div class="col-auto">
<i class="fas fa-user fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Kunjungan Bulan Ini</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $count }}</div>
</div>
<div class="col-auto">
<i class="fas fa-syringe fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Data Pembayaran</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">{{ $pembayarandone }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<!-- Earnings (Monthly) Card Example -->
<!-- <div class="col-xl-3 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Pembayaran Belum Lunas</div><div class="h5 mb-0 font-weight-bold text-gray-800">
{{ $jumlahIdPeriksa }}
</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div> -->
<!-- <div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Pendapatan(Bulan Ini)</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">Rp. {{ number_format($pendapatanbulan, 0, ',', '.') }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-6 col-md-6 mb-4">
<div class="card border-left-success shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
Total Semua Saldo Pendapatan</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">Rp. {{ number_format($pendapatan, 0, ',', '.') }}</div>
</div>
<div class="col-auto">
<i class="fas fa-dollar-sign fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div> -->
<div class="col-md-12">
<div class="card">
<div class="card-body">
<h5 class="card-title">Daftar 10 Besar Penyakit Pasien</h5>
<!-- Content Row -->
{{-- <div class="row"> --}}
<div class="dashboard-content mb-3">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row mb-2">
<div class="col-md-2">
<select class="form-control" name="tahun" id="tahun">
<option value="">Pilih Tahun</option>
@php
$startYear = 2010; // Tahun mulai
$currentYear = date('Y'); // Tahun sekarang
// Perulangan untuk menghasilkan opsi tahun dari tahun mulai hingga tahun sekarang
for ($year = $currentYear; $year >= $startYear; $year--) {
// Buat opsi tahun
echo '<option value="' . $year . '">' . $year . '</option>';
}
@endphp
</select>
</div>
<div class="col-md-2">
<button class="btn btn-primary" onclick="handleSubmit()">View</button>
</div>
          </div>
<div class="table-responsive">
<table id="UserData" class="table table-bordered">
<thead>
<tr>
<th class="text-center">No</th>
<th class="text-center">Kode ICD</th>
<th class="text-center">Diagnosa</th>
<th class="text-center">Jumlah</th>
</tr>
</thead>
<tbody>
@foreach($penyakitterbanyak as $key => $val)
<tr>
<td> {{$key+1}} </td>
<td>{{ $val->kode }}</td>
<td>{{ $val->diagnosa }}</td>
<td>{{ $val->total }} Pasien</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('addon-script')
<script type="text/javascript">
$(document).ready(function() {
    });
$(document).ready(function() {
$('#UserData').DataTable({
"ordering": false // Menyembunyikan fitur pengurutan
});
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Dapatkan nilai bulan dan tahun dari parameter URL (jika ada)
var urlParams = new URLSearchParams(window.location.search);
var selectedYear = urlParams.get('tahun');
// Setel nilai terpilih pada elemen <select> bulan dan tahun (jika nilai tersedia)
var selectYear = document.getElementById('tahun');
if (selectedYear) {
selectYear.value = selectedYear;
}
});
function print() {
// Dapatkan nilai yang dipilih dari elemen <select> bulan dan tahun
var selectedYear = document.getElementById('tahun').value;
// Buat URL dengan parameter yang dipilih
if (selectedYear) {
url += "tahun=" + selectedYear + "&";
}
// Hapus karakter '&' terakhir jika ada
url = url.slice(0, -1);
// Redirect ke URL yang dibangun
window.location.href = url;
}
function handleSubmit() {
// Dapatkan nilai yang dipilih dari elemen <select> bulan dan tahun
var selectedYear = document.getElementById('tahun').value;
// Buat URL dengan parameter yang dipilih
var url = "{{ route('home.index') }}?";
if (selectedYear) {
url += "tahun=" + selectedYear + "&";
}
// Hapus karakter '&' terakhir jika ada
url = url.slice(0, -1);
// Redirect ke URL yang dibangun
window.location.href = url;
}
</script>
@endpush