      <?php
	  $tanggal=date('Y-m-d');
$agenda = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM agenda WHERE tanggal='$tanggal'"));
$nilaik13 = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM nilai_harian WHERE kurikulum='K-13' AND tanggal='$tanggal'"));
$nilaiikm = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM nilai_harian WHERE kurikulum='Merdeka' AND tanggal='$tanggal'"));
$absensis = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM absensi WHERE kelas<>'' AND ket='H' AND tanggal='$tanggal'"));
$absengur = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM absensi WHERE idguru<>'' AND ket='H' tanggal='$tanggal'"));
$nilaiujian = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM nilai"));


?>           
	<div class='row'>
        <div class="col-lg-8">
            <div class='box box-solid'>
                <div class='box-header with-border '>
                    <h4 class='box-title'> <b>Dashboard Transkip</b></h4>
                    <div class='box-tools pull-right '>
                    </div>
                </div>
                <div class='box-body bg-info'>
				 <div class="row">
          <div class="col-lg-4">
            <div class="info-box">
              <span class="info-box-icon bg-green"><?= $agenda ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=agendaguru" style="color:#000"><b>AGENDA & JURNAL<br>GURU</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1></h1>                  
                </span>
              </div>
            </div>
          </div>
		  <div class="col-lg-4">
            <div class="info-box">
               <span class="info-box-icon bg-green"><?= $nilaik13 ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=nilaiharianguru" style="color:#000"><b>NILAI HARIAN<br>K-13</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1></h1>                  
                </span>
              </div>
            </div>
          </div>
		  <div class="col-lg-4">
            <div class="info-box">
               <span class="info-box-icon bg-green"><?= $nilaiikm ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=pelanggaran" style="color:#000"><b>NILAI HARIAN <br>K-MERDKA</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1><?= $jbk ?></h1>                  
                </span>
              </div>
            </div>
          </div>
		  
		    <div class="col-lg-4">
            <div class="info-box">
              <span class="info-box-icon bg-yellow"><?= $absensis ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=surat" style="color:#000"><b>KEHADIRAN SISWA <br>ABSEN KELAS</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1></h1>                  
                </span>
              </div>
            </div>
          </div>
		   <div class="col-lg-4">
            <div class="info-box">
              <span class="info-box-icon bg-yellow"><?= $absensis ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=surat" style="color:#000"><b>KEHADIRAN PEGAWAI <br>ABSEN PEGAWAI</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1></h1>                  
                </span>
              </div>
            </div>
          </div>
		  
		  <div class="col-lg-4">
            <div class="info-box">
              <span class="info-box-icon bg-yellow"><?= $nilaiujian ?></span>

              <div class="info-box-content">
                <span class="info-box-text"> <a href="?pg=surat" style="color:#000"><b>SINKRON NILAI <br>UJIAN SEKOLAH</b> <i class="fa fa-arrow-circle-right"></i></a></span>
                <span class="inner">
                  <h1></h1>                  
                </span>
              </div>
            </div>
         </div>
		 </div>
		 </div>
		 </div>
		 </div>
		   <div class="col-md-4">
        <div class="panel panel-default">
            <div class="panel-heading" style="height:45px">
                <h4 class='box-title'><i class='fas fa-laptop fa-fw'></i>
                    Koneksi Server CBT - AKM
                </h4>
                
            </div>
            <div class='box-body bg-info text-center'>
                <div id='server'>
                    <br>
                    
                </div>
            </div>
        </div>
    </div>
	</div>
	<div class='row'>
        <div class="col-lg-12">
            <div class='box box-solid'>
                <div class='box-header with-border '>
                    <h4 class='box-title'> <b>Jadwal PTM Hari ini</b></h4>
                    <div class='box-tools pull-right '>
                    </div>
                </div>
                <div class='box-body bg-info'>
				 <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>									  
									
                                </tr>
                            </thead>
							
							<tbody>
							
                                <?php
								$harix=date('D');
								$no = 0;
								 if ($user['level'] == 'admin') :
								 $query = mysqli_query($koneksi, "select * from jadwal_mapel
								 JOIN users ON users.id_user=jadwal_mapel.guru WHERE hari='$harix'");
								  elseif ($user['level'] == 'guru') :
								   $query = mysqli_query($koneksi, "select * from jadwal_mapel
								 JOIN users ON users.id_user=jadwal_mapel.guru WHERE  jadwal_mapel.guru='$_SESSION[id_user]' ");
								   endif;
                            while ($mapel = mysqli_fetch_array($query)) {
							$hari=fetch($koneksi,'m_hari',['inggris' =>$mapel['hari']]);
                                $no++;
                            ?>
							 <tr>
                                    <td class="hidden-xs"><?= $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>
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>