<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php if ($ac == '') { ?>
 <div class='row'>
 <div class='col-md-6'>
  <div class="card">
             <div class="card-header">
                  <h5 class='card-title'><i class="fas fa-graduation-cap"></i> Ekstrakurikuler</h5>
                </div>
			
            <div class='card-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example1' class='table table-hover'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th>Nama Siswa</th>
                                <th width="5%">Kelas</th>
                                <th width="5%">Action</th>  
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT id_siswa,id_kelas,nama
								FROM siswa");
                            $no = 0; ?>
                           <?php while ($siswa = mysqli_fetch_array($query)) {
								
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                   
                                    <td>
									 <a href="?pg=siswa_eskul&ac=input&idsiswa=<?= $siswa['id_siswa'] ?>" class="btn btn-sm btn-outline-success"><i class="fas fa-plus-circle"></i></a>
   			                        </td>
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                  </div>
				  </div>
				   </div>
					<div class='col-md-6'>
          <div class="card">
             <div class="card-header"></div>
				 <div class='card-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example' class='table table-hover'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th>Nama Siswa</th>
                                <th>Kelas</th>
                                <th>Eskul</th>  
								 <th>Action</th>  
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT * FROM siswa_eskul
							WHERE idguru='$_SESSION[id_user]'");
                            $no = 0; ?>
                           <?php while ($eskul = mysqli_fetch_array($query)) {
								$siswa=fetch($koneksi,'siswa',['id_siswa'=>$eskul['idsiswa']]);
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                   <td><?= $eskul['eskul'] ?></td>
                                     <td>
									 <button data-id="<?= $eskul['id'] ?>" class="hapus btn-sm btn btn-outline-danger"><i class="fas fa-trash"></i></button>
                                  
										</td>
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>
                    </div>
					</div>
                    </div>
			<script>
  $('#example').on('click', '.hapus', function() {
       var id = $(this).data('id');
        console.log(id);
        swal({
            title: 'Are you sure?',
            text: 'Akan menghapus data ini!',
			 type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'iya, hapus'
        }).then((result) => {
            if (result.value) {
                $.ajax({
                     url: 'sandik_rapor/crud_mapel.php?pg=hapuseskul',
                    method: "POST",
                    data: 'id=' + id,
                    success: function(data) {
                       iziToast.info(
            {
                title: 'Sukses!',
                message: 'Data berasil dihapus',
				titleColor: '#FFFF00',
				messageColor: '#fff',
				backgroundColor: 'rgba(0, 0, 0, 0.5)',
				 progressBarColor: '#FFFF00',
                  position: 'topRight'			  
                });
                        setTimeout(function() {
                            window.location.reload();
                        }, 2000);
                    }
                });
            }
            return false;
        })

    });
	</script>		
			<?php } elseif ($ac == 'input') { ?>		
					<div class='row'>
        <div class='col-md-12'>
           <div class="card">
             <div class="card-header">
                  <h5 class='card-title'><i class="fas fa-graduation-cap"></i> Input Data Siswa Eskul</h5>
				  </div>    
			        <div class="card-body">
						 <form id="formtujuan" action=''>
						
						<?php $siswa=fetch($koneksi,'siswa',['id_siswa'=>$_GET['idsiswa']]); ?>
                   <div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Nama Siswa</label>
							<div class="col-sm-5">
						   <select  class="form-control" style="width: 100%;" readonly>
                               <option value=""> <?= $siswa['nama']  ?></option>
							      
                                  </select>
							</div>
		                    </div>
							<div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Kelas</label>
							<div class="col-sm-5">
						   <input type="text" value="<?= $siswa['id_kelas']  ?>" class="form-control" readonly>
							</div>
		                    </div>
							<div class="row mb-2">
							<label  class="col-md-3 col-form-label bold">Pilih Eskul</label>
							<div class="col-sm-9">
						   <select name="eskul"  class="form-select" style="width: 100%;" required="true">
						   <option value=""></option>
                                <?php
                                $esk = mysqli_query($koneksi, "SELECT * FROM m_eskul WHERE idguru='$_SESSION[id_user]' ");
                                while ($kl = mysqli_fetch_array($esk)) {
                                echo "<option value='$kl[ekstra]'>$kl[ekstra]</option>";
                                                        }
                                                        ?>
                                  </select>
							</div>
		                    </div>
							
					<input type="hidden" name="ids" value="<?= $_GET['idsiswa'] ?>" >
					<input type="hidden" name="guru" value="<?= $_SESSION['id_user'] ?>" >
					<div class="right">
					   <button type='submit' name='submit' class='btn btn-success'><i class='fa fa-check-circle' ></i> Simpan</button>                                  
					 </div>
					  </form>
                        </div>
					 </div>
                        </div>
						</div>
                    </div>
						 
				  <script>
	 $('#formtujuan').submit(function(e) {
         e.preventDefault();
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_mapel.php?pg=eskul',
            data: $(this).serialize(),
            beforeSend: function() {
                $('form button').on("click", function(e) {
                    e.preventDefault();
                });
            },
            success: function(data) {
                console.log(data);
                if (data == 'OK') {
              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.replace('?pg=siswa_eskul');
                    }, 2000);
               } else {
                   iziToast.info(
				{
				title: 'GAGAL!',
				message: 'Data Sudah Ada',
				titleColor: '#FFFF00',
				messageColor: '#fff',
				backgroundColor: 'rgba(0, 0, 0, 0.5)',
				progressBarColor: '#FFFF00',
				position: 'topRight'
				}); 
					setTimeout(function() {
                         window.location.replace('?pg=siswa_eskul');
                    }, 2000);
                }

            }
        });
        return false;
    });
</script>

<?php } elseif ($ac == 'nilai') { ?>		
					<div class='row'>
        <div class='col-md-12'>
            <div class="card">
             <div class="card-header">
                  <h5 class='card-title'><i class="fas fa-graduation-cap"></i> Input Nilai Eskul</h5>
				  </div>    
			  
			
				 <div class='card-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example1' class='table table-hover'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th width="30%">Nama Siswa</th>
                                <th width="10%">Kelas</th>
                                <th width="20%">Eskul</th>
								<th width="10%">Nilai</th>								
								<th>Keterangan</th>
								 <th width="5%">Action</th>
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT * FROM siswa_eskul
							WHERE idguru='$_SESSION[id_user]'");
                            $no = 0; ?>
                           <?php while ($eskul = mysqli_fetch_array($query)) {
								$siswa=fetch($koneksi,'siswa',['id_siswa'=>$eskul['idsiswa']]);
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                   <td><?= $eskul['eskul'] ?></td>
								    <td><?= $eskul['nilai'] ?></td>
								    <td><?php if($eskul['ket']==''){ ?>
										<b style="color:red;">Nlai masih kosong</b>
									<?php } else{ ?>
										<?= $eskul['ket'] ?>
									<?php } ?>
										</td>
                                    <td>
										<button type="button" class="btn btn-sm btn-outline-success" data-bs-toggle="modal" data-bs-target="#modal-des<?= $no ?>">
                                              <i class="fas fa-edit"></i>
                                        </button>
										
										</td>
									
											<div class="modal fade" id="modal-des<?= $no ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <form id="form-des<?= $no ?>">
                                                        <div class="modal-header">
                                                          <h5 class="card-title">Input Nilai</h5>
                                                            <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
														 <div class="modal-body">
														 <form role="form"  method="POST">										
                                                            <input type="hidden" value="<?= $eskul['id'] ?>" name="id" class="form-control" >
                                                            <div class="form-group">
                                                                <label><b>Nama Siswa</b></label>
                                                                <input type="text" name="nama" value="<?= $siswa['nama'] ?>" class="form-control" readonly="">
                                                            </div>
                                                            
															 <div class="form-group">
                                                                <label><b>Nilai</b></label>
                                                                <select name='nilai' class="form-select" style="width: 100%; height:36px;" required>                                         
																   <option value=''></option>
																   <option value='A'>Sangat Baik</option>
															<option value='B'>Baik</option>
															<option value='C'>Cukup</option>
															
																		</select>
                                                            </div>
															 <div class="form-group">
                                                                <label class="bold"><b>Keterangan</b></label>
                                                        <input type="text" name="ket"  class="form-control" required="true">         
                                                            </div>
                                                       <p>
													   <div class='right'>
														  <button type='submit' name='submit' class='btn btn-success'><i class='fa fa-check-circle'></i> Simpan</button>
															 
																</div>
																 </div>
                                                                  </form>
												   
																	 </div>
																	  </div>
													<script>
        $('#form-des<?= $no ?>').submit(function(e) {
         e.preventDefault();
        var data = new FormData(this);
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_mapel.php?pg=editeskul',
             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>
									
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>
                    </div>
					</div>
                    </div>
					
					
	<?php } elseif ($ac == 'absen') { ?>		
					<div class='row'>
        <div class='col-md-12'>
            <div class='panel panel-default'>
               <div class="panel-heading" style="height:45px">
                  <h4 class='box-title'><i class="fas fa-graduation-cap"></i> Input Absensi Rapor</h4></div>    
			  
			  <div class="box-body">
                    <div class="box-body no-padding ">
                <div class="nav-tabs-custom">
                    <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" >
						<br>
						<div class="panel panel-default">
				 <div class='box-body'>
				<div class='row'>
           
				 <div class='box-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example2' class='table table-bordered'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th>Nama Siswa</th>
                                <th width="10%">Kelas</th>
                                <th width="5%">A</th>
								<th width="5%">S</th>								
								<th width="5%">I</th>
								 <th width="5%">Action</th>
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT * FROM siswa
							WHERE id_kelas='$pengawas[jabatan]'");
                            $no = 0; ?>
                           <?php while ($siswa = mysqli_fetch_array($query)) {
								
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                   <td><?= $siswa['alpha'] ?></td>
								    <td><?= $siswa['sakit'] ?></td>
								    <td><?= $siswa['izin'] ?></td>
                                    <td>
										<button type="button" class="btn btn-sm btn-success" data-toggle="modal" data-target="#modal-des<?= $no ?>">
                                              <i class="fas fa-edit"></i>
                                        </button>
										
										</td>
									
											<div class="modal fade" id="modal-des<?= $no ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <form id="form-des<?= $no ?>">
                                                        <div class="modal-header">
                                                            <h5 class="modal-title"> Absensi</h5>
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
														 <form role="form"  method="POST">
                                                        <div class="modal-body">
														
                                                            <input type="hidden" value="<?= $siswa['id_siswa'] ?>" name="id" class="form-control" >
                                                            <div class="form-group-sm">
                                                                <label><b>Nama Siswa</b></label>
                                                                <input type="text" name="nama" value="<?= $siswa['nama'] ?>" class="form-control" readonly="">
                                                            </div>
                                                            
															 <div class="form-group-sm">
                                                                <label><b>Alpha</b></label>
                                                                <input type="number" name='alpha' value="<?= $siswa['alpha'] ?>" class="form-control" style="width: 100%;" required>
                                            
                                                            </div>
															 <div class="form-group-sm">
                                                                <label><b>Sakit</b></label>
                                                        <input type="number" name='sakit' value="<?= $siswa['sakit'] ?>" class="form-control" style="width: 100%; height:36px;" required>
                                                
                                                            </div>
															 <div class="form-group-sm">
                                                                <label><b>Izin</b></label>
                                                        <input type="number" name='izin' value="<?= $siswa['izin'] ?>" class="form-control" style="width: 100%; height:36px;" required>
                                                
                                                            </div>
                                                        <div class='modal-footer'>
													   <div class='box-tools pull-right'>
														  <button type='submit' name='submit' class='btn btn-success'><i class='fa fa-check'></i> Simpan</button>
															 
																</div>
																 </div>
                                                                  </form>
												   
																	 </div>
																	  </div>
													<script>
        $('#form-des<?= $no ?>').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_mapel.php?pg=editabsen',
              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>
									
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>
                    </div>
					</div>
                    </div>				
					
					<?php } elseif ($ac == 'prestasi') { ?>		
					<div class='row'>
        <div class='col-md-12'>
            <div class='panel panel-default'>
               <div class="panel-heading" style="height:45px">
                  <h4 class='box-title'><i class="fas fa-graduation-cap"></i> Input Prestasi Siswa</h4></div>    
			  
			  <div class="box-body">
                    <div class="box-body no-padding ">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Eskul</a></li>
                      
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_1" >
						<br>
						<div class="panel panel-default">
				 <div class='box-body'>
				<div class='row'>
           
				 <div class='box-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example2' class='table table-bordered'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th width="30%">Nama Siswa</th>
                                <th width="10%">Kelas</th>
                                <th width="20%">Prestasi</th>							
								<th>Keterangan</th>
								 <th width="5%">Action</th>
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT * FROM siswa WHERE id_kelas='$pengawas[jabatan]'");
                            $no = 0; ?>
                           <?php while ($siswa = mysqli_fetch_array($query)) {
								
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                   <td><?php if($siswa['prestasi']==''){ ?>
										<b style="color:red;">Belum ada prestasi</b>
									<?php } else{ ?>
										<?= $siswa['prestasi'] ?>
									<?php } ?>
								   
								   </td>
								   
								    <td><?php if($siswa['ket_prestasi']==''){ ?>
										<b style="color:red;">Belum ada keterangan prestasi</b>
									<?php } else{ ?>
										<?= $siswa['ket_prestasi'] ?>
									<?php } ?>
										</td>
                                    <td>
										<button type="button" class="btn btn-sm btn-success" data-toggle="modal" data-target="#modal-des<?= $no ?>">
                                              <i class="fas fa-plus"></i>
                                        </button>
										
										</td>
									
											<div class="modal fade" id="modal-des<?= $no ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <form id="form-des<?= $no ?>">
                                                        <div class="modal-header">
                                                            <h5 class="modal-title"> Prestasi</h5>
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
														 <form role="form"  method="POST">
                                                        <div class="modal-body">
														
                                                            <input type="hidden" value="<?= $siswa['id_siswa'] ?>" name="id" class="form-control" >
                                                            <div class="form-group-sm">
                                                                <label><b>Nama Siswa</b></label>
                                                                <input type="text" name="nama" value="<?= $siswa['nama'] ?>" class="form-control" readonly="">
                                                            </div>
                                                            
															 <div class="form-group-sm">
                                                                <label><b>Jenis Prestasi</b></label>
                                                                <input type="text" name="prestasi"  class="form-control" required="true">   
                                                            </div>
															 <div class="form-group-sm">
                                                                <label><b>Keterangan</b></label>
                                                        <input type="text" name="ket"  class="form-control" required="true">         
                                                            </div>
                                                        <div class='modal-footer'>
													   <div class='box-tools pull-right'>
														  <button type='submit' name='submit' class='btn btn-success'><i class='fa fa-check'></i> Simpan</button>
															 
																</div>
																 </div>
                                                                  </form>
												   
																	 </div>
																	  </div>
													<script>
        $('#form-des<?= $no ?>').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_mapel.php?pg=editprestasi',
              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>
									
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>
                    </div>
					</div>
                    </div>
				<?php } elseif ($ac == 'catatan') { ?>		
					<div class='row'>
        <div class='col-md-12'>
            <div class='panel panel-default'>
               <div class="panel-heading" style="height:45px">
                  <h4 class='box-title'><i class="fas fa-graduation-cap"></i> Input Catatan Siswa</h4></div>    
			  
			  <div class="box-body">
                    <div class="box-body no-padding ">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">Eskul</a></li>
                      
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_1" >
						<br>
						<div class="panel panel-default">
				 <div class='box-body'>
				<div class='row'>
           
				 <div class='box-body'>
                <div class="table-responsive">
                     <table style="font-size: 12px" id='example1' class='table table-bordered'>
                        <thead>
						
                            <tr>
                                <th width='5px'>
                                    #
                                </th>
								<th width="30%">Nama Siswa</th>
                                <th width="15%">Kelas</th>							
								<th>Catatan Wali Kelas</th>
								 <th width="5%">Action</th>
                            </tr>
						
                        </thead>
                        <tbody>
						
                            <?php
							
							$tg=date('Y-m-d');
                            $query = mysqli_query($koneksi, "SELECT * FROM siswa_ptm WHERE id_kelas='$pengawas[jabatan]'");
                            $no = 0; ?>
                           <?php while ($siswa = mysqli_fetch_array($query)) {
							
                                $no++;
                              
                            ?>
							
                                <tr>
                                    <td><?= $no; ?></td>
                                    
									 <td><?= $siswa['nama'] ?></td>
									  <td><?= $siswa['id_kelas'] ?></td>
                                  
								    <td><?php if($siswa['catatan']==''){ ?>
										<b style="color:red;">Belum ada Catatan</b>
									<?php } else{ ?>
										<?= $siswa['catatan'] ?>
									<?php } ?>
										</td>
                                    <td>
										<button type="button" class="btn btn-sm btn-success" data-toggle="modal" data-target="#modal-des<?= $no ?>">
                                              <i class="fas fa-plus"></i>
                                        </button>
										
										</td>
									
											<div class="modal fade" id="modal-des<?= $no ?>" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
                                            <div class="modal-dialog" role="document">
                                                <div class="modal-content">
                                                    <form id="form-des<?= $no ?>">
                                                        <div class="modal-header">
                                                            <h5 class="modal-title"> Catatan Wali Kelas</h5>
                                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                                <span aria-hidden="true">&times;</span>
                                                            </button>
                                                        </div>
														 <form role="form"  method="POST">
                                                        <div class="modal-body">
														
                                                            <input type="hidden" value="<?= $siswa['id_siswa'] ?>" name="id" class="form-control" >
                                                            <div class="form-group-sm">
                                                                <label><b>Nama Siswa</b></label>
                                                                <input type="text" name="nama" value="<?= $siswa['nama'] ?>" class="form-control" readonly="">
                                                            </div>
                                                            
															 
															 <div class="form-group-sm">
                                                                <label><b>Catatan</b></label>
                                                        <input type="text" name="catat"  class="form-control" required="true">         
                                                            </div>
                                                        <div class='modal-footer'>
													   <div class='box-tools pull-right'>
														  <button type='submit' name='submit' class='btn btn-success'><i class='fa fa-check'></i> Simpan</button>
															 
																</div>
																 </div>
                                                                  </form>
												   
																	 </div>
																	  </div>
													<script>
        $('#form-des<?= $no ?>').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
        $.ajax({
            type: 'POST',
            url: 'sandik_rapor/crud_mapel.php?pg=editcatat',
              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>
									
							       </tr>
                            <?php } ?>
                        </tbody>
                        </table>
                    </div>
                    </div>
					</div>
                    </div>
					</div>
                    </div>
						
<?php } ?>