
<?php $__env->startSection('title','Receiving Voucher'); ?>
<?php $__env->startSection('main'); ?>


        <div class="container-md shadow mt-md-3 border-top rounded-top border-2 border-primary bg-light">
                <div class="row "> 
                     <div class="col-4 d-flex justify-content-left mt-3">
                <a href="<?php echo e(url('/Rvoucher/add')); ?>">
                <button type="submit" class="btn btn-success btn-sm">Add New &nbsp; <i class="fa-solid fa-plus icon-white"></i></button> 
                </a>
            </div>

            <div class="col-4  d-flex justify-content-center mt-2">                
                    <h1 style="font-family: 'Brush Script MT', cursive;">Receiving Voucher</h1>
            </div>
           
            <div class="col-4 mt-3 d-flex justify-content-end">
                <form class="row g-1">

                    <div class="col-auto ">
                        <datalist id="all_accounts_options">
                                <?php $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datass): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option  value="<?php echo e($datass->customer_name); ?>"> 
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </datalist>

                        <input list="all_accounts_options" autocomplete="off" class="form-control form-control-sm " name="search" type="search" placeholder="Search here!" value="<?php echo e($search); ?>">
                    
                        
                        
                    </div>
                    <div class="col-auto">
                    <a href="<?php echo e(url('/Rvoucher/index')); ?>">
                        
                    </a>
                    </div>
                    
               
            </div>
        </div>
        
        <table class="table table-sm table-hover mt-3">

                <thead>
                    <tr>
                    <th scope="col">
                        Receipt#
                        <?php if($sortby == "Receipt"): ?>
                        <input class="form-check-input" type="radio" name="sortby" value="receipt" checked>
                        <?php else: ?>
                        <input class="form-check-input" type="radio" name="sortby" value="receipt">
                        <?php endif; ?>

                        </th>
                    <th scope="col">Date</th>
                    <th scope="col">Project 
                        
                        
                        <?php if($sortby == "project_name"): ?>
                        <input class="form-check-input" type="radio" name="sortby" value="project_name" checked>
                        <?php else: ?>
                        <input class="form-check-input" type="radio" name="sortby" value="project_name">
                        <?php endif; ?>

                        
                        
                    </th>
                    <th scope="col">Account
                    <?php if($sortby == "account_name"): ?>
                    <input class="form-check-input" type="radio" name="sortby" value="account_name" checked>
                    <?php else: ?>
                    <input class="form-check-input" type="radio" name="sortby" value="account_name">
                    <?php endif; ?>
                    </th>
                    
                    <th scope="col">Description</th>
                    <th scope="col">Amount</th>
                    <th class="text-center" scope="col">Action</th>
                    </tr>
                </thead>
                 </form>
                <tbody>
                <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $datas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                        <td><?php echo e($datas->id); ?></td> 
                        
                        <td><?php echo e(date('d-M-y', strtotime($datas->cvdate))); ?></td>
                        <td><?php echo e($datas->ProjectName); ?></td>
                        <td><?php echo e(Str::of($datas->account_name)->limit(20)); ?></td>
                        
                        <td><?php echo e(Str::of($datas->description)->limit(25)); ?></td>
                        <td><?php echo e(number_format($datas->total_amount,0)); ?></td>    
                        <td class="text-center">


                            <a href="<?php echo e(route('Rvoucher.edit', ['id' => $datas->id])); ?>" ><i class="fa-solid fa-pen-to-square icon text-info"></i></a>&nbsp;
                            <a href="<?php echo e(route('Rvoucher.delete', $datas->id)); ?>" class="deleteUser"><i class="fa-solid fa-trash-can icon icon-red text-danger"></i></a>&nbsp;
                            <a href="<?php echo e(route('Rvoucher.show', ['id' => $datas->id])); ?>" ><i class="fa-solid fa-print icon icon-blue text-warning"></i></a>
                            
                                                        
                        </td>   
                                                
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>

                </table>
               
                   
          
                <div class="row">
    <?php echo e($data->onEachSide(0)->appends($_GET)->links('pagination::bootstrap-5')); ?>

    </div>

    </div>


<script>



$(document).on('click','.deleteUser',function() {
        var url = $(this).attr('rel');
        if(confirm("Are you sure you want to delete this?")){
           window.location.href = url
        }
        else{
            return false;
        }
    })

</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/alameenb/public_html/resources/views/Rvoucher/index.blade.php ENDPATH**/ ?>