
<?php if ($ac == '') { ?>

    <div class='row'>
	<div class='col-md-12'>
             <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-graduation-cap"></i> Cetak Rapor</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" >E-Rapor</a></li>
                    </ul>
					<div class="tab-content">
                    <div class="tab-pane active" id="tab_1" >
				<div class="panel panel-default">
				 <div class='box-body'>
				 <div class='row'>
        <div class='col-md-12'>
           <div class='box box-solid '>
                
            <div class='box-body'>
                   <div class='table-responsive'>
                        <table style="font-size: 11px" id='tabelekstra' class='table'>
                            <thead>
                            <tr>
                             <th width="5%" class="text-center">
                                    #
                                </th>
                                <th width="25%">Kelas</th>
                                <th>Wali Kelas</th>
								
							<th width="5%" style="text-align:center">Detail Nilai Formatif</th>
							<th width="5%" style="text-align:center">Detail Nilai Sumatif</th>
							<th width="5%" style="text-align:center">Leger Nilai Formatif</th>
							<th width="5%" style="text-align:center">Sumatif Akhir Materi</th>
							<th width="5%" style="text-align:center">Sumatif Akhir Semester</th>
							<th width="5%" style="text-align:center">Rekap Nilai Akhir</th>
							<th width="5%" style="text-align:center">Cetak Rapor</th>
							
                            </tr>
                        </thead>
                        <tbody>
                            <?php
							if($pengawas['level']=='admin'){
                            $query = mysqli_query($koneksi, "select * FROM siswa GROUP BY id_kelas");
							}else{
						    $query = mysqli_query($koneksi, "select * FROM siswa WHERE id_kelas='$pengawas[jabatan]' GROUP BY id_kelas");
							}
                            $no = 0;
                            while ($walas = mysqli_fetch_array($query)) {
							$user=fetch($koneksi,'pengawas',['jabatan' =>$walas['id_kelas']]);
                                $no++;
                            ?>
                                <tr>
                                    <td><?= $no; ?></td>
									<td><?= $walas['id_kelas'] ?></td>
									<td><?= $user['nama'] ?></td>
									 <td style="text-align:center">
                                       <a href="?pg=cetakraporproto&ac=detail&kelas=<?= $walas['id_kelas'] ?>" class='btn btn-xs btn-flat btn-warning' ><i class='fa fa-print'></i> </a>                                        
										 
										  </td>
										  <td style="text-align:center">
                                       <a href="?pg=cetakraporproto&ac=detailsum&kelas=<?= $walas['id_kelas'] ?>" class='btn btn-xs btn-flat btn-success' ><i class='fa fa-print'></i> </a>                                        
										 
										  </td>
                                    <td style="text-align:center">
                                       <button class='btn btn-xs btn-flat btn-danger' onclick="frames['frameresult<?= $walas[id_kelas] ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult<?= $walas['id_kelas'] ?>" src="sandik_ikm/legerformatif.php?kelas=<?= $walas['id_kelas'] ?>" style='display:none'></iframe>
 
										  </td>
										    <td style="text-align:center">
                                        <button class='btn btn-xs btn-flat btn-warning' onclick="frames['frameresult2<?= $walas[id_kelas] ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult2<?= $walas['id_kelas'] ?>" src="sandik_ikm/legersumatifAM.php?kelas=<?= $walas['id_kelas'] ?>" style='display:none'></iframe>
                                       
										   </td>
										   <td style="text-align:center">
                                       <button class='btn btn-xs btn-flat btn-success' onclick="frames['frameresult3<?= $walas[id_kelas] ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult3<?= $walas['id_kelas'] ?>" src="sandik_ikm/legersumatifAS.php?kelas=<?= $walas['id_kelas'] ?>" style='display:none'></iframe>
                                                                              
										   </td>
										   <td style="text-align:center">
										  <button class='btn btn-xs btn-flat btn-primary' onclick="frames['frameresult4<?= $walas[id_kelas] ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult4<?= $walas['id_kelas'] ?>" src="sandik_ikm/dna.php?kelas=<?= $walas['id_kelas'] ?>" style='display:none'></iframe>
                                                                                 
										   </td>
										   <td style="text-align:center">
                                       <a href="?pg=cetakraporproto&ac=siswa&kelas=<?= $walas['id_kelas'] ?>" class="btn btn-xs btn-info btn-rounded">
                                          <i class="fas fa-print"></i></button></a>                                        
										   </td>
										   
							   </tr>
								
                            <?php }
                            ?>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

	
<?php } elseif ($ac == 'siswa') { ?>
    <?php $kelas = $_GET['kelas']; ?>
	 <div class='row'>
	<div class='col-md-12'>
             <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-graduation-cap"></i> Cetak Rapor</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" >E-Rapor</a></li>
                    </ul>
					<div class="tab-content">
                    <div class="tab-pane active" id="tab_1" >
				<div class="panel panel-default">
				 
				 <div class='row'>
        <div class='col-md-12'>
          
            <div class='box-body'>
                   <div class='table-responsive'>
                        <table style="font-size: 11px" id='tabelekstra' class='table'>
                            <thead>
                            <tr>
                             <th width="5%" class="text-center">
                                    #
                                </th>
                                <th width="5%">Kelas</th>
                                <th>Nama Siswa</th>
							<th width="5%" style="text-align:center">Cover</th>
							<th width="5%" style="text-align:center">Biodata</th>
							<th width="5%" style="text-align:center">Rapor</th>
							
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            $query = mysqli_query($koneksi, "select * FROM siswa WHERE id_kelas='$_GET[kelas]'");
                            $no = 0;
                            while ($siswa = mysqli_fetch_array($query)) {
							
                                $no++;
                            ?>
                                <tr>
                                    <td><?= $no; ?></td>
									<td><?= $siswa['id_kelas'] ?></td>
									<td><?= $siswa['nama'] ?></td>
									<td>
									<a href="sandik_rapor/print_cover.php?ids=<?= $siswa['id_siswa'] ?>" target="_blank" class="btn btn-sm btn-primary"><i class="fas fa-graduation-cap"></i></a>
									</td>
									<td>
									<a href="sandik_rapor/print_biodata.php?ids=<?= $siswa['id_siswa'] ?>" target="_blank" class="btn btn-sm btn-warning"><i class="fas fa-user-cog"></i></a>
									</td>
									<td>
									<a href="sandik_ikm/print_raport.php?ids=<?= $siswa['id_siswa'] ?>" target="_blank" class="btn btn-sm btn-success"><i class="fas fa-print"></i></a>
									</td>
									</tr>
								
                            <?php }
                            ?>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<?php } elseif ($ac == 'detail') { ?>

<div class='row'>
	 <div class='col-md-12'>
             <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-graduation-cap"></i> E-Rapor</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" >Menu E Rapor</a></li>
                    </ul>
					<div class="tab-content">
                    <div class="tab-pane active" id="tab_1" >
				<div class="panel panel-default">
				 <div class='box-body'>
       		  <div class='row'>
        <div class='col-md-12'>
           <div class="panel panel-default">
                <div class='box-header'>
                    <h4 class='box-title'>Detail Nilai Formatif</h4>
                   
				</div>
					
                <div class='box-body'>
                    <div class='table-responsive'>
                        <table style="font-size: 11px" id='example1' class='table table-hover'>
                            <thead >
                                <tr>
                                    <th width='5px'>No</th>
									 <th width='5%'>Tingkat</th>	
									  <th width='5%'>Kelas</th>
									 <th width='5%'>Fase</th>	
									<th width='5%'>No Urut</th>
                                    <th>Kode</th>  
									<th>Nama Mapel</th> 
																	
									
									<th width='5%'>Action</th>
									
										</tr>
									</thead>							
							<tbody>							
                                <?php
								$no=0;
								$query = mysqli_query($koneksi, "select * FROM jadwal_proto
								JOIN mata_pelajaran ON mata_pelajaran.kode_mapel=jadwal_proto.kode WHERE jadwal_proto.kelas='$_GET[kelas]' ");
								 while ($mapel = mysqli_fetch_array($query)) {
									 $no++;
                                ?>
							 <tr>
                                    <td><?= $no; ?></td>
									<td><?= $mapel['tingkat'] ?></td>
									<td><?= $mapel['kelas'] ?></td>
									<td><?= $mapel['fase'] ?></td>
							        <td><?= $mapel['nourut'] ?></td>
									<td ><?= $mapel['kode_mapel'] ?></td>
									<td ><?= $mapel['nama_mapel'] ?></td>
									
									<td>
									 <button class='btn btn-xs btn-flat btn-danger' onclick="frames['frameresult<?= $no ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult<?= $no ?>" src="sandik_ikm/detailformatif.php?kelas=<?= $mapel['kelas'] ?>&mapel=<?= $mapel['kode_mapel'] ?>" style='display:none'></iframe>
 
									</td>
   			
							       </tr>
                           <?php } ?>
                        </tbody>
                        </table>
                      </div>
                     </div>
					</div>
                  </div>
				</div>
				<?php } elseif ($ac == 'detailsum') { ?>

<div class='row'>
	 <div class='col-md-12'>
             <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-graduation-cap"></i> E-Rapor</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" >Menu PTM</a></li>
                    </ul>
					<div class="tab-content">
                    <div class="tab-pane active" id="tab_1" >
				<div class="panel panel-default">
				 <div class='box-body'>
       		  <div class='row'>
        <div class='col-md-12'>
           <div class="panel panel-default">
                <div class='box-header'>
                    <h4 class='box-title'>Detail Nilai Sumatif</h4>
                   
				</div>
					
                <div class='box-body'>
                    <div class='table-responsive'>
                        <table style="font-size: 11px" id='example1' class='table table-hover'>
                            <thead >
                                <tr>
                                    <th width='5px'>No</th>
									 <th width='5%'>Tingkat</th>	
									  <th width='5%'>Kelas</th>
									 <th width='5%'>Fase</th>	
									<th width='5%'>No Urut</th>
                                    <th>Kode</th>  
									<th>Nama Mapel</th> 
																	
									
									<th width='5%'>Action</th>
									
										</tr>
									</thead>							
							<tbody>							
                                <?php
								$no=0;
								$query = mysqli_query($koneksi, "select * FROM jadwal_proto
								JOIN mata_pelajaran ON mata_pelajaran.kode_mapel=jadwal_proto.kode WHERE jadwal_proto.kelas='$_GET[kelas]' ");
								 while ($mapel = mysqli_fetch_array($query)) {
									 $no++;
                                ?>
							 <tr>
                                    <td><?= $no; ?></td>
									<td><?= $mapel['tingkat'] ?></td>
									<td><?= $mapel['kelas'] ?></td>
									<td><?= $mapel['fase'] ?></td>
							        <td><?= $mapel['nourut'] ?></td>
									<td ><?= $mapel['kode_mapel'] ?></td>
									<td ><?= $mapel['nama_mapel'] ?></td>
									
									<td>
									<button class='btn btn-xs btn-flat btn-danger' onclick="frames['frameresult<?= $no ?>'].print()"><i class='fa fa-print'></i> </button>                                        
										 <iframe id='loadframe' name="frameresult<?= $no ?>" src="sandik_ikm/detailsumatif.php?kelas=<?= $mapel['kelas'] ?>&mapel=<?= $mapel['kode_mapel'] ?>" style='display:none'></iframe>
 
									</td>
   			
							       </tr>
                           <?php } ?>
                        </tbody>
                        </table>
                      </div>
                     </div>
					</div>
                  </div>
				</div>
	<?php } ?>