<?php
error_reporting(0);
session_start();
include 'query_all.php';
$data = '';
if(isset($_GET['id'])){
	$data = get_last_item_id($_GET['id']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Info - @mybot</title>
	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
	<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>

	<script src="https://getbootstrap.com/docs/4.0/assets/js/vendor/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
	<script src="https://getbootstrap.com/docs/4.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script><script src="/docs/4.0/assets/js/docs.min.js"></script>

</head>
<body>
	<nav class="navbar navbar-light bg-light">
	    <a href='index.php' class="navbar-brand">@MYBOT</a>
		<ul class="navbar-nav">
			<li class="nav-item">
				<a class="nav-link" href="list.php">กลุ่มไล</a>
			</li>
		</ul>
	</nav>
	<div class="container">
		<br>
		<nav>
			<div class="nav nav-tabs" id="nav-tab" role="tablist">
				<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">ข้อมูลสำคัญ</a>
				<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">รายละเอียด</a>
			</div>
		</nav>
		<div class="tab-content" id="nav-tabContent">
			<div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
				<br>
				<div class="card mb-4 shadow-sm">
					<div class="card-header">
						<h4 class="my-0 font-weight-normal"><?php echo $data[0]['groupline_name']; ?></h4>
					</div>
					<div class="card-body">
						<h1 class="card-title pricing-card-title">ID : <?php echo $data[0]['groupline_id']; ?></h1>
						<ul class="list-unstyled mt-3 mb-4">
						<li>วันที่เช่า : <?php echo $data[0]['groupline_buy_date']; ?></li>
						<li>ถึงวันที่ : <?php echo $data[0]['groupline_buy_end']; ?></li>
						<li>รวมทั้งสิ้น : <?php echo $data[0]['groupline_alldate']; ?> วัน</li>
						<li>บอท : <?php echo $data[0]['groupline_products']; ?></li>
						<li>เวอชั่น : <?php echo $data[0]['groupline_version']; ?></li>
						<li> <?php echo $data[0]['groupline_key']; ?> </li>
						</ul>
					</div>
				</div>
			</div>
			<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
				<br>
				<ul class="list-group">
					<li class="list-group-item"><label >ตาราง</label> <label style="float: right;">ข้อมูล</label></li>
					<?php foreach ($data as $key => $data): ?>
					<?php $get_key = array_keys($data);$i=1;?>
						<?php foreach ($get_key as $name): ?>
						<li class="list-group-item"><?php echo $i++;?>). <?php print_r($name); ?> | <b ><?php echo $data[$name]; ?></b></li>
						<?php endforeach; ?>
					<?php endforeach; ?>
				</ul>
			</div>
		</div>


	</div>
</body>
</html>
