<body class="wrap-all-content">

    <!-- <div class="se-pre-con"></div> -->

    <!-- Main -->

    <main role="main" class="container with-navbar" style="padding:0px 0px 0px 0px; max-width: 480px !important;">

        <!-- Content -->

        <!-- Set up your HTML -->

<div class="container-fluid mb-1 card-head">

    <div class="row" style=" border-top:0px solid #f7f7f7;">

        <div class="col-md-12" style="margin-top:30px;padding-right: 0px;padding-left: 0px;">

            <div class="box-seacrh">

                <div class="logo">

                    <img class="img-fluid img-responsive" src="assets/home/img/home/<?php echo $profil['logo_depan']; ?>"

                        style="width:80%;" alt="icon-bb">

                    <!-- </div> -->

                </div>

                <div class="search" style="padding-left:8px;">

                    <div class="text-center">

                        <a href="search" style="margin-bottom:0;" class="mysearch onc-gtm">

                            <div class="input-group">

                                <input name="q" autocomplete="off" id="keyword" type="text"

                                    style="background-color:#F2F2F2;"

                                    class="form-control border-left SearchHomeInput mysearch" value=""

                                    placeholder="Cari yang ingin kamu bantu" aria-label="Cari yang ingin kamu bantu"

                                    aria-describedby="button-addon2" onfocus="blur();">

                                <div class="input-group-append mysearch">

                                    <span class="btn btn-outline-secondary border-right " style="border: none;

                                        border: none;

                                        background-color:#f5f5f5;" id="button-addon2"><i

                                            class="fas fa-search"></i></span>

                                </div>

                            </div>

                            <p class="paragraphbox paragraphbox-jarakspace" style="display: none;">Search Home</p>

                        </a>

                    </div>

                </div>

            </div>

        </div>

    </div>

    <br>



    <!-- Slider main container -->

    <div class="row">

        <div class="swiper-container">

            <div class="swiper-wrapper">

                <?php foreach($galang as $gal): ?>

                <div class="swiper-slide">

                    <a href="donasi/<?php echo $gal['gd_url']; ?>" class="banner-list" bb-title="<?php echo $gal['gd_judul']; ?>"

                        bb-list="Home">

                        <img width="100%" style="border-radius: 8px;" loading="eager"

                        onError="this.onerror=null;this.src='assets/home/img/<?php echo $gal['gd_foto']; ?>';"

                            src="assets/home/img/<?php echo $gal['gd_foto']; ?>" alt="<?php echo $gal['gd_judul']; ?>">

                    </a>

                </div>

                <?php endforeach; ?>

            </div>

            <!-- Add Pagination -->

            <div class="swiper-pagination"></div>

            <!-- Add Arrows -->

            <!-- <div class="swiper-button-next"></div>

            <div class="swiper-button-prev"></div> -->

        </div>

    </div>



    

</div>

<br>

<!-- Pilihan Kategori Benihbaik -->
<div class="container card-head" style="border-top:10px solid #f7f7f7; margin-top:10px;padding-bottom:10px;">
    <div class="row" style="padding-top:20px; padding-bottom:15px;">
        <div class="col-md-12 nomargin">
            <div class="float-left">
                <p class="font_benihbaik_judul" style="font-family: montserrat-bold !important;">
                    <b>Pilihan Kategori <?php echo $profil['nama']; ?></b>
                </p>
            </div>
            <div class="float-right">
                <!-- <a href="/campaign/explore"><p style="color:#41B548"><b>Lihat lainnya</b></p></a> -->
            </div>

        </div>
    </div>

    <div class="text-center" style="padding-bottom:20px;">
        <div class="row">
            <?php foreach($kategori as $kat): ?>
            <div class="col-1-4 p-1">
                <a href="#" class="kategori-link" data-kategori-id="<?php echo $kat['kacam_id']; ?>"> <!-- Tambahkan data-kategori-id -->
                    <div class="item-category">
                        <img link="<?php echo $kat['kacam_id']; ?>" loading="lazy" class="img-fluid img-responsive mb-2 img-category unv-gtm" data-name="Pilihan Kategori Kagum Foundationeee" data-action="<?php echo $kat['kacam_nama'] ?>" data-label="kategori-campaign/<?php echo $kat['kacam_url']; ?>" src="assets/home/categories/<?php echo $kat['kacam_icon'] ?>" style="width:60%;" alt="<?php echo $kat['kacam_nama'] ?>">
                        <span class="text-center card-title font_benihbaik_judul text_bb_kategori" style="color:#828282;font-family: montserrat-regular !important;"><br><?php echo $kat['kacam_nama'] ?></span>
                    </div>
                </a>
            </div>
            <?php endforeach; ?>

            <div class="col-1-4 p-1">
                <a href="kategori-campaign">
                    <img class="img-fluid img-responsive mb-2 img-category unv-gtm" loading="lazy" data-name="Pilihan Kategori <?php echo $profil['nama']; ?>" data-action="Lainnya" data-label="kategori-campaign" src="assets/home/img/home/Lihat-Semua.png" style="width:60%;" alt="icon-lainnya">
                    <span class="text-center card-title font_benihbaik_judul text_bb_kategori" style="color:#828282;font-family: montserrat-regular !important;"><br>Lainnya</span>
                </a>
            </div>
        </div>
    </div>



</div>


<!-- Campaign Pilihan Hari ini -->

<div id="result" class="container card-head bb-impact" style="border-top:10px solid #f7f7f7; margin-top:10px;">

    <div class="row" style="padding-top:20px; padding-bottom:15px;">

        <div class="col-md-12 nomargin">

            <div class="float-left">

                <p class="font_benihbaik_judul" style="font-family: montserrat-bold !important;">

                    <b>Campaign Pilihan Kami</b>

                </p>

            </div>

            <div class="float-right">

                <!-- <a href="/campaign/explore"><p style="color:#41B548"><b>Lihat lainnya</b></p></a> -->

            </div>

        </div>



        <div class="box-slider pilihan_bb" id="BenihBaikPilihan">

            <?php foreach($galang as $gal): ?>

                <?php 

$terkumpul = 0;



$this->db->select('donasi_gdid, SUM(donasi_jml) as terkumpul');

$this->db->where('donasi_status', 2);

$this->db->where('donasi_gdid', $gal['gd_id']);

$query = $this->db->get('tb_donasi');



if ($query->row()->terkumpul > 0) {

    $terkumpul = $query->row()->terkumpul;

}

 ?>

                <?php if($terkumpul == 0) { ?>

                <?php }else { ?>

                <?php $progres = $gal['gd_dana'] / $terkumpul; ?>

                <?php $progres1 = 100 / $progres; ?>

                <?php } ?>

            <a href="donasi/<?php echo $gal['gd_url']; ?>" class="campaign-list" bb-title="<?php echo $gal['gd_judul']; ?>"

                bb-list="Home" bb-author="<?php echo $profil['nama']; ?>" bb-type="Pilihan Benihbaik">

                <div class="card mb-1 pilihan-card" style="border-radius: 8px;">

                    <div class="card-header-camp-pilihan p-0">

                        <img loading="lazy" class="card-img-top" style="object-fit: cover;height: 100%;"

                            src="../fastcdn.benihbaik.com/campaign/thumbnail/Benihbaik_2023-09-29_1695979656651698888818e.jpg"

                            onError="this.onerror=null;this.src='assets/home/img/<?php echo $gal['gd_foto']; ?>';"

                            alt="<?php echo $gal['gd_judul']; ?>">

                    </div>



                    <div class="card-body" style="padding: 10px 10px 0px 10px;">

                        <h6 class="card-title font_benihbaik_judul title-rowcut"

                            style="font-family:montserrat-bold;margin-bottom:15px;min-height: 2.4em; font-size:14px !important;line-height: 150%;" data-toggle="tooltip" data-placement="bottom" title="<?php echo $gal['gd_judul']; ?>">

                            <b><?php echo $gal['gd_judul']; ?></b></h6>

                        <p class="user title-rowcut" style="font-size:13px;color:#828282; height: 2.8em;">

                            <?php echo $profil['nama']; ?> <img class="img-fluid img-responsive"

                                style="width:5%;margin-left: 8px; margin-top: 2px;"

                                src="assets/home/img/home/ceklis.svg" alt="ceklis"> </p>



                        <div class="progress" style="margin-bottom:5px; height:5px;">

                            <?php if($terkumpul == 0) { ?>
                            <div class="progress-bar" style="width:0%;"></div>
                            <?php }else { ?>
                            <div class="progress-bar" style="width:<?php echo round($progres1); ?>%;"></div>
                            <?php } ?>

                        </div>

                        <div class="row" style="margin-bottom:15px;padding-right: 1em;padding-left: 1em;">

                            <div class="col-md-12 nomargin">

                                <div class="float-left">

                                    <p class="card-text mt-1"

                                        style="color:#23B570;font-size: 12px;font-family:montserrat-bold;">

                                        <b>Rp <?php echo number_format($gal['gd_dana'],0,',','.'); ?></b>

                                    </p>

                                </div>

<?php 

$batas_galang_dana_date = new DateTime($gal['gd_tgl_selesai']);

$tanggal_sekarang = new DateTime();

$interval = $tanggal_sekarang->diff($batas_galang_dana_date);

$jumlah_hari = $interval->days;

 ?>

                                <div class="float-right">

                                    <p class="card-text mt-1"

                                        style="color:#626262;font-size: 12px;font-family:montserrat-regular;">

                                        <b>

                                            <?php if($batas_galang_dana_date < $tanggal_sekarang) { ?>

                                                Selesai

                                            <?php }else { ?>

                                                <?php echo $jumlah_hari; ?> hari lagi

                                            <?php } ?>

                                        </b>

                                    </p>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </a>

        <?php endforeach; ?>

                        <a href="donasi">

                <div class="pilihan-card lihat-semua">

                    <div class="box-button">

                        <div class="box-icon"><i class="fas fa-angle-right"></i></div>

                        <span class="text-lihat-semua">Lihat Semua</span>

                    </div>

                </div>

            </a>

        </div>

    </div>

</div>

</div>

</div>

<div class="container card-head" style="border-top:10px solid #f7f7f7; margin-top:10px;">
    <div class="row" style="padding-top:20px; padding-bottom:15px;">
        <div class="col-md-12 nomargin">
            <div class="float-left">
                <p class="font_benihbaik_judul" style="font-family: montserrat-bold !important;">
                    <b>Artikel & Kegiatan Kami</b>
                </p>
            </div>
            <div class="float-right">
                <!-- <a href="/campaign/explore"><p style="color:#41B548"><b>Lihat lainnya</b></p></a> -->
            </div>
        </div>

        <div class="Cerita-Mereka box-slider" id="NewsBenihBaik" style="padding-bottom: 20px;">
                        <?php foreach($bloglist as $bl): ?>
                        <a href="blog/<?php echo $bl['post_url']; ?>" class="ceritaMereka-list"
                bb-title="<?php echo $bl['post_judul']; ?>" bb-list="Home" bb-author="Super Admin" bb-type="Blog">
                <div class="card mb-1" style="border-radius: 8px;height: 330px;width: 310px;">
                    <img loading="lazy" class="card-img-top" src="assets/home/img/<?php echo $bl['post_foto']; ?>" alt="<?php echo $bl['post_judul']; ?>"
                    onError="this.onerror=null;this.src='assets/home/img/<?php echo $bl['post_foto']; ?>';"
                        style="height: 141px;">

                    <div class="card-body" style="padding: 10px 10px 0px 10px;">
                        <h4 class="card-title title-rowcut"
                            style="margin-top:0px;margin-bottom:8px;font-size:13px;color: #00b34a;font-family: montserrat-bold !important;">
                            <b><?php echo $bl['kat_nama']; ?></b></h4>
                        <h6 class="title-rowcut"
                            style="min-height: 2.4em; font-size:14px !important;font-family: montserrat-bold !important;line-height: 150%;color: #212529 !important;" data-toggle="tooltip" data-placement="bottom" title="<?php echo $bl['post_judul']; ?>">
                            <b><?php echo $bl['post_judul']; ?></b></h6>


                        <div class="row" style="margin-bottom:10px;padding-right: 1em;padding-left: 1em;">
                            <div class="col-md-12 nomargin">
                                <p class="card-text mt-1 title-rowcut-dec-news"
                                    style="font-size: 12px;color:#BDBDBD;font-family: montserrat-regular !important;">
                                    <?php echo word_limiter($bl['post_isi'], 7); ?>
                                </p>
                            </div>
                        </div>
                        <h6 class="card-title title-rowcut float-right"
                            style="margin-bottom:15px;font-size:12px !important;color: #00b34a;padding-right:5px;font-family: montserrat-regular !important;">
                            Read More</h6>
                    </div>
                </div>
            </a>
        <?php endforeach; ?>
                    </div>

    </div>
</div>

<!-- Benihbaik Impact -->

<div class="container card-head" style="border-top:10px solid #f7f7f7; margin-top:10px;" id="events">

    <div class="row" style="padding-top:20px; padding-bottom:15px;">

        <div class="col-md-12 nomargin">

            <div class="float-left">

                <p class="font_benihbaik_judul" style="font-family: montserrat-bold !important;">

                    <b>Events Kami <?php echo $profil['nama']; ?></b>

                </p>

            </div>

            <div class="float-right">

                <!-- <a href="/campaign/explore"><p style="color:#41B548"><b>Lihat lainnya</b></p></a> -->

            </div>

        </div>



        <div class="Impact box-slider" id="BenihbaikImpact" style="padding-bottom: 20px;">

            <?php foreach($events as $ev): ?>

            <a href="event/<?php echo $ev['event_url']; ?>" class="Impact-list" bb-title="<?php echo $ev['event_tema']; ?>" bb-list="Home" bb-author="<?php echo $profil['nama']; ?>" bb-type="Campaign Impact">

                <div class="card mb-2" style="border-radius: 8px;width: 310px;">

                    <img loading="lazy" class="card-img-top gambar-impact" src="assets/home/img/event/<?php echo $ev['event_foto']; ?>"

                    onError="this.onerror=null;this.src='assets/home/img/event/<?php echo $ev['event_foto']; ?>';"

                        style="border-radius: 8px;" alt="<?php echo $ev['event_tema']; ?>">

                    <div class="card-body" style="bottom:0px;position: absolute; background-image:

                        linear-gradient(rgba(18, 17, 17, 0) 2.94%, rgb(0, 0, 0));border-radius: 8px">

                        <h6 class="card-title font_benihbaik_judul_impact title-rowcut"

                            style="color: #FFFFFF;margin-bottom:15px;min-height: 2.3em;padding-top:5px;font-family: montserrat-bold !important;padding-left:10px;padding-right:10px;">

                            <b><?php echo $ev['event_tema']; ?></b></h6>

                        <div class="row" style="padding-right: 1em;padding-left: 1em;">

                            <div class="font_benihbaik_content_impact" style="color: #E0E0E0;min-height: 5.3em;padding-left:10px;padding-right:10px;font-family: montserrat-regular !important;">Waktu : <?php echo date('d-m-Y', strtotime($ev['event_tgl'])); ?> <?php echo $ev['event_waktu']; ?> <br> Lokasi : </i> <?php echo $ev['event_lokasi']; ?></a></div>
                        </div>

                    </div>

                </div>

            </a>

            <?php endforeach; ?>

        </div>



    </div>

</div>



<!-- Download Aplikasi Benihbaik -->

<div class="container card-head" style="border-top:10px solid #f7f7f7; margin-top:10px;">

    <div class="row" style="padding-top:20px;">

        <div class="col-md-12 nomargin">

            <div class="float-left">

                <p class="font_benihbaik_judul" style="font-family: montserrat-bold !important;">


                </p>

            </div>

            <div class="float-right">


            </div>

        </div>

    </div>

    <div class="container text-center" style="padding-bottom:10px;font-family: montserrat-regular !important;">

        <p class="font_benihbaik_judul"

            style="text-align: center;font-size:16px;font-family: montserrat-bold !important;"><b>Download Aplikasi <?php echo $profil['nama']; ?></b></p>

        <p style="text-align: center;font-size:14px;color:#828282;">Donasi, zakat, dan lindungi keluarga bersama jutaan orang baik melalui aplikasi Mobile <?php echo $profil['nama']; ?>


        <div class="row d-flex align-items-center justify-content-between">

            <div class="text-center" style="width:50%;">

                <a href="#"

                    target="_blank" class="onc-gtm">

                    <img loading="lazy" class="img-fluid img-responsive mb-2" src="assets/home/img/home/playstore.png"

                        style="width:90%;" alt="playstore">

                    <p style="display: none;">Google Play</p>

                </a>

            </div>

            <div class="text-center" style="width:50%;">

                <a href="#" target="_blank" class="onc-gtm">

                    <img loading="lazy" class="img-fluid img-responsive mb-2" src="assets/home/img/home/appstore.png"

                        style="width:90%;" alt="appstore">

                    <p style="display: none;">IOS Application</p> 

                </a>

            </div>

        </div>


        </div>

    </div>

    </div>

</div>

<div class="container card-head pad-bawah-bb" style="border-top:5px solid #f7f7f7; margin-top:5px;padding-bottom:70px;">
</div>



