<!-- data table start -->
<div class="col-12 mt-5">
  <div class="card">
    <div class="card-body">
      <h4 class="header-title">Data Pengguna</h4>
      <div class="data-tables">
        <a href="?page=Add-User" target="_self"><button type="button" class="btn btn-primary mb-3">Tambah Data</button></a>
        <table id="dataTable2" class="text-center">
          <thead class="bg-light text-capitalize">
            <tr>
              <th width="5%">No</th>
              <th width="35%">Nama Lengkap</th>
              <!-- <th width="10%">User ID</th> -->
              <th width="10%">Level</th>
              <th width="30%">Foto</th>
              <th width="20%">Aksi</th>
            </tr>
          </thead>
          <tbody>
            <?php
            include_once "../library/inc.sesadmin.php";
            include_once "../library/inc.library.php";

            $userSql = "SELECT * FROM user ORDER BY id ASC";
            $userQry = mysql_query($userSql, $koneksidb)  or die ("Query user salah : ".mysql_error());
            $nomor  = 0;
            while ($userRow = mysql_fetch_array($userQry)) 
            {
             $nomor++;
             $Kode = $userRow['id'];
             ?>
             <tr>
              <td><b><?php echo $nomor; ?></b></td>
              <td align="left"><?php echo $userRow['nama']; ?></td>
              <td><?php echo $userRow['level'] ?></td>
              <td><img src="../foto/<?php echo $userRow['foto'] ?>" width="100px"></td>
              <td align="center">
                <a href="?page=Edit-User&amp;Kode=<?php echo $Kode; ?>"><button type="button" class="btn btn-warning btn-xs">Ubah</button></a> &nbsp
                <a href="?page=Delete-User&amp;Kode=<?php echo $Kode; ?>&txtNamaFile=<?php echo $userRow['foto'] ?>" target="_self" alt="Delete Data" onclick="return confirm('ANDA YAKIN INGIN MENGHAPUS DATA PENTING INI ... ?')"><button type="button" class="btn btn-danger btn-xs">Hapus</button></a>
              </td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
<!-- data table end -->
