<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php
$skl = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM skl  WHERE id_skl='1'"));
?>
<?php if ($ac == '') { ?>
<div class='row'>

        <div class='col-md-7'>
           <div class="card">
             <div class="card-header">									
                  <h5 class="card-title"><i class="fas fa-print"></i> Cetak Rekap Transaksi</h4></div>    
			  
			 
						<div class="card-body">
						<form id="formpengaturan" action='sandik_bayar/cetakrekap.php' target="_blank"  method='post' class="form-horizontal" enctype='multipart/form-data'>
                          <div class="row mb-2">
						<label  class="col-md-3 col-form-label bold">Pembayaran</label>
							<div class="col-sm-7">
							   <select name='kode' class='form-select' required='true'>
                                      <option value=''>Pilih Pembayaran</option>
                                       <?php $quem = mysqli_query($koneksi, "SELECT * FROM m_bayar"); ?>
                                                <?php while ($m = mysqli_fetch_array($quem)) : ?>
                                                    <option value="<?= $m['kode'] ?>"><?= $m['nama_pembayaran'] ?></option>
                                                <?php endwhile ?>
                                                    </select>            
										   </div>
						            </div>
							<div class="row mb-2">
						<label  class="col-md-3 col-form-label bold">Bulan</label>
							<div class="col-sm-9">
						<select  name='bulan' class='form-select' required='true'>
                                      <option value=''>Pilih Bulan</option>
                                       <?php $q = mysqli_query($koneksi, "SELECT * FROM bulan"); ?>
                                                <?php while ($b = mysqli_fetch_array($q)) : ?>
                                                    <option value="<?= $b['bln'] ?>"><?= $b['ket'] ?></option>
                                                <?php endwhile ?>
                                                    </select> 
                                            </div>
                                        </div>
							
							<div class="right">
						<button type='submit'  class='btn btn-sm  btn-primary'><i class='fa fa-print' ></i>Print Rekap</button>
											
                              </div>						          	 							
						            
									           </form>
								            
											</div>
										</div>
									</div>
								</div> 
                          
					  <script>
				  $("#level").change(function() {
					var level = $(this).val();
					console.log(level);
					$.ajax({
						type: "POST", 
						url: "sandik_pk/crud_pk.php?pg=ambil_kelas", 
						data: "level=" + level, 
						success: function(response) { 
							$("#kelas").html(response);
						}
					});
				});		
						
			</script>
			
                    
			
						
	<?php } elseif ($ac == 'siswa') { ?>
<?php $kelas = $_POST['kelas']; ?>
<div class='row'>

        <div class='col-md-12'>
            <div class='panel panel-default'>
               <div class="panel-heading" style="height:45px">
                  <h4 class='box-title'><i class="fas fa-print"></i> CETAK STANDAR KOMPETENSI UTAMA</h4></div>    
			  
			  <div class="box-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true" >Transkip Nilai</a></li>
					</ul>					
					<div class="tab-content">
                        <div class="tab-pane active" id="tab_1" >
						<br>					
						<div class="panel panel-default">	
                <div class='box-body'>
                <div class="table-responsive">
                    <table style="font-size: 12px" class="table table-bordered table-hover" id="example1">
                        <thead>
                            <tr>
                                 <th class="text-center" width="3%" >
                                    #
                                </th>
                              <th width="10%" >Kelas</th>
                                <th >N I S</th>
								 <th >N I S N</th>
								 <th >Nama Siswa</th>
								<th ></th>
							</tr>
                        </thead>
                        <tbody>
                            <?php
                            $query = mysqli_query($koneksi, "select * from siswa WHERE id_kelas='$kelas' ");
                            $no = 0;
                            while ($siswa = mysqli_fetch_array($query)) {								
                                $no++;
                            ?>
                                <tr>
                                    <td><?= $no; ?></td>
                                   <td><?= $siswa['id_kelas'] ?></td>
								   <td><?= $siswa['nis'] ?></td>
								   <td><?= $siswa['nisn'] ?></td>
                                    <td><?= $siswa['nama'] ?></td>
                                  <td>
								  <a href="sandik_pk/cetaksku.php?nis=<?= $siswa['nis'] ?>" target="_blank" class="btn btn-sm btn-danger"><i class="fa fa-print"></i> Cetak </a>
								  </td>
                                </tr>

                            <?php }
                            ?>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

					 
<?php } ?>	