                         <?php
							require("../../config/koneksi.php");
								require("../../config/function.php");
								require("../../config/crud.php");
								  ?>
								  <div class="row">
								<?php
							$query = mysqli_query($koneksi, "SELECT * FROM jadwal_rapor"); 
						while ($data = mysqli_fetch_array($query)) :												 
						$peg = fetch($koneksi,'users',['id_user'=>$data['idguru']]);
					$jsiswa = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM siswa WHERE level='$data[tingkat]' "));				
					$jnilai = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM nilai_rapor WHERE idguru='$data[idguru]' AND kode='$data[kodemap]' "));				
					$jnilai2 = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM nilai_sumatif WHERE idguru='$data[idguru]' AND kode='$data[kodemap]' GROUP BY nis"));	
						
										
												  

												  ?>
						 <div class="col-xl-6">
                               
                                    <div class="card-body">
                                        <div class="widget-payment-request-container">
                                            <div class="widget-payment-request-author">
                                                <div class="avatar m-r-sm">
                                                    <img src="../images/user.png" alt="">
                                                </div>
                                                <div class="widget-payment-request-author-info">
                                                    <span class="widget-payment-request-author-name"><?= $peg['nama'] ?></span>
                                                    <span class="widget-payment-request-author-about"><b><?= $data['kodemap'] ?> - <?= $data['kurikulum'] ?></b></span>
                                                 <span class="badge badge-secondary">KELAS <?php
														$dataArray = unserialize($data['kelas']);
														foreach ($dataArray as $key => $value) :
															echo $value . " ";
														endforeach;
														?></span>
												</div>
                                            </div>
                                              
                                        <div class="widget widget-list">
                                        <ul class="widget-list-content list-unstyled">
                                            <li class="widget-list-item widget-list-item-green">
                                                
                                                <span class="widget-list-item-description">
                                                   <?php if($data['kurikulum']=='K-2013'): ?>
												   <a href="#" class="widget-list-item-description-title">
                                                      <?= $jnilai ?>  dari <?= $jsiswa ?> data
                                                    </a>
                                                    <span class="widget-list-item-description-progress">
                                                        <div class="progress">
                                                            <div class="progress-bar bg-success" role="progressbar" style="width: <?= ($jnilai/$jsiswa)*100; ?>%;" aria-valuenow="<?= ($jnilai/$jsiswa)*100; ?>" aria-valuemin="0" aria-valuemax="100"></div>
                                                        </div>
														<?php endif; ?>
                                                    <?php if($data['kurikulum']=='K-Merdeka'): ?>
												   <a href="#" class="widget-list-item-description-title">
                                                     <?= $jnilai2 ?>  dari <?= $jsiswa ?> data
                                                    </a>
                                                    <span class="widget-list-item-description-progress">
                                                        <div class="progress">
                                                            <div class="progress-bar" role="progressbar" style="width: <?= ($jnilai2/$jsiswa)*100; ?>%;" aria-valuenow="<?= ($jnilai2/$jsiswa)*100; ?>" aria-valuemin="0" aria-valuemax="100"></div>
                                                        </div>
														<?php endif; ?>
                                                </span>
												 </span>	
                                            </li>
                                           
                                        </ul>
                                   </div>
								   </div>
                                  
                                </div>
                            </div>
                       <?php endwhile; ?>
					    </div>