    <?= $this->extend('layout/landing') ?>

    <?= $this->section('title') ?>
    <title>DASHBOARD &mdash; KUA WAY BUNGUR</title>
    <?= $this->endSection() ?>

    <?= $this->section('css') ?>
    <?= $this->endSection() ?>

    <?= $this->section('content') ?>
    <!--corosal-->
    <div id="carouselExampleIndicators2" class="carousel slide" data-ride="carousel" data-interval="4000">
        <ol class="carousel-indicators">
            <?php foreach ($carosal as $key => $carosal1) : ?>
            <li data-target="#carouselExampleIndicators2" data-slide-to="<?= $key ?>"
                <?= $key == 0 ? 'class="active"' : '' ?>></li>
            <?php endforeach; ?>
        </ol>
        <div class="carousel-inner">
            <?php foreach ($carosal as $key => $carosalku) : ?>
            <div class="carousel-item <?= $key == 0 ? 'active' : '' ?>">
                <img style="object-fit: cover;height: auto;" class="d-block w-100"
                    src="<?= base_url() ?>foto_berita/<?= $carosalku->gambar ?>" loading="lazy"
                    alt="<?= $carosalku->judul ?>" />
                <div class="carousel-caption d-none d-md-block">
                    <h5 style="color: #000000;text-shadow: 1px 1px 1px #ffffff;text-transform: uppercase;font-weight: bold;"
                        class="text-black">
                        <?= $carosalku->judul ?></h5>

                </div>
            </div>
            <?php endforeach; ?>
        </div>
        <a class="carousel-control-prev" href="#carouselExampleIndicators2" role="button" data-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="carousel-control-next" href="#carouselExampleIndicators2" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>

    <!--corosal-->
    <!-- tulisan berjalan -->
    <div style="
          background-color: #ffffff;
          padding: 15px 0;
          color: #000000;
          opacity: 1;
        ">
        <div class="">
            <marquee style="font-size: 20px; opacity: 2">
                Selamat Datang di Website Resmi Kantor Urusan Agama Kecamatan
                Way Bungur | Jl. Bismo, Tambah Subur, Kec. Way Bungur, Kabupaten Lampung Timur, Lampung 34373 | Email : <?= $kontakData->email ?>
            </marquee>
        </div>
    </div>
    <!-- tulisan berjalan -->
    <!-- About US Start -->
    <div class="about-area2 gray-bg pt-30 pb-30">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="whats-news-wrapper">
                        <!-- Heading & Nav Button -->
                        <div class="row justify-content-between align-items-center mb-15">
                            <div class="col-xl-8">
                                <div class="section-tittle mb-30">
                                    <h3>Kantor Urusan Agama</h3>
                                    <h3>Kecamatan Way Bungur</h3>
                                    <p>
                                        <?= substr($profileData->sejarah, 0, 500) ?>
                                    </p>
                                </div>
                            </div>
                            <div class="col-xl-4 col-md-4">
                                <div class="card border border-0">
                                    <div class="card-body">
                                        <img class="img-fluid" src="<?= base_url() ?>assets_user/img/logo/logo.png"
                                            alt="" loading="lazy" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- berita terbaru Start -->
    <section class="whats-news-area pt-50 pb-20 gray-bg">
        <div class="container">
            <div class="row">
                <div class="col-lg-8">
                    <div class="whats-news-wrapper">
                        <!-- Heading & Nav Button -->
                        <div class="row justify-content-between align-items-end mb-15">
                            <div class="col-xl-12">
                                <div class="section-tittle mb-30">
                                    <h3>Berita Terbaru</h3>
                                </div>
                            </div>
                        </div>
                        <!-- Tab content -->
                        <div class="row">
                            <div class="col-12">
                                <!-- Nav Card -->
                                <div class="tab-content" id="nav-tabContent">
                                    <!-- card one -->
                                    <div class="tab-pane fade show active" id="nav-home" role="tabpanel"
                                        aria-labelledby="nav-home-tab">
                                        <div class="row">
                                            <!-- Left Details Caption -->
                                            <div class="col-xl-12 col-lg-12">
                                                <div class="whats-news-single mb-40 mb-40">
                                                    <div class="whates-img">
                                                        <img style="object-fit: cover;"
                                                            src="<?= base_url() ?>foto_berita/<?= $beritaBaru->gambar ?>"
                                                            alt="" loading="lazy" />
                                                    </div>
                                                    <div class="whates-caption">
                                                        <h4>
                                                            <a
                                                                href="<?= base_url('news/view/' . $beritaBaru->id_berita) ?>"><?= $beritaBaru->judul ?></a>
                                                        </h4>
                                                        <span>by <?php
                                                                    $Name = '';
                                                                    foreach ($user as $userdata) {
                                                                        if ($userdata->id_admin == $beritaBaru->id_admin) {
                                                                            $Name = $userdata->nama_admin;
                                                                            break;
                                                                        }
                                                                    }
                                                                    echo $Name;
                                                                    ?> -
                                                            <?= date('d-m-Y', strtotime($beritaBaru->tanggal)) ?>
                                                        </span>
                                                        <p>
                                                            <?= substr($beritaBaru->isi, 0, 500) ?>
                                                        </p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- End Nav Card -->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-4">
                <!-- Most Recent Area -->
                <div class="most-recent-area">
                    <!-- Section Tittle -->
                    <div class="small-tittle mb-20">
                        <h4>Berita Lain</h4>
                    </div>
                    <?php foreach ($beritaLain as $beritaLain) : ?>
                    <!-- Single -->
                    <div class="most-recent-single">
                        <div class="most-recent-images">
                            <img style="height: 79px;width:85px;"
                                src="<?= base_url() ?>foto_berita/<?= $beritaLain->gambar ?>" alt="" loading="lazy" />
                        </div>
                        <div class="most-recent-capt">
                            <h4>
                                <a
                                    href="<?= base_url('news/view/' . $beritaLain->id_berita) ?>"><?= $beritaLain->judul ?></a>
                            </h4>
                            <p><?php
                                    $Name = '';
                                    foreach ($user as $userdata) {
                                        if ($userdata->id_admin == $beritaLain->id_admin) {
                                            $Name = $userdata->nama_admin;
                                            break;
                                        }
                                    }
                                    echo $Name;
                                    ?> |
                                <?= date('d-m-Y', strtotime($beritaLain->tanggal)) ?></p>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </div>
        </div>
    </section>
    <!-- berita terbaru End -->
    <!-- berita kategori -->
    <section class="whats-news-area pt-50 pb-20 gray-bg">
        <div class="container">
            <div class="row">
                <div class="col-lg-4">
                    <!-- Most Recent Area -->
                    <div class="most-recent-area">
                        <!-- Section Tittle -->
                        <div class="small-tittle mb-20">
                            <h4>Berita Umum</h4>
                        </div>

                        <?php foreach ($beritaUmum as $beritaUmum) : ?>
                        <!-- Single -->
                        <div class="most-recent-single">
                            <div class="most-recent-images">
                                <img style="height: 79px;width:85px;"
                                    src="<?= base_url() ?>foto_berita/<?= $beritaUmum->gambar ?>" alt=""
                                    loading="lazy" />
                            </div>
                            <div class="most-recent-capt">
                                <h4>
                                    <a
                                        href="<?= base_url('news/view/' . $beritaUmum->id_berita) ?>"><?= $beritaUmum->judul ?></a>
                                </h4>
                                <p><?php
                                        $Name = '';
                                        foreach ($user as $userdata) {
                                            if ($userdata->id_admin == $beritaUmum->id_admin) {
                                                $Name = $userdata->nama_admin;
                                                break;
                                            }
                                        }
                                        echo $Name;
                                        ?> |
                                    <?= date('d-m-Y', strtotime($beritaUmum->tanggal)) ?></p>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
                <div class="col-lg-4">
                    <!-- Most Recent Area -->
                    <div class="most-recent-area">
                        <!-- Section Tittle -->
                        <div class="small-tittle mb-20">
                            <h4>Berita Daerah</h4>
                        </div>

                        <?php foreach ($beritaDaerah as $beritaDaerah) : ?>
                        <!-- Single -->
                        <div class="most-recent-single">
                            <div class="most-recent-images">
                                <img style="height: 79px;width:85px;"
                                    src="<?= base_url() ?>foto_berita/<?= $beritaDaerah->gambar ?>" alt=""
                                    loading="lazy" />
                            </div>
                            <div class="most-recent-capt">
                                <h4>
                                    <a
                                        href="<?= base_url('news/view/' . $beritaDaerah->id_berita) ?>"><?= $beritaDaerah->judul ?></a>
                                </h4>
                                <p><?php
                                        $Name = '';
                                        foreach ($user as $userdata) {
                                            if ($userdata->id_admin == $beritaDaerah->id_admin) {
                                                $Name = $userdata->nama_admin;
                                                break;
                                            }
                                        }
                                        echo $Name;
                                        ?> |
                                    <?= date('d-m-Y', strtotime($beritaDaerah->tanggal)) ?></p>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
                <div class="col-lg-4">
                    <!-- Most Recent Area -->
                    <div class="most-recent-area">
                        <!-- Section Tittle -->
                        <div class="small-tittle mb-20">
                            <h4>Berita Lokal</h4>
                        </div>

                        <?php foreach ($beritaLokal as $beritaLokal) : ?>
                        <!-- Single -->
                        <div class="most-recent-single">
                            <div class="most-recent-images">
                                <img style="height: 79px;width:85px;"
                                    src="<?= base_url() ?>foto_berita/<?= $beritaLokal->gambar ?>" alt=""
                                    loading="lazy" />
                            </div>
                            <div class="most-recent-capt">
                                <h4>
                                    <a
                                        href="<?= base_url('news/view/' . $beritaLokal->id_berita) ?>"><?= $beritaLokal->judul ?></a>
                                </h4>
                                <p><?php
                                        $Name = '';
                                        foreach ($user as $userdata) {
                                            if ($userdata->id_admin == $beritaLokal->id_admin) {
                                                $Name = $userdata->nama_admin;
                                                break;
                                            }
                                        }
                                        echo $Name;
                                        ?> |
                                    <?= date('d-m-Y', strtotime($beritaLokal->tanggal)) ?></p>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- berita kategori End -->
    <!-- agenda terbaru Start -->
    <section class="whats-news-area pt-50 pb-20 gray-bg">
        <div class="container">
            <div class="row">
                <div class="col-lg-8">
                    <div class="whats-news-wrapper">
                        <!-- Heading & Nav Button -->
                        <div class="row justify-content-between align-items-end mb-15">
                            <div class="col-xl-12">
                                <div class="section-tittle mb-30">
                                    <h3>Agenda Terbaru</h3>
                                </div>
                            </div>
                        </div>
                        <!-- Tab content -->
                        <div class="row">
                            <div class="col-12">
                                <!-- Nav Card -->
                                <div class="tab-content" id="nav-tabContent">
                                    <!-- card one -->
                                    <div class="tab-pane fade show active" id="nav-home" role="tabpanel"
                                        aria-labelledby="nav-home-tab">
                                        <div class="row">
                                            <!-- Left Details Caption -->

                                            <div class="col-xl-12 col-lg-12">
                                                <div class="whats-news-single mb-40 mb-40">
                                                    <div class="whates-img">
                                                        <img src="<?= base_url() ?>foto_agenda/<?= $agendaBaru->gambar ?>"
                                                            alt="" loading="lazy" />
                                                    </div>
                                                    <div class="whates-caption">
                                                        <h4>
                                                            <a
                                                                href="<?= base_url('schedule/view/' . $agendaBaru->id_agenda) ?>"><?= $agendaBaru->tema ?></a>
                                                        </h4>
                                                        <span>by <?php
                                                                    $Name = '';
                                                                    foreach ($user as $userdata) {
                                                                        if ($userdata->id_admin == $agendaBaru->id_admin) {
                                                                            $Name = $userdata->nama_admin;
                                                                            break;
                                                                        }
                                                                    }
                                                                    echo $Name;
                                                                    ?> -
                                                            <?= date('d-m-Y', strtotime($agendaBaru->tanggal)) ?> -
                                                            <?= date('h:m', strtotime($agendaBaru->waktu)) ?>
                                                        </span>
                                                        <p>
                                                            <?= substr($agendaBaru->isi, 0, 500) ?>
                                                        </p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- End Nav Card -->
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <!-- Most Recent Area -->
                    <div class="most-recent-area">
                        <!-- Section Tittle -->
                        <div class="small-tittle mb-20">
                            <h4>Agenda Lain</h4>
                        </div>
                        <?php foreach ($agendaLain as $key => $agendaLain) : ?>
                        <!-- Single -->
                        <div class="most-recent-single">
                            <div class="most-recent-images">
                                <img src="<?= base_url() ?>foto_agenda/<?= $agendaLain->gambar ?>"
                                    style="height: 79px;width:85px;" loading="lazy" class="img-fluid" alt="" />
                            </div>
                            <div class="most-recent-capt">
                                <h4>
                                    <a
                                        href="<?= base_url('schedule/view/' . $agendaLain->id_agenda) ?>"><?= $agendaLain->tema ?></a>
                                </h4>
                                <p><?php
                                        $Name = '';
                                        foreach ($user as $userdata) {
                                            if ($userdata->id_admin == $agendaLain->id_admin) {
                                                $Name = $userdata->nama_admin;
                                                break;
                                            }
                                        }
                                        echo $Name;
                                        ?> | <?= date('d-m-Y', strtotime($agendaLain->tanggal)) ?> |
                                    <?= date('h:i', strtotime($agendaLain->waktu)) ?></p>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- agenda terbaru End -->
    <!--   galeri start -->
    <div class="weekly2-news-area pt-50 pb-30 gray-bg">
        <div class="container">

            <div class="weekly2-wrapper">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="slider-wrapper">
                            <!-- section Tittle -->
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="small-tittle mb-30">
                                        <h4>Galeri</h4>
                                    </div>
                                </div>
                            </div>
                            <!-- Slider -->

                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="weekly2-news-active d-flex">

                                        <!-- Single -->
                                        <?php foreach ($gallery as $key => $gallery) : ?>
                                        <a href="<?= base_url('galeri') ?>">
                                            <div class="weekly2-single">
                                                <div class="weekly2-img">
                                                    <img src="<?= base_url() ?>foto_gallery/<?= $gallery->gambar ?>"
                                                        style="width: 100%;height: 250px;" class="img-fluid "
                                                        loading="lazy" alt="" />
                                                </div>
                                                <div style="font-size: 15px;" class="text-center text-uppercase">
                                                    <b>
                                                        <?= $gallery->judul ?>
                                                    </b>
                                                </div>
                                            </div>
                                        </a>
                                        <?php endforeach; ?>

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

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

        </div>
    </div>

    <!-- galeri-News -->

    <?= $this->endSection() ?>

    <?= $this->section('js') ?>
    <?= $this->endSection() ?>