<?php
include 'query_all.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<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">
    <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>
    <title>Register - @mybot</title>
</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>
        <?php $res = get_missing(); ?>
	<div class="container">
		<br>
		<nav aria-label="breadcrumb">
          <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="index.php">Home</a></li>
            <li class="breadcrumb-item active" aria-current="page">ห้องหาย</li>
          </ol>
        </nav>
          <?php
          $i = 0;
          foreach ($res as $key => $value) {
            $i = $i+1;
          ?>  
		<div class="card border-dark mb-3" style="max-width: 18rem;float: left;margin-right: 10px;">
		  <div class="card-header"><?php echo mb_substr(str_replace("?","",$value['groupline_name']), 0, 30, 'UTF-8');?></div>
		  <div class="card-body">
		    <h5 class="card-title">รหัสกลุ่ม <?php echo $value['groupline_id'];?></h5>
		    <p class="card-text">
		    	<ul style="list-style: none;padding-left: 0;">
                    <li>บอทที่ใช้ <?php echo $value['groupline_products'];?></li> 
                    <li>เวอชั่น <?php echo $value['groupline_version'];?></li>
		    	</ul>
		    </p>
            <p style="font-size: 12px;"><?php echo $value['groupline_key'];?></p>
		  </div>
		  <div class="card-footer bg-transparent">
		  	<button href="x?id=<?php echo $value['groupline_id'];?>" class="btn btn-primary btn-sm" >ให้ใช้งานต่อ</button>        
            <a href="x?id=<?php echo $value['groupline_id'];?>" class="btn btn-danger btn-sm">Disable</a>
		  </div>
		</div>
        <?php  } ?>

    </div>

</body>
<script>
    function modal_register(id,name){ // renew.php
        $('#id').val(id);
        $('#name').html(name);
        $('#open_register').modal();
    }
</script>
<div class="modal fade" id="open_register" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
            <h5 class="modal-title" id="exampleModalLabel">ลงทะเบียน : <b id="name">....</b></h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            </div>
            <div class="modal-body">
            <form action='register.php' method="GET">
                <input type="hidden" name="id" id="id">
                <div class="form-group">
                    <label>จำนวนวันที่สมัคร :</label>
                    <select class="form-control" name="category">
                        <option value="31">คี 1 เดือน(31วัน)</option>
                        <option value="93">คี 3 เดือน(93วัน)</option>
                        <option value="186">คี 6 เดือน(186วัน)</option>
                        <option value="372">คี 1 ปี(372วัน)</option>
                        <option value="1">คี 1 วัน(เทสบอท)</option>
                        <option value="3">คี 3 วัน(ทดสอบ)</option>
                        <option value="7">คี 7 วัน(ฟรี)</option>
                    </select>
                </div>	
                <input type="submit" value="ลงทะเบียน" class="btn btn-success">
            </form>	
            </div>
        </div>
    </div>
</div>
</html>