<?php
include('../../config/koneksi.php');

// hitung warga
$query_warga = "SELECT COUNT(*) AS total FROM warga";
$hasil_warga = mysqli_query($db, $query_warga);
$jumlah_warga = mysqli_fetch_assoc($hasil_warga);

// hitung warga laki-laki
$query_warga_l = "SELECT COUNT(*) AS total FROM warga WHERE jenis_kelamin_warga = 'L'";
$hasil_warga_l = mysqli_query($db, $query_warga_l);
$jumlah_warga_l = mysqli_fetch_assoc($hasil_warga_l);

// hitung warga laki-laki
$query_warga_p = "SELECT COUNT(*) AS total FROM warga WHERE jenis_kelamin_warga = 'P'";
$hasil_warga_p = mysqli_query($db, $query_warga_p);
$jumlah_warga_p = mysqli_fetch_assoc($hasil_warga_p);

// hitung total user
$query_user = "SELECT COUNT(*) AS total FROM user"; 
$hasil_user = mysqli_query($db, $query_user);
$jumlah_user = mysqli_fetch_assoc($hasil_user);

// hitung total Pelatih
$query_pelatih = "SELECT COUNT(*) AS total FROM pelatih"; 
$hasil_pelatih = mysqli_query($db, $query_pelatih);
$jumlah_pelatih = mysqli_fetch_assoc($hasil_pelatih);
?>



