 
<?php $__env->startSection('title', 'Outreach Input Ageing Report'); ?>
<?php $__env->startSection('content'); ?>
    <!-- push external head elements to head -->
    <?php $__env->startPush('head'); ?>
        <link rel="stylesheet" href="<?php echo e(asset('plugins/DataTables/datatables.min.css')); ?>">
        <link rel="stylesheet" href="<?php echo e(asset('plugins/jquery-ui/jquery-ui.css')); ?>">
    <?php $__env->stopPush(); ?>

    
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-pie-chart bg-blue"></i>
                        <div class="d-inline">
                            <h5><?php echo e(__('Outreach Input Ageing Report')); ?></h5>
                            <!-- <span><?php echo e(__('EJAF.')); ?></span> -->
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="<?php echo e(route('dashboard')); ?>"><i class="ik ik-home"></i></a>
                            </li>
                            
                           <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('Outreach Input')); ?></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <div class="row clearfix">
            <div class="col-md-12">
                
                <form class="forms-sample"  method='POST' action="<?php echo e(route('getfilteredoutreachageingreport')); ?>" >
                <?php echo csrf_field(); ?>
                    <div class="form-group row">
                        <div class="col-3">
                            <label>Month</label>
                            <select name='month' id='month' class='form-control' required>
                                <option value="">Select Month</option>
                                <?php for($i=1;$i<=12;$i++): ?>
                                <option value="<?php echo e(str_pad($i, 2, '0', STR_PAD_LEFT)); ?>" <?php echo e($month == str_pad($i, 2, '0', STR_PAD_LEFT) ? 'selected' : ''); ?>><?php echo e(str_pad($i, 2, '0', STR_PAD_LEFT)); ?></option>
                                <?php endfor; ?>
                            </select>
                        </div>
                        <div class="col-3">
                            <label>Year</label>
                            <select name='year' id='year' class='form-control' required>
                                <option value="">Select Month</option>
                                <?php for($i=2022;$i<=2030;$i++): ?>
                                <option value="<?php echo e($i); ?>" <?php echo e($year == $i ? 'selected' : ''); ?>><?php echo e($i); ?></option>
                                <?php endfor; ?>
                            </select>
                        </div>
                        <div class="col-2 mt-25">
                            <button type="submit" id="submit" class="btn btn-primary mr-2"><?php echo e(__('Submit')); ?></button>
                        </div>
                    </div>
                </form>
                <div class="card">
                    <div class="card-header">
                        <h3><?php echo e(__('Outreach Input Ageing Report')); ?></h3>
                    </div>
                    <div class="card-body table-responsive">
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th><?php echo e(__('STAFF CODE')); ?></th>
                                    <th><?php echo e(__('STATE CODE')); ?></th>
                                    <th><?php echo e(__('DIST CODE')); ?></th>
                                    <th><?php echo e(__('Client ART Center Code')); ?></th>
                                    <th><?php echo e(__('Client Mobile')); ?></th>
                                    <th><?php echo e(__('Pre ART REG Number')); ?></th>
                                    <th><?php echo e(__('ART REG Number')); ?></th>
                                    <th><?php echo e(__('Client Name')); ?></th>
                                    <th><?php echo e(__('Linelist Received Date')); ?></th>
                                    <th><?php echo e(__('CONTACT VISIT')); ?></th>
                                    <th><?php echo e(__('Activity')); ?></th>
                                    <th><?php echo e(__('Ageing Days')); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                 <?php $__currentLoopData = $getdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $getdatas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($getdatas->emp_code); ?></td>
                                    <td><?php echo e($getdatas->state_code); ?></td>
                                    <td><?php echo e($getdatas->dist_code); ?></td>
                                    
                                    <?php
                                    $getpatregdata = DB::table('patient_register')->where(['id'=>$getdatas->pat_uid])->first();
                                    ?>
                                    <td><?php echo e($getpatregdata->art_centre_code ?? ''); ?></td>
                                    <td><?php echo e($getpatregdata->pat_mobile ?? ''); ?></td>
                                    <td><?php echo e($getpatregdata->pre_art_reg_num ?? ''); ?></td>
                                    <td><?php echo e($getpatregdata->art_reg_num ?? ''); ?></td>
                                    <td><?php echo e($getpatregdata->pat_name ?? ''); ?></td>
                                    <td><?php echo e(date('d-m-Y',strtotime($getdatas->linelist_date))); ?></td>
                                    <td><?php echo e($getdatas->contact_visit); ?></td>
                                    <td>
                                        <?php if($getdatas->linelist_reason_v1 == 1): ?>
                                        <?php echo e($getdatas->linelist_reason_v1.'- LFU'); ?>

                                        
                                        <?php elseif($getdatas->linelist_reason_v1 == 2): ?>
                                        <?php echo e($getdatas->linelist_reason_v1.'- MIS'); ?>

                                        
                                        <?php elseif($getdatas->linelist_reason_v1 == 3): ?>
                                        <?php echo e($getdatas->linelist_reason_v1.'- Home Delivery'); ?>

                                        
                                        <?php else: ?>
                                        <?php echo e($getdatas->linelist_reason_v1.'- VL'); ?>

                                        <?php endif; ?>
                                    </td>
                                    <?php
                                        $earlier = new DateTime($getdatas->linelist_date);
                                        $later = new DateTime(date('Y-m-d'));
                                        $days = $earlier->diff($later)->format("%a Days");
                                    ?>
                                    <td><?php echo e($days); ?></td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div> 
            </div>
        </div>
    </div>

    <!-- push external js -->
    <?php $__env->startPush('script'); ?>
    <script src="<?php echo e(asset('plugins/jquery-ui/jquery-ui.min.js')); ?>"></script>
    <script src="<?php echo e(asset('plugins/DataTables/datatables.min.js')); ?>"></script>
    <!--get editable datatable script-->
    <script src="<?php echo e(asset('js/editable-datatable.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/virutha/treatbuddy.virutha.xyz/resources/views/pages/outreach-ageing-report.blade.php ENDPATH**/ ?>