<?php
// ====================================================================================================================== //
session_start();
$_V_IP = $_SERVER['REMOTE_ADDR'];
$_EVENT_ID = md5($_V_IP . strtotime(date("Y-m-d H:i:s")));
// ====================================================================================================================== //

// Ganti kode pixel dibawah ini
$_PIXEL_ID = "396992252411649";

// Ganti link loops dibawah ini
$_LOOP_WA = "https://mauorder.online/cs-bimo-axel-etawalin-13";
$_LOOP_EMAIL = "https://app.loops.id/save-order/form-bimo-axel-etawalin-22";
// ====================================================================================================================== //
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Site Icon -->
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" />
    <!-- Script CDN icon -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Scrip CSS CDN Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <!-- Script memanggil file css -->
    <link rel="stylesheet" href="src/styles/style.css" />
    <!-- Site Title -->
    <title>Etawalin Resmi - INDONESIA</title>

    <!-- Meta Pixel Code -->
    <script>
        !function (f, b, e, v, n, t, s) {
            if (f.fbq) return; n = f.fbq = function () {
                n.callMethod ?
                    n.callMethod.apply(n, arguments) : n.queue.push(arguments)
            };
            if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';
            n.queue = []; t = b.createElement(e); t.async = !0;
            t.src = v; s = b.getElementsByTagName(e)[0];

            s.parentNode.insertBefore(t, s)
        }(window, document, 'script',
            'https://connect.facebook.net/en_US/fbevents.js');
        fbq('init', '<?php echo $_PIXEL_ID; ?>');
        fbq('track', 'PageView', {}, { eventID: "ePV-<?php echo $_EVENT_ID; ?>" });
    </script>
    <noscript>
        <img height="1" width="1" style="display:none"
            src="https://www.facebook.com/tr?id=<?php echo $_PIXEL_ID; ?>&ev=PageView&noscript=1" />
    </noscript>
    <!-- End Meta Pixel Code -->
</head>

<!-- ====================================================================================================================== -->
<!-- ## Copy dan paste kode dibawah ini di dalam tag <body> ##-->
<!-- Button Untuk Trigger Modal (Pilih Salah Satu Saja Antara Manual Atau Gambar) -->

<center>
    <!-- Kode dibawah ini jika ingin menggunakan button dengan gambar -->
    <button class="floating-btn" data-bs-toggle="modal" data-bs-target="#exampleModal">
        <img src="src/assets/promo-klik-disini.gif" alt="Floating Button" />
        <!-- Sesuaikan dengan gambar/gif yang akan dipakai -->
    </button>
</center>

<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="exampleModalLabel">Form Pemesanan</h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <div style="
                                border-radius: 10px;
                                margin: 7% 4%;
                                padding: 5px 25px;
                                background: #ffe610;
                                border: 3px solid black;
                            ">
                    <center>
                        <div class="form-container-custom">
                            <p style="font-size: large; font-weight: 600;"><b>Selamat !!</b><br />"Anda Dapat Diskon
                                Promo
                                Potongan Harga 50% + Gratis Ongkir sampai 40.000" <br> <b>COD SELURUH INDONESIA</b> <br> ⬇︎ISI
                                FORM PEMESANAN⬇︎</p>
                        </div>
                    </center>
                    <form id="form-order" class="loops-forms" action="<?php echo $_LOOP_EMAIL; ?>" method="POST">
                        <div class="loops-group">
                            <label for="name" style="color: #000">Nama Lengkap<span class="red">*</span></label>
                            <input type="text" id="name" name="name" value="" placeholder="Tulis nama Anda" required />
                        </div>
                        <div class="loops-group">
                            <label for="phone" style="color: #000">No. WhatsApp <span class="red">*</span></label>
                            <input type="text" id="phone" name="phone" value=""
                                placeholder="Sebutkan nomor HP aktif Anda: contoh 081234567890"
                                pattern="[0]{1}[0-9]{8,12}" required />
                        </div>
                        <div class="loops-group">
                            <input type="submit" value="Beli + Ambil Promo" class="loops-submit btn-add-to-cart" />
                        </div>
                        <input type="hidden" id="current" name="current" value="" />
                        <input type="hidden" name="redirect" value="" />
                        <input type="hidden" name="_loops_nonce" value="" />

                        <!--CAPI EVENT-->
                        <input type="hidden" name="event_id" id="event_id" value="eATC-<?php echo $_EVENT_ID; ?>" />

                        <div style="text-align: center">
                            <p style="
                                        background: #ffa432;
                                        color: #000;
                                        font-weight: 900;
                                        font-size: 18px;
                                        padding: 2px;
                                        ">
                                Pastika Nomor WA Kamu Benar, Agar Kami Bisa Menghubungi Kamu
                            </p>
                        </div>
                    </form>
                    <script>
                        var form = document.getElementById("form-order");
                        form.addEventListener("submit", function (e) {
                            setCookie("vip", "<?php echo $_V_IP; ?>", 7);
                            fbq(
                                "track",
                                "AddToCart",
                                { currency: "IDR" },
                                { eventID: "eATC-<?php echo $_EVENT_ID; ?>" }
                            );
                        });
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- ====================================================================================================================== -->

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/1.webp" class="img" /></span>
</div>
<!-- Carousell -->
<!-- ====================================================================================================================== -->
<!-- ## Copy dan paste kode dibawah ini di dalam tag <body> ##-->
<center>
  <div id="carouselExample" class="carousel slide">
    <div class="carousel-inner">
      <div class="carousel-item active">
        <img
          src="src/assets/2.webp"
          class="d-block w-100"
          alt="gambar-1" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/3.webp"
          class="d-block w-100"
          alt="gambar-2" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/4.webp"
          class="d-block w-100"
          alt="gambar-3" />
      </div>
    </div>
    <button
      class="carousel-control-prev"
      type="button"
      data-bs-target="#carouselExample"
      data-bs-slide="prev">
      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Previous</span>
    </button>
    <button
      class="carousel-control-next"
      type="button"
      data-bs-target="#carouselExample"
      data-bs-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Next</span>
    </button>
  </div>
</center>

<!-- ====================================================================================================================== -->

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/5.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/6.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/7.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/8.gif" class="img" /></span>
</div>


<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/9.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/10.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/11.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/12.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/13.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/14.gif" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/15.gif" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/19.webp" class="img" /></span>
</div>

<!-- Button 1 box-->
<div style="display:  flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-pesan"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>Pesan Paket Sehat</a>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/18.webp" class="img" /></span>
</div>

<!-- Button 2 box -->
<div style="display: flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-pesan"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>Pesan Paket Akut</a>
</div>

<!-- Gambar -->
<div class="section" id="harga">
    <span><img src="src/assets/17.webp" class="img" /></span>
</div>

<!-- Button 3 box -->
<div style="display: flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-pesan"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>Pesan Paket Kronis</a>
</div>

<!-- Gambar -->
<div class="section" id="harga">
    <span><img src="src/assets/16.webp" class="img" /></span>
</div>

<!-- Button 4 box -->
<div style="display: flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-pesan"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>Pesan Paket Spesial</a>
</div>

<!-- Gambar -->
<div class="section" id="harga">
    <span><img src="src/assets/20.webp" class="img" /></span>
</div>

<!-- Button 5 box -->
<div style="display: flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-pesan"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>Pesan Paket Reseller</a>
</div>

<!-- Gambar -->
<center>
    <span><img src="src/assets/ribuan-paket.webp" class="img" /></span>
</center>

<!-- Gambar -->
<center>
    <span><img src="src/assets/50.gif" class="img" /></span>
</center>

<!-- Promo Text -->
<div style="text-align: center;">
    <div id="value" style="font: 700 60px system-ui; color: #000;">37</div>
    <p style="text-transform: uppercase; color: #000; font-weight: 600; font-size: 15px;">
        Stok Promo Tersisa Hari Ini</p>
</div>

<!-- Gambar -->
<center>
    <span><img src="src/assets/testi-kirim.webp" class="img" /></span>
</center>

<!-- Alert -->
<div class="alert" id="alert">
    <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span>
    <strong>Promo Hanya Hari Ini.
    </strong>
    <p>Pastikan Nomor WhatsApp Aktif.</p>
</div>

<!-- Promo Text -->
<!-- <div
        style="text-align: center; margin: 6% 8% 0 8%; text-transform: uppercase; background: #f8fc04; font-size: 28px; font-weight: 900; padding: 2px;">
        <p style="color: #000;">Gratis Ongkir</p>
        <p style="color: #FF1B1B;">Minimal Pemesanan 3 box</p>
    </div> -->

<!-- Gif -->
<div class="section">
    <span><img style="margin: 10% 1%;" src="src/assets/isi-form.gif" class="img" /></span>
</div>

<!-- Form -->
<div class="section" id="form" style="position: relative;">
    <div
        style="border-radius: 10px; margin: 2% 2%; width:96%; padding: 15px 10px; background: #ffe610; border: 3px solid black">

        <form id="form-order" class="loops-forms" action="<?php echo $_LOOP_EMAIL; ?>" method="POST">
            <div class="loops-group">
                <label for="name" style="color: #000">Nama Lengkap<span class="red">*</span></label>
                <input type="text" id="name" name="name" value="" placeholder="Tulis nama Anda" required>
            </div>
            <div class="loops-group">
                <label for="phone" style="color: #000">No. WhatsApp <span class="red">*</span></label>
                <input type="text" id="phone" name="phone" value=""
                    placeholder="Sebutkan nomor HP aktif Anda: contoh 081234567890" pattern="[0]{1}[0-9]{8,12}"
                    required>
            </div>
            <div class="loops-group">
                <input type="submit" value="Beli + Ambil Promo" class="loops-submit btn-add-to-cart">
            </div>
            <input type="hidden" id="current" name="current" value="">
            <input type="hidden" name="redirect" value="">
            <input type="hidden" name="_loops_nonce" value="">

            <!--CAPI EVENT-->
            <input type="hidden" name="event_id" id="event_id" value="eATC-<?php echo $_EVENT_ID; ?>">

            <div style="text-align: center;">
                <p style="background: #FFA432; color: #000; font-weight: 900; font-size: 18px; padding: 2px;">
                    PASTIKAN NOMOR WA KAMU BENAR, AGAR KAMI BISA MENGHUBUNGI KAMU</p>
            </div>
        </form>
        <script>
            var form = document.getElementById('form-order');
            form.addEventListener('submit', function (e) {
                setCookie('vip', '<?php echo $_V_IP; ?>', 7);
                fbq('track', 'AddToCart', { currency: 'IDR' }, { eventID: "eATC-<?php echo $_EVENT_ID; ?>" });
            });
        </script>
    </div>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/ori.webp" class="img" /></span>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/kerugian.webp" class="img" /></span>
</div>

<!-- Button -->
<div style="display: flex; justify-content: center;">
    <a href="#harga" class="btn-promo buttons-cek-promo"><span><i class="fa fa-list-alt" aria-hidden="true"></i>
        </span>Cek Harga & Promo</a>
</div>

<!-- Button -->
<div style="display: flex; justify-content: center;">
    <a href="#alert" class="btn-promo buttons-ambil-promo"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>PESAN SEKARANG + AMBIL PROMO</a>
</div>

<!-- Button -->
<div style="display: flex; justify-content: center;">
    <a href="<?php echo $_LOOP_WA; ?>" class="btn-wa buttons-pesan"><span><i class="fa fa-whatsapp"
                aria-hidden="true"></i>
        </span>Pesan Lewat Admin Cadangan</a>
</div>

<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/footer.webp" class="img" /></span>
</div>

<script src="src/scripts/jquery-3.6.0.min.js" language="javascript"></script>
<script src="src/scripts/jquery.lazyload.min.js" language="javascript"></script>
<script src="src/scripts/toasts-notification.js" language="javascript"></script>
<script src="src/scripts/slideshow.js" language="javascript"></script>
<script src="src/scripts/carousel.js" language="javascript"></script>
<script src="src/scripts/counter-titik.js" language="javascript"></script>
<script src="src/scripts/counter.js" language="javascript"></script>

<!-- Script CDN Bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
    crossorigin="anonymous"></script>

<script>
    function redirect() {
        window.location = "<?php echo $_LOOP_WA; ?>";
    }
</script>

<!-- Script Kode CAPI -->
<script>

    function setCookie(cname, cvalue, exdays) {
        const d = new Date();
        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
        let expires = "expires=" + d.toUTCString();
        document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
    }

    function getCookie(cname) {
        let name = cname + "=";
        let decodedCookie = decodeURIComponent(document.cookie);
        let ca = decodedCookie.split(';');
        for (let i = 0; i < ca.length; i++) {
            let c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1);
            }
            if (c.indexOf(name) == 0) {
                return c.substring(name.length, c.length);
            }
        }
        return "";
    }

    $(document).ready(function (e) {
        // $("img.lazy").lazyload();

        if (getCookie('vip')) {
            //$('#form-order').hide();
            $('#thx_div').show();
        }

        <?php if (isset($_GET['reset']) && $_GET['reset'] == 1) { ?>
            document.cookie = "vip=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
        <?php } ?>

        fbq('track', 'ViewContent', {}, { eventID: "eVC-<?php echo $_EVENT_ID; ?>" });
    });

</script>
<!-- Paste Script Nakula Dibawah Sini -->
<script>var gbsid = "5a4232a817aad03decae98419ab274ab"</script>
<script src="https://xt.gbnkla.com/jx/v1/cakra.js"></script>;

</body>

</html>