<?php $__env->startSection('page-title', __('Submissions')); ?>
<?php $__env->startSection('page-heading', __('Submissions')); ?>

<?php $__env->startSection('breadcrumbs'); ?>
    <li class="breadcrumb-item active">
        <?php echo app('translator')->get('Submission'); ?>
    </li>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <?php echo $__env->make('partials.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <?php if(env('LANDINGPAGE') == 1): ?>
        <div class="card">
            <div class="card-body">

                <form action="" method="GET" id="users-form" class="pb-2 mb-3 border-bottom-light">
                    <div class="row my-3 flex-md-row flex-column-reverse">


                        <div class="col-md-6 mt-2 mt-md-0">
                            <label>Filter By Community</label>
                            <select name="community" id="status" class="form-control input-solid">
                                <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($key); ?>"
                                        <?php echo e(Request::get('community') == $key ? 'selected' : ''); ?>>
                                        <?php echo e($value); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                </form>

                <div class="table-responsive" id="users-table-wrapper">
                    <table id="users-table" class="table table-borderless table-striped">
                        <thead>
                            <tr>
                                <th class="min-width-150"><?php echo app('translator')->get('Full Name'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Email'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Experience'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Country'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Members'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Facebook Username'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Whatsapp Username'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Tictok Username'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Twitter Username'); ?></th>
                                <th class="min-width-80"><?php echo app('translator')->get('Registration Date'); ?></th>
                                <th class="min-width-80"><?php echo app('translator')->get('News Letter'); ?></th>
                                <th class="text-center min-width-150"><?php echo app('translator')->get('Action'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if(count($users)): ?>
                                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        
                                        <td class="align-middle"><?php echo e($user->name); ?></td>
                                        <td class="align-middle"><?php echo e($user->email); ?></td>
                                        <td class="align-middle"><?php echo e($user->experience); ?></td>
                                        <td class="align-middle"><?php echo e($user->country); ?></td>
                                        <td class="align-middle"><?php echo e($user->people); ?></td>
                                        <td class="align-middle"><?php echo e($user->fbusername); ?></td>
                                        <td class="align-middle"><?php echo e($user->wausername); ?></td>
                                        <td class="align-middle"><?php echo e($user->ttusername); ?></td>
                                        <td class="align-middle"><?php echo e($user->txusername); ?></td>
                                        <td class="align-middle"><?php echo e($user->created_at); ?></td>
                                        <td class="align-middle">
                                            <span
                                                class="badge badge-lg <?php if($user->newsletter == 'on'): ?> badge-success <?php else: ?> badge-danger <?php endif; ?> }}">
                                                <?php echo e($user->newsletter ?? 'Off'); ?>

                                            </span>
                                        </td>
                                        <td class="text-center align-middle">
                                            
                                            <a href="<?php echo e(route('users.submission.destroy', $user->id)); ?>"
                                                class="btn btn-icon" title="<?php echo app('translator')->get('Delete User'); ?>" data-toggle="tooltip"
                                                data-placement="top" data-method="DELETE"
                                                data-confirm-title="<?php echo app('translator')->get('Please Confirm'); ?>"
                                                data-confirm-text="<?php echo app('translator')->get('Are you sure that you want to delete this submission?'); ?>"
                                                data-confirm-delete="<?php echo app('translator')->get('Yes, delete it!'); ?>">
                                                <i class="fas fa-trash"></i>
                                            </a>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <tr>
                                    <td colspan="10"><em><?php echo app('translator')->get('No records found.'); ?></em></td>
                                </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    <?php else: ?>
        <div class="card">
            <div class="card-body">


                <div class="table-responsive" id="users-table-wrapper">
                    <table id="users-table" class="table table-borderless table-striped">
                        <thead>
                            <tr>
                                <th class="min-width-150"><?php echo app('translator')->get('Full Name'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Email'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Phone'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Experience'); ?></th>
                                <th class="min-width-100"><?php echo app('translator')->get('Community'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('People'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Company'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Website'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Volume'); ?></th>
                                <th class="min-width-150"><?php echo app('translator')->get('Interest'); ?></th>
                                <th class="min-width-80"><?php echo app('translator')->get('Registration Date'); ?></th> 
                                <th class="text-center min-width-150"><?php echo app('translator')->get('Action'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if(count($users)): ?>
                                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        
                                        <td class="align-middle"><?php echo e($user->name); ?></td>
                                        <td class="align-middle"><?php echo e($user->email); ?></td>
                                        <td class="align-middle"><?php echo e($user->phone); ?></td>
                                        <td class="align-middle"><?php echo e($user->experience); ?></td>
                                        <td class="align-middle"><?php echo e($user->community); ?></td>
                                        <td class="align-middle"><?php echo e($user->people); ?></td>
                                        <td class="align-middle"><?php echo e($user->company); ?></td>
                                        <td class="align-middle"><?php echo e($user->website); ?></td>
                                        <td class="align-middle"><?php echo e($user->volume); ?></td>
                                        <td class="align-middle"><?php echo e($user->interest); ?></td>
                                        <td class="align-middle"><?php echo e($user->created_at); ?></td> 
                                        <td class="text-center align-middle">
                                            
                                            <a href="<?php echo e(route('users.submission.destroy', $user->id)); ?>"
                                                class="btn btn-icon" title="<?php echo app('translator')->get('Delete User'); ?>" data-toggle="tooltip"
                                                data-placement="top" data-method="DELETE"
                                                data-confirm-title="<?php echo app('translator')->get('Please Confirm'); ?>"
                                                data-confirm-text="<?php echo app('translator')->get('Are you sure that you want to delete this submission?'); ?>"
                                                data-confirm-delete="<?php echo app('translator')->get('Yes, delete it!'); ?>">
                                                <i class="fas fa-trash"></i>
                                            </a>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php else: ?>
                                <tr>
                                    <td colspan="10"><em><?php echo app('translator')->get('No records found.'); ?></em></td>
                                </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <?php echo $users->render(); ?>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    

    <script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.25/datatables.min.js"></script>

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.bootstrap4.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.html5.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.print.min.js"></script>
    <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.colvis.min.js"></script>

    <script>
        $(document).ready(function() {
            $('#users-table').DataTable({
                // Enables the DOM structure for buttons (B), length (l), filtering (f), table (t), info (i), and pagination (p)
                dom: 'Bfrtip',
                // Define the export buttons
                buttons: [
                    'copy', 'csv', 'excel', 'pdf', 'print'
                ],
                // Use the 'columns' option to disable sorting and export on the 'Action' column (index 9)
                "columnDefs": [{
                        "orderable": false,
                        "targets": 9
                    }, // Disable ordering for the 10th column (index 9)
                    {
                        "exportable": false,
                        "targets": 9
                    } // Exclude the 10th column (index 9) from export
                ]
            });
        });
    </script>
    <script>
        $("#status").change(function() {
            $("#users-form").submit();
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/AMPPS/www/vanguard/resources/views/submission/list.blade.php ENDPATH**/ ?>