 <?php 
 $hari = date('D');
$jjadwal = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM jadwal_mapel WHERE hari='$hari'"));
$hadir = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM absensi WHERE tanggal='$tanggal' AND ket='H' AND level='siswa'"));
$hadpeg = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM absensi WHERE tanggal='$tanggal' AND ket='H' AND level='pegawai'"));
?>



                       <div class="row">
                            <div class="col-xl-4">
                                <div class="card widget widget-stats">
                                    <div class="card-body">
                                        <div class="widget-stats-container d-flex">
                                            <div class="widget-stats-icon widget-stats-icon-primary">
                                                <i class="material-icons-outlined">school</i>
                                            </div>
                                            <div class="widget-stats-content flex-fill">
                                                <span class="widget-stats-title">JADWAL AKTIF HARI INI</span>
                                                <span class="widget-stats-amount"><?= $jjadwal ?></span><p>
                                               
                                            </div>
                                           
                                        </div>
                                    </div>
                                </div>
                            </div>
							
                            <div class="col-xl-4">
                                 <div class="card widget widget-stats">
                                    <div class="card-body">
                                        <div class="widget-stats-container d-flex">
                                            <div class="widget-stats-icon widget-stats-icon-success">
                                                <i class="material-icons-outlined">school</i>
                                            </div>
                                            <div class="widget-stats-content flex-fill">
                                                <span class="widget-stats-title">SISWA AKTIF HARI INI</span>
                                                <span class="widget-stats-amount"><?= $hadir ?></span><p>
                                                
                                            </div>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
                          
                            <div class="col-xl-4">
                                <div class="card widget widget-stats">
                                    <div class="card-body">
                                        <div class="widget-stats-container d-flex">
                                            <div class="widget-stats-icon widget-stats-icon-danger">
                                                <i class="material-icons-outlined">school</i>
                                            </div>
                                            <div class="widget-stats-content flex-fill">
                                                <span class="widget-stats-title">GURU AKTIF HARI INI</span>
                                                <span class="widget-stats-amount"><?= $hadpeg ?></span><p>
                                               
                                            </div>
                                            
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                           <div class="col-xl-7">
                                <div class="card widget widget-payment-request">
                                    <div class="card-header">
                                        <h5 class="card-title">JADWAL HARI INI</h5>
                                    </div>
                                    <div class="card-body">
                                        <div id='logabsen' ></div> 
                                            
                                            
                                           
                                        </div>
                                    </div>
                                </div>
                          
                            <div class="col-xl-5">
                                <div class="card widget widget-list">
                                    <div class="card-header">
									
                                        <h5 class="card-title">PROGRES PTM HARI INI</h5>
										
                                    </div>
                                    <div class="card-body">
									  <div id='loglive' ></div> 
										
                                </div>
                               </div>
                             	<?php
							
							$jwb = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM absen_daring"));
							
							?> 
													
                                
                                    </div>
                                </div>
                            </div>
						</div>
                       </div>
	<script>						
$('#formhapusdata').submit(function(e) {
        e.preventDefault();
        $.ajax({
            type: 'POST',
            url: 'asesmen/tsetting.php?pg=clear',
            data: $(this).serialize(),
            success: function(data) {
                console.log(data);
                if (data == "ok") {
                   setTimeout(function()
				{
				window.location.reload();
						}, 2000);
                } else {
                    iziToast.warning(
            {
                title: 'Gagal!',
                message: 'Belum ada yang dipilih',
				titleColor: '#FFFF00',
				messageColor: '#fff',
				backgroundColor: '#8b0000',
				 progressBarColor: '#FFFF00',
                  position: 'topRight'
            });
                }

            }
        });
        return false;
    });
</script>
								<script>

							var autoRefresh = setInterval(
								function() {
									
									$('#logabsen').load('cbtserver_ptm/logabsen.php');
									$('#loglive').load('cbtserver_ptm/logstatus.php');
									
								}, 1000
							);
						</script>
