<?php 

$menu        = strtolower($this->uri->segment(1));

$sub_menu    = strtolower($this->uri->segment(2));

$sub_menu3   = strtolower($this->uri->segment(3));

 ?>

<style>

a:hover {

    color: #41B548;

    text-decoration: none;

}

.table-striped tbody tr:nth-of-type(odd) {

    background-color: #ffffff;

}

</style>



                </div>

            </div>

        </div>

    <!-- ============================ End Modal Bottom Platform ======================== -->

    <!-- End Central Modal Small -->

        <!-- Content -->

    </main>

    <!-- Main -->  




<div class="modal fade custId" id="custId">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">

            <!-- Modal Header -->
            <div class="modal-header" style="border-bottom: 0px solid #e9ecef;">

                <p style="color: #666666;font-size: 1.3em;margin-bottom: 5px;color: #666666;letter-spacing: 0px;">
                    <!-- <b>Hallo Teman Baik,</b><br> -->
                    <!-- <span style="font-size: 14px;color:#9F9F9F;">Dengan hanya 10 detik kamu membagikan galang dana ini, kamu bisa mengumpulkan hingga Rp 200.000 untuk TemanKita yang membutuhkan</span> -->
                </p>
                <button type="button" class="close" data-dismiss="modal">×</button>
            </div>

            <!-- Modal body -->
            <div class="container">
                <div class="row">
                    <div class="container mt-2 text-center">
                        <span style="font-size: 14px;color:#9F9F9F;text-align:center;">Dengan hanya 10 detik kamu membagikan galang dana ini, kamu bisa mengumpulkan hingga <span style="color:#23B570;"><b>Rp 200.000</b></span> untuk TemanKita yang membutuhkan</span>
                    </div>
                </div>
            </div>
            <div class="modal-body"><div class="container">
    <div class="row">
        <div class="container mt-2 mb-2 text-center">

            <div class="input-group" style="margin-bottom: 1rem;"> 
                <input type="text" class="form-control" value="<?php echo base_url().uri_string(); ?>" readonly="">
                <div class="input-group-prepend">
                    <span class="input-group-text" onclick="CopyLink('<?php echo base_url().uri_string(); ?>')">Salin</span>
                </div>
            </div>

            <p class="card-text semibold" style="font-size: 16px;color: #696969;line-height:27px;font-family: montserrat-bold !important;">atau share via</p> 

            <div class="text-center" style="padding-bottom:10px;"> 
                <div class="row">
                    <div class="col-1-5 p-1">
                        <a href="https://api.whatsapp.com/send?text=<?php echo base_url().uri_string(); ?>" target="_blank">
                            <img class="img-fluid img-responsive mb-2" src="assets/home/img/home/icon-whatsapp.svg" style="width:60%;" alt="icon-whatsapp">
                            <span class="text-center card-title font_benihbaik_judul text_bb_sosial_media" style="color:#828282;font-family: montserrat-regular !important;"><br>Whatsapp</span>
                        </a>
                    </div>
                    <div class="col-1-5 p-1">
                        <a href="http://twitter.com/intent/tweet?text=<?php echo base_url().uri_string(); ?>" target="_blank">
                            <img class="img-fluid img-responsive mb-2" src="assets/home/img/home/icon-twitter.svg" style="width:60%;" alt="icon-twitter">
                            <span class="text-center card-title font_benihbaik_judul text_bb_sosial_media" style="color:#828282;font-family: montserrat-regular !important;"><br>Twitter</span>
                        </a>
                    </div> 
                    <div class="col-1-5 p-1">
                        <a href="https://social-plugins.line.me/lineit/share?url=<?php echo base_url().uri_string(); ?>" target="_blank">
                            <img class="img-fluid img-responsive mb-2" src="assets/home/img/icon/line.jpg" style="width:60%;" alt="icon-line">
                            <span class="text-center card-title font_benihbaik_judul text_bb_sosial_media" style="color:#828282;font-family: montserrat-regular !important;"><br>Line</span>
                        </a>
                    </div>
                    <div class="col-1-5 p-1">
                        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo base_url().uri_string(); ?>" target="_blank">
                            <img class="img-fluid img-responsive mb-2" src="assets/home/img/home/icon-facebook.svg" style="width:60%;" alt="icon-facebook">
                            <span class="text-center card-title font_benihbaik_judul text_bb_sosial_media" style="color:#828282;font-family: montserrat-regular !important;"><br>Facebook</span>
                        </a>
                    </div>
                    <div class="col-1-5 p-1">
                        <a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?php echo base_url().uri_string(); ?>&amp;title=<?php echo $galang['gd_judul']; ?>" target="_blank">
                            <img class="img-fluid img-responsive mb-2" src="assets/home/img/home/icon-linkedin.svg" style="width:60%;" alt="icon-linkedin">
                            <span class="text-center card-title font_benihbaik_judul text_bb_sosial_media" style="color:#828282;font-family: montserrat-regular !important;"><br>Linkedin</span>
                        </a>
                    </div>
                </div>
            </div>  
            
             

                <hr style="padding-bottom:10px;">  
                <p style="font-size: 14px;color:#9F9F9F;text-align:center;">Dengan menjadi fundraiser kamu juga bisa membantu kebaikan!</p><a href="<?php echo base_url().uri_string(); ?>" class="block2 text-center" style="text-decoration:none">Jadi Fundraiser</a>
                                    
            
        </div>
    </div>
</div>

</div>

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

                <!-- Footer -->

            <style>

    .font-foter{

        font-family:montserrat-regular;

        font-size:10px;

        color:#D2D2D2;

    }

    .font-foter-active{

        font-family:montserrat-regular;

        color:#00b34a;

        font-size:10px;

    }



    @media (max-width: 320px)  {

        .font-foter{

            font-family:montserrat-regular;

            font-size:9px;

            color:#D2D2D2;

        }

        .font-foter-active{

            font-family:montserrat-regular;

            color:#00b34a;

            font-size:9px;

        }

    }

</style>

<?php if(uri_string() == 'donasi') { ?>

<?php }else if(uri_string() == 'user/donasi') { ?>

<?php }else if($this->uri->segment(1) == 'donasi' AND $this->uri->segment(2) != '') { ?>

<?php }else if($this->uri->segment(1) == 'konfirmasi-donasi') { ?>

<?php }else if($this->uri->segment(1) == 'metode') { ?>
<?php }else if($this->uri->segment(1) == 'search') { ?>

<?php }else if($this->uri->segment(1) == 'tagihan-donasi') { ?>
<?php }else if($this->uri->segment(1) == 'kategori-campaign') { ?>
<?php }else if($this->uri->segment(1) == 'konfirmasi-identitas') { ?>

<?php }else { ?>

<div class="fixed-bottom">



    



    <!-- menu footer -->

    <footer class="footer" style="line-height: 0px;">

        <div class="container footer_benihbaik text-center" style="background-color:#ffffff;max-width: 480px !important;">

            <div class="row">

                <div class="col-1-5 p-3">

                    <a href="" class="onc-klik">

                        <img src="assets/home/img/icon/<?php if($menu == '' AND $sub_menu == ''){echo 'icon-home-hijau.svg';}else {echo 'Group_486.svg';} ?>" class="icon-footer pb-2" alt="Home<?php if($menu == '' AND $sub_menu == ''){echo '-hijau';} ?>">

                        <span class="text-center font-foter<?php if($menu == '' AND $sub_menu == ''){echo '-active';} ?>"><br>Home</span>

                    </a>

                </div>

                <div class="col-1-5 p-3">

                    <div style="position:absolute; background:red;left: 23px;font-size: 11px;border-radius:5px;">

                    </div>

                    <a href="#events" class="onc-klik">

                        <img src="assets/home/img/icon/Group_487.svg" class="icon-footer pb-2" alt="icon-bell">

                        <span class="text-center font-foter"><br>Events</span>

                    </a>

                    

                </div>

                <div class="col-1-5 p-3 nomargin">

                    <a href="donasi" class="onc-klik">

                        <img src="assets/home/img/icon/Group_490.svg" class="icon-footer pb-2" alt="Upload">

                        <span class="text-center font-foter"><br>Galang Dana</span>

                    </a>

                </div>

                <div class="col-1-5 p-3 nomargin">

                    <a href="user/donasi" class="onc-klik">

                        <img src="assets/home/img/icon/<?php if($menu == 'user' AND $sub_menu == 'donasi'){echo 'Group_484.svg';}else {echo 'Group_488.svg';} ?>" class="icon-footer pb-2" alt="Love<?php if($menu == 'user' AND $sub_menu == 'donasi'){echo '-hijau';} ?>">

                        <span class="text-center font-foter<?php if($menu == 'user' AND $sub_menu == 'donasi'){echo '-active';} ?>"><br>Donasi</span>

                    </a>

                </div>

                <div class="col-1-5 p-3">

                    <a href="user/dashboard" class="onc-klik">

                        <img src="assets/home/img/icon/<?php if($menu == 'user' AND $sub_menu == 'dashboard'){echo 'Group_472.svg';}else {echo 'Group_489.svg';} ?>" class="icon-footer pb-2" alt="Profile<?php if($menu == 'user' AND $sub_menu == 'dashboard'){echo '-hijau';} ?>">

                        <span class="text-center font-foter<?php if($menu == 'user' AND $sub_menu == 'dashboard'){echo '-active';} ?>"><br>Profil</span>

                    </a>

                </div>

            </div>

        </div>

    </footer>

    <!--end menu footer -->

</div>        <!-- Footer -->

            

<?php } ?>

<form id="payment-form" method="post" action="send">

        <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">

        <input type="hidden" name="result_type" id="result-type" value=""></div>

        <input type="hidden" name="result_data" id="result-data" value=""></div>

      </form>



    <!-- Bootstrap core JavaScript ================================================== -->

    <!-- Placed at the end of the document so the pages load faster -->

    <script src="assets/home/js/jquery-3.2.1.min.js"></script>



    <script src="assets/home/js/vendor/jquery.priceformat.js"></script>



    <script src="assets/home/js/vendor/popper.min.js"></script>

    <script src="assets/home/js/dist/bootstrap.min.js"></script>

    <!-- <script src="jquery.min.js"></script> -->

    <script src="assets/home/js/dist/owl/owl.carousel.min.js"></script>



    <!-- DatePicker Benihbaik -->

    <script src="assets/home/js/gijgo.min.js" type="text/javascript"></script>



    <!-- Dropify -->

    <script src="assets/home/plugin/dropify/dist/js/dropify.min.js"></script>

    <!-- End Dropify -->

<script src="assets/home/plugin/allert.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>

<script type="text/javascript">

  

    $('#pay-button').click(function (event) {

      event.preventDefault();

      $(this).attr("disabled", "disabled");

    

    $.ajax({

      url: 'token',

      cache: false,



      success: function(data) {

        //location = data;



        console.log('token = '+data);

        

        var resultType = document.getElementById('result-type');

        var resultData = document.getElementById('result-data');



        function changeResult(type,data){

          $("#result-type").val(type);

          $("#result-data").val(JSON.stringify(data));

          //resultType.innerHTML = type;

          //resultData.innerHTML = JSON.stringify(data);

        }



        snap.pay(data, {

          

          onSuccess: function(result){

            changeResult('success', result);

            console.log(result.status_message);

            console.log(result);

            $("#payment-form").submit();

          },

          onPending: function(result){

            changeResult('pending', result);

            console.log(result.status_message);

            $("#payment-form").submit();

          },

          onError: function(result){

            changeResult('error', result);

            console.log(result.status_message);

            $("#payment-form").submit();

          }

        });

      }

    });

  });



  </script>

<script type="text/javascript">

// $(window).on("load",function() {

//     // Animate loader off screen

//     $(".se-pre-con").fadeOut("slow");

// });

function sharePopUp(link){

// console.log(link)  

    $.ajax({

            type : 'get',

            url : '/popupshare/'+ link, //Here you will fetch records

            //data :  'rowid='+ rowid, //Pass $id

            success : function(data){

            $('.data').html(data);//Show fetched data from database

            }

        });

    $('#custId').modal('show');

}



function Like(x,link) {



    url="BookMark.html"

    $.ajax({

        type : 'get',

        url : url +'/'+ link, //Here you will fetch records

        //data :  'rowid='+ rowid, //Pass $id

        success : function(data){



            var obj = JSON.parse(data);



            if(obj.kode==400){

                window.location = obj.url;

            }else{

                if(obj.kode==300){

                    x.style.color ='#CBCBCB';

                    x.className  ='far fa-bookmark';

                }else if(obj.kode==200){

                    x.style.color ='red';

                    x.className  ='fas fa-bookmark';

                }

            }

        }

    });

}









</script>





<script type="text/javascript">

    function CopyLink(link) {

        var copyText2 = document.getElementById("no_rek");



        var textArea2 = document.createElement("textarea");

        textArea2.value = link;

        document.body.appendChild(textArea2);

        textArea2.select();

        document.execCommand("Copy");

        // alert("Copied the text: " + textArea2.value);

        swal.fire({title:"Link Berhasil Disalin", text: false, icon:"success", showCancelButton: false, showConfirmButton: true,timer: 1500});

        textArea2.remove();



    }

</script> 

<script src="assets/home/js/html5shiv.js"></script>

<script src="assets/home/js/respond.min.js"></script>

<script type="text/javascript" src="assets/home/js/gtm-essentialae52.js?v=5"></script>



<script>

    $('.back').click(function (e) {

        e.preventDefault();



        var fallbackUrl = 'index.html';

        var prevPage    = window.location.href;



        window.history.go(-1);



        setTimeout(function(){

            if (window.location.href == prevPage) {

                window.location.href = fallbackUrl;

            }

        }, 500);

    });

</script>







    <script>



    let header = document.getElementById('imageActivityModul');

    $("#aktivitasTerbaru").on("scroll", function (e) {

        horizontal = e.currentTarget.scrollLeft;

        // vertical = e.currentTarget.scrollTop;



        if (horizontal <= 350) {

            header.style.opacity = 1 - horizontal / 250;

            header.style.left = 0 + ( horizontal / parseFloat(1.05) )+"px";

        } else {

            header.style.opacity = 0;

            header.style.left = 0+"px";

        }

    });



</script>

<script type="text/javascript"> 



    if ('serviceWorker' in navigator) {

        window.addEventListener('load', function() {

            navigator.serviceWorker.register('sw.js').then(function(registration) {

            // Registration was successful

            // console.log('ServiceWorker registration successful with scope: ', registration.scope);

            }, function(err) {

            // registration failed :(

            // console.log('ServiceWorker registration failed: ', err);

            });

        });

    }



    let deferredPrompt;

    var div = document.querySelector('.add-to'); 

    var padBawahBb = document.querySelector('.pad-bawah-bb');

    var buttonPWABB = document.querySelector('.add-to-btn-bb');

    var buttonClosePWABB = document.querySelector('.add-to-btn-bb-close');

    div.style.display = "block";

    padBawahBb.style.paddingBottom = "140px";



    buttonClosePWABB.addEventListener('click', (e) => {

        // hide our user interface that shows our A2HS button

        div.style.display = 'none';

        padBawahBb.style.paddingBottom = "70px";

    });



</script>

<script>

    $(window).on("load",function () {



        var initKategori = $( ".item-category .img-category" ).first().attr('link');



        // console.log(initKategori);



        var action = false;

        var category = initKategori;

        var page = 1;

        var all = $('#all_category');

        var url = "campaign/explore.html";







        $('.img-category').click(function () {

            page = 1;

            category = $(this).attr('link');



            $('.img-category').removeClass("img-category-active");

            this.classList.add("img-category-active");



            if (action == false) {

                action = true;

                $('#list_campaign').empty();

                loadCampaign();

            }

            all.attr("href", url + '?category=' + category)

        })



        function loadCampaign() {

            $.ajax({

                url: "https://m.benihbaik.com",

                method: "get",

                data: {

                    page: page,

                    category: category

                },

                cache: false,

                success: function (data) {

                    $('#list_campaign').append(data);

                    if (data == '') {

                        action = true;

                    } else {

                        action = false;

                    }



                    page = page + 1;

                    // console.log('succes')

                },

                error: function (xhr, status, error) {

                    if (xhr.status == 404) {

                        $('#list_campaign').append(xhr.responseText);

                    }

                    action = false;

                }

            });

        }





        // $(window).scroll(function(){

        //     if($(window).scrollTop() + $(window).height() > $("#list_campaign").height() && action == 'inactive'){

        //         action = 'active';

        //         loadCampaign();

        //     }

        // });



        // $(document).ready(function () {

            loadCampaign();

            all.attr("href", url + '?category=' + category)

        // });



        $("#BenihbaikBanner").owlCarousel({

            items: 1,

            // video:true,

            autoplay: true,

            animateOut: 'fadeOut',

            autoplayTimeout: 4000,

            loop: true,

            autoHeight: true,

            center: true,

            lazyLoad: true,

            dots: true,

        });



        $("#ModalInfoPopupHomeWidget").owlCarousel({

            items: 1.2,

            animateOut: 'fadeOut',

            loop: true,

            autoHeight: true,

            margin: 15,

            stagePadding: 15,

            autoplay: true,

            autoplayTimeout: 5000,

            center: true,

        });



        // $("#popupModalWidgetHomeButton").click(function(){

        //     // set the item in localStorage

        //     var value = ["0","2024-07-21"];

        //     localStorage.setItem('popupModalHomeWidget', JSON.stringify(value));

        // });





    });

</script>

<script src="assets/home/plugin/swiper/swiper-bundle.min3860.js?v=1"></script>

<script>

    var swiper = new Swiper('.swiper-container', {

      slidesPerView: 1,

      spaceBetween: 10,

      autoplay: {

                    delay: 3000,

                },

      loop: true,

      pagination: {

        el: '.swiper-pagination',

        clickable: true,

      }

    //   ,

    //   navigation: {

    //     nextEl: '.swiper-button-next',

    //     prevEl: '.swiper-button-prev',

    //   }

    });

</script>



<!-- <script>

        $(function () {

            $(window).on('beforeunload',function()

            {

                return null;

            })

        });

    </script> -->

<script>

    $("#email").keyup(function () {

        var email = $('#email').val();



        if (IsEmail(email) == false) {

            $("#email").removeClass("valid");

            $("#email").addClass("invalid");

            $("#btn_email").attr('disabled', true);



        } else {

            $("#email").removeClass("invalid");

            $("#email").addClass("valid");

            $("#btn_email").attr('disabled', false);

        }



    });



    function IsEmail(email) {

        var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

        if (!regex.test(email)) {

            return false;

        } else {

            return true;

        }

    }

</script>

<script src="assets/home/js/custom-select.js"></script>

<script>

    $(document).ready(function(){



        $("#optKendaraan").val("");

        $("#txtJarak").val("");

        $("#txtPenumpang").val("");

        $("#txtFrekuensi").val("");

        $("#optEmisiPerjalanan").val("");



        let curlInitEmisi = $('#formEmisi').attr('action');

        let submitDonasiEmisi = $("#submitDonasiEmisi").val();

        var emisi = {

            optKendaraan: "",

            txtJarak: "",

            txtPenumpang: "",

            txtFrekuensi: "",

            optEmisiPerjalanan: "",

            _token: "",

            getEmisi: function (callback) {

                $.ajax({

                    url: curlInitEmisi,

                    type: "POST",

                    data: {

                        optKendaraan: this.optKendaraan,

                        txtJarak: this.txtJarak,

                        txtPenumpang: this.txtPenumpang,

                        txtFrekuensi: this.txtFrekuensi,

                        optEmisiPerjalanan: this.optEmisiPerjalanan,

                        _token: this._token

                    },

                    success: function (response) {

                        callback(response);

                    },

                });

            }

        }



        $("#optKendaraan").change(function(){



        var kendaraan = $("#optKendaraan").val();

                if (kendaraan == "Mobil" || kendaraan == "Motor") {

                    $("#jumlah-penumpang").addClass("active");

                }else{

                    $("#jumlah-penumpang").removeClass("active");

                    $("#txtPenumpang").val("");

                }

        })



        $("#formEmisi").submit(function(e){

            e.preventDefault();

            emisi.optKendaraan = $("#optKendaraan").val();

            emisi.txtJarak = $("#txtJarak").val();

            emisi.txtPenumpang = $("#txtPenumpang").val();

            emisi.txtFrekuensi = $("#txtFrekuensi").val();

            emisi.optEmisiPerjalanan = $("#optEmisiPerjalanan").val();

            emisi._token = $("input[name='_token']").val();



            if (emisi.optKendaraan == null || emisi.optKendaraan == "") {

                Swal.fire({

                    icon: 'error',

                    title: 'Oops...',

                    text: 'Sepertinya Kamu belum mengisi semua informasi yang dibutuhkan!',

                })

                // console.log("if1");

                return false;

            }

            if(emisi.txtJarak == null || emisi.txtJarak == ""){

                Swal.fire({

                    icon: 'error',

                    title: 'Oops...',

                    text: 'Sepertinya Kamu belum mengisi semua informasi yang dibutuhkan!',

                })

                // console.log("if2");

                return false;

            }

            if(emisi.txtFrekuensi == null || emisi.txtFrekuensi == ""){

                Swal.fire({

                    icon: 'error',

                    title: 'Oops...',

                    text: 'Sepertinya Kamu belum mengisi semua informasi yang dibutuhkan!',

                })

                // console.log("if3");

                return false;

            }



            if (emisi.txtPenumpang == null || emisi.txtPenumpang == "" ) {

                if(emisi.optKendaraan == "Mobil" || emisi.optKendaraan == "Motor" ) {

                    Swal.fire({

                        icon: 'error',

                        title: 'Oops...',

                        text: 'Sepertinya Kamu belum mengisi semua informasi yang dibutuhkan!',

                    })

                    // console.log("if4");

                    return false;

                }

            }



            if(emisi.optEmisiPerjalanan == null || emisi.optEmisiPerjalanan == ""){

                Swal.fire({

                    icon: 'error',

                    title: 'Oops...',

                    text: 'Sepertinya Kamu belum mengisi semua informasi yang dibutuhkan!',

                })

                // console.log("if5");

                return false;

            }



            x = emisi.getEmisi(function (e) {

                var parse = JSON.parse(e);

                // console.log(parse);

                Swal.fire({

                    html: parse.htmlMessage,

                    showCancelButton: true,

                    confirmButtonText: "Donasi",

                    cancelButtonText: "Kembali",

                    reverseButtons: true,

                    customClass: {

                        cancelButton: 'btn-kembali-emisi',

                        confirmButton: 'btn-donasi-emisi'

                    }

                }).then((result) => {

                    if (result.isConfirmed) {

                        var param = parse.donasiParam;

                        // window.location.href = submitDonasiEmisi + "&donate=" + param;

                        window.location.href = submitDonasiEmisi;

                    }

                });

            });



        });



        var limit   = 20

        var start   = 0;

        var action  = 'inactive';



        var _token = "XCTmt7tMhRfzf9HM7FoRdvyEG6EMNxuOkQXUlF5K";

        var id_campaign = "17177";

        loadMoreDonatur(id_campaign, start, _token);



        function loadMoreDonatur(id_campaign, start, _token) {

            $.ajax({

                url:"https://m.benihbaik.com/loadmoredonatur",

                method:"POST",

                data:{id_campaign:id_campaign, id:start, _token:_token},

                beforeSend: function () {

                    // availableReq = true;

                    $('#load').show();  

                },

                complete: function () {

                    $('#load').hide();

                },

                success:function(data){

                    $('#donatur_data').append(data);

                    if(data == ''){

                        action = 'active';

                    }else{

                        action = "inactive";

                    }

                }

            });

        }

        

        $('#scrollBack').on('click', function(){

            $("#scrollScreenDonatur").animate({scrollTop: 0}, 500);

        })



        $('#scrollScreenDonatur').scroll(function(){

            // console.log("scroll " + ($('#scrollScreenDonatur').scrollTop() + $('#scrollScreenDonatur').height() + 100));

            // console.log("layer " + ($("#donatur_data").height()));

            // console.log(action);

            if($('#scrollScreenDonatur').scrollTop() + $('#scrollScreenDonatur').height() + 100 > ($("#donatur_data").height()) && action == 'inactive'){

                action = 'active';

                start = start + limit;

                setTimeout(function(){

                    // loadMoreDonatur(start, _token);

                    loadMoreDonatur(id_campaign, start, _token);

                }, 500);

            }

        });



        // if(){



        //  $('#flash_message_konfirmasi_pencairan').modal('show');



        // }



                

    });

</script>



<script>

    </script>



<script>

    $(window).scroll(function() {

           

           ($(this).scrollTop() > 550) ? $('#footer').show() : $('#footer').hide();

           

       });



    $(window).scroll(function() {

        ($(this).scrollTop() > 10) ? $('.navbar').addClass('benihbaik_solid') : $('.navbar').removeClass('benihbaik_solid');

    });



    $(window).scroll(function() {

           

           ($(this).scrollTop() > 10) ? $('.ozan').addClass('arrow_solid') : $('.ozan').removeClass('arrow_solid');

       });



    $(window).scroll(function() {

           

           ($(this).scrollTop() > 10) ? $('.pl-1').addClass('hilang_font') : $('.pl-1').removeClass('hilang_font');

       });



    $(document).ready(function(){



        $("#BenihbaikCampaignLainnya").owlCarousel(

            {

                loop:true,

                margin:10,

                items:1.2,

            }

        );



        $("#BenihbaikSearch").owlCarousel(

                {

                    loop:true,

                    margin:16, 

                    items:1.4, 

                    dots: false, 

                    lazyLoad: true,

                }

            );



        $('#showhide').click(function(e) {

            $('#bb_collapse').toggleClass('bb_collapse_hide');

            $('#bb_collapse').toggleClass('bb_collapse');

            

           // $(this).text( $(this).text() == 'Baca Selengkapnya' ? 'Ringkas' : 'Baca Selengkapnya' );

            

            $('#showhide').hide();

            e.preventDefault();

        });



        $('#showhide_timeline').click(function() {

            $('#bb_collapse_timeline').toggleClass('bb_collapse_hide');

            $('#bb_collapse_timeline').toggleClass('bb_collapse_timeline');



            //$(this).text( $(this).text() == 'Lihat Selengkapnya' ? 'Ringkas' : 'Lihat Selengkapnya' );

            $('#showhide_timeline').hide();



           

        });

        

        



    });

</script>

<?php if($this->uri->segment(1) == 'konfirmasi-donasi') { ?>

<script>

document.addEventListener('DOMContentLoaded', function() {

    // Mendapatkan semua elemen card body dengan class nominal

    var cardBodies = document.querySelectorAll('.card-body');



    cardBodies.forEach(function(cardBody) {

        cardBody.addEventListener('click', function() {

            // Mengambil nilai dari elemen input yang berada di dalam card body yang diklik

            var nominalValue = this.querySelector('input[type="hidden"]').value;

            // Mengisi nilai ke dalam input dengan id 'jumlah-donasi'

            document.getElementById('jumlah-donasi').value = nominalValue;

        });

    });

});

</script>

<?php } ?>

<script>

        function myFunctionCopyBank() {

            var copyText1 = document.getElementById("myInput");



            var textArea1 = document.createElement("textarea");

            textArea1.value = copyText1.textContent;

            document.body.appendChild(textArea1);

            textArea1.select();

            document.execCommand("Copy");

            //alert("Copied the text: " + copyText1.innerHTML);

            alert("Nomor vitual account telah disalin");

            textArea1.remove();



        }



        function myFunctionCopyNominal() {

            var copyText2 = document.getElementById("debit");



            var textArea2 = document.createElement("textarea");

            textArea2.value = copyText2.value;

            document.body.appendChild(textArea2);

            textArea2.select();

            document.execCommand("Copy");

            //alert("Copied the text: " + copyText2.value);

            alert("Nominal telah disalin");

            textArea2.remove();

        }



</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
    const kategoriLinks = document.querySelectorAll('.kategori-link');
    const campaignItems = document.querySelectorAll('.campaign-item');

    kategoriLinks.forEach(link => {
        link.addEventListener('click', function(event) {
            event.preventDefault(); // Mencegah reload halaman
            
            const kategoriId = this.getAttribute('data-kategori-id');

            // Tampilkan campaign sesuai kategori yang dipilih
            campaignItems.forEach(item => {
                if (kategoriId === 'all' || item.getAttribute('data-kategori-id') === kategoriId) {
                    item.style.display = 'block'; // Tampilkan item
                } else {
                    item.style.display = 'none'; // Sembunyikan item
                }
            });
        });
    });
});
</script>
<?php if(uri_string() == 'search') { ?>
<script>
    $('.auto-load').hide();

    var res = $('#result');
    var opsi = $('#opsi');
    var page = 1;
    var action = 'active';

    function infinteLoadMore(page, key) {
        if (key != "") {
            $.ajax({
                url: "<?php echo site_url('welcome/search_x'); ?>?page=" + page + "&key=" + key,
                datatype: "html",
                type: "get",
                beforeSend: function () {
                    $('.auto-load').show();
                }
            })
            .done(function (data) {
                $('.auto-load').hide();
                if (data.trim().length == 0) {
                    action = 'inactive';
                    return;
                }
                res.append(data);
                res.show();
                opsi.hide();
            })
            .fail(function (xhr, status, error) {
                if (xhr.status == 404) {
                    res.append('<p>Terjadi kesalahan</p>');
                }
            });
        }
    }

    $("#key").keyup(function (e) {
        let val = $(this).val();
        var key = e.which;

        if (val.split(' ').length >= 2 || key == 13 || val.length >= 3) {
            $.ajax({
                url: "<?php echo site_url('welcome/search_x'); ?>",
                method: "GET",
                data: { key: val, page: 1 },
                success: function (data) {
                    page = 1;
                    action = 'active';
                    res.html(data);
                    res.show();
                    opsi.hide();
                },
                error: function (xhr, status, error) {
                    res.append('<p>Terjadi kesalahan</p>');
                }
            });
        } else {
            res.hide();
            opsi.show();
        }
    });

    $(window).scroll(function () {
        if ($(window).scrollTop() + $(window).height() > $(document).height() - 100) {
            var keywordPaginate = $('#key').val();
            if (action == 'active') {
                page++;
                infinteLoadMore(page, keywordPaginate);
            }
        }
    });

    $(window).on("load", function () {
        $("#key").focus();
    });

    function Choose(e) {
        let link = $(e).attr('bb-link');
        if (link) {
            window.location.href = link; // Mengarahkan ke link
        }
    }

</script>

<?php } ?>

</body>

</html>

