<?php echo $__env->make('admin.layouts.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php echo $__env->make('admin.layouts.sidebar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
    <div class="m-subheader ">
        <div class="d-flex align-items-center">
            <div class="mr-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    Direct Assignment
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <?php if(Session::has('success')): ?>
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                <?php echo e(Session::get('success')); ?>

            </div>
        <?php endif; ?>
        <?php if(Session::has('error')): ?>
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"></button>
                <?php echo e(Session::get('error')); ?>

            </div>
        <?php endif; ?>

        
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__head">
                <div class="m-portlet__head-caption">
                    <div class="m-portlet__head-title">
                        <span class="m-portlet__head-icon">
                            <i class="fa fa-file-excel-o"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            Loans Upload
                        </h3>
                    </div>
                </div>
                <div class="m-portlet__head-tools" style="padding-right: 13px;">
                    
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div class="m-section__content">
                        <div class="col-md-12">
                            <div class="row" style="color:red;">* Please remove extra headers &amp; footers from file before processing</div>
                            <div class="row" style="font-weight: 500;">[Supported file - xls, xlsx]</div>
                            <form id="da_system_upload_form" class="form-horizontal" action="/admin/da-system/import" method="POST" enctype="multipart/form-data">
                                <input name="_token" value="<?php echo csrf_token(); ?>" type="hidden">
                                <div class="row" style="padding-bottom: 10px; margin-left: -32px; padding-top: 10px;">
                                    <div class="col-md-3">
                                        <input type="file" name="file" id="file" class="form-control" autocomplete="off" required="required" accept=".xls,.xlsx">
                                    </div>
                                    <div class="col-md-6" style="padding-top: 2px;">
                                        <input type="submit" class="btn btn-accent" value="Import Data" style="margin-right: 20px;">
                                        <div class="btn btn-primary" onclick="window.location = '/admin/da-system';">Clear</div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__head">
                <div class="m-portlet__head-caption">
                    <div class="m-portlet__head-title">
                        <span class="m-portlet__head-icon">
                            <i class="fa fa-file-excel-o"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            RPS Upload
                        </h3>
                    </div>
                </div>
                <div class="m-portlet__head-tools" style="padding-right: 13px;">
                    
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div class="m-section__content">
                        <div class="col-md-12">
                            <div class="row" style="color:red;">* Please remove extra headers &amp; footers from file before processing</div>
                            <div class="row" style="font-weight: 500;">[Supported file - xls, xlsx]</div>
                            <form id="da_system_upload_form" class="form-horizontal" action="/admin/da-system/rps-import" method="POST" enctype="multipart/form-data">
                                <input name="_token" value="<?php echo csrf_token(); ?>" type="hidden">
                                <div class="row" style="padding-bottom: 10px; margin-left: -32px; padding-top: 10px;">
                                    <div class="col-md-3">
                                        <input type="file" name="file" id="file" class="form-control" autocomplete="off" required="required" accept=".xls,.xlsx">
                                    </div>
                                    <div class="col-md-6" style="padding-top: 2px;">
                                        <input type="submit" class="btn btn-accent" value="Import Data" style="margin-right: 20px;">
                                        <div class="btn btn-primary" onclick="window.location = '/admin/da-system';">Clear</div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__head">
                <div class="m-portlet__head-caption">
                    <div class="m-portlet__head-title">
                        <span class="m-portlet__head-icon">
                            <i class="fa fa-file-excel-o"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            Collection Upload
                        </h3>
                    </div>
                </div>
                <div class="m-portlet__head-tools" style="padding-right: 13px;">
                    
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div class="m-section__content">
                        <div class="col-md-12">
                            <div class="row" style="color:red;">* Please remove extra headers &amp; footers from file before processing</div>
                            <div class="row" style="font-weight: 500;">[Supported file - xls, xlsx]</div>
                            <form id="da_system_upload_form" class="form-horizontal" action="/admin/da-system/payment-import" method="POST" enctype="multipart/form-data">
                                <input name="_token" value="<?php echo csrf_token(); ?>" type="hidden">
                                <div class="row" style="padding-bottom: 10px; margin-left: -32px; padding-top: 10px;">
                                    <div class="col-md-3">
                                        <input type="file" name="file" id="file" class="form-control" autocomplete="off" required="required" accept=".xls,.xlsx">
                                    </div>
                                    <div class="col-md-6" style="padding-top: 2px;">
                                        <input type="submit" class="btn btn-accent" value="Import Data" style="margin-right: 20px;">
                                        <div class="btn btn-primary" onclick="window.location = '/admin/da-system';">Clear</div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__head">
                <div class="m-portlet__head-caption">
                    <div class="m-portlet__head-title">
                        <span class="m-portlet__head-icon">
                            <i class="fa fa-tasks"></i>
                        </span>
                        <h3 class="m-portlet__head-text">
                            Processing Status
                        </h3>
                    </div>
                </div>
            </div>
            <div class="m-portlet__body">
                <div class="m-section">
                    <div class="m-section__content">
                        <table class="table table-bordered table-hover" style="font-size: 13px;">
                            <thead>
                                <tr style="background-color: #f4f5f8;">
                                    <th>#</th>
                                    <th>File Name</th>
                                    <th>Queued At</th>
                                    <th>Status</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $jobs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $job): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <?php
                                        $payload = json_decode($job->payload);
                                        $fileName = $payload->file_name ?? '—';
                                    ?>
                                    <tr>
                                        <td><?php echo e($job->id); ?></td>
                                        <td><?php echo e($fileName); ?></td>
                                        <td><?php echo e($job->created_at); ?></td>
                                        <td>
                                            <?php if($job->is_available == 1): ?>
                                                <span class="badge badge-success" style="padding: 5px 10px; background-color: #34bfa3; color: #fff; border-radius: 4px;">Processed</span>
                                            <?php else: ?>
                                                <span class="badge badge-warning" style="padding: 5px 10px; background-color: #ffb822; color: #fff; border-radius: 4px;">Pending</span>
                                            <?php endif; ?>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="4" class="text-center">No files uploaded yet.</td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>

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