<?php
 session_start();
 include "header.php";
 include "sidebar.php";
 
 ?>

 
  <main id="main" class="main">

    <div class="pagetitle">
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.php">Home</a></li>
          <li class="breadcrumb-item active">Verifikasi Beban Kerja Guru</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->
  
  <section class="section">
      <div class="row">
        <div class="col-lg-12">
    
		 <div class="card info-card customers-card">
		 <h5 class="card-title">Verifikasi Rencana Pelaksanaan Pembelajaran Guru</h5>
			   
                 <?php
				 if (isset($_GET['rpp'])) {
					include 'config.php';
												
					$userid=$_GET['rpp'];
					$result = mysqli_query($mysqli, "SELECT drpp.Idrpp kodeid,tapel.nama nmtapel,tapel.semester, user.madrasah, user.nama nmguru,mapel.nama nmmapel, kelas.nama nmkelas,drpp.kaldik,drpp.rpe,drpp.alokasiwaktu,drpp.cp,drpp.atp,drpp.prota,drpp.promes, drpp.kktp,drpp.modulrpp,drpp.tglkirim, drpp.tglvalidasi, drpp.catatan,drpp.peta_cp,drpp.validasi FROM drpp,tapel,user,mapel,kelas WHERE drpp.Iduser=user.Iduser AND drpp.Idtapel=tapel.Idtapel AND drpp.Idmapel=mapel.Idmapel AND drpp.Idkelas=kelas.Idkelas AND drpp.Idrpp=$userid ORDER BY drpp.Idrpp ASC");
					$res = mysqli_fetch_assoc($result);
					$nkoderpp = $res['kodeid'];
					$ntapel = $res['nmtapel'];
					$nsemester = $res['semester'];
					$nmadrasah = $res['madrasah'];
					$nguru = $res['nmguru'];
					$nmapel = $res['nmmapel'];
					$nkelas = $res['nmkelas'];
					$nkaldik = $res['kaldik'];
					$nrpe = $res['rpe'];
					$nalokasi = $res['alokasiwaktu'];
					$ncp = $res['cp'];
					$natp = $res['atp'];
					$nprota = $res['prota'];
					$npromes = $res['promes'];
					$nkktp = $res['kktp'];
					$nmodulrpp = $res['modulrpp'];
					$ntglkirim = $res['tglkirim'];
					$ntglvalidasi = $res['tglvalidasi'];
					$nvalidasi = $res['validasi'];
					$ncatatan = $res['catatan'];
					$nkbc = $res['peta_cp'];
					
					include "phpqrcode/qrlib.php";
					//hapus gambarqrcode di folder images
					$filesqr    =glob('qrimg/*.png');
					foreach ($filesqr as $fileqr) {
					if (is_file($fileqr))
					unlink($fileqr); // hapus file
					}
					$path = 'qrimg/'; 

					// $ecc stores error correction capability('L') 
					 $ecc = 'L'; 
					 $pixel_Size = 5; 
					 $frame_Size = 2; 
						// Generates QR Code and Stores it in directory given
					
					$file = $path."kaldik.png"; 
					QRcode::png($nkaldik, $file, $ecc, $pixel_Size, $frame_Size); 
                    $file = $path."rpe.png"; 
					QRcode::png($nrpe, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."alokasi.png"; 
					QRcode::png($nalokasi, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."cp.png"; 
					QRcode::png($ncp, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."atp.png"; 
					QRcode::png($natp, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."prota.png"; 
					QRcode::png($nprota, $file, $ecc, $pixel_Size, $frame_Size);
					$file = $path."promes.png"; 
					QRcode::png($npromes, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."kktp.png"; 
					QRcode::png($nkktp, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."modul.png"; 
					QRcode::png($nmodulrpp, $file, $ecc, $pixel_Size, $frame_Size); 
					$file = $path."kbc.png"; 
					QRcode::png($nkbc, $file, $ecc, $pixel_Size, $frame_Size);
					
				
				?>	
					
      
             
              <!-- Horizontal Form -->
              <form name="edit" method="post" action="verifikasirpp.php">
                   
                 <table width=50%>
				 <tr>
					<td width=200  >ID RPP </td>
					<td>: <?php echo $nkoderpp; ?> <input type="hidden" class="form-control" name="ikoderpp" id="ikoderpp" width="100" value="<?php echo $nkoderpp?>" ></td>
                  </tr>
				   <tr>
				  <td >Nama Madrasah </td>
					<td>: <?php echo $nmadrasah; ?> </td>
                  </tr>			  
				 <tr>
					<td >Nama Guru </td>
					<td>: <?php echo $nguru; ?> </td>
                  </tr>	 <tr>
					<td >Mata Pelajaran </td>
					<td>: <?php echo $nmapel; ?> </td>
                  </tr>	
				  <tr>
					<td >Kelas </td>
					<td>: <?php echo $nkelas; ?> </td>
                  </tr>	
				  <tr>
					<td >Tahun Pelajaran </td>
					<td>: <?php echo $ntapel; ?> </td>
                  </tr>
				  <tr>
					<td >Semester </td>
					<td>: <?php echo $nsemester; ?> </td>
                  </tr>	
				   <tr>
					<td >Tanggal Kirim </td>
					<td>: <?php echo $ntglkirim; ?> </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td >Kalender Akademik </td>
					<td>
					 <?php 
					 echo "<a href=\"$nkaldik\" target=\"_blank\">$nkaldik</a><br><a href=\"$nkaldik\" target=\"_blank\"><img src=\"qrimg/kaldik.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Rincian Pekan Efektif </td>
					<td>
					 <?php 
					 echo "<a href=\"$nrpe\" target=\"_blank\">$nrpe</a><br><a href=\"$nrpe\" target=\"_blank\"><img src=\"qrimg/rpe.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Analisis Alokasi Waktu </td>
					<td>
					 <?php 
					 echo "<a href=\"$nalokasi\" target=\"_blank\">$nalokasi</a><br><a href=\"$nalokasi\" target=\"_blank\"><img src=\"qrimg/alokasi.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Capaian Pembelajaran (CP) / Layanan </td>
					<td>
					 <?php 
					 echo "<a href=\"$ncp\" target=\"_blank\">$ncp</a><br><a href=\"$ncp\" target=\"_blank\"><img src=\"qrimg/cp.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				   <tr bgcolor=#c0c0c0>
					<td>TP dan ATP </td>
					<td> 
					 <?php 
					 echo "<a href=\"$natp\" target=\"_blank\">$natp</a><br><a href=\"$natp\" target=\"_blank\"><img src=\"qrimg/atp.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Program Tahunan </td>
					<td> 
					 <?php 
					 echo "<a href=\"$nprota\" target=\"_blank\">$nprota</a><br><a href=\"$nprota\" target=\"_blank\"><img src=\"qrimg/prota.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Program Semester </td>
					<td> 
					 <?php 
					 echo "<a href=\"$npromes\" target=\"_blank\">$npromes</a><br><a href=\"$npromes\" target=\"_blank\"><img src=\"qrimg/promes.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>KKTP </td>
					<td> 
					 <?php 
					 echo "<a href=\"$nkktp\" target=\"_blank\">$nkktp</a><br><a href=\"$nkktp\" target=\"_blank\"><img src=\"qrimg/kktp.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr bgcolor=#c0c0c0>
					<td>Modul Ajar / RPP </td>
					<td>
					 <?php 
					 echo "<a href=\"$nmodulrpp\" target=\"_blank\">$nmodulrpp</a><br><a href=\"$nmodulrpp\" target=\"_blank\"><img src=\"qrimg/modul.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				   <tr bgcolor=#c0c0c0>
					<td>Pemetaan CP (KBC & DPL)</td>
					<td>
					 <?php 
					 echo "<a href=\"$nkbc\" target=\"_blank\">$nkbc</a><br><a href=\"$nkbc\" target=\"_blank\"><img src=\"qrimg/kbc.png\" width=\"200\" height=\"200\" border=\"0\" alt=\"Bukti Dukung\"></a>";
					  
					  ?> 
					  </td>
                  </tr>	
				  <tr>
					<td>Catatan</td>
					<td> <div class="col-sm-4"><textarea class="form-control" name="icatatan" id="icatatan" style="height: 100px;" ><?php echo $ncatatan?></textarea>
                     </div>
					  </td>
                  </tr>	
				   <tr>
					<td>Tanggal Verifikasi</td>
					<td><div class="col-sm-4"><input type="date" id="itglverifikasi" name="itglverifikasi" value="<?php echo date('Y-m-d',strtotime($ntglvalidasi)) ?>">
                     </div>
					  </td>
                  </tr>	
				   <tr>
					<td>Hasil Verifikasi</td>
					<td>
					<div class="col-sm-4">
                       <select name="ivalidasi" id="ivalidasi" class="form-select" required >
						   <option value="<?php echo $nvalidasi ?>"><?php echo  $nvalidasi ?></option>
						   <option value="baru">baru</option>
						   <option value="kirim">kirim</option>
						   <option value="verifikasi">verifikasi</option>
					  </select>
					 </div> 
			</div>
					  </td>
                  </tr>	
				  <tr>
					<td></td>
					<td> <button type="submit" name="updaterpp" class="btn btn-primary">Simpan</button></td>
                  </tr>
                  </table> 
                 
                   
                
               
               
				
				
				
             
			<?php
				}	
				?>
             

            
           
        </div><!-- End Left side columns -->

       </div>
      </div>
    </section> 
     
<?php
 include "footer.php";
?>
 