<?php defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');?>
<?php
$bl=date('m');
$bulane = fetch ($koneksi, 'bulan', ['bln' =>$bl]);
?>
<div class='panel panel-default'>
               <div class="panel-heading" style="height:45px">
                   
                    <div class='box-tools pull-right '>
					
                    </div>
					<h4 class='box-title'><i class="fas fa-calendar"></i>  Absen Daring Bulan <?= $bulane['ket'] ?></h4>
                    </div>
                <div class='box-header with-border '>
			   <div class='box-tools pull-right '>
			   <table>
			   <tr>
			   <td>
			   <div class="form-group-sm">
			  <select name='jenjang' class='form-control' >
              <option value=""><?= $setting['sekolah'] ?></option>
               </select>
			   </div>
				</td>
			   <td>
			   <div class="form-group-sm">
			  <select name='jenjang' class='form-control' >
              <option value=""><?= $setting['jenjang'] ?></option>
               </select>
			   </div>
				</td>
				<td>
				<div class="form-group-sm">
			  <select name='jenjang' class='form-control'>
               <option value=""><?= $setting['kota'] ?></option>
               </select>
			   </div>
				</td>
				<td>
				<div class="form-group-sm">
			  <select name='jenjang' class='form-control' >
               <option value=""><?= $setting['kecamatan'] ?></option>
               </select>
			   </div>
				</td>
				</tr>					
			</table>
			</div>
			 <h4 class='box-title'></h4>
			  </div>
			  <div class="box-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true" >Materi Daring</a></li>                       
                    </ul>				
					<div class="tab-content">
                        <div class="tab-pane active" id="tab_1" >
					 <div class="box-body">	
				<div class="panel panel-default">
				 <div class='box-body'>
                <div id='tablemateri' class='table-responsive'>
                        <table id="example1" class='table table-bordered table-hover'>
                            <thead>
                                <tr>
                                    <th width='5px'>#</th>
                                    <th>Mata Pelajaran</th>
                                    <th>Tanggal</th>
                                    <th>Nama Siswa</th>
                                    <th>Kelas</th>
                                    <th>Ket</th>
                                    
                                </tr>
                            </thead>
                            <tbody>
                                <?php
								$no=0;
                                if ($pengawas['level'] == 'guru') {
                                    $abmap = mysqli_query($koneksi, "SELECT * FROM absen_daringmapel where guru='$_SESSION[id_pengawas]' ORDER BY tanggal DESC");
                                } else {
                                    $abmap = mysqli_query($koneksi, "SELECT * FROM absen_daringmapel ");
                                }
                                ?>
                                <?php while ($ab = mysqli_fetch_array($abmap)) : ?>
                                    <?php
                                  
									$siswa = mysqli_fetch_array(mysqli_query($koneksi, "select * FROM siswa where id_siswa='$ab[idsiswa]'"));
                                    $no++
                                    ?>
                                    <tr>
                                        <td><?= $no ?></td>
                                        <td><?= $ab['mapel'] ?> </td>
                                        <td> <?= date('d-m-Y',strtotime($ab['tanggal'])); ?></td>    
                                         <td> <?= $siswa['nama'] ?></td>
										<td> <?= $siswa['id_kelas'] ?></td>    
                                       <td> <?= $ab['ket'] ?></td>    
                                           
                                        
										</tr>
										<?php endwhile; ?>
										</tbody>
									</table>
								</div>
							</div>
						</div>
