<?php $__env->startSection('title', 'IV Media - Increase your popularity'); ?>
<?php $__env->startSection('content'); ?>
<!-- Start content -->
<div class="content">
    <div class="container-fluid">

        <div class="row">
            <div class="col-xl-12">
                <div class="page-title-box">
                    <h4 class="page-title float-left">Dashboard</h4>

                    <ol class="breadcrumb float-right">
                        <li class="breadcrumb-item"><a href="<?php echo e(url('/')); ?>"><?php echo \App\Helper::panelName(); ?></a>
                        </li>
                        <li class="breadcrumb-item active">Server Like <?php echo e($id); ?></li>
                    </ol>

                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
        <!-- end row -->


        <div class="row">
            <?php if($flash = session('message')): ?> {
              <div class="col-md-12">
                <div class="alert alert-success" role="alert">
                  <ul>
                  <?php $__currentLoopData = $flash; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li><?php echo e($key.'  '.$val); ?></li>
                  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </ul>
                </div>
              </div>
            <?php endif; ?>
            <div class="col-lg-6 col-md-12">

                <?php if($result = session('result')): ?>
                    <?php echo $result; ?>

                <?php endif; ?>
                <div class="card-box">

                    <h4 class="header-title m-t-0 m-b-30"><span class="label label-primary"><?php echo e(auth()->user()->level); ?></span> <?php echo \App\Helper::panelName(); ?> Server Like <?php echo e($id); ?></h4>
                    

                    <div class="row">
                        <div class="col-12">
                        <?php
                                   
                                    if($id == 1)
                                    {
                                        $max = 1000;
                                    }else
                                    {
                                        $max = 500;
                                    }
                                    
                                    if($id == 1){
                                        $jeda = 'like_4';
                                    }else{
                                        $jeda = 'like_1';
                                    }
                                ?>
                        
                        <?php if(\Carbon\Carbon::now() > auth()->user()->delay->$jeda): ?>
                        
                        <form action="/service/submitlike/<?php echo e($id); ?>" id="formini" method="POST">
                                
                                <?php echo e(csrf_field()); ?>

                               
                                <fieldset class="form-group">
                                    <label for="url">URL Foto</label>
                                    <input type="text" name="url" class="form-control" placeholder="https://www.instagram.com/p/NaxTixTOKEa/">
                                </fieldset>
                                <fieldset class="form-group">
                                    <label for="username">Mau Berapa Like?</label>
                                    <input type="number" class="form-control <?php echo e($errors->has('jumlah') ? 'parsley-error' : ''); ?>" id="jumlah" placeholder="<?php echo e($max); ?>" name="jumlah">
                                            <?php if($errors->has('jumlah')): ?>
                                                <span class="help-block">
                                                    <ul class="parsley-errors-list filled"><li class="parsley-required"><?php echo e($errors->first('jumlah')); ?></li></ul>
                                                </span>
                                            <?php endif; ?>
                                </fieldset>
                                
                                <button type="submit" id="submitBtn" class="btn btn-block btn-primary">Submit</button>
                                
                                <br>
                                
                            </form>
                        
                        <?php else: ?>
                        <div class="alert alert-danger" role="alert">
                            Please wait <?php echo e(\Carbon\Carbon::parse(auth()->user()->delay->$jeda)->diffForHumans()); ?> to submit like
                        </div>
                        
                        
                        
                        <?php ($button = '<button type="submit" id="submitBtn" class="btn btn-block btn-danger" disabled>Please Wait</button>'); ?>
                        <?php endif; ?>
                            
                            <?php if(session('result') == 'SUKSES'): ?>
                        <div class="alert alert-success" role="alert">
                            Success Submit Like ! ^_^ <br>
                            Jika Submit Gagal Atau Like Tidak Masuk Silahkan Reupload Post Anda
                        </div>
                        
                        <?php endif; ?>
                        <?php if(session('result') == 'GAGAL'): ?>
                        <div class="alert alert-danger" role="alert">
                            Gagal Submit Like ! :(
                        </div>
                        <?php endif; ?>
                        <!--<div class="alert alert-success" role="alert">-->
                        <!--            Server Like sedang dalam masa percobaan ! <br>-->
                        <!--            Proses like masuk sekitar 1 - 5 menit <br>-->
                        <!--            Harap tambahkan www seperti pada contoh agar like masuk <br>-->
                        <!--            https://www.instagram.com/p/BkCmiFelpBD/ <br>-->
                        <!--            Jika url tidak seperti pada contoh submit like akan gagal <br>-->
                        <!--            Apabila notifikasi yang muncul sukses namun like tidak masuk harap cek url kembali atau ubah url untuk post yang lain-->
                        <!--        </div>-->
                                
                        </div>
                        
                        
                    </div><!-- end row -->
                </div>
            </div>
            <div class="col-lg-6 col-md-12">
                <div class="card-box">
                    <h4 class="header-title m-t-0 m-b-30"><span class="label label-primary"><?php echo e(auth()->user()->level); ?></span> <?php echo \App\Helper::panelName(); ?> Server Like <?php echo e($id); ?></h4>
                    <ul class="list-group">
                      <li class="list-group-item">Selamat Datang Di <?php echo \App\Helper::panelName(); ?> PANEL</li>
                      <li class="list-group-item">Data Base Like 3000±</li>
                      <li class="list-group-item">Database Like Bisa Naik Turun Karena Pemakaian</li>
                      <li class="list-group-item">Server 1,2,3 digunakan secara bergantian</li>
                      <li class="list-group-item">Jeda Submit 15 Menit</li>
                      <li class="list-group-item">Instagram Jangan Di <span class="label label-danger"><i class="fa fa-lock"></i> Private</span></li>
                      
                    </ul>
                </div>
            </div>
        </div>
        <!-- end row -->


    </div>
    <!-- container -->

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

<?php $__env->startSection('js'); ?>
<script>
$(document).ready(function(){
    $('#submitBtn').dblclick(function(){
        $('#submitBtn').attr('disabled', true);
    });
});
$(document).ready(function(){
    $('#jumlah').on('input change', function(){
        var submitBtn = $('#submitBtn');
        var value = $('#jumlah').val();
        if(value <= <?php echo e($max); ?>){
            submitBtn.removeAttr("disabled");
            submitBtn.text('Submit');
            submitBtn.removeClass('btn-danger').addClass('btn-primary');
        }
        else{
            submitBtn.attr("disabled", true);
            submitBtn.text('Max <?php echo e($max); ?>! Silahkan Rubah Jumlah');
            submitBtn.removeClass('btn-primary').addClass('btn-danger');
        }
    });
    
    $('#submitBtn').on('click',function(){
        $('#submitBtn').attr('disabled', true);
        $('#formini').submit();
    });
  });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>