<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>Slider List | NCU LTD</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc." />
    <meta name="author" content="Zoyothemes" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="images/logo.png">

    <link href="assets/libs/simple-datatables/style.css" rel="stylesheet" type="text/css" />

    <!-- App css -->
    <link href="assets/css/app.min.css" rel="stylesheet" type="text/css" id="app-style" />

    <!-- Icons -->
    <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

    <!-- Head CSS -->
    <script src="assets/js/head.js"></script>
    <!-- SweetAlert2 CSS & JS -->


</head>

<!-- body start -->

<body data-menu-color="dark" data-sidebar="default">
    <!-- Begin page -->
    <div id="app-layout">

        <!-- Topbar Start -->
        <div class="topbar-custom">
            <div class="container-fluid">
                <div class="d-flex justify-content-between">
                    <ul class="list-unstyled topnav-menu mb-0 d-flex align-items-center">
                        <li>
                            <button type="button" class="button-toggle-menu nav-link">
                                <iconify-icon icon="solar:hamburger-menu-linear" class="fs-22 align-middle text-dark">
                                </iconify-icon>
                            </button>
                        </li>
                        <li class="d-none d-lg-block">
                            <form class="app-search d-none d-md-block me-auto">
                                <div class="position-relative topbar-search">
                                    <iconify-icon icon="solar:minimalistic-magnifer-line-duotone"
                                        class="fs-18 align-middle text-dark position-absolute text-dark top-50 translate-middle-y ms-2">
                                    </iconify-icon>
                                    <input type="text" class="form-control shadow-none"
                                        placeholder="Search for somethings" />
                                </div>
                            </form>
                        </li>
                    </ul>

                    <ul class="list-unstyled topnav-menu mb-0 d-flex align-items-center gap-2">
                        <li class="dropdown topbar-dropdown">
                            <a class="nav-link dropdown-toggle me-0" data-bs-toggle="dropdown" href="#" role="button"
                                aria-haspopup="false" aria-expanded="false">
                                <iconify-icon icon="solar:earth-bold-duotone" class="fs-22 align-middle"
                                    id="selected-language-image"></iconify-icon>
                            </a>

                            <div class="dropdown-menu dropdown-menu-end profile-dropdown">
                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item" data-translator-lang="en">
                                    <img src="assets/images/flags/lang-flag/circle-us.svg" class="me-2"
                                        id="selected-language-image"><span class="align-middle">English</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item" data-translator-lang="hi">
                                    <img src="assets/images/flags/lang-flag/circle-us.svg" class="me-2"
                                        id="selected-language-image"><span class="align-middle">Hindi</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item">
                                    <img src="assets/images/flags/lang-flag/circle-de.svg" class="me-2"
                                        id="selected-language-image"> <span class="align-middle">German</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item">
                                    <img src="assets/images/flags/lang-flag/circle-ca.svg" class="me-2"
                                        id="selected-language-image"> <span class="align-middle">Canada</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item">
                                    <img src="assets/images/flags/lang-flag/circle-au.svg" class="me-2"
                                        id="selected-language-image"> <span class="align-middle">Australia</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item">
                                    <img src="assets/images/flags/lang-flag/circle-ru.svg" class="me-2"
                                        id="selected-language-image"> <span class="align-middle">Russian</span>
                                </a>

                                <!-- item-->
                                <a href="javascript:void(0);" class="dropdown-item">
                                    <img src="assets/images/flags/lang-flag/circle-si.svg" class="me-2"
                                        id="selected-language-image"> <span class="align-middle">Italian</span>
                                </a>
                            </div>
                        </li>

                        <!-- Button Trigger Customizer Offcanvas -->
                        <li class="d-none d-sm-flex">
                            <button type="button" class="btn nav-link" data-toggle="fullscreen">
                                <iconify-icon icon="solar:full-screen-bold-duotone"
                                    class="fs-22 align-middle text-dark fullscreen noti-icon"></iconify-icon>
                            </button>
                        </li>

                        <!-- Light/Dark Mode Button Themes -->
                        <li class="d-none d-sm-flex">
                            <button type="button" class="btn nav-link d-flex align-items-center justify-content-center"
                                id="light-dark-mode">
                                <div class="d-flex align-items-center justify-content-center">
                                    <iconify-icon icon="solar:sun-2-bold-duotone"
                                        class="fs-22 text-dark align-middle dark-mode"></iconify-icon>
                                    <iconify-icon icon="solar:moon-bold-duotone"
                                        class="fs-22 text-dark align-middle light-mode"></iconify-icon>
                                </div>
                            </button>
                        </li>

                        <!-- Notifications -->
                        <li class="dropdown notification-list topbar-dropdown">
                            <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
                                aria-expanded="false" data-bs-auto-close="outside">
                                <iconify-icon icon="solar:bell-bing-bold-duotone" class="fs-22 text-dark align-middle">
                                </iconify-icon>
                            </a>


                        </li>

                        <!-- User Dropdown -->
                        <li class="dropdown notification-list topbar-dropdown">
                            <a class="nav-link dropdown-toggle nav-user me-0" data-bs-toggle="dropdown" href="#"
                                role="button" aria-haspopup="false" aria-expanded="false">
                                <img src="assets/images/users/avatar/avatar-07.svg" alt="user-image"
                                    class="img-fluid " />
                            </a>
                            <div class="dropdown-menu dropdown-menu-end profile-dropdown">
                                <!-- item-->
                                <div
                                    class="dropdown-header noti-title border-bottom border-dashed d-flex align-items-center">
                                    <img src="assets/images/users/avatar/avatar-07.svg" alt="user-image"
                                        class="avatar avatar-xs rounded-circle me-2" />
                                    <h6 class="text-overflow m-0">Nyanza Admin !</h6>
                                </div>





                                <!-- item-->
                                <form method="POST" action="<?php echo e(route('logout')); ?>">
                                    <?php echo csrf_field(); ?>

                                    <button type="submit" class="dropdown-item notify-item">
                                        <iconify-icon icon="solar:logout-2-bold-duotone" class="fs-18 align-middle">
                                        </iconify-icon>
                                        <span>Logout</span>
                                    </button>
                                </form>

                            </div>
                        </li>

                    </ul>
                </div>
            </div>
        </div>
        <!-- end Topbar -->

        <!-- Left Sidebar Start -->
        <div class="app-sidebar-menu">
            <div class="h-100" data-simplebar>

                <!--- Sidemenu -->
                <div id="sidebar-menu">

                    <div class="logo-box">
                        <a href="index.html" class="logo logo-light">
                            <span class="logo-sm">
                                <img src="images/logo.png" alt="" height="22">
                            </span>
                            <span class="logo-lg">
                                <img src="images/logo.png" alt="" height="26">
                            </span>
                        </a>
                        <a href="index.html" class="logo logo-dark">
                            <span class="logo-sm">
                                <img src="images/logo.png" alt="" height="22">
                            </span>
                            <span class="logo-lg">
                                <img src="images/logo.png" alt="" height="26">
                            </span>
                        </a>
                    </div>

                    <ul id="side-navbar">

                        <li class="menu-title">Menu</li>

                        <li>
                            <a href="#sidebarDashboards" data-bs-toggle="collapse">
                                <span class="nav-icon">
                                    <iconify-icon icon="solar:widget-6-bold-duotone"></iconify-icon>
                                </span>
                                <span class="sidebar-text"> Dashboards </span>
                                <span class="menu-arrow"></span>
                            </a>
                            <div class="collapse" id="sidebarDashboards">
                                <ul class="nav-second-level">
                                    <li>
                                        <a href="<?php echo e(route('admin')); ?>" class="tp-link"><i
                                                class="ti ti-point"></i>Home</a>
                                    </li>
                                    <!-- <li>
                                            <a href="ecommerce.html" class="tp-link"><i class="ti ti-point"></i>E Commerce</a>
                                        </li> -->
                                </ul>
                            </div>
                        </li>

                        <li class="menu-title mt-2">Apps</li>

                        <li>
                            <a href="<?php echo e(route('pdfs.index')); ?>" class="tp-link">
                                <span class="nav-icon">
                                    <iconify-icon icon="solar:notes-bold-duotone"></iconify-icon>
                                </span>
                                <span class="sidebar-text"> Pdf List </span>
                            </a>
                        </li>
                        <li>
                            <a href="<?php echo e(route('sliders.index')); ?>" class="tp-link">
                                <span class="nav-icon">
                                    <iconify-icon icon="solar:server-minimalistic-bold-duotone"></iconify-icon>
                                </span>
                                <span class="sidebar-text"> Slider List </span>
                            </a>
                        </li>


                    </ul>
                </div>
                <!-- End Sidebar -->

                <div class="clearfix"></div>

            </div>
        </div>
        <!-- Left Sidebar End -->

        <!-- ============================================================== -->
        <!-- Start Page Content here -->
        <!-- ============================================================== -->

    <div class="content-page">
    <div class="content">
        <div class="container-fluid">

            <!-- Header + Add Slider Button -->
            <div class="py-3 d-flex align-items-sm-center flex-sm-row flex-column">
                <div class="flex-grow-1">
                    <h4 class="fs-18 fw-medium m-0">Slider List</h4>
                </div>
                <div class="text-end">
                    <button type="button" class="btn btn-success" data-bs-toggle="modal" data-bs-target="#addSliderModal">
                        Add Slider
                    </button>
                </div>
            </div>

            <!-- Slider Table -->
            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="table-responsive">
                                <table class="table datatable">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Title</th>
                                            <th>Subtitle</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $__currentLoopData = $sliders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $slider): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <!-- <td><?php echo e($slider->id); ?></td> -->
                                              <td><?php echo e($index + 1); ?></td>
                                            <td><?php echo e($slider->title); ?></td>
                                            <td><?php echo e($slider->subtitle); ?></td>
                                            <td class="text-end">
                                                <!-- Preview -->
                                                <button class="btn btn-sm btn-info" data-bs-toggle="modal" data-bs-target="#previewSlider<?php echo e($slider->id); ?>">Preview</button>
                                                  <?php if(!empty($slider->pdf)): ?>
    <a href="<?php echo e(asset($slider->pdf)); ?>" target="_blank" class="btn btn-icon btn-sm border shadow-sm me-1" title="Download PDF" download>
        <i class="mdi mdi-download fs-14 text-success"></i>
    </a>
<?php endif; ?>

                                                <!-- Edit -->
                                                <button class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#editSlider<?php echo e($slider->id); ?>">Edit</button>
                                                <!-- Delete -->
                                                <button class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#deleteSlider<?php echo e($slider->id); ?>">Delete</button>
                                            </td>
                                        </tr>

                                        <!-- Preview Modal -->
                                        <div class="modal fade" id="previewSlider<?php echo e($slider->id); ?>" tabindex="-1">
                                            <div class="modal-dialog modal-lg">
                                                <div class="modal-content">
                                                    <div class="modal-header">
                                                        <h5 class="modal-title"><?php echo e($slider->title); ?> - Preview</h5>
                                                        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                                                    </div>
                                                    <div class="modal-body text-center">
                                                        <img src="<?php echo e(asset($slider->image)); ?>" alt="<?php echo e($slider->title); ?>" class="img-fluid">
                                                        <p class="mt-2"><?php echo e($slider->description); ?></p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <!-- Edit Modal -->
                                        <div class="modal fade" id="editSlider<?php echo e($slider->id); ?>" tabindex="-1">
                                            <div class="modal-dialog modal-lg">
                                                <div class="modal-content">
                                                    <form action="<?php echo e(route('sliders.update', $slider->id)); ?>" method="POST" enctype="multipart/form-data">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('PUT'); ?>
                                                        <div class="modal-header">
                                                            <h5 class="modal-title">Edit Slider</h5>
                                                            <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                                                        </div>
                                                        <div class="modal-body">
                                                            <div class="mb-3">
                                                                <label>Title</label>
                                                                <input type="text" name="title" class="form-control" value="<?php echo e($slider->title); ?>" required>
                                                            </div>
                                                            <div class="mb-3">
                                                                <label>Subtitle</label>
                                                                <input type="text" name="subtitle" class="form-control" value="<?php echo e($slider->subtitle); ?>">
                                                            </div>
                                                            <div class="mb-3">
                                                                <label>Description</label>
                                                                <textarea name="description" class="form-control"><?php echo e($slider->description); ?></textarea>
                                                            </div>
                                                            <div class="mb-3">
                                                                <label>Image</label>
                                                                <input type="file" name="image" class="form-control">
                                                            </div>

                                                            <!-- PDF Checkbox -->
                                                            <div class="form-check mb-3">
                                                                <input class="form-check-input edit-pdf-checkbox" type="checkbox" id="editIncludePDF<?php echo e($slider->id); ?>">
                                                                <label class="form-check-label" for="editIncludePDF<?php echo e($slider->id); ?>">
                                                                    Include PDF
                                                                </label>
                                                            </div>

                                                            <!-- PDF Input (hidden by default) -->
                                                            <div class="mb-3 edit-pdf-container" id="editPdfContainer<?php echo e($slider->id); ?>" style="display: none;">
                                                                <label>PDF File</label>
                                                                <input type="file" name="pdf" id="editPdfInput<?php echo e($slider->id); ?>" class="form-control" accept=".pdf">
                                                            </div>
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                                                            <button type="submit" class="btn btn-primary">Update Slider</button>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>

                                        <!-- Delete Modal -->
                                        <div class="modal fade" id="deleteSlider<?php echo e($slider->id); ?>" tabindex="-1">
                                            <div class="modal-dialog">
                                                <div class="modal-content">
                                                    <form action="<?php echo e(route('sliders.destroy', $slider->id)); ?>" method="POST">
                                                        <?php echo csrf_field(); ?>
                                                        <?php echo method_field('DELETE'); ?>
                                                        <div class="modal-header">
                                                            <h5 class="modal-title">Delete Slider</h5>
                                                            <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                                                        </div>
                                                        <div class="modal-body">
                                                            Are you sure you want to delete <strong><?php echo e($slider->title); ?></strong>?
                                                        </div>
                                                        <div class="modal-footer">
                                                            <button type="button" class="btn btn-light" data-bs-dismiss="modal">Cancel</button>
                                                            <button type="submit" class="btn btn-danger">Delete</button>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>

                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Add Slider Modal -->
            <div class="modal fade" id="addSliderModal" tabindex="-1">
                <div class="modal-dialog modal-lg">
                    <div class="modal-content">
                        <form action="<?php echo e(route('sliders.store')); ?>" method="POST" enctype="multipart/form-data">
                            <?php echo csrf_field(); ?>
                            <div class="modal-header">
                                <h5 class="modal-title">Add Slider</h5>
                                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                            </div>
                            <div class="modal-body">
                                <div class="mb-3">
                                    <label>Title</label>
                                    <input type="text" name="title" class="form-control" required>
                                </div>
                                <div class="mb-3">
                                    <label>Subtitle</label>
                                    <input type="text" name="subtitle" class="form-control">
                                </div>
                                <div class="mb-3">
                                    <label>Description</label>
                                    <textarea name="description" class="form-control"></textarea>
                                </div>
                                <div class="mb-3">
                                    <label>Image</label>
                                    <input type="file" name="image" class="form-control" required>
                                </div>

                                <!-- PDF Checkbox -->
                                <div class="form-check mb-3">
                                    <input class="form-check-input" type="checkbox" id="includePDFCheckbox">
                                    <label class="form-check-label" for="includePDFCheckbox">
                                        Include PDF
                                    </label>
                                </div>

                                <!-- PDF Input (hidden by default) -->
                                <div class="mb-3" id="pdfInputContainer" style="display: none;">
                                    <label>PDF File</label>
                                    <input type="file" name="pdf" id="pdfInput" class="form-control" accept=".pdf">
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
                                <button type="submit" class="btn btn-primary">Add Slider</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<!-- JavaScript to toggle PDF input -->
<script>
    // Add Slider Modal
    const addCheckbox = document.getElementById('includePDFCheckbox');
    const addPdfContainer = document.getElementById('pdfInputContainer');
    const addPdfInput = document.getElementById('pdfInput');

    addCheckbox.addEventListener('change', function() {
        if (this.checked) {
            addPdfContainer.style.display = 'block';
            addPdfInput.required = true;
        } else {
            addPdfContainer.style.display = 'none';
            addPdfInput.required = false;
        }
    });

    // Edit Slider Modals
    document.querySelectorAll('.edit-pdf-checkbox').forEach(function(checkbox) {
        checkbox.addEventListener('change', function() {
            const sliderId = this.id.replace('editIncludePDF', '');
            const container = document.getElementById('editPdfContainer' + sliderId);
            const input = document.getElementById('editPdfInput' + sliderId);

            if (this.checked) {
                container.style.display = 'block';
                input.required = true;
            } else {
                container.style.display = 'none';
                input.required = false;
            }
        });
    });
</script>


        <!-- ============================================================== -->
        <!-- End Page content -->
        <!-- ============================================================== -->

    </div>
    <!-- END wrapper -->

    <!-- Vendor -->
    <script src="assets/libs/jquery/jquery.min.js"></script>
    <script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="assets/libs/iconify-icon/iconify-icon.min.js"></script>
    <script src="assets/libs/simplebar/simplebar.min.js"></script>
    <script src="assets/libs/node-waves/waves.min.js"></script>
    <script src="assets/libs/waypoints/lib/jquery.waypoints.min.js"></script>
    <script src="assets/libs/jquery.counterup/jquery.counterup.min.js"></script>
    <script src="assets/libs/feather-icons/feather.min.js"></script>

    <!-- Simple Datatables JS -->
    <script src="assets/libs/simple-datatables/umd/simple-datatables.js"></script>

    <!-- Simple Datatables Init JS -->
    <script src="assets/js/pages/simple-datatables.init.js"></script>

    <!-- App js-->
    <script src="assets/js/app.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
    <script>
    <?php if(session('success')): ?>
    Swal.fire({
        icon: 'success',
        title: 'Success!',
        text: '<?php echo e(session('
        success ')); ?>',
        timer: 3000,
        showConfirmButton: false
    });
    <?php endif; ?>

    <?php if(session('error')): ?>
    Swal.fire({
        icon: 'error',
        title: 'Oops!',
        text: '<?php echo e(session('
        error ')); ?>',
        timer: 4000,
        showConfirmButton: true
    });
    <?php endif; ?>
    </script>


</body>

</html><?php /**PATH C:\xampp\htdocs\ncu-laravel\resources\views/admin/sliders.blade.php ENDPATH**/ ?>