 
<?php $__env->startSection('title', 'Editable Datatable'); ?>
<?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')); ?>">
        <link href='https://fonts.googleapis.com/css?family=Josefin Sans' rel='stylesheet'>
    <?php $__env->stopPush(); ?>
<?php

    $adminstatecode = auth()->user()->state_code;
    $admindistcode = auth()->user()->dist_code;
    
    use App\User;
    $id = Auth::user()->id;
    $user  = User::with('roles','permissions')->find($id);
    $permissions = $user->getAllPermissions();
    $add_perm = 0;
    $edit_perm = 0;
    $delete_perm = 0;
    if(count($permissions) > 0)
    {
        foreach($permissions as $data)
        {
            if($data->name == "Add")
            {
                $add_perm = 1;
            }
            if($data->name == "Modify")
            {
                $edit_perm = 1;
            }
            if($data->name == "Delete")
            {
                $delete_perm = 1;
            }
        }
    }
?>
    
    <div class="container-fluid" style="font-family:'Josefin Sans';">
         <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(__('MAT Intake Form View Data')); ?></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(__('MAT Intake Form View')); ?></li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <div class="row clearfix">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header">
                        <h3><?php echo e(__('Editable Data Table')); ?></h3>
                        <?php if($add_perm == 1): ?>
                        <a href='<?php echo e('mat-form'); ?>' style='margin-left: 75%;' class='btn btn-primary'><?php echo e(__('Add Mat Data')); ?></a>
                        <?php endif; ?>
                    </div>
                    <div class="card-body">
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th><?php echo e(__('Date of Entry')); ?></th>
                                    <th><?php echo e(__('UID')); ?></th>
                                    <th><?php echo e(__('State Code')); ?></th>
                                    <th><?php echo e(__('District Code')); ?></th>
                                    <th><?php echo e(__('Reporting Person')); ?></th>
                                    <th style="display:none"><?php echo e(__('Client Name')); ?></th>
                                    <th style="display:none"><?php echo e(__('Gender')); ?></th>
                                    <th style="display:none"><?php echo e(__('Age')); ?></th>
                                    <th style="display:none"><?php echo e(__('KP Group')); ?></th>
                                    <th style="display:none"><?php echo e(__('Type of client')); ?></th>
                                    <th style="display:none"><?php echo e(__('Name of hotspot')); ?></th>
                                    <th style="display:none"><?php echo e(__('Date of OST initiation')); ?></th>
                                    <th style="display:none"><?php echo e(__('Name of OST Centre')); ?></th>
                                    <th style="display:none"><?php echo e(__('OST registration No.')); ?></th>
                                    <th style="display:none"><?php echo e(__('Current OST Status')); ?></th>
                                    <th style="display:none"><?php echo e(__('Record Date if OST Status = Dropped out / Transferred Out / Imprisonment')); ?></th>
                                    <th style="display:none"><?php echo e(__('Date of Last Status Update')); ?></th>
                                    <th><?php echo e(__('Action')); ?></th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $unwant = array("1) ", "2) ", "3) ", "4) ", "5) ", "6) ", "7) ", "8) ", "9) "); ?>
                                 <?php $__currentLoopData = $getdata; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $getdatas): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($getdatas->dateofentry); ?></td>
                                    <td><?php echo $getdatas->state_code.'-'.$getdatas->dist_code.'-' ?><?php echo e($getdatas->uidnum); ?></td>
                                    <td><?php echo e($getdatas->state_code); ?></td>
                                    <td><?php echo e($getdatas->dist_code); ?></td>
                                    <td><?php echo e($getdatas->reportingpname); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->clientname); ?></td>
                                    <td style="display:none"><?php echo e(str_replace($unwant, "",$getdatas->gender)); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->age); ?></td>
                                    <td style="display:none"><?php echo e(str_replace($unwant, "",$getdatas->kpgroup)); ?></td>
                                    <td style="display:none"><?php echo e(str_replace($unwant, "",$getdatas->typeofclient)); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->hostpotname); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->ostinidate); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->ostcname); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->ostregno); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->currentostc); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->dropoutdate); ?></td>
                                    <td style="display:none"><?php echo e($getdatas->lstatusdate); ?></td>
                                    <td>
                                        <?php if($edit_perm == 1): ?>
                                        <a href='<?php echo e('editmat/'.$getdatas->id); ?>' class='btn btn-success'>Edit</a> 
                                        <?php endif; ?>
                                        <?php if($delete_perm == 1): ?>
                                        <?php echo e(__(' | ')); ?><a href='<?php echo e('deletemat/'.$getdatas->id); ?>' class='btn btn-danger'>Delete</a>
                                        <?php endif; ?>
                                    </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>
    <!--<script src="<?php echo e(asset('plugins/DataTables/Cell-edit/dataTables.cellEdit.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/viruxyz/public_html/ejaf/resources/views/pages/mat-form-data.blade.php ENDPATH**/ ?>