<?php
error_reporting(0);
session_start();
include 'config/database.php';
$data = get_keynote();
?>
<!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>KEY NOTE | @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.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</head>
<body>
	<nav class="navbar navbar-light bg-light">
	    <a href='http://at-mybot.me:8000/index.php' class="navbar-brand">@MYBOT</a>
		<ul class="navbar-nav">
			<li class="nav-item">
				<a class="nav-link" href="index.php">หน้าแรก</a>
			</li>
		</ul>
		<span class="form-inline">
			<a class="nav-link" href="list.php">รายชื่อกลุ่ม</a>
		</span>
	</nav>
	<div class="container">
		<br>
		<a href="keynote_create.php" class="btn btn-primary">เพิ่มรายการ</a>
		<br><br>
		
		<?php foreach ($data as $key => $value): ?>
		<div class="card border-dark mb-3" style="max-width: 18rem;float: left;margin-right: 10px;">
		  <div class="card-header"><?php echo  $value['k_title'];?></div>
		  <div class="card-footer bg-transparent">
		  	<a href="keynote_update.php?kid=<?php echo $value["k_id"]; ?>" class="btn btn-warning">แก้ไข</a>
		  	<a href="keynote_detail.php?kid=<?php echo $value["k_id"]; ?>" class="btn btn-info">ข้อมูล</a>
		  </div>
		</div>
		<?php endforeach; ?>
	</div>

</body>
</html>
