 <?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php if ($ac == '') { ?>
   
	<div class='row'>
        <div class='col-md-12'>
             <div class="card">
             <div class="card-header">	
                  <h5 class='card-title'><i class="fas fa-calendar"></i> Rekapitulasi Absensi Mapel</h5></div>    
			  
                   <div class="card-body">
                    <div class='table-responsive'>
                        <table style="font-size: 12px" id='example1' class='table'>
                            <thead>
                                <tr>
                                    <th width='3px'>No</th>
									<th width='5%'>Tingkat</th>
									  <th width='5%'>Kelas</th>
                                    <th>Nama Mapel</th>  
                                     <th>Guru Mapel</th> 	
									 <th width='10%'>Hari</th>
                                      <th width='5%'>Dari</th>
                                        <th width='5%'>Sampai</th>									  
									
									  <th width='5%'>Cetak</th>
                                </tr>
                            </thead>
							
							<tbody>
							
                                <?php
								$no = 0;
				
								 $query = mysqli_query($koneksi, "select * from jadwal_mapel
								 JOIN users ON users.id_user=jadwal_mapel.guru");
                            while ($mapel = mysqli_fetch_array($query)) {
							$hari=fetch($koneksi,'m_hari',['inggris' =>$mapel['hari']]);
							 $no++;
                            ?>
							 <tr>
                                    <td><?= $no; ?></td>
									 <td><?= $mapel['tingkat'] ?></td>
									 <td><?= $mapel['kelas'] ?></td>
							        <td><?= $mapel['mapel'] ?></td>
									<td><?= $mapel['nama'] ?></td>
									<td><?= $hari['hari'] ?></td>					
									<td><?= $mapel['dari'] ?></td>
									<td><?= $mapel['sampai'] ?></td>
                                   
								  <td style="text-align:center">
								  <button type="submit" class='btn btn-sm btn-outline-danger' onclick="frames['frameresult<?= $mapel['id_jadwal'] ?>'].print()" data-placement="top" data-toggle="tooltip" data-original-title="Print"><i class='fa fa-print'></i></button>				
									 
								  </td>
								   <iframe name='frameresult<?= $mapel['id_jadwal'] ?>' src="sandik_absen/cetakabsenmapel.php?idj=<?= $mapel['id_jadwal'] ?>" style='border:none;width:1px;height:1px;'></iframe>
										
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
						
                    </div>
                    </div>
					</div>
	<?php } ?>
  
  