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

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

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

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

    <div class="card">
        <div class="card-body">
            <div class="table-responsive" id="contacts-table-wrapper">
                <table id="contacts-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-150"><?php echo app('translator')->get('Email'); ?></th>
                            <th class="min-width-100"><?php echo app('translator')->get('Phone'); ?></th>
                            <th class="min-width-150"><?php echo app('translator')->get('Subject'); ?></th>
                            <th class="min-width-150"><?php echo app('translator')->get('Mission/Dept'); ?></th>
                            <th class="min-width-100"><?php echo app('translator')->get('Role/Rank'); ?></th>
                            <th class="min-width-200"><?php echo app('translator')->get('Message'); ?></th>
                            <th class="min-width-150"><?php echo app('translator')->get('Submitted At'); ?></th>
                            <th class="text-center"><?php echo app('translator')->get('Action'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(count($contacts)): ?>
                            <?php $__currentLoopData = $contacts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td class="align-middle"><?php echo e($contact->fname); ?></td>
                                    <td class="align-middle"><?php echo e($contact->email); ?></td>
                                    <td class="align-middle"><?php echo e($contact->phone); ?></td>
                                    <td class="align-middle">
                                        <span class="badge badge-info"><?php echo e($contact->subject); ?></span>
                                    </td>
                                    <td class="align-middle"><?php echo e($contact->service_branch); ?></td>
                                    <td class="align-middle"><?php echo e($contact->rank); ?></td>
                                    <td class="align-middle">
                                        <small><?php echo e(Str::limit($contact->message, 50)); ?></small>
                                    </td>
                                    <td class="align-middle"><?php echo e($contact->created_at); ?></td>
                                    <td class="text-center align-middle">
                                        <button class="btn btn-icon" title="<?php echo app('translator')->get('View Full Message'); ?>" 
                                                onclick="alert('<?php echo e(addslashes($contact->message)); ?>')">
                                            <i class="fas fa-eye"></i>
                                        </button>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                            <tr>
                                <td colspan="9" class="text-center"><em><?php echo app('translator')->get('No records found.'); ?></em></td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <?php echo $contacts->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>
        $(document).ready(function() {
            $('#contacts-table').DataTable({
                dom: 'Bfrtip',
                buttons: ['copy', 'csv', 'excel', 'pdf', 'print'],
                "columnDefs": [
                    { "orderable": false, "targets": 8 } // Disable sorting on Action column
                ]
            });
        });
    </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/military/resources/views/submission/contact.blade.php ENDPATH**/ ?>