<?php
// Recoded by Gh0Code
// Hargailah orang lain jika Anda ingin dihargai
session_start();
require("../mainconfig.php");

if (isset($_SESSION['user'])) {
	$sess_username = $_SESSION['user']['username'];
	$check_user = mysqli_query($db, "SELECT * FROM users WHERE username = '$sess_username'");
	$data_user = mysqli_fetch_assoc($check_user);
	if (mysqli_num_rows($check_user) == 0) {
		header("Location: ".$cfg_baseurl."logout.php");
	} else if ($data_user['status'] == "Suspended") {
		header("Location: ".$cfg_baseurl."logout.php");
	}
}

include("../lib/header.php");
?>
<div class="page-body">
    <?php include('../lib/partial/breadcrumb.php') ?>
          <!-- Container-fluid starts-->
          <div class="container-fluid">
            <div class="row">
                <?php
							$check_staff = mysqli_query($db, "SELECT * FROM staff ORDER BY level ASC");
							while ($data_staff = mysqli_fetch_assoc($check_staff)) {
							?>
              <div class="col-xl-4 col-sm-6 col-xxl-3 col-ed-4 box-col-4">
                <div class="card social-profile">
                  <div class="card-body">
                    <div class="social-img-wrap"> 
                      <div class="social-img"><img src="../assets/images/dashboard-2/cs-icon.jpg" alt="profile"></div>
                      <div class="edit-icon">
                        <svg>
                          <use href="../assets/svg/icon-sprite.svg#profile-check"></use>
                        </svg>
                      </div>
                    </div>
                    <div class="social-details">
                      <h5 class="mb-1"><?= $data_staff['name']; ?></h5>
                      <ul class="card-social">
                        <li><p><?= $data_staff['level']; ?></p></li>
                      </ul>
                    </div>
                    <div class="card-body">
                    <p><?= nl2br($data_staff['contact']); ?></p>
                  </div>
                  </div>
                </div>
              </div>
              <?php } ?>
            </div>
          </div>
          <!-- Container-fluid Ends-->
        </div>
<?php
include("../lib/footer.php");
?>