<?php $__env->startPush('title', get_phrase('Contact')); ?>
<?php $__env->startPush('meta'); ?><?php $__env->stopPush(); ?>
<?php $__env->startPush('css'); ?><?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
    <!-- Mani section header and breadcrumb -->
    <div class="ol-card radius-8px print-d-none">
        <div class="ol-card-body my-3 py-4 px-20px">
            <div class="d-flex align-items-center justify-content-between gap-3 flex-wrap flex-md-nowrap">
                <h4 class="title fs-16px">
                    <i class="fi-rr-settings-sliders me-2"></i>
                    <span><?php echo e(get_phrase('Contacts')); ?></span>
                </h4>
            </div>
        </div>
    </div>


    <div class="row">
        <div class="col-12">
            <div class="ol-card">
                <div class="ol-card-body p-3">

                    <div class="row print-d-none mb-3 mt-3 row-gap-3">
                        <div class="col-md-6 pt-2 pt-md-0">
                            <div class="custom-dropdown">
                                <button class="dropdown-header btn ol-btn-light">
                                    <?php echo e(get_phrase('Export')); ?>

                                    <i class="fi-rr-file-export ms-2"></i>
                                </button>
                                <ul class="dropdown-list">
                                    <li>
                                        <a class="dropdown-item" href="#" onclick="downloadPDF('.print-table', 'contacts')"><i class="fi-rr-file-pdf"></i> <?php echo e(get_phrase('PDF')); ?></a>
                                    </li>
                                    <li>
                                        <a class="dropdown-item" href="#" onclick="window.print();"><i class="fi-rr-print"></i> <?php echo e(get_phrase('Print')); ?></a>
                                    </li>
                                </ul>
                            </div>
                        </div>

                        <div class="col-md-6">
                            <form action="<?php echo e(route('admin.contacts')); ?>" method="get">
                                <div class="row row-gap-3">
                                    <div class="col-md-9">
                                        <div class="search-input">
                                            <input type="text" name="search" value="<?php echo e(request('search')); ?>"
                                                placeholder="<?php echo e(get_phrase('Search Contact')); ?>" class="ol-form-control form-control" />

                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <button type="submit" class="btn ol-btn-primary w-100" id="submit-button"><?php echo e(get_phrase('Search')); ?></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>

                    <?php if(count($contacts) > 0): ?>
                        <div
                            class="admin-tInfo-pagi d-flex justify-content-between justify-content-center align-items-center flex-wrap gr-15">
                            <p class="admin-tInfo">
                                <?php echo e(get_phrase('Showing') . ' ' . count($contacts) . ' ' . get_phrase('of') . ' ' . $contacts->total() . ' ' . get_phrase('data')); ?>

                            </p>
                        </div>
                        <div class="table-responsive course_list" id="course_list">
                            <table class="table eTable eTable-2 print-table">
                                <thead>
                                    <tr>
                                        <th scope="col">#</th>
                                        <th scope="col"><?php echo e(get_phrase('Name')); ?></th>
                                        <th scope="col"><?php echo e(get_phrase('Contact')); ?></th>
                                        <th scope="col"><?php echo e(get_phrase('Message')); ?></th>
                                        <th class="print-d-none" scope="col"><?php echo e(get_phrase('Options')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php $__currentLoopData = $contacts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $contact): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <th scope="row">
                                                <p class="row-number"><?php echo e($key + 1); ?></p>
                                            </th>
                                            <td>
                                                <div class="dAdmin_profile d-flex align-items-center min-w-200px">
                                                    <div class="dAdmin_profile_name">
                                                        <h4 class="title fs-14px"><?php echo e($contact->name); ?></h4>
                                                        <p>
                                                            <?php if(!check_registered($contact->email)): ?>
                                                                <span class="badge bg-danger"><?php echo e(get_phrase('Not registered')); ?></span>
                                                            <?php else: ?>
                                                                <span class="badge bg-success"><?php echo e(get_phrase('Registered')); ?></span>
                                                            <?php endif; ?>
                                                        </p>
                                                    </div>
                                                </div>
                                            </td>
                                            <td>
                                                <div class="dAdmin_profile d-flex align-items-center min-w-200px">
                                                    <div class="dAdmin_profile_name">
                                                        <p class="sub-title2 text-12px">
                                                            <?php echo e(get_phrase('Email')); ?>:
                                                            <?php echo e($contact->email); ?></p>
                                                        <p class="sub-title2 text-12px">
                                                            <?php echo e(get_phrase('Phone')); ?>:
                                                            <?php echo e($contact->phone); ?></p>
                                                        <p class="sub-title2 text-12px">
                                                            <?php echo e(get_phrase('Address')); ?>:
                                                            <?php echo e($contact->address); ?></p>
                                                    </div>
                                                </div>
                                            </td>

                                            <td>
                                                <p class="sub-title text-12px"><?php echo e($contact->message); ?></p>
                                            </td>

                                            <td class="print-d-none">
                                                <div class="dropdown ol-icon-dropdown ol-icon-dropdown-transparent">
                                                    <button class="btn ol-btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
                                                        <span class="fi-rr-menu-dots-vertical"></span>
                                                    </button>
                                                    <ul class="dropdown-menu" >
                                                        <li>
                                                            <a class="dropdown-item"
                                                                onclick="ajaxModal('<?php echo e(route('modal', ['admin.contact.reply', 'user_id' => $contact->id])); ?>', '<?php echo e(get_phrase('Message Reply')); ?>')"><?php echo e(get_phrase('Reply')); ?></a>
                                                        </li>
                                                        <li>
                                                            <a class="dropdown-item"
                                                                onclick="confirmModal('<?php echo e(route('admin.contact.delete', $contact->id)); ?>')"
                                                                href="javascript:void(0)"><?php echo e(get_phrase('Delete')); ?></a>
                                                        </li>
                                                    </ul>
                                                </div>
                                            </td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    <?php else: ?>
                        <?php echo $__env->make('admin.no_data', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                    <?php endif; ?>
                    <!-- Data info and Pagination -->
                    <?php if(count($contacts) > 0): ?>
                        <div
                            class="admin-tInfo-pagi d-flex justify-content-between justify-content-center align-items-center flex-wrap gr-15">
                            <p class="admin-tInfo">
                                <?php echo e(get_phrase('Showing') . ' ' . count($contacts) . ' ' . get_phrase('of') . ' ' . $contacts->total() . ' ' . get_phrase('data')); ?>

                            </p>
                            <?php echo e($contacts->links()); ?>

                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('js'); ?><?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/payraty/lms_main/resources/views/admin/contact/index.blade.php ENDPATH**/ ?>