<?php
$_title = "Ninja School Online";
include_once '../system/head.php';
if ($_login == null) {
	header("location:/");
}
$_active = isset($_active) ? $_active : null;
?>
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>thông tin tài khoản</title>
	<!--update body trang-->
	<link rel="stylesheet" href="../assets/css/nap-tien.css" />
	<!--update body trang-->
	<!--update body trang-->
	<link rel="stylesheet" href="../assets/css/dangky-dangnhap.css" />
	<!--update body trang-->
</head>

<body>
	<div style="margin-top: 100px;"></div>
	<main class="flex-grow-1 flex-shrink-1">
		</br>
		<div class="container pb-5">


			<?php echo $_active; ?>
			<?php
			if ($thanhVien == "0") {
				echo '<div class="alert alert-primary">Để có thể sử dụng các tính năng, bạn cần phải <a href="/active">kích hoạt tài khoản</a> (Phí: 10,000 Coin = 10,000 VND).</div>';
			}
			?>
			<div class="user-card">
				<div class="col-md-12">
					<!--	<h5 class="tex-userr pb-2 pt-2">Thông tin tài khoản</h5> -->
					<div style="margin-top: 11px;"></div>
					<p class="maincontent-texxx">THÔNG TIN TÀI KHOẢN</p>
					<table class="user-table" width="100%">
						<tbody>

							<tr>
								<th width="50%" scope="row">TÀI KHOẢN</th>
								<th width="50%">
									<div class="table-highlight">
										<?php echo $_username; ?>
									</div>
								</th>
							</tr>

							<tr>
								<th width="50%" scope="row">SỐ DƯ</th>
								<td width="50%">
									<div class="text-danger"><b>
											<?php echo number_format($_coin); ?> Coin
										</b></div>
								</td>
							</tr>


							<tr>
								<th width="50%" scope="row">KHÁCH HÀNG</th>
								<td width="50%">
									<div class="table-highlight">
										<?php echo $_nhomkhachhang; ?>
									</div>
								</td>
							</tr>

							

							<tr>
								<th width="50%" scope="row">TRẠNG THÁI</th>
								<td width="50%" class="font-weight-bold">
									<div class="table-highlight">
										<?php echo $_status_name; ?>
									</div>
								</td>
							</tr>

							<tr>
								<th width="50%" scope="row">MẬT KHẨU</th>
								<td width="50%" ><a href="/change-password"><b><i class="text-danger">****** (Đổi Mật
												Khẩu)</i></b></a>
								</td>
							</tr>
							<tr>
								<th width="50%" scope="row">ĐỔI LƯỢNG</th>
								<td width="50%" ><a class="tex-conin btn btn-coin" href="/exchange">[ Đổi Coin ]</a>
								</td>
							</tr>
							<tr>
								<th width="50%" scope="row">ĐĂNG XUẤT</th>
								<td width="50%">
									<!--	<a class="btn btn-outline-primary" href="/?out">Đăng xuất</a>   -->
									<a class="btn btn-dangky-dangnhap" href="/?out">Đăng xuất</a>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		<!--	<?php
			include '../system/ketnoi.php';
			if ($admin_web == 1) {
				$sql = "SELECT SUM(tongthang) as tongthang  FROM `users` ";
				$result = mysqli_fetch_assoc(mysqli_query($ketnoi, $sql));
				?>
				<div class="card mb-3">
					<div class="card-header">Tổng tiền tháng này: <font color="red" size="4">
							<?= number_format($result['tongthang']); ?>
						</font> VNĐ</div>
					<div class="card-header">Lịch Sử Nạp (10 lịch sử gần nhất):</div>
					<div class="table-responsive">
						<table class="table table-hover table-nowrap">
							<thead>
								<tr>
									<th>ID</th>
									<th>Loại</th>
									<th>username</th>
									<th>Trạng thái</th>
									<th>Mệnh giá</th>
									<th>Thời gian</th>
								</tr>
							</thead>
							<tbody>
								<?php
								$data = _query(_select("*", "naptien", "tinhtrang='1' ORDER BY id DESC LIMIT 10"));
								while ($row = mysqli_fetch_array($data)) {
									?>

									<tr>
										<td>
											<?php echo htmlspecialchars($row['id']); ?>
										</td>
										<td>
											<?php echo htmlspecialchars($row['loaithe']); ?>
										</td>
										<td>
											<?php echo htmlspecialchars($row['uid']); ?>
										</td>
										<td>
											<?php echo get_string_tinhtrangthe($row['tinhtrang']); ?>
										</td>
										<td>
											<?php echo number_format($row['sotien']); ?>đ
										</td>
										<td>
											<?php echo date("H:i - d/m/Y", $row['time']); ?>
										</td>
									</tr>

								<?php }
								?>
							</tbody>
						</table>
					</div>
				</div>
			<?php } ?>-->
		</div>
		<div style="margin-top: 50px;"></div>
		<?php
		include_once '../system/end.php';
		?>
		</div>
	</main>
</body>

</html>