<?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 = "1282472775942457";

// Ganti link loops dibawah ini
$_LOOP_WA = "https://mauorder.online/fajar-etawaku-wa";
$_LOOP_EMAIL = "https://app.loops.id/save-order/3-box-etawalin-gratis-ongkir";
$_LOOP_FLOATING = "https://mauorder.online/fajar-etawaku-form";
// ====================================================================================================================== //
?>

<!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>Promo 3 Box</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>
  <button class="floating-btn" onclick="floating()">
    <img src="src/assets/claim.webp" alt="Floating Button" />
    <!-- Sesuaikan dengan gambar/gif yang akan dipakai -->
  </button>
</center>
<!-- ====================================================================================================================== -->
<!-- ## Copy dan paste kode dibawah ini di bagian bawah namun tetap dalam tag <body> ##-->
<script>
  function floating() {
    window.location = "<?php echo $_LOOP_FLOATING; ?>"; // sesuaikan redirect, contoh ini adalah floating button untuk memanggil link loop wa
  }
</script>

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

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

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


</div>
<div style="text-align: left; margin: 0 7%">
<p style="text-transform: uppercase; background: #020101; color: #FFFFFF; font-weight: 900; font-size: 16px">
            Isi Form Pemesanan untuk terhubung dengan Admin kami !!!</p>
        </div>

<!-- Button 1 box-->
<div style="display:  flex; justify-content: center;">
    <a href="#anchor" class="btn-promo buttons-pesan" style="background-color:#ED0000;><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>AMBIL PROMO 3 BOX GRATIS ONGKIR</a>
</div>
<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/c.webp" class="img" /></span>
</div>
<div class="section">
    <span><img src="src/assets/sk.webp" class="img" /></span>
</div>
<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/e.webp" class="img" /></span>
</div>

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

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


<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/bawah-counter.png" class="img" /></span>
</div>
<!-- Promo Text -->
<div style="text-align: center;">
    <div id="valuesatu" style="font: 800 60px system-ui; color: #071952;">1001</div>
    <p style="text-transform: capitalize; color: #31363F; font-weight: 600; font-size: 15px;">
        Membuktikan Manfaat Susu Etawalin</p>
</div>




<!-- Gambar -->
<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/sps.gif" class="img" /></span>
</div>
<div class="section">
    <span><img src="src/assets/disc.gif" class="img" /></span>
</div>
<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/1-box.webp" class="img" /></span>
</div>

<!-- Button 1 box-->
<div style="display:  flex; justify-content: center;">
    <a href="#anchor" 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/2-box.webp" class="img" /></span>
</div>

<!-- Button 2 box -->
<div style="display: flex; justify-content: center;">
    <a href="#anchor" 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/3-box.webp" class="img" /></span>
</div>

<!-- Button 3 box -->
<div style="display: flex; justify-content: center;">
    <a href="#anchor" 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/paket5.webp" class="img" /></span>
</div>

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

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

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

<!-- 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 -->

<!-- Alert -->
<div class="alert" id="alert">
    <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span>
    <strong>PROMO TERBATAS SPESIAL KOTAMU 50 ORANG TERCEPAT.
    </strong>
</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" id="anchor">
    <span><img style="margin: 10% 1%;" src="src/assets/isi-form.gif" class="img" /></span>
</div>
<div style="text-align: center; margin: 0 7%">
        <p style="text-transform: uppercase; background: #FF0000; color: #FFFFFF; font-weight: 900; font-size: 19px">AMBIL
            PROMO 3 BOX GRATIS ONGKIR + GRATIS E-BOOK</p>
    </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">Nomer Whatsapp Aktif:  <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="CHAT WHATSAPP + 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: 12px; padding: 2px;">
                    PASTIKAN NOMER ANDA SUDAH BENAR</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 style="text-align: center; margin: 0 7%">
        <p style="text-transform: uppercase; background: #FF0000; color: #FFFFFF; font-weight: 900; font-size: 19px">           PROMO TERBATAS CUMA HARI INI!</p>
    </div>
<!-- Gambar -->
<div class="section">
    <span><img src="src/assets/gratisongkir.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="#anchor" class="btn-promo buttons-ambil-promo"><span><i class="fa fa-shopping-cart" aria-hidden="true"></i>
        </span>PESAN SEKARANG + AMBIL PROMO</a>
</div>

<div class="section">
    <span><img src="src/assets/panah.gif" class="img" /></span>
</div>

<div class="section">
    <span><img src="src/assets/cod.png" class="img" /></span>
</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>
<div class="section">
    <span><img src="src/assets/crjudul.webp" class="img" /></span>
</div>
<center>
  <div id="carouselExample" class="carousel slide">
    <div class="carousel-inner">
      <div class="carousel-item active">
        <img
          src="src/assets/cr1.webp"
          class="d-block w-100"
          alt="gambar-1" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/cr2.webp"
          class="d-block w-100"
          alt="gambar-2" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/cr3.webp"
          class="d-block w-100"
          alt="gambar-3" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/cr4.webp"
          class="d-block w-100"
          alt="gambar-4" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/cr5.webp"
          class="d-block w-100"
          alt="gambar-5" />
      </div>
      <div class="carousel-item">
        <img
          src="src/assets/cr6.webp"
          class="d-block w-100"
          alt="gambar-6" />
      </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>
<div class="section">
    <span><img src="src/assets/pab.webp" class="img" /></span>


<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 = "92931ad3bb500c776d9b73441e27a881"</script>
<script src="https://xt.gbnkla.com/jx/v1/cakra.js"></script>;

</body>

</html>