Commit de953028 by Siti Aisah

update dashboard

parent f11113ea
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Support\ValidationRule;
use App\Http\Controllers\Controller;
use App\Models\Admin\Pengajuan;
use Exception;
use Storage;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redirect;
class DashboardController extends Controller
{
public function index() {
$data['jumlah'] = DB::table("tr_pengajuan")
->select("id_kategori", DB::raw("count (id_kategori) as jumlah"))
->groupBy("id_kategori")
->pluck('jumlah','id_kategori');
$semua = DB::table('bantuan_pengusul')->count();
$sudah = DB::table('tr_pengajuan')->count();
$data['sudah'] = $sudah;
$data['belum'] = $semua-$sudah;
return view('dashboard',$data);
}
}
......@@ -48,7 +48,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">4</h4>
@php
if(isset($jumlah['c6c43201-3f60-43af-968a-75c2984624e7'])){
$jsarjana = $jumlah['c6c43201-3f60-43af-968a-75c2984624e7'];
} else {
$jsarjana = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jsarjana }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S1/D4</p>
</div>
</div>
......@@ -61,7 +68,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">1</h4>
@php
if(isset($jumlah['11459605-89b4-4dfc-9586-519802e989e4'])){
$jpasca = $jumlah['11459605-89b4-4dfc-9586-519802e989e4'];
} else {
$jpasca = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jpasca }}</h4>
<p class="card-text font-small-3 mb-0">Mhs S2/S3</p>
</div>
</div>
......@@ -74,7 +88,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">2</h4>
@php
if(isset($jumlah['ec949871-68fa-4357-8084-547db716faf6'])){
$jdosen = $jumlah['ec949871-68fa-4357-8084-547db716faf6'];
} else {
$jdosen = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jdosen }}</h4>
<p class="card-text font-small-3 mb-0">Dosen</p>
</div>
</div>
......@@ -87,7 +108,14 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">3</h4>
@php
if(isset($jumlah['790fdbb1-36e7-447c-9a38-55b62816395c'])){
$jindustri = $jumlah['790fdbb1-36e7-447c-9a38-55b62816395c'];
} else {
$jindustri = 0;
}
@endphp
<h4 class="fw-bolder mb-0">{{ $jindustri }}</h4>
<p class="card-text font-small-3 mb-0">Industri</p>
</div>
</div>
......@@ -107,7 +135,7 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">20</h4>
<h4 class="fw-bolder mb-0">{{ $sudah }}</h4>
<p class="card-text font-small-3 mb-0">Sudah dikategorikan</p>
</div>
</div>
......@@ -120,7 +148,7 @@
</div>
</div>
<div class="my-auto">
<h4 class="fw-bolder mb-0">10</h4>
<h4 class="fw-bolder mb-0">{{ $belum }}</h4>
<p class="card-text font-small-3 mb-0">Belum dikategorikan</p>
</div>
</div>
......
<?php
use App\Http\Controllers\Admin\Auth\LoginController;
use App\Http\Controllers\Admin\DashboardController;
use App\Http\Controllers\Admin\KategoriController;
use App\Http\Controllers\Admin\TransaksiController;
use App\Http\Controllers\Admin\SakuController;
......@@ -25,9 +26,7 @@
// Route::get('/home', [TransaksiController::class, 'index'])->name('admin.index-transaksi');
Route::middleware(['auth','prevent-back-history'])->group(function(){
Route::get('/home', function () {
return view('dashboard');
});
Route::get('/home', [DashboardController::class, 'index']);
Route::resource('kategori', KategoriController::class);
Route::resource('transaksi', TransaksiController::class);
Route::resource('saku', SakuController::class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment