<?php 
include 'connect.php';
session_start();

	$sql = "SELECT * FROM `bahagian/unit`";
	$result = mysqli_query($conn,$sql);
	

?>


<!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">

  <!-- =======================================================
  * 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>

  <main>
    <div class="container">

      <section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
        <div class="container">
          <div class="row justify-content-center">
            <div class="col-lg-5 col-md-6 d-flex flex-column align-items-center justify-content-center">

              <div class="card mb-3">

                <div class="card-body">

                  <div class="pt-4 pb-2">
                    <h4 class="card-title text-center pb-0 fs-4"><i class="bi bi-person-plus-fill"></i> PENDAFTARAN PENGGUNA</h4>
                    <p class="text-center small">SISTEM TEMPAHAN</p>
					
                  </div>

                  <form class="row g-3 needs-validation" action="internalPage/registerUser.php" method="post" novalidate>
				  
				  <div class="col-12">
                      <label for="yourUsername" class="form-label">Nama</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend"><i class="bi bi-person-fill"></i></span>
                        <input type="text" name="nama" id="nama" class="form-control" id="yourUsername" style="text-transform:uppercase;" required>
                        <div class="invalid-feedback">Sila masukkan nama anda.</div>
                      </div>
                    </div>

                    <div class="col-12">
                      <label for="yourUsername" class="form-label">No Kad Pengenalan</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend"><i class="bi bi-person-fill"></i></span>
                        <input type="text" name="kadPengenalan" id="kadPengenalan" class="form-control" id="yourUsername" required>
                        <div class="invalid-feedback">Sila masukkan no. kad pengenalan anda.</div>
                      </div>
                    </div>

                     <div class="col-12">
                      <label for="yourUsername" class="form-label">Kata laluan</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend"><i class="bi bi-lock-fill"></i></span>
                        <input type="password" name="password" class="form-control" id="password" required>
                        <div class="invalid-feedback">Sila masukkan kata laluan anda.</div>
                      </div>
                    </div>
					
					 <div class="col-12">
                      <label for="yourUsername" class="form-label">Jawatan</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend"><i class="bi bi-person-fill"></i></span>
                        <input type="text" name="jawatan" id="jawatan" class="form-control" id="yourUsername" style="text-transform:uppercase;" required>
                        <div class="invalid-feedback">Sila masukkan jawatan anda.</div>
                      </div>
                    </div>
					
					 <div class="col-12">
                      <label for="yourUsername" class="form-label">Bahagian/Unit</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text" id="inputGroupPrepend"><i class="bi bi-building"></i></span>
                       <select class="form-control" aria-label="Default select example" name="bahagian" id="bahagian" required>
							  <option value="" >--Pilih--</option>
							  
								<?php 
									while ($row = mysqli_fetch_array($result))
									{
								
								?>
							  <option value="<?php echo $row["nama_bahagian"]; ?>"><?php echo $row["nama_bahagian"]; ?></option>
							  <?php
									}
							  ?>
							</select>
                        <div class="invalid-feedback">Sila pilih bahagian/unit anda.</div>
                      </div>
                    </div>

                    
                    <div class="col-12">
                      <button class="btn btn-primary w-100" type="submit">DAFTAR PENGGUNA</button>
                    </div>
					</form>
					
                    <label style="font-size:11px"><i class="bi bi-exclamation-circle-fill"></i> Anda sudah mempunyai akuan berdaftar? <a href="loginPage.html">Log masuk</a></label>
                  

                </div>
              </div>
				<div class="credits">               
				<p style="font-size:12px; color:black;">Hakcipta Terpelihara © 2022 Majlis Agama Islam Negeri Pulau Pinang.</p>
              </div>
              

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

      </section>

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

  <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>