<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php if ($ac == '') { ?>
<div class='row'>
        <div class='col-md-8'>
             <div class="card">
             <div class="card-header">		
                  <h5 class='card-title'><i class="fas fa-tools"></i> Mapel Penilaian Sikap Sosial</h5></div>    
			
						<div class="card-body">
						<div class="alert alert-custom" role="alert">
					 <div class="custom-alert-icon icon-dark"><i class="fa fa-check fa-2x"></i></div>
                       <div class="alert-content">
                          <span class="alert-text" style="text-align:justify"> Pastikan Mapel PPKn Sudah diisi di Jadwal Mapel pada Menu PTM, Jika Belum diisi maka Penilaian Sikap tidak Tersimpan di Jadwal Mapel, Data ini akan digunakan pada Pengisian dan Cetak Rapor</span>
                                </div>
                         </div>	
                    <form id='menu'  method='post'>
					<div class="row mb-1">
						<label  class="col-md-3 col-form-label bold">Tingkat</label>
							<div class="col-sm-9">
						    <select name='level' id="level" class='form-select' required='true'>
                               <option value=''>Pilih Tingkat</option>
                                  <?php $qt = mysqli_query($koneksi, "SELECT * FROM kelas WHERE model_rapor='1' GROUP BY level"); ?>
                                     <?php while ($mt = mysqli_fetch_array($qt)) : ?>
                                         <option value="<?= $mt['level'] ?>"><?= $mt['level'] ?></option>
                                                <?php endwhile ?>
                                          </select>   
						          	</div>
		                        </div>
							<div class="row mb-1">
						<label  class="col-md-3 col-form-label bold">Mapel PPKn</label>
							<div class="col-sm-9">
						    <select name='kode' id="kode" class='form-select' required='true'>
                               <option value=''>Pilih Mapel PPKn</option>
                                  <?php $qt = mysqli_query($koneksi, "SELECT * FROM mata_pelajaran"); ?>
                                     <?php while ($mt = mysqli_fetch_array($qt)) : ?>
                                         <option value="<?= $mt['kode_mapel'] ?>"><?= $mt['nama_mapel'] ?></option>
                                                <?php endwhile ?>
                                          </select>   
						          	</div>
		                        </div>
							<p>
						<div class="right">
					   <button type='submit' name='submit' class='btn  btn-outline-success'><i class='fa fa-check-circle' ></i> Simpan</button>
                                     
					 </div>
					  </form>
                        </div>
					 </div>
					  
					  
		</div>
		
	
		  <script>
		$('#menu').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
      
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_jadwal.php?pg=sosial',
            enctype: 'multipart/form-data',
            data: data,
            cache: false,
            contentType: false,
            processData: false,
            success: function(data) {
				iziToast.info(
               {
				title: 'Sukses!',
				message: 'Data berhasil disimpan',
				titleColor: '#FFFF00',
					messageColor: '#fff',
					backgroundColor: 'rgba(0, 0, 0, 0.5)',
					progressBarColor: '#FFFF00',
					position: 'topRight'			  
                });
                setTimeout(function() {
                    window.location.reload();
                }, 2000);

            }
        });
        return false;
    });
</script>
		<div class="col-md-4">
					 <div class="card widget widget-info-inline">
                                    <div class="card-header">
                                        <h5 class="card-title">Sikap Sosial<span class="badge badge-info badge-style-light">Premium</span></h5>
								   </div>
                                    <div class="card-body">
                                        <div class="widget-info-container">
                                            <p class="widget-info-text"><b style="color:red">Pendidikan Pancasila dan Kewarganearaan</b></p>
                                           <p class="widget-info-text">NEW SANDIK</p>
                                            <div class="widget-info-image" style="background: url('../dist/img/speed.svg')"></div>
                                        </div>
                                    </div>
                                </div>					
                      
<?php } ?>