<?php
session_start();
$_V_IP = $_SERVER['REMOTE_ADDR'];
$_EVENT_ID = md5($_V_IP . strtotime(date("Y-m-d H:i:s")));
// ====================================================================
// $_PIXEL_ID = "458684066216869";
// $_LOOP_WA = "https://mauorder.online/wa-etawalin-resmi-2-2-2";
// $_LOOP_EMAIL = "https://mauorder.online/form-etawalin-resmi-5-2-2-2";
// $_LOOP_EMAILF = "https://app.loops.id/save-order/form-etawalin-resmi-5-2-2";
?>

<!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>Distributor Resmi Etawalin</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>

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

<center>
    <button class="floating-btn">
        <a href="#alert">
        <img src="src/assets/WA-Pesan-1.gif" alt="Floating Button" /></a>
        <!-- Sesuaikan dengan gambar/gif yang akan dipakai -->
    </button>
</center>

<!-- voucher -->
<!-- <div class="popup" id="voucherPopup">
    <div class="popup-content">
        <span class="close-btn" onclick="closePopup()">&times;</span>
        <img src="src/assets/vcr.gif" alt="Voucher Potongan Ongkir Ekstra" class="voucher-image">
        <button onclick="claimVoucher()" class="voucher-button">Ambil Voucher</button>
    </div>
</div> -->

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

<div class="section">
    <span><img src="src/assets/1.webp" class="img" /></span>
</div>

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

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

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

<!-- Gambar -->

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

<!-- Gambar -->
<div class="section" id="harga">
    <span><img src="src/assets/3box.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">
    <span><img src="src/assets/2box.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">
    <span><img src="src/assets/1box.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/5box.webp" class="img" /></span>
</div>

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

<center>
    <span><img src="src/assets/5.gif" class="img" /></span>
</center>


<center>
    <span><img src="src/assets/7.webp" class="img" /></span>
</center>

<div class="section" id="alert">

    <span><img style="margin: 1% 1%;" src="src/assets/9.gif" class="img" /></span>

</div>

<!-- Form Scalev -->
<div class="section" id="form" style="position: relative;">
    <div style="border-radius: 10px; margin: 2% 2%; width:96%; padding: 15px 10px; background:rgb(255, 217, 0); border: 3px solid black">
        <iframe id="myiframe" width="100%" frameborder="0" src="https://rokhim.myscalev.com/fajar1"></iframe><script>const iframe=document.getElementById('myiframe')
        function resizeIframe(height){iframe.style.height=height+'px'}
        function isUrl(string){try{new URL(string)
        return true}catch(_){return false}}
        function isJSONObject(string){try{const parsed=JSON.parse(string)
        return typeof parsed==='object'&&parsed!==null}catch(e){return false}}
        function isIframeSameOrigin(){try{const doc=iframe.contentDocument||iframe.contentWindow.document
        return true}catch(e){return false}}
        window.addEventListener('message',function(e){if(e.origin==='https://rokhim.myscalev.com'){if(isUrl(e.data)){location.href=e.data}
        if(isJSONObject(e.data)&&!isIframeSameOrigin()){const message=JSON.parse(e.data)
        if(message.type==='resize'){resizeIframe(message.height)}}}},false)
        document.addEventListener('DOMContentLoaded', function () {var observer = new IntersectionObserver(function (entries) {
        entries.forEach((entry) => {if (entry.isIntersecting) {
        iframe.src = iframe.src
        observer.disconnect()}})})
        observer.observe(iframe)})</script>
    </div>
</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: 4px solid black">

        <form id="form-order" class="loops-forms" action="<?php echo $_LOOP_EMAILF; ?>" method="POST">

            <div class="loops-group">

                <label for="name" style="color: #000">Nama Lengkap<span class="red"
                        style="color: #ff1b1b;">*</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"
                        style="color: #ff1b1b;">*</span></label>

                <input type="text" id="phone" name="phone" value=""
                    placeholder="isi 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: 780; 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> -->


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

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

<div class="section">
    <span><img src="src/assets/12.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> -->

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

<div class="section">
    <span><img src="src/assets/14.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>
    // Mencegah klik kanan
    document.addEventListener('contextmenu', function (e) {
        e.preventDefault();
    });

    // Mencegah F12 dan Ctrl+Shift+I
    document.addEventListener('keydown', function (e) {
        if (e.key === 'F12' || (e.ctrlKey && e.shiftKey && e.key === 'I')) {
            e.preventDefault();
        }
    });
</script>

<script>
    function redirect1() {
        window.location = "https://rokhim.myscalev.com/fajar1";
    }
</script>


<script>
    function redirect() {
        window.location = "https://rokhim.myscalev.com/akbar-lin";
    }
</script>

<!-- Popup Js -->
<script>
    // Fungsi untuk menampilkan pop-up setelah halaman selesai dimuat
    window.onload = function () {
        setTimeout(function () {
            document.getElementById("voucherPopup").style.display = "flex";
        }, 3000); // Tunggu 5 detik sebelum pop-up muncul (sesuaikan sesuai kebutuhan)
    }

    // Fungsi untuk menutup pop-up
    function closePopup() {
        document.getElementById("voucherPopup").style.display = "none";
    }

    // Fungsi untuk tindakan klaim voucher
    function claimVoucher() {
        window.location.href = "https://rokhim.myscalev.com/fajar1"; // Arahkan ke URL
        closePopup(); // Menutup pop-up setelah klaim
    }
</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 = "f6f9dbb64bb39ebe841e22f7cfcd07db"</script>
<script src="https://xt.gbnkla.com/jx/v1/cakra.js"></script>; -->



</body>



</html>