<?php
include("sess_check.php");

// deskripsi halaman
$pagedesc = "Data Siswa";
$menuparent = "siswa";
include("layout_top.php");
$tgl = date('Y-m-d');
?>
<!-- top of file -->
<!-- Page Content -->
<div id="page-wrapper">
	<div class="container-fluid">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="page-header">Data Siswa</h1>
			</div><!-- /.col-lg-12 -->
		</div><!-- /.row -->

		<div class="row">
			<div class="col-lg-12"><?php include("layout_alert.php"); ?></div>
		</div>

		<div class="row">
			<div class="col-lg-12">
				<form class="form-horizontal" action="siswa_insert.php" method="POST" enctype="multipart/form-data">
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3>Tambah Data Siswa</h3>
						</div>
						<div class="panel-body">
							<div class="form-group">
								<label class="control-label col-sm-3">Nis</label>
								<div class="col-sm-4">
									<input type="text" name="nis" class="form-control" placeholder="Nis" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Nama Lengkap</label>
								<div class="col-sm-4">
									<input type="text" name="nama_lengkap" class="form-control" placeholder="Nama Lengkap" required>
								</div>
							</div>
							<div class="form-group">
								<label class="control-label col-sm-3">Kelas</label>
								<div class="col-sm-4">
									<select name="id_kelas" id="kelas" class="form-control" required>
										<option value="">==== Pilih Kelas ====</option>
										<?php
										$sql_brg = "SELECT tingkatan.*, kelas.* FROM tingkatan, kelas WHERE tingkatan.id_tingkatan=kelas.id_tingkatan AND tingkatan.keterangan BETWEEN 'Masuk' and 'Masuk' ORDER by kelas.id_kelas ASC";
										$ress_brg = mysqli_query($conn, $sql_brg);
										while ($li = mysqli_fetch_array($ress_brg)) {
											echo '<option value="' . $li['id_kelas'] . '">'  . $li['nama_kelas'] . '</option>';
										}
										?>
									</select>
								</div>
							</div>



						</div>
						<div class="panel-footer">
							<button type="submit" name="simpan" class="btn btn-success">Simpan</button>
						</div>
					</div><!-- /.panel -->
				</form>
			</div><!-- /.col-lg-12 -->
		</div><!-- /.row -->
	</div><!-- /.container-fluid -->
</div><!-- /#page-wrapper -->
<!-- bottom of file -->
<?php
include("layout_bottom.php");
?>