<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<?php
$skl = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM skl  WHERE id_skl='1'"));
?>
<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-tools"></i> Transkip</h4></div>    
			  
			  <div class="box-body">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true" >Transkip</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">
						<form id="formpengaturan" action='' method='post' class="form-horizontal" enctype='multipart/form-data'>
                           <button type='submit' name='submit1' class='btn btn-sm btn-success pull-right' style='margin-top:-70px;margin-right:-10px;'><i class='fa fa-check' ></i><span> Simpan</span></button>
							<div class="box-body box-pane">
					         <div class="form-group-sm">
							<label class="col-sm-3 control-label">Aplikasi</label>
							<div class="col-sm-7">
						   <input type='text' name='aplikasi' value="<?= $setting['aplikasi'] ?>" class='form-control' readonly />
							</div>
		                    </div>
							<label class="col-xs-12 control-label"></label> 
                            <div class="form-group-sm">
                                <label class="col-sm-3 control-label">Pilih Tingkat</label>
							<div class="col-sm-7">
                                <select name='tingkat' class='form-control'  required='true'>
                             <option value="<?= $skl['tingkat'] ?>"><?= $skl['tingkat'] ?></option>
                               <?php
                                $lev = mysqli_query($koneksi, "SELECT * FROM siswa group by level");
                                        while ($level = mysqli_fetch_array($lev)) :
                                            echo "<option value='" . $level['level'] . "' $s>$level[level]</option>";
                                        endwhile;
                                 ?>
                                </select>
                            </div>
                        </div>
							<label class="col-xs-12 control-label"></label> 
						     <div class="form-group-sm">
							<label class="col-sm-3 control-label">Tanggal Kelulusan</label>
							<div class="col-sm-7">
							   <input type='text' name='tanggal' value="<?= $setting['tgl_lulus'] ?>" class='form-control' required='true' />
                                            </div>
						            </div>
							<label class="col-xs-12 control-label"></label> 
							
									<label class="col-xs-12 control-label"></label>
									           </form>
								            
											</div>
										</div>
									</div>
								</div> 
                          
									 
<script>
   $('#formpengaturan').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
      
        $.ajax({
            type: 'POST',
            url: 'sandik_pk/crud_pk.php?pg=setting',
            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>