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

<!-- BEGIN PAGE CSS -->
<?php $__env->startSection('page-css'); ?>
<style>
    .toggle-code-snippet {
        margin-bottom: 0px;
    }

    body.dark .toggle-code-snippet {
        margin-bottom: 0px;
    }
</style>
<link rel="stylesheet" type="text/css" href="/cork/src/plugins/css/dark/table/datatable/dt-global_style.css">
<link rel="stylesheet" type="text/css" href="/cork/src/plugins/src/table/datatable/datatables.css">

<link rel="stylesheet" type="text/css" href="/cork/src/plugins/css/light/table/datatable/dt-global_style.css">
<link rel="stylesheet" type="text/css" href="/cork/src/plugins/css/light/table/datatable/custom_dt_miscellaneous.css">

<link rel="stylesheet" type="text/css" href="/cork/src/plugins/css/dark/table/datatable/dt-global_style.css">
<link rel="stylesheet" type="text/css" href="/cork/src/plugins/css/dark/table/datatable/custom_dt_miscellaneous.css">
<style>
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #enrollments {
        width: 100% !important;
    }

    #enrollments th,
    #enrollments td {
        white-space: nowrap;
    }

    /* Adjust these widths as needed */
    #enrollments th:nth-child(1),
    #enrollments td:nth-child(1) { width: 100px; }
    #enrollments th:nth-child(2),
    #enrollments td:nth-child(2) { width: 150px; }
    /* ... add more column-specific widths as needed ... */

    @media screen and (max-width: 767px) {
        .table-responsive {
            border: none;
        }
    }
</style>
<?php $__env->stopSection(); ?>
<!-- END PAGE CSS -->

<!-- BREADCRUMB -->
<?php $__env->startSection('breadcrumb'); ?>
    <div class="page-meta">
        <nav class="breadcrumb-style-one" aria-label="breadcrumb">
            <ol class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo e(route('dashboard')); ?>">Home</a></li>
                <li class="breadcrumb-item active" aria-current="page">Welcome Letters</li>
            </ol>
        </nav>
    </div>
    <!-- /BREADCRUMB -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <button class="btn btn-primary m-2" onclick="window.location.href = '<?php echo e(route('welcome-letters.create')); ?>';">+ Add Welcome Letter</button>
    <table id="welcome-letters" class="table dt-table-hover" style="width:100%">
        <thead>
            <tr>
                <th>Section</th>
                <th>Teacher</th>
                <th>Need To Send</th>
                <th class="no-content">Action</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $welcome_letters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $wl): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td>
                        <?php if($wl->section && $wl->section->provider && $wl->section->course && $wl->section->teacher && $wl->section->year): ?>
                            <?php echo e($wl->section->provider->name); ?> -
                            <?php echo e($wl->section->course->name); ?> -
                            <?php echo e($wl->section->teacher->last_name); ?> -
                            <?php echo e($wl->section->year->year); ?>

                            <?php echo e($wl->section->termDesc()); ?>

                        <?php else: ?>
                            N/A
                        <?php endif; ?>
                    </td>
                    <td>
                        <?php if($wl->section && $wl->section->teacher): ?>
                            <?php echo e($wl->section->teacher->last_name); ?>, <?php echo e($wl->section->teacher->first_name); ?>

                        <?php else: ?>
                            N/A
                        <?php endif; ?>
                    </td>
                    <td>
                        <?php if($wl->section): ?>
                            <?php echo e($pendingCounts[$wl->section->id] ?? 0); ?>

                        <?php else: ?>
                            0
                        <?php endif; ?>
                    </td>
                    <td>
                        <a href="<?php echo e(route('welcome-letters.bulk-send', $wl->id)); ?>"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill: rgba(0, 0, 0, 1);transform: ;msFilter:;"><path d="M20 4H4c-1.103 0-2 .897-2 2v12c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V6c0-1.103-.897-2-2-2zm0 2v.511l-8 6.223-8-6.222V6h16zM4 18V9.044l7.386 5.745a.994.994 0 0 0 1.228 0L20 9.044 20.002 18H4z"></path></svg></a>
                        <a href="<?php echo e(route('welcome-letters.show', $wl->id)); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg></a>&nbsp;
                        <a href="<?php echo e(route('welcome-letters.edit', $wl->id)); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"/></svg></a>&nbsp;
                        <a href="<?php echo e(route('welcome-letters.delete', $wl->id)); ?>"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg></a>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
<?php $__env->stopSection(); ?>
<!--  BEGIN PAGE SCRIPTS FILE  -->
<?php $__env->startSection('page-css'); ?>
    <style>
        .toggle-code-snippet { margin-bottom: 0px; }
        body.dark .toggle-code-snippet { margin-bottom: 0px; }

        /* New styles for sorting arrows */
        table.dataTable thead .sorting:after,
        table.dataTable thead .sorting_asc:after,
        table.dataTable thead .sorting_desc:after {
            position: absolute;
            top: 12px;
            right: 8px;
            display: block;
            font-family: Arial, sans-serif;
        }
        table.dataTable thead .sorting:after {
            content: "\2195";
            color: #ddd;
            font-size: 0.8em;
        }
        table.dataTable thead .sorting_asc:after {
            content: "\2191";
            color: #000;
        }
        table.dataTable thead .sorting_desc:after {
            content: "\2193";
            color: #000;
        }
    </style>
    <link rel="stylesheet" href="/cork/src/plugins/css/dark/table/datatable/dt-global_style.css">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-js'); ?>
<script src="/cork/src/plugins/src/table/datatable/datatables.js"></script>
<script src="/cork/src/plugins/src/table/datatable/button-ext/dataTables.buttons.min.js"></script>
<script src="/cork/src/plugins/src/table/datatable/button-ext/jszip.min.js"></script>
<script src="/cork/src/plugins/src/table/datatable/button-ext/buttons.html5.min.js"></script>
<script src="/cork/src/plugins/src/table/datatable/button-ext/buttons.print.min.js"></script>
<script src="/cork/src/plugins/src/table/datatable/custom_miscellaneous.js"></script>
    <script>
        $('#welcome-letters').DataTable({
            "dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
                "<'table-responsive'tr>" +
                "<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count  mb-sm-0 mb-3'i><'dt--pagination'p>>",
            "oLanguage": {
                "oPaginate": {
                    "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',
                    "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>'
                },
                "sInfo": "Showing page _PAGE_ of _PAGES_",
                "sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
                "sSearchPlaceholder": "Search...",
                "sLengthMenu": "Results :  _MENU_",
            },
            "stripeClasses": [],
            "lengthMenu": [25, 50, 75, 100],
            "pageLength": 100,
            "ordering": true,
            "order": [[0, 'asc']],
            "columnDefs": [
                { "orderable": true, "targets": [0, 1, 2] },
                { "orderable": false, "targets": 3 }
            ]
        });
    </script>
<?php $__env->stopSection(); ?>
<!--  END PAGE SCRIPTS FILE  -->

<?php echo $__env->make('layouts.cork', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/psjybwmy/public_html/registration/resources/views/admin/welcome-letters/index.blade.php ENDPATH**/ ?>