<?= $this->extend('frontend/layout/main'); ?>

<?= $this->section('css') ?>
<link href="<?= base_url() ?>assets/frontend/css/style.css" rel="stylesheet">
<?= $this->endSection(); ?>
<?= $this->section('title') ?>Sign Out<?= $this->endSection(); ?>
<?= $this->section('content') ?>



<!-- Page Title -->
<div class="page-title light-background" data-aos="fade">
    <div class="heading">
        <div class="container">
            <div class="row d-flex justify-content-center text-center">
                <div class="col-lg-8">
                    <h1>Thank You</h1>
                    <p class="mb-0">
                        We hope you enjoyed our services. Search your name below to sign out.
                    </p>
                </div>
            </div>
        </div>
    </div>
    <nav class="breadcrumbs">
        <div class="container">
            <ol>
                <li><a href="<?= url_to('home') ?>">Home</a></li>
                <li class="current">Sign Out</li>
            </ol>
        </div>
    </nav>
</div><!-- End Page Title -->

<section id="contact" class="contact section">

    <div class="container" data-aos="fade-up" data-aos-delay="100">
        <?= view_cell('AlertCell') ?>

        <div class="row gy-4">

            <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                <div class="form-group">
                    <?= form_label('Your Last Name <span class="text-danger">*</span>', 'last_name') ?>
                    <?= form_input([
                        'name' => 'last_name',
                        'id' => 'last_name',
                        'class' => 'form-control form-control-lg',
                        'placeholder' => 'Enter your last name',
                        'required' => true,
                        'autocomplete' => 'off',
                    ], set_value('last_name', '')) ?>

                </div>
                <div id="display"></div>
            </div>
        </div>

    </div>

    </div>

</section><!-- /Contact Section -->
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script>
    $(document).ready(function() {
        $('#last_name').keyup(function() {
            var name = $('#last_name').val();
            if (name == "") {
                $('#display').html("");
            } else {
                if (name.length >= 4) {
                    $.ajax({
                        type: "POST",
                        url: "<?= url_to('search_last_name') ?>",
                        data: {
                            last_name: name
                        },
                        success: function(html) {
                            $('#display').html(html).show();
                        }
                    });
                }
            }
        });
    });
</script>
<?= $this->endSection(); ?>