<?php $__env->startSection('breadcrumb'); ?>
	<li class="breadcrumb-item">Dashboard</li>
	<li class="breadcrumb-item active">SPP</li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

	<div class="row">
         <div class="col-md-12">
              <div class="card">
                  <div class="card-body">
                       <div class="card-title"><?php echo e(__('Tambah SPP')); ?></div>
                     
                        <form method="post" action="<?php echo e(url('/dashboard/data-spp')); ?>">
                           <?php echo csrf_field(); ?>
                           
                           <div class="form-group">
                              <label>Tahun</label>
                              <input type="number" class="form-control <?php $__errorArgs = ['tahun'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="tahun" value="<?php echo e(old('tahun')); ?>">
                              <span class="text-danger"><?php $__errorArgs = ['tahun'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo e($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?></span>
                           </div>
                           
                           <div class="form-group">
                              <label>Nominal</label>
                              <input type="text" class="form-control <?php $__errorArgs = ['nominal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="nominal" value="<?php echo e(old('nominal')); ?>">
                              <span class="text-danger"><?php $__errorArgs = ['nominal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <?php echo e($message); ?> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?></span>
                           </div>
                           
                           <button type="submit" class="btn btn-success btn-rounded float-right">
                                 <i class="mdi mdi-check"></i> Simpan
                           </button>
                        
                        </form>
                  </div>
              </div>     
            </div>
            
	</div>
     <div class="row">
           <div class="col-md-12">
			<div class="card">
				<div class="card-body">
					<div class="card-title">Data SPP</div>
                              
						<div class="table-responsive mb-3">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th scope="col">#</th>
                                            <th scope="col">TAHUN</th>
								    <th scope="col">NOMINAL</th>
                                            <th scope="col">DIBUAT</th>
								    <th scope="col"></th>                                        
                                        </tr>
                                    </thead>
                                    <tbody>
								<?php 
								$i=1;
								?>
								<?php $__currentLoopData = $spp; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>					    
                                            <th scope="row"><?php echo e($i); ?></th>
                                            <td><?php echo e($value->tahun); ?></td>
								    <td><?php echo e($value->nominal); ?></td>
                                            <td><?php echo e($value->created_at->format('d M, Y')); ?></td>
					
                                            <td>										                           
                               	 		  <div class="hide-menu">
                                    			<a href="javascript:void(0)" class="text-dark" id="actiondd" role="button" data-toggle="dropdown">
                                       				<i class="mdi mdi-dots-vertical"></i>
                                    			</a>
                                    				<div class="dropdown-menu dropdown-menu-right" aria-labelledby="actiondd">
                                        			<a class="dropdown-item" href="<?php echo e(url('dashboard/data-spp/'.$value->id.'/edit')); ?>"><i class="ti-pencil"></i> Edit </a>
											<form method="post" action="<?php echo e(url('dashboard/data-spp', $value->id)); ?>" id="delete<?php echo e($value->id); ?>">
												<?php echo csrf_field(); ?>
												<?php echo method_field('delete'); ?>
												
												<button type="button" class="dropdown-item" onclick="deleteData(<?php echo e($value->id); ?>)">
													<i class="ti-trash"></i> Hapus
												</button>	
											
											</form>																																																
                                        			                    							                                                                            
                                				</div>
                            				</div>								
								    </td>					
                                        </tr>
								<?php
								$i++;
								?>
								<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>                                  
                                    </tbody>
                                </table>
                            </div>

					  <!-- Pagination -->
					<?php if($spp->lastPage() != 1): ?>
						<div class="btn-group float-right">		
						   <a href="<?php echo e($app->previousPageUrl()); ?>" class="btn btn-success">
								<i class="mdi mdi-chevron-left"></i>
						    </a>
						    <?php for($i = 1; $i <= $spp->lastPage(); $i++): ?>
								<a class="btn btn-success <?php echo e($i == $spp->currentPage() ? 'active' : ''); ?>" href="<?php echo e($spp->url($i)); ?>"><?php echo e($i); ?></a>
						    <?php endfor; ?>
					        <a href="<?php echo e($spp->nextPageUrl()); ?>" class="btn btn-success">
								<i class="mdi mdi-chevron-right"></i>
							</a>
					   </div>
					<?php endif; ?>
					<!-- End Pagination -->
					
					   <?php if(count($spp) == 0): ?>
				  			<div class="text-center">Tidak ada data!</div>
					   <?php endif; ?>
				</div>
			</div>
		</div>
     </div>

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

<?php $__env->startSection('sweet'); ?>

   function deleteData(id){
      Swal.fire({
               title: 'PERINGATAN!',
               text: "Yakin ingin menghapus data SPP?",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yakin',
                cancelButtonText: 'Batal',
            }).then((result) => {
               if (result.value) {
                     $('#delete'+id).submit();
                  }
               })
   }
   
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\pembayaran-spp\resources\views/dashboard/data-spp/index.blade.php ENDPATH**/ ?>