<?php
defined('APK') or exit('Anda tidak dizinkan mengakses langsung script ini!');
?>
<div class='row'>

       <div class='col-md-12'>
           <div class="card">
              <div class="card-header">	
				       <h5 class="card-title">Pengaturan Logo Karpel</h5>
					</div>
                       	
                         <div class='card-body'>
						 <div class="example-container">
                          <div class="example-content">
						 	<form id='menu'  method='post' class="form-horizontal">
							<div class="row">									  
							<div class="col-sm-5">	
							 <div class="form-group">
							<label class="bold">Logo Kiri</label>
							   <input type='file' name='logo' class='form-control' />
                                            </div>
										</div>
                                     <div class="col-sm-2">	
                                      <div class="form-group">									 
                                                <img src="<?= $homeurl ?>/<?= $setting['logo'] ?>" height='50px' />
                                            </div>
						                </div>				
									 </div><p>
								
						       <div class="row">									  
							<div class="col-sm-5">	
							 <div class="form-group">
							<label class="bold">Logo Kanan</label>
							   <input type='file' name="logokanan" id="logokanan" class='form-control' />
                                            </div>
											 </div>
											  <div class="col-sm-2">	
                                               	 <div class="form-group">											  
                                                <img src="<?= $homeurl ?>/<?= $setting['logo_kanan'] ?>" height='50px' />
                                            </div>
						                </div>
                                    </div>	
                                      <p>
						       
					
                                     <div>	
                                      								 
                                                <button type='submit' name='submit1' class='btn btn-outline-primary right' ><i class="fas fa-check-circle"></i>Simpan</button>
													<br>	
                                            </div>
						               
									           </form>
								            
											</div>
										</div>
									</div>
								</div> 
                          
<script>
				  $('#menu').submit(function(e) {
        e.preventDefault();
        var data = new FormData(this);
      
        $.ajax({
            type: 'POST',
            url: 'sandik_ptm/crud_logo.php',
            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>