<?php
include '../connect.php';
session_start();
	
	$sql1 ="SELECT peranan_user FROM user WHERE kad_pengenalan='".$_SESSION['kadPengenalan']."'";
	$result1 = mysqli_query($conn,$sql1);
	$row1 = mysqli_fetch_array($result1);
	
	$bilikID=$_GET['bilikID'];
	
	$sql2 = "SELECT tempahan_bilik.bilikID, tempahan_bilik.kad_pengenalan, tempahan_bilik.nama_mesyuarat,tempahan_bilik.tarikh, tempahan_bilik.masaDari, tempahan_bilik.masaHingga, tempahan_bilik.jenisBilik, tempahan_bilik.status, user.nama_user FROM `tempahan_bilik` JOIN `user` ON tempahan_bilik.kad_pengenalan=user.kad_pengenalan WHERE tempahan_bilik.bilikID='".$bilikID."'";
	$result2 = mysqli_query($conn,$sql2);
	$row2 = mysqli_fetch_array($result2);
	
	$sql = "SELECT * FROM `user` where kad_pengenalan = '".$row2['kad_pengenalan']."'";
	$result = mysqli_query($conn,$sql);
	$row = mysqli_fetch_array($result);

?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>Sistem Tempahan</title>
  <meta content="" name="description">
  <meta content="" name="keywords">

  <!-- Favicons -->
  <link href="../assets/img/logo_tab.png" rel="icon">

  <!-- Google Fonts -->
  <link href="https://fonts.gstatic.com" rel="preconnect">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Nunito:300,300i,400,400i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">

  <!-- Vendor CSS Files -->
  <link href="../assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link href="../assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
  <link href="../assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
  <link href="../assets/vendor/quill/quill.snow.css" rel="stylesheet">
  <link href="../assets/vendor/quill/quill.bubble.css" rel="stylesheet">
  <link href="../assets/vendor/remixicon/remixicon.css" rel="stylesheet">
  <link href="../assets/vendor/simple-datatables/style.css" rel="stylesheet">

  <!-- Template Main CSS File -->
  <link href="../assets/css/style.css" rel="stylesheet">
  
  <!-- Script logout -->
  <script type="text/javascript" src="internalPage/logoutConfirmation.js"></script>
  
  <!-- =======================================================
  * Template Name: NiceAdmin - v2.2.0
  * Template URL: https://bootstrapmade.com/nice-admin-bootstrap-admin-html-template/
  * Author: BootstrapMade.com
  * License: https://bootstrapmade.com/license/
  ======================================================== -->
</head>

<body>

  <?php 
  if($row1['peranan_user']=='USER')
  {
	  include 'header.html';
  }
  else
  {
	  include 'headerAdmin.html';
  }
  ?>

  <main id="main" class="main">

    <div class="pagetitle">
      <h1>Semak Kelulusan Tempahan Bilik</h1>
      
    </div><!-- End Page Title -->
    <section class="section">
      <div class="row">
        <div class="col-lg-12">

          <div class="card">
            <div class="card-body">
              <h5 class="card-title"></h5>

              <!-- Horizontal Form -->
              <form class="row g-3" action="internalPage/insertKelulusan.php?bilikID=<?php echo $row2['bilikID']; ?>" method="post" >
                <div class="row mb-3">
                  <label for="inputEmail3" class="col-sm-2 col-form-label">Nama:</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" id="nama" name="nama" style="font-size:14px;" value="<?php echo $row['nama_user']; ?>" disabled>
                  </div>
                </div>
                <div class="row mb-3">
                  <label for="inputEmail3" class="col-sm-2 col-form-label">Jawatan:</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" id="jawatan" name="jawatan" style="font-size:14px;" value="<?php echo $row['jawatan']; ?>" disabled>
                  </div>
				  <label for="inputEmail3" class="col-sm-2 col-form-label">Bahagian/Unit:</label>
                  <div class="col-sm-5">
                    <input type="text" class="form-control" id="jawatan" name="jawatan" style="font-size:14px;" value="<?php echo $row['bahagian']; ?>" disabled>
                  </div>
                </div>
                <div class="row mb-3">
                  <label for="inputPassword3" class="col-sm-2 col-form-label">Nama Mesyuarat:</label>
                  <div class="col-sm-10">
                    <input type="text" class="form-control" id="namaMesyuarat" name="namaMesyuarat" style="text-transform:uppercase; font-size:12px;" value="<?php echo $row2['nama_mesyuarat']; ?>" disabled>
                  </div>
                </div>
               <div class="row mb-3">
                  <label for="inputPassword3" class="col-sm-2 col-form-label">Tarikh Mesyuarat:</label>
                  <div class="col-sm-4">
                    <input type="text" class="form-control" id="tarikhMesyuarat" name="tarikhMesyuarat" value="<?php echo $row2['tarikh']; ?>" disabled>
                  </div>
                </div>
                <div class="row mb-3">
					<label for="inputEmail3" class="col-sm-2 col-form-label">Masa Diperlukan</label><br>
                  <label for="inputEmail3" class="col-sm-2 col-form-label">Dari:</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" id="masaDari" name="masaDari" value="<?php echo $row2['masaDari']; ?>" disabled>
                  </div>
				  <label for="inputEmail3" class="col-sm-2 col-form-label">Hingga:</label>
                  <div class="col-sm-3">
                    <input type="text" class="form-control" id="masaHingga" name="masaHingga" value="<?php echo $row2['masaHingga']; ?>" disabled>
                  </div>
                </div>
				<div class="row mb-3">
                  <label for="inputPassword3" class="col-sm-2 col-form-label">Jenis Bilik:</label>
                  <div class="col-sm-4">
                    <input type="text" class="form-control" id="tarikhMesyuarat" name="tarikhMesyuarat" value="<?php echo $row2['jenisBilik']; ?>" disabled>
                  </div>
                </div>
				<div class="row mb-3">
                  <label for="inputPassword3" class="col-sm-2 col-form-label">Kelulusan</label>
                  <div class="col-sm-4">
                    <select  aria-label="Default select example" name="kelulusan" id="kelulusan">
					  <option value="LULUS" >LULUS</option>
					  <option value="TIDAK LULUS" >TIDAK LULUS</option>
					</select>
                  </div>
                </div>
				<div class="row mb-3">
                  <label for="inputPassword3" class="col-sm-2 col-form-label">Catatan:</label>
                  <div class="col-sm-4">
                    <textarea type="text" class="form-control" id="catatan" name="catatan" placeholder="Sila masukkan catatan jika permohonan tidak diluluskan"></textarea>
                  </div>
                </div>
                <div class="text-center">
                  <button type="submit" class="btn btn-primary">Submit</button>
                  <button type="reset" class="btn btn-secondary">Reset</button>
                </div>
              </form><!-- End Horizontal Form -->

            </div>
          </div>

          

         </div>
        </div>

        </div>
      </div>
    </section>

  </main><!-- End #main -->

  <!-- ======= Footer ======= -->
  <footer id="footer" class="footer">
    <div class="copyright">
      &copy; Copyright <strong><span>Majlis Agama Islam Negeri Pulau Pinang @ 2022</span></strong>.
    </div>
  </footer><!-- End Footer -->

  <a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>

  <!-- Vendor JS Files -->
  <script src="../assets/vendor/apexcharts/apexcharts.min.js"></script>
  <script src="../assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="../assets/vendor/chart.js/chart.min.js"></script>
  <script src="../assets/vendor/echarts/echarts.min.js"></script>
  <script src="../assets/vendor/quill/quill.min.js"></script>
  <script src="../assets/vendor/simple-datatables/simple-datatables.js"></script>
  <script src="../assets/vendor/tinymce/tinymce.min.js"></script>
  <script src="../assets/vendor/php-email-form/validate.js"></script>

  <!-- Template Main JS File -->
  <script src="../assets/js/main.js"></script>

</body>

</html>