<?php
    function activetab($hal) {
        if(isset($_GET['page'])) {
            require 'assets/data.php';
            $page = mysqli_real_escape_string($data, $_GET['page']);

            if($page == $hal) {
                echo 'active';
            }
        }
    }
?>  

<div id="navmobile" class="sidenav d-lg-none">
  <a href="javascript:void(0)" class="closebtn" onclick="clsMobilenav()">&times;</a>
  <a class="home-m nav-m" href="/"> Home</a>
  <a class="livedraw-m <?php activetab('livedraw-togel'); ?> nav-m" href="?page=livedraw-togel">Live draw</a>
  <a class="prediksi-m <?php activetab('prediksi-mobile'); ?> nav-m" href="?page=prediksi-mobile">Prediksi Togel</a>
  <a class="promosi-m <?php activetab('promosi-togel'); ?> nav-m" target="_blank" href="<?php echo ftab("link_promosi", "web_setting", "link_promosi") ?>">Promosi</a>
  <a class="data-m <?php activetab('slot-gacor'); ?> nav-m" href="<?php echo ftab("link_rtp", "web_setting", "link_rtp") ?>" target="_blank">Slot Gacor</a>
  <a class="data-m <?php activetab('data-keluaran-togel'); ?> nav-m" href="?page=data-keluaran-togel">Data Result</a>
  <a class="data-m <?php activetab('paito-togel-warna'); ?> nav-m" href="?page=paito-togel-warna">Paito Warna</a>

  <div class="accordion accordion-flush" id="menumobileac">
  <div class="accordion-item bg-transparent">
    <h2 class="accordion-header" id="flush-headingOne">
      <a class="alat-m <?php activetab('bbfs'); ?> <?php activetab('buku-mimpi-togel'); ?> <?php activetab('jadwal-togel'); ?> nav-m" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">Alat Togel <i class="fas fa-chevron-circle-down"></i></a>
    </h2>
    <div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#menumobileac">
      <div class="accordion-body">
        <a class="alat-m <?php activetab('bbfs'); ?> nav-m" href="?page=bbfs">BB Generator</a>
        <a class="buku-mimpi-m <?php activetab('konversi-toto-sgp'); ?> nav-m" href="?page=konversi-toto-sgp">Konv.Toto SGP</a>
        <a class="buku-mimpi-m <?php activetab('buku-mimpi-togel'); ?> nav-m" href="?page=buku-mimpi-togel">Buku Mimpi</a>
       
      </div>
    </div>
  </div>
</div>

  <a class="alat-m <?php activetab('bukti-jp-member'); ?> nav-m" href="<?php echo ftab("link_bukti", "web_setting", "link_bukti") ?>" target="_blank">Bukti Jackpot</a>
  <a class="alat-m <?php activetab('keluhan'); ?> nav-m" href="?page=keluhan">Keluhan</a>
  <a class="tour-m <?php activetab('turnamen'); ?> nav-m" target="_blank" href="<?php echo ftab("link_panduan", "web_setting", "link_panduan") ?>">Panduan</a>
  
</div>


<div id="mains"> <!-- Main Body Nav -->

<header>

<div class="m-0 d-lg-none">
    <div class="bg-wa">
         <a target="_blank" href="https://api.whatsapp.com/send?phone=<?php echo ftab("wa_number", "web_setting", "wa_number") ?>"><h6 class="title-wa m-0"><i class="fab fa-whatsapp"></i> Whatsapp</h6></a>
    </div>
</div>

<div class="top-nav">
        <div class="container">
                <div class="d-flex justify-content-center justify-content-lg-between">

                <div class="wrap-list">
                    <ul class="top-list">
                        <li>
                         <a target="_blank" href="<?php echo ftab("link_apk", "web_setting", "link_apk") ?>"><img src="images/icon-apk.webp" class="icon-apk" alt="icon apk"> Download Aplikasi Togel </a>
                        </li>
                        <li><a target="_blank" href="<?php echo ftab("link_daftarbo", "web_setting", "link_daftarbo") ?>">Daftar Jadi Member</a></li>
                        <li><a target="_blank" href="<?php echo ftab("link_apk2", "web_setting", "link_apk2") ?>"><i class="fab fa-telegram text-info"></i> Telegram</a></li>
                        <li><a target="_blank" href="<?php echo ftab("link_rtp2", "web_setting", "link_rtp2") ?>"><i class="fas fa-comments text-warning"></i> Livechat</a></li>
                    </ul>
                </div>

                <div class="d-lg-block d-none">
                    
                </div>


                <div class="d-lg-block wa-desc d-none">
                    <div class="bg-wa rounded-bottom">
                        <a target="_blank" href="https://api.whatsapp.com/send?phone=<?php echo ftab("wa_number", "web_setting", "wa_number") ?>"><h6 class="title-wa m-0"><i class="fab fa-whatsapp"></i> Whatsapp</h6></a>
                    </div>
                    <p><i class="fas fa-clock"></i> <span id="Date"><span>xxxxx</span>, xx xxx xxxx</span> ( <span id="hours">00</span><span id="point">:</span><span id="min">00</span><span id="point">:</span><span id="sec">00</span> )</p>
                </div>

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

<div class="nav-bar d-none d-lg-block shadow">
    <div class="container">
        <!-- Navbar -->
        <nav class="navbar navbar-expand-lg navbar-dark">
                <div class="container-fluid">
                    <a style="margin-right: 7px !important;" class="navbar-brand" href="/">
                        <img src="<?php echo ftab("logo_web", "web_setting", "logo_web") ?>" class="img-fluid d-block mx-auto" alt="logo blog ">
                    </a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#menubar" aria-controls="menubarcontent" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                    </button>
                    <div class="collapse navbar-collapse" id="menubar">
                    <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                        <li class="nav-item">
                        <a class="nav-link 
                            <?php
                                if(!isset($_GET['page'])) {
                                    echo 'active';
                                }
                            ?>
                        " aria-current="page" href="/"><i class="fas fa-home"></i> Home</a>
                        </li>
                        
                        <li class="nav-item">
                        <a class="nav-link <?php activetab('livedraw-togel'); ?>" href="?page=livedraw-togel">Live draw</a>
                        </li>

                        <li class="nav-item">
                        <a class="nav-link <?php activetab('prediksi-togel'); ?>" href="?page=prediksi-togel">Prediksi Togel</a>
                        </li>

                        <li class="nav-item position-relative">
                        <span class="position-absolute notify translate-middle badge rounded-pill bg-danger">
                               <span class="blinks"><i class="fas fa-fire"></i> HOT!</span>
                            </span>
                        <a class="nav-link <?php activetab('slot-gacor'); ?>" target="_blank" href="<?php echo ftab("link_rtp", "web_setting", "link_rtp") ?>">RTP Slot Gacor</a>
                        </li>
                        
                        <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="menualattogel" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                            Alat Togel
                        </a>
                        <ul class="dropdown-menu" aria-labelledby="menualattogel">
                            <li><a class="dropdown-item" href="?page=jadwal-togel">Jadwal Togel</a></li>
                            <li><a class="dropdown-item" href="?page=bbfs">Bbfs Generator</a></li>
                            <li><a class="dropdown-item" href="?page=buku-mimpi-togel">Buku Mimpi</a></li>
                            <li><a class="dropdown-item" href="?page=paito-togel-warna">Paito Togel Warna</a></li>
                            <li><a class="dropdown-item" href="?page=konversi-toto-sgp">Konversi Toto SGP</a></li>
                            
                            
                        </ul>
                        </li>

                        <li class="nav-item position-relative">
                            <span class="position-absolute notify translate-middle badge rounded-pill bg-danger">
                               <span class="blinks">NEW!</span> 
                            </span>
                        <a class="nav-link <?php activetab('data-keluaran-togel'); ?>" href="?page=data-keluaran-togel">Data Result</a>
                        </li>
                        <li class="nav-item">
                        <a class="nav-link <?php activetab('bukti-jp-member'); ?>" href="<?php echo ftab("link_bukti", "web_setting", "link_bukti") ?>" target="_blank">Bukti Jackpot</a>
                        </li>
                        <li class="nav-item position-relative">
                        <span class="position-absolute notify translate-middle badge rounded-pill bg-danger">
                               <span class="blinks"><i class="fas fa-fire"></i> HOT!</span>
                            </span>
                        <a class="nav-link <?php activetab('promosi-togel'); ?>" target="_blank" href="<?php echo ftab("link_promosi", "web_setting", "link_promosi") ?>">Promosi</a>
                        </li>
                        
                        <li class="nav-item">
                        <a class="nav-link <?php activetab('keluhan'); ?>" href="?page=keluhan">Keluhan</a>
                        </li>
                        <li class="nav-item">
                        <a class="nav-link <?php activetab('turnamen'); ?>" href="<?php echo ftab("link_panduan", "web_setting", "link_panduan") ?>" target="_blank">Panduan</a>
                        </li>
                    </ul>

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

        <!-- /Navbar -->
    </div>
</div>

</header>

<div class="container">
<div class="main position-relative">
    <button id="btn-up" class="btn btn-danger btn-up"><i class="fas fa-chevron-circle-up"></i></button>

    <div class="d-lg-none">
    <div class="container">

        <div class="main navbar-ms border-bottom border-dark">
            <div class="d-flex align-items-center justify-content-center">
                <div>
                   <a href="/"><img class="img-fluid" src="<?php echo ftab("logo_web", "web_setting", "logo_web") ?>" alt="logo blog mobile"></a>
                </div>

                <!-- <div onclick="openMobilenav()" class="navbar-icons">
                    <i class="fas fa-bars"></i>
                </div> -->

            </div>
        </div>


    </div>
</div>


    <div class="d-lg-none d-sm-block">
    <div class="container p-3">
        <div class="row g-2">
                <div class="col-6">
                        <div class="d-grid">
                            <a href="/" class="btn btn-sm btn-warning">Home</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=livedraw-togel" class="btn btn-sm btn-warning">Livedraw</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=prediksi-mobile" class="btn btn-sm btn-warning">Prediksi Togel</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a target="_blank" href="<?php echo ftab("link_promosi", "web_setting", "link_promosi") ?>" class="btn btn-sm btn-warning">Promosi</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=jadwal-togel" class="btn btn-sm btn-warning">Jadwal Togel</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=data-keluaran-togel" class="btn btn-sm btn-warning">Data Result</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="<?php echo ftab("link_rtp", "web_setting", "link_rtp") ?>" target="_blank" class="btn btn-sm btn-warning">RTP Slot Gacor</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=bbfs" class="btn btn-sm btn-warning">BB Generator</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=paito-togel-warna" class="btn btn-sm btn-warning">Paito Warna</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=konversi-toto-sgp" class="btn btn-sm btn-warning">Konv.Toto SGP</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=buku-mimpi-togel" class="btn btn-sm btn-warning">Buku Mimpi</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="<?php echo ftab("link_bukti", "web_setting", "link_bukti") ?>" target="_blank" class="btn btn-sm btn-warning">Bukti Jackpot</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="?page=keluhan" class="btn btn-sm btn-warning">Keluhan</a>
                        </div>
                </div>

                <div class="col-6">
                        <div class="d-grid">
                            <a href="<?php echo ftab("link_panduan", "web_setting", "link_panduan") ?>" target="_blank" class="btn btn-sm btn-warning">Panduan</a>
                        </div>
                </div>

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


    <div class="row">

        <!-- TitleBar -->
        <div class="col-lg-12 order-lg-1 mb-2">
                <div class="position-relative">
                    <div class="icon-teksberjalan">
                        <i class="fas fa-bullhorn text-secondary"></i>
                    </div>
                    <marquee class="text-uppercase" scrollamount="3" direction="left"><?php echo ftab("pengumuman_web", "web_setting", "pengumuman_web") ?></marquee>
                </div>
        </div>
        <?php 
        //     if(!isset($_GET['page'])) {
                                
        //    echo ' <div class="col-lg-12 order-lg-1 mb-2">
        //         <div class="alert alert-warning title-main alert-dismissible fade show" role="alert">
        //                 <h1 class="blinks text-uppercase">Pengumuman Penting!</h1>
        //                 <hr class="w-75">
        //                      '. ftab("pengumuman_web", "web_setting", "pengumuman_web") .' 
        //             <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
        //         </div>      
        //     </div> ';
        //     }
        ?>

        <!-- /TitleBar -->

        
            <!-- Mainbar -->
            <div class="col-lg-12 order-lg-3 mb-3">

                        <div class="row bg-mainslide p-2 justify-content-center">
                            <div class="col-lg-7">
                                     <div class="swiper slider-blog">
                                        <!-- Additional required wrapper -->
                                        <div class="swiper-wrapper">
                                            <!-- Slides -->

                                                <?php
                                                    $sslide = "SELECT sliders FROM img_sliders";
                                                    $qslide = mysqli_query($data, $sslide);
                                                    $b = 0;
                                                    if(mysqli_num_rows($qslide) > 0) {
                                                        while($fslide = mysqli_fetch_assoc($qslide)) {
                                                            $slideimg = $fslide['sliders'];
                                                            
                                                            echo '<div class="swiper-slide">
                                                                <img data-src="'.$slideimg.'" alt="slider '.$b++.'" class="swiper-lazy rounded w-100" />
                                                                <div class="swiper-lazy-preloader"></div>
                                                            </div>';
                                                        }

                                                    } else {
                                                        echo '<div class="swiper-slide">
                                                        No Slider
                                                    </div>';
                                                    }
                                                    
                                                ?>

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

                                    <div class="row g-1 my-2">
                                            <div class="col d-grid">
                                                <a target="_blank" href="<?php echo ftab("link_daftarbo", "web_setting", "link_daftarbo") ?>" class="btn btn-sm btn-warning"><i class="fas fa-sign-in-alt"></i> Login</a>
                                            </div>

                                            <div class="col d-grid">
                                                <a target="_blank" href="<?php echo ftab("link_promosi", "web_setting", "link_promosi") ?>" class="btn btn-sm btn-primary"><i class="fas fa-hand-holding-usd"></i> Promo</a>
                                            </div>

                                            <div class="col d-grid">
                                                <a target="_blank" href="<?php echo ftab("link_rtp", "web_setting", "link_rtp") ?>" class="btn btn-sm btn-warning"><i class="fas fa-gamepad"></i> RTP Slot</a>
                                            </div>
                                    </div>


                            </div>

                            
                            <?php
                                $sbanner = "SELECT link_bannerweb, link_targetweb FROM banner_web";
                                $qbanner = mysqli_query($data, $sbanner);

                                if(mysqli_num_rows($qbanner) > 0) {
                                    echo '<div class="col-lg-5 d-none d-lg-block">';
                                    $x = 1;
                                    while($fbanner = mysqli_fetch_assoc($qbanner)) {
                                        echo '
                                      <a href="'.$fbanner['link_targetweb'].'" target="_blank">  <img src="'.$fbanner['link_bannerweb'].'" class="img-fluid" alt="banner blog togel  '.$x++.'"> </a>
                                    ';
                                    }
                                    echo '</div>';
                                }
                            ?>
                            

                        </div>

                        <hr>

                    <?php
                        if(isset($_GET['page'])) {
                            $page = mysqli_real_escape_string($data, $_GET['page']);

                            switch($page) {

                                case 'prediksi-togel' :
                                    include 'assets/pages/prediksi.php';
                                break;

                                case 'data-keluaran-togel' :
                                    include 'assets/pages/result.php';
                                break;

                                case 'bbfs' :
                                    include 'assets/pages/bbfs.php';
                                break;

                                case 'keluhan' :
                                    include 'assets/pages/keluhan.php';
                                break;

                                case 'promosi-togel' :
                                    include 'assets/pages/promosi.php';
                                break;

                                case 'paito-togel-warna' :
                                    include 'assets/pages/paito.php';
                                break;

                                case 'panduan' :
                                    include 'assets/pages/panduan.php';
                                break;

                                case 'livedraw-togel' :
                                    include 'assets/pages/livedraw.php';
                                break;

                                case 'slot-gacor' :
                                    include 'assets/pages/slotgacor.php';
                                break;

                                case 'prediksi-mobile' :
                                    include 'assets/pages/prediksi-mb.php';
                                break;

                                case 'bukti-jp-member' :
                                    include 'assets/pages/bukti-jp.php';
                                break;

                                case 'jadwal-togel' :
                                    include 'assets/pages/jadwal.php';
                                break;

                                case 'buku-mimpi-togel' :
                                    include 'assets/pages/bukumimpi.php';
                                break;

                                case 'konversi-toto-sgp' :
                                    include 'assets/pages/totosgp.php';
                                break;

                                case 'turnamen' :
                                    include 'assets/pages/turnamen.php';
                                break;

                                default: 
                                    include 'assets/pages/main.php';
                                break;

                            }

                        } else {
                            include 'assets/pages/main.php';
                        }
                        
                    ?>

            </div>
            <!-- /Mainbar -->


        <!-- Sidebar -->
            <!-- <div class="col-lg-3 order-lg-2 mb-3">
                        <img src="images/slotgif.gif" width="230" alt="">
                        <hr>
                        <div id="rtpslot"></div>

                    <div id="dindongwrap">
                        <img src="images/dindo.gif" class="img-fluid title-img">
                        <div class="my-2" id="dindong-game"><img src="images/loading.gif" width="50" alt="loading"> </div>
                    </div>
                    
            </div> -->
        <!-- /Sidebar -->

        <div class="col-lg-12 order-lg-3">
            <hr class="w-75 d-block mx-auto" />
             <?php echo ftab("web_infos", "web_setting", "web_infos"); ?>
        </div>

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

<?php echo ftab("content_script2", "web_setting", "content_script2")?>

<footer class="text-center text-light py-3">
    <div class="container d-flex justify-content-center">
        <p>Copyright &copy; <?php echo '<p class="mx-1">' .date("Y"). '</p>' . ftab("footer_web", "change_text", "footer_web") ?></p>
    </div>
</footer>

</div> <!-- /Main Body Nav -->

<!-- Kontak aktif -->
<div class="modal fade" id="kontakus" tabindex="-1" aria-labelledby="kontaklabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="kontaklabel"><i style="font-size: 0.9rem;" class="fas bg-danger text-light rounded-circle p-2 fa-phone-alt"></i> Hubungi Kami:</h5>
      </div>
      <div class="modal-body">
            <?php echo ftab("isi_kontak", "web_setting", "isi_kontak"); ?>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-bs-dismiss="modal"><i class="fas fa-check"></i> Selesai</button>
      </div>
    </div>
  </div>
</div>