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

	$sql = "SELECT * FROM `bahagian/unit`";
	$result = mysqli_query($conn,$sql);
	$row = mysqli_fetch_array($result);
	
	$sql1 = "select * from `user` where kad_pengenalan = '".$_SESSION['kadPengenalan']."' ";
	$result1 = mysqli_query($conn,$sql1);
	$row1 = mysqli_fetch_array($result1);
	
	$userID = $row1["id_user"];
	//echo $peranan_user;
	
	$idSuratMasuk = $_GET['idSuratMasuk'];
	
	

?>

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

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

  <title>Sistem Pendaftaran Surat</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>
  <script src="https://code.jquery.com/jquery-3.2.1.js"></script>
  <script>
	$(document).ready(function() {
	  var i = 0;
	  $("#add_row").click(function() {
	  $('tr').find('input').prop('disabled',false)
		$('#addr' + i).html("<td><input type='text' name='noCek" + i + "' class='form-control input-md'  /></td><td><input type='text' name='noResit" + i + "' class='form-control input-md'/></td><td><input type='text' name='jumlah" + i + "'  class='form-control input-md'/></td>");

		$('#tab_logic').append('<tr id="addr' + (i + 1) + '"></tr>');
		i++;
	  });
	});
  </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 
  include 'header.php';
  
  ?>

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

     <div class="pagetitle">
      <h1>Ubahsuai Surat Masuk</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="">Surat Masuk / Ubahsuai Surat Masuk</a></li>          
        </ol>
      </nav>
    </div><!-- End Page Title -->
    <section class="section">
      <div class="row">
         <div class="card">
            <div class="card-body">
              <h5 class="card-title"></h5>
			  
			  <!-- Default Tabs -->
              <ul class="nav nav-tabs" id="myTab" role="tablist">
                <li class="nav-item" role="presentation">
                  <button class="nav-link " id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true" disabled >Maklumat Surat Masuk</button>
                </li>
                <li class="nav-item" role="presentation">
                  <button class="nav-link active" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">Maklumat Pendaftaran Cek</button>
                </li>
                
              </ul>
			  <div class="tab-content pt-5" id="myTabContent">
				<div class="tab-pane fade show active" id="profile" role="tabpanel" aria-labelledby="profile-tab">
				<label id="add_row" class="btn btn-primary btn-xs pull-left" />Tambah cek</label>
					<form class="row g-3" action="internalPage/insertCek.php?idSuratMasuk=<?php echo $idSuratMasuk ?>" method="post" enctype="multipart/form-data" >					  
						<div class="row mb-3" >
						
						  <table class="table table-bordered table-hover" id="tab_logic" style="margin-top:18px;">
							<thead>
							  <tr>
								<th class="text-center">
								  No Cek:
								</th>
								<th class="text-center">
								  No. Resit:
								</th>
								<th class="text-center">
								  Jumlah:
								</th>
							  </tr>
							</thead>
							<tbody>
							  <tr id='addr0'>
								
								<td>
								  <input type="text" name="noCek1"  class="form-control" disabled />
								</td>
								<td>
								  <input type="text" name="noResit1" class="form-control" disabled />
								</td>
								<td>
								  <input type="text" name="jumlah1" class="form-control" disabled />
								</td>
							  </tr>
							  <tr id='addr1'></tr>
							</tbody>
						  </table>
						  
						</div>
						<div class="row mb-3">
						  <label for="inputDate" class="col-sm-2 col-form-label">Tarikh Resit:</label>
						  <div class="col-sm-2">
							<input type="date" class="form-control" name="tarikh_resit" id="tarikh_resit" data-date-format="dd/mm/yy">
						  </div>
						</div>
						<div class="row mb-3">
						  <label class="col-sm-2 col-form-label">Perihal:</label>
						  <div class="col-sm-6">
							<input type="text" class="form-control" name="perihal1" id="perihal1" style="text-transform:uppercase;">
							<input type="text" class="form-control" name="perihal2" id="perihal2" style="text-transform:uppercase;">
													
						  </div>
						</div>
						<div class="row mb-3">
						  <label class="col-sm-2 col-form-label">Lain-lain Hal:</label>
						  <div class="col-sm-6">
							<textarea type="text" class="form-control" name="lainlainhal" id="lainlainhal" style="text-transform:uppercase;"></textarea>					
						  </div>
						</div>
						<div class="text-center">
						  <button type="submit" class="btn btn-primary" >Simpan</button>
						  <button type="reset" class="btn btn-secondary">Reset</button>
						</div>
						
					</form>
				 </div>
			  </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>
	<script src="asserts/js/jquery-1.11.1.min.js"></script>  
</body>

</html>