

<?php $__env->startSection('title'); ?>
  Pengaturan
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
   ##parent-placeholder-6e5ce570b4af9c70279294e1a958333ab1037c86##
   <li>pengaturan</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>     
<div class="row">
    <div class="container-fluid">
        <div class="card">
            <div class="card-block" >  

    <form class="form form-horizontal" data-toggle="validator" method="post">
    <?php echo e(csrf_field()); ?> <?php echo e(method_field('PATCH')); ?>

    
    <div style="margin-top:20px;margin-left:50px;margin-right:50px;">
        
        <div class="form-group">
            <label>Nama Perusahaan</label>
            <input id="nama" type="text" class="form-control" name="nama" required readonly="true">
            <span class="help-block with-errors"></span>
        </div>
        
        
        <div class="form-group">
            <label>Alamat</label>
            <input id="alamat" type="text" class="form-control" name="alamat" required readonly="true">
            <span class="help-block with-errors"></span>
        </div>

        <div class="form-group">
            <label>Telepon</label>
            <input id="telepon" type="text" class="form-control" name="telepon" required readonly="true">
            <span class="help-block with-errors"></span>
        </div>
        
        
        <div class="form-group">
            <label>Masa Aktif</label>
            <input id="masa" type="date" class="form-control" name="masa">
        </div>
        
    </div>
    
    <div class="box-footer">
        <a onclick="window.location='<?php echo e(route('home')); ?>'" class="btn btn-warning btn-sm"><i class="fa fa-home"></i> Home </a>
        <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-floppy-o"></i> Simpan Perubahan</button>
    </div>
    <br>
    
    </div>
    </div>  
</form>

  </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
<script type="text/javascript">

$(function(){

    showData();

    $('.form').validator().on('submit', function(e){
        if(!e.isDefaultPrevented()){ 

            $.ajax({
                url : "<?php echo e(DIR_APP); ?>setting/renew",
                type : "GET",
                data : $(".form").serialize(),
                dataType :"JSON",
                success : function(data){
                    if(data.msg=="success"){
                        
                        swal('info', 'Perpanjang masa aktif berhasil', 'success');
                    }
                },
                error : function(){
                    alert("Tidak dapat menyimpan data!");
                }   
            });
            return false;
        }
    });

});

function showData(){
    $.ajax({
        url : "<?php echo e(DIR_APP); ?>setting/1/edit",
        type : "GET",
        dataType : "JSON",
        success : function(data){
            $('#nama').val(data.nama_company);
            $('#alamat').val(data.alamat);
            $('#telepon').val(data.telepon);
            $('#masa').val(data.valid_until);
        },
        error : function(){
            alert("Tidak dapat menyimpan data!");
        }   
    });
}

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/myprojeq/public_html/sriayu/resources/views/setting/index_renew.blade.php ENDPATH**/ ?>