<?php $__env->startSection('breadcrumb'); ?>
   <li class="breadcrumb-item">Dashboard</li>
   <li class="breadcrumb-item active">Pembayaran</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">Entri Pembayaran</div>
               
                <form method="post" action="<?php echo e(url('dashboard/pembayaran')); ?>">
                  <?php echo csrf_field(); ?>
                  
                     <div class="form-group">
                        <label>NISN Siswa</label>
                        <input type="text" class="form-control <?php $__errorArgs = ['nisn'];
$__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="nisn">
                        <span class="text-danger"><?php $__errorArgs = ['nisn'];
$__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="input-group mb-3">									
                        <div class="input-group-prepend">										
                           <label class="input-group-text">										 	
                              SPP Bulan	
                           </label>
                        </div>
                        <select class="custom-select <?php $__errorArgs = ['spp_bulan'];
$__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="spp_bulan">
                           									
                              <option value="">Silahkan Pilih</option>											
                                 <option value="januari">Januari</option>
                                 <option value="februari">Februari</option>
                                 <option value="maret">Maret</option>
                                 <option value="april">April</option>
                                 <option value="mei">Mei</option>
                                 <option value="juni">Juni</option>
                                 <option value="juli">Juli</option>
                                 <option value="agustus">Agustus</option>
                                 <option value="september">September</option>
                                 <option value="oktober">Oktober</option>
                                 <option value="november">November</option>
                                 <option value="desember">Desember</option>
                       </select>
                     </div>
                     <span class="text-danger"><?php $__errorArgs = ['spp_bulan'];
$__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 class="form-group">
                       <label>Jumlah Bayar</label>
                       <input type="text" class="form-control <?php $__errorArgs = ['jumlah_bayar'];
$__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="jumlah_bayar">
                       <span class="text-danger"><?php $__errorArgs = ['jumlah_bayar'];
$__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 Pembayaran</div>
                  
                  <div class="table-responsive mb-3">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th scope="col">#</th>
                                            <th scope="col">PETUGAS</th>
								    <th scope="col">NISN SISWA</th>
                                            <th scope="col">NAMA SISWA</th>
                                            <th scope="col">SPP</th>
                                            <th scope="col">JUMLAH BAYAR</th>
                                            <th scope="col">TANGGAL BAYAR</th>
								    <th scope="col"></th>                                        
                                        </tr>
                                    </thead>
                                    <tbody>
								<?php 
								$i=1;
								?>
								<?php $__currentLoopData = $pembayaran; $__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->users->name); ?></td>
								    <td><?php echo e($value->siswa->nisn); ?></td>
                                            <td><?php echo e($value->siswa->nama); ?></td>
                                            <td><?php echo e($value->siswa->spp->nominal); ?></td>
                                            <td><?php echo e($value->jumlah_bayar); ?></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/pembayaran/'. $value->id .'/edit')); ?>"><i class="ti-pencil"></i> Edit </a>
                                                        <form method="post" action="<?php echo e(url('dashboard/pembayaran', $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($pembayaran->lastPage() != 1): ?>
						<div class="btn-group float-right">		
						   <a href="<?php echo e($pembayaran->previousPageUrl()); ?>" class="btn btn-success">
								<i class="mdi mdi-chevron-left"></i>
						    </a>
						    <?php for($i = 1; $i <= $pembayaran->lastPage(); $i++): ?>
								<a class="btn btn-success <?php echo e($i == $pembayaran->currentPage() ? 'active' : ''); ?>" href="<?php echo e($pembayaran->url($i)); ?>"><?php echo e($i); ?></a>
						    <?php endfor; ?>
					        <a href="<?php echo e($pembayaran->nextPageUrl()); ?>" class="btn btn-success">
								<i class="mdi mdi-chevron-right"></i>
							</a>
					   </div>
					<?php endif; ?>
					<!-- End Pagination -->
					
					   <?php if(count($pembayaran) == 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/entri-pembayaran/index.blade.php ENDPATH**/ ?>