 <?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>

	<div class='row'>
        <div class='col-md-12'>
            <div class="card">
             <div class="card-header">	
                  
			    <div class='right '>
				 <a href="sandik_absen/cetakrekapguru.php" target="_blank" class="btn btn-outline-danger" ><i class='fa fa-print'></i>Rekap</a>
									
				   </div>
                  <h5 class='card-title'><i class="fas fa-calendar"></i> Absensi Pegawai</h5></div>    
			  
                  <div class='card-body'>
                    <div class='table-responsive'>
                        <table style="font-size: 12px" id='example1' class='table'>
                            <thead>
                                <tr>
                                    <th>No</th>
									<th>NIP</th>
									  <th>Nama Lengkap</th>
                                    <th>Jabatan</th>  
									  <th>Cetak</th>
                                </tr>
                            </thead>
							
							<tbody>
							
                                <?php
								$no = 0;
				
								 $query = mysqli_query($koneksi, "select * from users WHERE level<>'admin'");
                            while ($peg = mysqli_fetch_array($query)) {
							
							 $no++;
                            ?>
							 <tr>
                                    <td><?= $no; ?></td>
									 <td><?= $peg['nip'] ?></td>
									 <td><?= $peg['nama'] ?></td>
							        <td><?= strtoupper($peg['level']) ?></td>
									
								  <td style="text-align:center">
								  <button type="submit" class='btn btn-sm btn-outline-danger' onclick="frames['frameresult<?= $peg['id_user'] ?>'].print()" data-placement="top" data-toggle="tooltip" data-original-title="Print"><i class='fa fa-print'></i></button>				
									 	
								  </td>
								   <iframe name='frameresult<?= $peg['id_user'] ?>' src="sandik_absen/detailabsenguru.php?idu=<?= $peg['id_user'] ?>" style='border:none;width:1px;height:1px;'></iframe>
									
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
						
                    </div>
                    </div>
					</div>
					</div>