<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php if ($ac == '') { ?>
							<div class='row'>
							  <div class="col-xl-6">
                                <div class="card widget widget-payment-request">
                                    <div class="card-header">
                                        <h5 class="card-title">REKAP NILAI UJIAN</h5>
                                    </div>
                                    <div class="card-body">
                                        <div class="widget-payment-request-container">
                                            <div class="widget-payment-request-author">
                                                <div class="avatar m-r-sm">
                                                    <img src="<?= $homeurl ?>/images/buku.png" alt="">
                                                </div>
                                                <div class="widget-payment-request-author-info">
                                                    <span class="widget-payment-request-author-name">REKAP NILAI UJIAN</span>
                                                    <span class="widget-payment-request-author-about"><?= $setting ['sekolah'] ?></span>
                                                </div>
                                            </div>
                                           
                                            <div class="widget-payment-request-info m-t-md">
                                                <form id="formpengaturan" action='asesmen/nilai/rekap_excel.php'  method='post' class="form-horizontal" enctype='multipart/form-data'>
                          <div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Tingkat</label>
							<div class="col-sm-9">
							   <select id='level' name='level' class='form-select' required='true'>
                                      <option value=''>Pilih Tingkat</option>
                                       <?php $quem = mysqli_query($koneksi, "SELECT * FROM siswa GROUP BY level"); ?>
                                                <?php while ($m = mysqli_fetch_array($quem)) : ?>
                                                    <option value="<?= $m['level'] ?>"><?= $m['level'] ?></option>
                                                <?php endwhile ?>
                                                    </select>            
										   </div>
						            </div>
							 <div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Kelas</label>
							<div class="col-sm-9">
							<select name='kelas' id="kelas" class='form-select'  required='true'>
                            
                                                </select>
                                            </div>
                                        </div>
							
							 <div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Pilih Ujian</label>
							<div class="col-sm-9">
							  <select name='jenis' class='form-select' required='true'>
							  <option value=''>Pilih Jenis</option>
                                     <?php $quem = mysqli_query($koneksi, "SELECT * FROM jenis WHERE status='aktif'"); ?>
                                                <?php while ($m = mysqli_fetch_array($quem)) : ?>
                                                    <option value="<?= $m['id_jenis'] ?>"><?= $m['nama'] ?></option>
                                                <?php endwhile ?>
                                                    </select> 
							                        </div>
                                                </div>
                                                </div>
                                                <div class="widget-payment-request-info-item">
                                                    
                                                </div>
                                            </div>
                                            <div class="widget-payment-request-actions m-t-lg d-flex">
                                                <a href="#" class="btn btn-light flex-grow-1 m-r-xxs">Reject</a>
                                                <button type="submit" id="blockui-2" class="btn btn-primary flex-grow-1 m-l-xxs">Approve</button>
                                            </div>
                                        </div>
										</form>
                                    </div>
                                </div>
                            
               
							
                          		 <script>
				  $("#level").change(function() {
					var level = $(this).val();
					console.log(level);
					$.ajax({
						type: "POST", 
						url: "asesmen/nilai/tkelas.php?pg=ambil_kelas", 
						data: "level=" + level, 
						success: function(response) { 
							$("#kelas").html(response);
						}
					});
				});			
        			  	
			</script>
					 
			             <div class="col-xl-6">
                                <div class="card widget widget-payment-request">
                                    <div class="card-header">
                                        <h5 class="card-title">DATA UJIAN</h5>
                                    </div>
                                    <div class="card-body">
                        
                        <table style="font-size: 12px" id='datatable1' class='table'>
                            <thead>
                                <tr>
                                    <th width='3px'>No</th>
									<th>Kode Ujian</th>
									<th>Kode Mapel</th>
                                </tr>
                            </thead>
							
							<tbody>
							
                                <?php
								$no = 0;
								
								 $query = mysqli_query($koneksi, "select * from ujian");							  
                            while ($ujian = mysqli_fetch_array($query)) {							
                                $no++;
                            ?>
							 <tr>
                                    <td><?= $no; ?></td>
									 <td><?= $ujian['kode_nama'] ?></td>
									 <td><?= $ujian['nama'] ?></td>
							       
                                     
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                           
                        </div>
						
						
                    	 </div>
						     </div>	
						         </div>
						             
                        
					
<?php } ?>	