    <?php
    /*** BEGIN .Halaman Utama (Beranda atau Home) ***/
    if ($_GET['module']=='home'){
    ?>
<?php
 	  $querystatis  = "SELECT * FROM halamanstatis WHERE id_halaman=1";
        $detailstatis = mysqli_query($konek, $querystatis);
	      $r1            = mysqli_fetch_array($detailstatis);
	      
	  $querystatis2  = "SELECT * FROM halamanstatis WHERE id_halaman=2";
        $detailstatis2 = mysqli_query($konek, $querystatis2);
	      $r2            = mysqli_fetch_array($detailstatis2);
	      
	      
	  $querystatis3  = "SELECT * FROM halamanstatis WHERE id_halaman=4";
        $detailstatis3 = mysqli_query($konek, $querystatis3);
	      $r3            = mysqli_fetch_array($detailstatis3);

     ?>
      <?php
                // Tampilkan 5 headline berita terbaru
                $queryterbaru = "SELECT * FROM banner ORDER BY id_banner ASC";
                $hasilterbaru = mysqli_query($konek, $queryterbaru);
              $t=mysqli_fetch_array($hasilterbaru); ?>
     
     
    <div class="container-fluid py-5" 
     style="background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0)), 
            url(<?php echo "$d[alamat_website]/foto_banner/$t[gambar]" ?>);
            background-position: center;
            background-size: cover;
            border-radius:10px;">
<div class="container py-lg-5 py-0">
  <div class="row align-items-center">

  <!-- Kolom Teks -->
  <div class="col-lg-8 col-md-12 text-lg-start text-center mb-4 mb-lg-0">
   <span class="label" style="
      display:inline-block;
      background-color:#fcde05;
      color:#000;
      padding:4px 15px;
      border-radius:20px;
      font-size:14px;
      margin-bottom:8px;">
      bunker-lsi.com 
    </span>
    <h1 class="display-4 text-uppercase text-dark mb-4" 
        style="font-size: calc(1.475rem + 1.7vw);">
      <?php echo "$r1[judul]" ?>
    </h1>

    <span class="fs-5 text-dark mb-0">
      <?php echo "$r1[isi_halaman]" ?>
    </span>
    
    <div class="d-flex justify-content-center  justify-content-lg-start   flex-shrink-0 mb-4 ">
                                           <a target="_blank" class="btn btn-primary py-3 px-4 px-md-5 ms-2" href="https://api.whatsapp.com/send?phone=<?php echo"$d[twitter]"?>&amp;text=<?php echo"$d[twitter_widget]"?>" style="border-radius:50rem"> Hubungi Kami</a> 
                                           
                                        </div>
                                        
                                        
                                        
  </div>

  <!-- Kolom Gambar -->
  <div class="col-lg-4 col-md-12 text-center">
    <img src="<?php echo "$d[alamat_website]/foto_banner/$r1[gambar]" ?>" 
         alt="Image" 
         class="img-fluid rounded"
         style="max-width:100%;">
  </div>

</div>

</div>
</div>
     
     
     <div class="container-fluid about bg-light py-5" id="about">
            <div class="container py-5">
                <div class="row g-5 align-items-center justify-content-center">
                    <div class="col-xl-6 wow fadeInLeft animated" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s;">
                        <div>
                           <h5 style="color:#2887ff">Tentang Kami</h5>
                             <h1 class="display-5 mb-4"><?php echo"$r2[judul]"?></h1>
                           <?php echo"$r2[isi_halaman]"?>  
                           
                        </div>
                    </div>

                    <div class="col-xl-6 wow fadeInLeft animated" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s;">
                        <div>
                           
                          <img src="<?php echo"$d[alamat_website]/foto_banner/$r2[gambar]"?>" style="width:100%;border-radius:10px">
                                                     
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
     
     
     
     
     <!-- Abvout Start -->
        <div class="container-fluid blog py-5" id="produk">
            <div class="container py-5">
             <div class="text-center mx-auto pb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px;">
      <h1 class="display-5 text-dark">Our Product</h1>
      <hr class="mx-auto mb-5" style="width: 80px; border: 2px solid #ffc107; opacity: 1;">
    </div>
                <div class="row g-5 align-items-center justify-content-center text-start">
<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM berita  ORDER BY id_berita DESC";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($g=mysqli_fetch_array($hasilvideo)) {
                
                ?>
<div class="col-xl-4 ">
                           
              
                            
                            
                            
                             <a >
                            <img src="<?php echo"$d[alamat_website]/foto_berita/$g[gambar]"?>" class="img-fluid w-100" style="width: 100%;height:auto;object-fit: cover;margin-top: 0px;border-radius: 10px;">
                          </a>
                          </div>
                            
 <div class="col-xl-8 ">                              
                            
                        <a  class="h3 d-inline-block mb-3 "><?php echo"$g[judul]"?></a>

                        
                        
                        
                       <?php echo"$g[isi_berita]"?>
                    
        
                        

                      
                      <div class="text-center w-100 pt-2 px-5"> 
                        <a href="https://api.whatsapp.com/send?phone=<?php echo"$d[twitter]"?>&amp;text=<?php echo"$d[twitter_widget]"?>" class="btn btn-primary rounded-pill py-3" style="font-size: 1rem;font-weight: 700;color:#fff;border-radius: 10px !important;padding: 10px 30px !important;width: 100%;">Order Now
                        </a>
                      
                    </div>
                    </div>
                    
                  <?php } ?>

                </div>
            </div>
        </div>
        <!-- About End -->




     
     
     
     
     
     
     
     
     
        
        
        
        
        
        





         <div class="container-fluid faq  bg-light" id="faq">
            <div class="container py-5">
                <div class="text-center mx-auto wow fadeInUp animated" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s;">
               
                    <h1 class="display-5">FAQ</h1>
                     <hr class="mx-auto mb-5" style="width: 80px; border: 2px solid #ffc107; opacity: 1;">
                    
                   
                </div>
            
                      
                     <div class="accordion rounded p-2" id="accordionExample">
  <div class="row g-4 justify-content-center">

    <?php
    $queryterbaru = "SELECT * FROM tag ORDER BY id_tag ASC";
    $hasilterbaru = mysqli_query($konek, $queryterbaru);
    $no = 0;
    while($t = mysqli_fetch_array($hasilterbaru)) {
      $no++;
      $isFirst = ($no == 1);
    ?>
    
    <div class="col-lg-10">
      <div class="accordion-item shadow-sm rounded border-0">
        <h2 class="accordion-header" id="heading<?php echo $t['id_tag']; ?>">
          <button class="accordion-button <?php echo !$isFirst ? 'collapsed' : ''; ?> bg-light fw-semibold text-white wawa fw-bold"
            type="button"
            data-bs-toggle="collapse"
            data-bs-target="#collapse<?php echo $t['id_tag']; ?>"
            aria-expanded="<?php echo $isFirst ? 'true' : 'false'; ?>"
            aria-controls="collapse<?php echo $t['id_tag']; ?>">

            <i class="bi bi-tag me-2 text-white"></i>
            <?php echo"$t[nama_tag]"?>
          </button>
        </h2>
        <div id="collapse<?php echo $t['id_tag']; ?>"
          class="accordion-collapse collapse <?php echo $isFirst ? 'show' : ''; ?>"
          aria-labelledby="heading<?php echo $t['id_tag']; ?>"
          data-bs-parent="#accordionExample">
          <div class="accordion-body">
           
            <?php echo"$t[tgl_mulai]"?>
          </div>
        </div>
      </div>
    </div>

    <?php } ?>

  </div>
</div>

            </div>
        </div>
        
        




  <!-- Abvout Start -->
       <div class="container-fluid blog py-5">
            <div class="container py-5">
             <div class="text-center mx-auto pb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px;">
      <h1 class="display-5">Artikel</h1>
      <hr class="mx-auto mb-5" style="width: 80px; border: 2px solid #ffc107; opacity: 1;">
    </div>
    
    <div class="row g-5 align-items-center justify-content-center">
    
    
               	<?php 
        $query  = "SELECT * FROM agenda ORDER BY id_agenda DESC LIMIT 3";
        $tampil = mysqli_query($konek, $query);
        while($r=mysqli_fetch_array($tampil)){
            $isi_agenda = strip_tags($r['isi_agenda']); // membuat paragraf pada isi berita dan mengabaikan tag html
                  $isi = substr($isi_agenda,0,150); // ambil sebanyak 170 karakter
                  $isi = substr($isi_agenda,0,strrpos($isi," ")); // potong per spasi kalimat
                 
                  $tgl_posting = tgl_indo($r['tgl_posting']);
                 
                 
                 
        ?>
<div class="col-xl-4 px-3">
                           
                       <div class="blog-item p-2" style="box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.5);">
                     <a href="<?php echo"$d[alamat_website]/artikel-$r[tema_seo]"?>">
                            <img src="<?php echo"$d[alamat_website]/foto_banner/$r[gambar]"?>" class="img-fluid w-100 rounded" style="width: 100%;height:350px;object-fit: cover;margin-top: 0px;" alt="<?php echo"$r[tema]"?>">
                      
                          </a>
                       <div class="text-start p-4 ">
                        <a href="<?php echo"$d[alamat_website]/artikel-$r[tema_seo]"?>" class="h4 d-inline-block my-3 text-start"><?php echo"$r[tema]"?></a>
                       
                        <p class=""><i class="fas fa-calendar me-2"></i> <?php echo"$tgl_posting"?> <i class="fas fa-eye ms-2 me-1"></i> <?php echo"$r[dibaca]"?>x</p>

                        <p><?php echo"$isi"?>..</p>

 <p>
                       <a href="<?php echo"$d[alamat_website]/artikel-$r[tema_seo]"?>" class="" style="font-size: 1rem;font-weight: 700;color:#000">Selengkapnya <i class="fa fa-arrow-right" style="padding-left:5px"></i>
                        </a>
                        
                        </p>
                         </div>
                    </div>
                    </div>
                    
                  <?php } ?>
                    
                    <div class="col-xl-4 text-center">
                        
                                           <a class="btn btn-primary py-3 px-4 px-md-5 ms-2" href="<?php echo"$d[alamat_website]/blog"?>" style="border-radius:50rem"> Lihat Semua</a> 
                                           
                                        
                    </div>
                    
                </div>
            </div>
        </div>
        <!-- About End -->

  <!-- Abvout Start -->
        <div class="container-fluid blog py-5 bg-light" id="videos">
            <div class="container py-5">
                <div class="text-center mx-auto pb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                    
                    <h1 class="display-5 mb-4">Our Videos</h1>
                  
                </div>
                <div class="row g-5">
    

<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM polling ORDER BY id_polling DESC LIMIT 3";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($g=mysqli_fetch_array($hasilvideo)) {
          
            
              

                ?>

                    <div class="col-xl-4 wow fadeInLeft" data-wow-delay="0.2s">
                           <iframe width="100%" height="315" src="https://www.youtube.com/embed/<?php echo"$g[pilihan]"?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
                    </div>
                    
                  <?php } ?>
            
            
            <div class="col-xl-12 px-2 py-2 mt-0 text-center">
<p class="mt-5 text-center"><a class="btn btn-primary rounded-pill py-3 px-4 px-md-5 ms-2" href="<?php echo"$d[alamat_website]/videos"?>">Lihat Semua </a></p>

</div>



                </div>
            </div>
        </div>
        <!-- About End -->
        
        
        
        
        

    <?php
    }     /*** END .Halaman Utama (Beranda atau Home) ***/

    
    /*** BEGIN .Detail Berita ***/
    elseif ($_GET['module']=='detailberita'){
     $query5 = "SELECT * FROM berita WHERE judul_seo='$_GET[judul_seo]'";       
              $hasil5 = mysqli_query($konek, $query5);
              $r=mysqli_fetch_array($hasil5);
               $tanggal = tgl_indo($r['tanggal']);
              ?>

            
    <!-- Header Start -->
            <div class="container-fluid bg-breadcrumb d-none d-lg-block" >
               
            
        </div>
        <!-- Navbar & Hero End -->

 <!-- Abvout Start -->
        <div class="container-fluid about py-5">
            <div class="container py-5">
                <div class="row g-5 align-items-center">
                    <div class="col-xl-5 wow fadeInRight" data-wow-delay="0.2s">
                       
                            <img src="<?php echo"$d[alamat_website]/foto_berita/$r[gambar]"?>" class="img-fluid rounded w-100" alt="">
                            
                      
                    </div>
                    <div class="col-xl-7 wow fadeInLeft" data-wow-delay="0.2s">
                        <div>
                           
                            <h1 class="display-5 mb-4"><?php echo"$r[judul]"?></h1>
                            <?php echo"$r[isi_berita]"?>
                           
                        </div>
                    </div>
                    
                </div>
            </div>
        </div>
        <!-- About End -->




<!-- Abvout Start -->
        <div class="container-fluid about py-5">
            <div class="container py-5">
                <div class="row g-5 align-items-center">


<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM album WHERE id_berita=$r[id_berita] ORDER BY id_album DESC";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($g=mysqli_fetch_array($hasilvideo)) {?>

                    <div class="col-xl-3 wow fadeInLeft" data-wow-delay="0.2s">
                     
                            <img src="<?php echo"$d[alamat_website]/foto_album/$g[gambar]"?>" style="width: 100%;height:300px;object-fit: cover;margin-top: 0px;border-radius: 10px;">
                      
                    </div>
                    
                  <?php } ?>

                </div>
            </div>
        </div>
        <!-- About End -->





     <?php
	     
    } /*** END .Detail Berita ***/
    /*** BEGIN .Semua Berita ***/
    elseif ($_GET['module']=='testimoni'){
    ?>

    <style>
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}

/* Button used to open the contact form - fixed at the bottom of the page */


/* The popup form - hidden by default */
.form-popup {
  display: none;
  position: fixed;
  bottom: 0;
  left: 15px;
  border: 3px solid #191919;
  z-index: 9;
}

/* Add styles to the form container */
.form-container {
  max-width: 300px;
  padding: 10px;
  background-color: #191919;
}

/* Full-width input fields */
.form-container input[type=text], .form-container input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  border: none;
  background: #f1f1f1;
}

/* When the inputs get focus, do something */
.form-container input[type=text]:focus, .form-container input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}

/* Set a style for the submit/login button */
.form-container .btn {
  background-color: #04AA6D;
  color: white;
  padding: 16px 20px;
  border: none;
  cursor: pointer;
  width: 100%;
  margin-bottom:10px;
  opacity: 0.8;
}

/* Add a red background color to the cancel button */
.form-container .cancel {
  background-color: red;
}

/* Add some hover effects to buttons */
.form-container .btn:hover, .open-button:hover {
  opacity: 1;
}



.navbar .navbar-nav .nav-link:hover, .navbar .navbar-nav .nav-link.active, .sticky-top .navbar .navbar-nav .nav-link:hover, .sticky-top .navbar .navbar-nav .nav-link.active {
  color: #5ea4dd !important;
}
.navbar .navbar-nav .nav-item::before, .navbar .navbar-nav .nav-item::after {
  position: absolute;
  content: "";
  width: 0;
  height: 0;
  border: 0px solid #5ea4dd;
  transition: 0.5s;
}
.navbar .navbar-nav .nav-item::before, .navbar .navbar-nav .nav-item::after {
  position: absolute;
  content: "";
  width: 0;
  height: 0;
  border: 0px solid #5ea4dd;
  transition: 0.5s;
}

body {
  top: 0px !important;
}

.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none; // add !important if required 
  }
</style>
   <!-- Header Start -->
   <?php
                   $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Testimoni</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Testimoni</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->	



            <!-- Abvout Start -->
        <div class="container-fluid about py-5">
            <div class="container py-5">
                <div class="row g-5 align-items-center">


                       <div class="col-xl-4 wow fadeInLeft" data-wow-delay="0.2s">
                     
                            <h1 class="display-4 mb-4" style="color:#000">Apa Kata Client Kami</h1>
                            


                             <button class="btn btn-primary rounded-pill text-white py-3 px-5" onclick="openForm()" >Tulis Testimoni <i class="fas fa-arrow-right text-primary me-2" style="color: #fff !important;padding-left: 8px;"></i></button>
                      
                    </div>


<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM galeri ORDER BY id_galeri DESC";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($r=mysqli_fetch_array($hasilvideo)) {
                $tanggal=tgl_indo($r['tgl']);
                ?>

                    <div class="col-xl-4 wow fadeInLeft" data-wow-delay="0.2s">
                     
                            <div class="testimonial-item bg-white rounded p-4" style="border:1px solid #f19a26;">
                                <div class="d-flex">
                                    <div><i class="fas fa-quote-left fa-3x text-dark me-3" style="color: #f19a26 !important;"></i></div>
                                   <p><span style="color: #f19a26; font-family: Roboto, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><span style="color: #202124; font-family: Roboto, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"><?php echo"$r[isig]"?></span></span></p>                                </div>
                                <div class="d-flex justify-content-end">
                                    <div class="my-auto text-end">
                                        <h5 style="color: #f19a26 !important;"><?php echo"$r[judul_galeri]"?></h5>
                                        <p class="mb-0"><?php echo"$tanggal"?></p>
                                    </div>
                                    <div class="bg-white rounded-circle ms-3">
                                        
                                                  
          <img src="https://static.thenounproject.com/png/1743561-200.png" class="rounded-circle p-2" style="width: 80px; height: 80px; border: 1px solid; border-color: #f19a26;" alt="">
          
                                                  
                                    </div>
                                </div>
                            </div>
                      
                    </div>
                    
                  <?php } ?>

                </div>
            </div>
        </div>
        <!-- About End -->	


         <div class="form-popup" id="myForm">
  <form action="<?php echo"$d[alamat_website]/aksi-review"?>" class="form-container" method="post">
    <span onclick="closeForm()" style="padding-left: 30px;float: right;">X</span>
   <h3 style="font-height: 25px;font-family: 'Open sans';font-weight: 700;color:#fff;margin-bottom: 20px;margin-top: 0px;text-transform: capitalize ;text-align: center">Write Rivew </h3>

   
    <label for="email"><b>Nama</b></label>
    <input type="text" placeholder="Enter Name" name="judul_galeri" id="judul_galeri" required>

    <label for="psw"><b>Isi Testimoni</b></label>
    <textarea class="form-control" name="isig" id="isig" placeholder="Enter Rivew" rows="10" required="" style="margin-bottom: 30px;background-color: #fff;"></textarea>

    <button type="submit" class="btn">Rivew</button>
    
  </form>
</div>

<script>
function openForm() {
  document.getElementById("myForm").style.display = "block";
}

function closeForm() {
  document.getElementById("myForm").style.display = "none";
}
</script>
			
    <?php         
    } /*** END .Semua Berita ***/

     /*** BEGIN .Semua Berita ***/
    elseif ($_GET['module']=='aksireview'){
        
      $judul_galeri   = addslashes($_POST['judul_galeri']);
      $isig  = addslashes($_POST['isig']);


      $queryhubungi = "INSERT INTO galeri(judul_galeri,
                                           isig,
                                           tgl) 
                                  VALUES('$judul_galeri',
                                         '$isig',
                                         '$tgl_sekarang')";
      $hasilhubungi = mysqli_query($konek, $queryhubungi);
      header('Location:testimoni');
}
 
    
    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='keunggulan'){
       
                $querystatis2  = "SELECT * FROM halamanstatis WHERE id_halaman=2";
        $detailstatis2 = mysqli_query($konek, $querystatis2);
	      $r2            = mysqli_fetch_array($detailstatis2);
               
                
     // Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->


       <!-- Abvout Start -->
        <div class="container-fluid blog py-5" id="keunggulan">
            <div class="container py-5">
                <div class="text-center mx-auto wow fadeInUp animated" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s;">
               
                    <h1 class="display-5 ">Our Advantages</h1>
                    
                     <hr class="mx-auto mb-5" style="width: 80px; border: 2px solid #ffc107; opacity: 1;">
                   
                </div>
                <div class="row g-5 align-items-center justify-content-center text-center">

      
<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM video3 ORDER BY id_video3 DESC";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($g=mysqli_fetch_array($hasilvideo)) {?>

                    
                    <div class="col-xl-4 wow fadeInLeft animated" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s;">
                            
                 
                        <div class="blog-item p-4" style="border-radius:  10px;">
                     
                   
              
              
                        <h4><?php echo"$g[judul_video3]"?></h4>
                        <?php echo"$g[deskripsi]"?>
                      
                        
                    </div>
                    </div>
                    
                  <?php } ?>

    </div>
            </div>
        </div>
        <!-- About End -->
        
        
      <!-- Payment Method Start -->
<div class="container-fluid about py-5">
  <div class="container py-5">
    <div class="row g-5 align-items-center justify-content-center bg-light px-0 px-md-5 shadow-lg py-5" style="border-radius:15px;">

      <!-- Bagian Kiri: Logo Payment -->
      <div class="col-xl-6 wow fadeInLeft mt-3 mt-md-0" data-wow-delay="0.2s">
       
        <h1 class="display-5 mb-4 text-dark">Payment Methods</h1>
       

        <div class="row g-3">
          <?php
          $queryvideo = "SELECT * FROM album ORDER BY id_album DESC LIMIT 6";
          $hasilvideo = mysqli_query($konek, $queryvideo);
          while ($g=mysqli_fetch_array($hasilvideo)) { ?>
            
            <div class="col-4 col-md-3">
              <div class="bg-white rounded shadow-sm h-100 d-flex align-items-center justify-content-center p-3 payment-card" style="transition: all 0.3s;">
                <img src="<?php echo"$d[alamat_website]/foto_album/$g[gambar]"?>" 
                     class="img-fluid" 
                     alt="Metode Pembayaran" style="max-height:40px;">
              </div>
            </div>

          <?php } ?>
        </div>
      </div>

      <!-- Bagian Kanan: Konten Dinamis -->
      <div class="col-xl-6 wow fadeInRight mt-5 mt-md-0" data-wow-delay="0.3s">
        
        <h1 class="display-5 mb-4 text-dark"><?php echo"$r2[judul]"?></h1>
      
          <?php echo"$r2[isi_halaman]"?>
  
      </div>

    </div>
  </div>
</div>
<!-- Payment Method End -->

<!-- CSS Extra -->
<style>
  .payment-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  }
</style>

        
        
        
        
        
        
















        
        

 <?php  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='detaillayanan'){
    $query5 = "SELECT * FROM video WHERE video_seo='$_GET[video_seo]'";       
              $hasil5 = mysqli_query($konek, $query5);
              $r=mysqli_fetch_array($hasil5);
               
               $baca         = $r['dibaca']+1;
              ?>
<style>
    .text-primary{
        color:#000 !important;
    }
</style>
<!-- Header Start -->
            <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_video/$r[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;">
               

               <div class="text-center" style="max-width: 100%;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s"><?php echo"$r[judul_video]"?></h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary"><?php echo"$r[judul_video]"?></li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
            
    

<div class="container-fluid blog py-5">
            <div class="container pb-5">
              
                <div class="row g-4 justify-content-center">


                    <div class="col-md-12">
                        <div class="blog-item bg-light rounded p-4" style="box-shadow: inset 0 0 5px rgba(0, 0, 0, .1);">
                                                      
                            <div class="my-4">
                                
                            <img src="<?php echo"$d[alamat_website]/foto_video/$r[gambar]"?>" style="width:100%;border-radius:10px">
                            
                                  <h1 style="padding-top:2rem"> <?php echo"$r[judul_video]"?></h1>
                                 

                                                 <h3 style="color:red"><?php echo"$r[link_youtube]"?></h3>

                                <?php echo"$r[deskripsi]"?>
                            </div>
   
                        </div>
                    </div>



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

<?php  
  $dibaca = mysqli_query($konek, "UPDATE video SET dibaca=$r[dibaca]+1 WHERE video_seo='$_GET[video_seo]'");  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='detailrenungan'){
    $query5 = "SELECT * FROM berita WHERE judul_seo='$_GET[judul_seo]'";       
              $hasil5 = mysqli_query($konek, $query5);
              $r=mysqli_fetch_array($hasil5);
           
              ?>
<div class="container-fluid position-relative p-0 d-none d-lg-block">
            
            <!-- Header Start -->
            <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_berita/$r[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  background-size: cover;">
                
            </div>
            <!-- Header End -->
        </div>










<!-- Form Pemesanan Domain -->
<div class="container my-5">
  <div class="row justify-content-center">
    <div class="col-lg-8">
      <div class="card shadow-lg rounded-4 border-0">
        <div class="card-body p-5">
          <h2 class="fw-bold text-center mb-4">Form Pemesanan Domain</h2>
          <p class="text-muted text-center mb-4">Isi data berikut untuk memesan domain di <span class="fw-bold">Lelangdi.com</span>.</p>

        <form method="POST" action="cart">
            
            <!-- Nama Lengkap -->
            <div class="mb-3">
              <label for="nama" class="form-label">Nama Lengkap</label>
              <input type="text" name="nama" id="nama" class="form-control form-control-lg" placeholder="Masukkan nama lengkap" required>
            </div>

            <!-- Email -->
            <div class="mb-3">
              <label for="email" class="form-label">Email</label>
              <input type="email" name="email" id="email" class="form-control form-control-lg" placeholder="Masukkan email aktif" required>
            </div>

            <!-- Nomor WhatsApp -->
            <div class="mb-3">
              <label for="wa" class="form-label">Nomor WhatsApp</label>
              <input type="text" name="wa" id="wa" class="form-control form-control-lg" placeholder="Contoh: 08123456789" required>
            </div>

            <!-- Nama Domain -->
            <div class="mb-3">
              <label for="domain" class="form-label">Domain yang Dipesan</label>
              <input type="text" name="domain" value="<?php echo"$r[judul]"?>" class="form-control form-control-lg" placeholder="<?php echo"$r[judul]"?>" readonly>
            </div>
            
             <div class="mb-3">
              <label for="domain" class="form-label">Harga Awal Domain</label>
              <input type="text" name="a2" value="<?php echo"$r[a2]"?>" class="form-control form-control-lg" placeholder="<?php echo"$r[a2]"?>" readonly>
            </div>

  <!-- Nomor WhatsApp -->
            <div class="mb-3">
              <label for="wa" class="form-label">Harga Penawaran</label>
              <input type="text" name="harga" id="harga" class="form-control form-control-lg" placeholder="" required>
            </div>
          

            <!-- Catatan Tambahan -->
            <div class="mb-4">
              <label for="catatan" class="form-label">Catatan Tambahan (Opsional)</label>
              <textarea name="catatan" id="catatan" rows="3" class="form-control form-control-lg" placeholder="Masukkan catatan tambahan jika ada"></textarea>
            </div>

            <button type="submit" class="btn btn-warning btn-lg w-100 fw-bold shadow-sm">Ikut Lelang</button>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>


 <?php  
    } /*** END .Hubungi Aksi ***/
    
    
    
    elseif ($_GET['module']=='cart'){

 $nama      = $_POST['nama'];
    $email     = $_POST['email'];
    $wa        = $_POST['wa'];
    $domain    = $_POST['domain'];
    $a2        = $_POST['a2'];
    $harga     = $_POST['harga'];
    $catatan   = $_POST['catatan'];

    $to      = "delyastore15@gmail.com"; // email tujuan
    $subject = "Pemesanan Domain dari $nama";
    $body    = "
Nama: $nama
Email: $email
WhatsApp: $wa
Domain: $domain
Harga Awal: $a2
Harga Penawaran: $harga
Catatan: $catatan
    ";
    $headers = "From: $email\r\n";

    if(mail($to, $subject, $body, $headers)){
        echo "<script>alert('Pemesanan berhasil! Cek email Anda.'); window.location='';</script>";
    } else {
        echo "<script>alert('Gagal mengirim email.'); window.history.back();</script>";
    }


 } /*** END .Detail PRODUK DIGITAL ***/
    
    
     /*** BEGIN .Hubungi Aksi ***/
    elseif ($_GET['module']=='hubungiaksi'){
      $nama   = $_POST['nama'];
      $email  = $_POST['email'];
      $phone  = $_POST['phone'];
      $person = $_POST['person'];
      $berangkat  = $_POST['berangkat'];
      $layanan  = $_POST['layanan'];
      $orders  = $_POST['orders'];

      
      

      $queryhubungi = "INSERT INTO hubungi(nama_pengirim,
                                           email,
                                           phone,
                                           person,
                                           berangkat,
                                           layanan,
                                           orders,
                                           tanggal) 
                                  VALUES('$nama',
                                         '$email',
                                         '$phone',
                                         '$person',
                                         '$berangkat',
                                         '$layanan',
                                         '$orders',
                                         '$tgl_sekarang')";
      $hasilhubungi = mysqli_query($konek, $queryhubungi); ?>
<script>
setTimeout(function(){
  window.location.href = 'https://wa.me/<?php echo $d["twitter"] ?>?text=Hello%2C%20I%20would%20like%20to%20book%20a%20<?php echo urlencode($layanan) ?>%20with%20the%20following%20details%3A%0AName%3A%20<?php echo urlencode($nama) ?>%0AEmail%3A%20<?php echo urlencode($email) ?>%0APhone%3A%20<?php echo urlencode($phone) ?>%0ANumber%20of%20Persons%3A%20<?php echo urlencode($person) ?>%0ATour%20Date%3A%20<?php echo urlencode($berangkat) ?>%0AVia%20Website%3A%20<?php echo urlencode($d["alamat_website"]) ?>%0AKindly%20confirm%20the%20availability%20and%20further%20details.%20Thank%20you%21';
}, 1000);
</script>
            




            
      
    <?php  
    } /*** END .Hubungi Aksi ***/


     elseif ($_GET['module']=='pelayanan'){
    $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

  <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Pelayanan Produk</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Layanan</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->


   

<div class="container-fluid blog py-5">
            <div class="container py-5">
                <div class="row g-5 align-items-center justify-content-center text-center">



<?php 
      $query2  = "SELECT * FROM video ORDER BY id_video DESC";
      $tampil2 = mysqli_query($konek, $query2);
      while ($r2=mysqli_fetch_array($tampil2)){?>

<div class="col-xl-4 wow fadeInLeft animated" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s;">
    <div class="square-flip">


        <div class='square' style="background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url(<?php echo"$d[alamat_website]/foto_video/$r2[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  border-radius: 10px;
  ">
            <div class="square-container">
               
                <h2 class="textshadow"><?php echo"$r2[judul_video]"?></h2>
            </div>
            <div class="flip-overlay"></div>
        </div>


        <div class='square2' data-image="http://localhost/legis/foto_berita/2069839882_2.jpg">
            <div class="square-container2">
                <div class="align-center"></div>
               <span class="text-white"><?php echo"$r2[deskripsi]"?></span> 
            </div>
            <div class="flip-overlay"></div>
        </div>



    </div>

</div>
 <?php } ?>  

<div class="col-xl-4">
<a class="btn btn-primary rounded-pill py-3 px-4 px-md-5 ms-2" href="<?php echo"$d[alamat_website]/proses-alur-maklon"?>" style="border-radius: .5rem !important;"><i aria-hidden="true" class="fas fa-external-link-alt" style="padding-right:10px"></i> ALUR MAKLON </a>
</div>



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





<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script id="rendered-js">
jQuery(document).ready(function ($) {

  //Count nr. of square classes
  var countSquare = $('.square').length;

  //For each Square found add BG image
  for (i = 0; i < countSquare; i++) {if (window.CP.shouldStopExecution(0)) break;
    var firstImage = $('.square').eq([i]);
    var secondImage = $('.square2').eq([i]);

    var getImage = firstImage.attr('data-image');
    var getImage2 = secondImage.attr('data-image');

    firstImage.css('background-image', 'url(' + getImage + ')');
    secondImage.css('background-image', 'url(' + getImage2 + ')');
  }window.CP.exitedLoop(0);

});
//# sourceURL=pen.js
    </script>





 <?php  

    }
    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='prosesalurmaklon'){
    $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

  <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Proses Alur Maklon</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Proses</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->





<div class="container-fluid feature py-5">
            <div class="container py-5">
                <div class="text-center mx-auto pb-5 mb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                   
                    <h1 class="display-5 mb-4">Alur Pembuatan Jasa Maklon</h1>
                    <hr style="height: 5px;color: #64a42c;opacity: 1;">
                  
                </div>
                <div class="row g-4">

<?php  
$query  = "SELECT * FROM menu ORDER BY id_menu ASC";
      $tampil = mysqli_query($konek, $query);
 
      $no = 1;
      while ($r=mysqli_fetch_array($tampil)){?>

                   <div class="col-md-4 col-lg-4 col-xl-4">
                                    <div class="d-flex">
                                        <div><i class="fas fa-lightbulb fa-3x text-primary"></i></div>
                                        <div class="ms-4">
                                            <h4><?php echo"$r[nama_menu]"?></h4>
                                            <p> <?php echo"$r[link]"?></p>
                                        </div>
                                    </div>
                                </div>
              

<?php } ?>

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




<div class="container-fluid feature py-5" style="background-color:#105D5E">
            <div class="container py-5">
                <div class="text-center mx-auto pb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                    
                    <h1 class="display-5 mb-4  text-white">Syarat & Ketentuan Jasa Maklon</h1>
                  
                </div>
                <div class="row g-4">
                    <div class="col-md-6 col-lg-6 col-xl-3 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <div class="feature-item p-4">
                            <div class="feature-icon p-4 mb-4">
                                <i class="fas fa-chart-line fa-4x text-primary"></i>
                            </div>
                            <h4>Kartu Indentitas </h4>
                            <p class="mb-4">KTP (Kartu Tanda Penduduk) yang masih berlaku dan aktif 
                            </p>
                            </div>
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-3 wow fadeInUp" data-wow-delay="0.4s" style="visibility: visible; animation-delay: 0.4s; animation-name: fadeInUp;">
                        <div class="feature-item p-4">
                            <div class="feature-icon p-4 mb-4">
                                <i class="fas fa-university fa-4x text-primary"></i>
                            </div>
                            <h4>Minimal Order </h4>
                            <p class="mb-4"> Batas minimal pemesanan produk adalah 100 botol*
                            </p>
                            <p>*S&K Berlaku.</p>
                            </div>
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-3 wow fadeInUp" data-wow-delay="0.6s" style="visibility: visible; animation-delay: 0.6s; animation-name: fadeInUp;">
                        <div class="feature-item p-4">
                            <div class="feature-icon p-4 mb-4">
                                <i class="fas fa-file-alt fa-4x text-primary"></i>
                            </div>
                            <h4>Nama Produk</h4>
                            <p class="mb-4">Siapkan tiga alternatif nama produk yang akan dijadikan produk Anda 
                            </p>
                           </div>
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-3 wow fadeInUp" data-wow-delay="0.8s" style="visibility: visible; animation-delay: 0.8s; animation-name: fadeInUp;">
                        <div class="feature-item p-4">
                            <div class="feature-icon p-4 mb-4">
                                <i class="fas fa-hand-holding-usd fa-4x text-primary"></i>
                            </div>
                            <h4>Biaya Perijinan </h4>
                            <p class="mb-4">Membayar biaya perijinan produk, baik itu POM TR (Obat Tradisional) ataupun POM NA (Kosmetika) 
                            </p>
                             </div>
                    </div>
                </div>
            </div>
        </div>

<style >
    @media (min-width: 1200px) {
  .col-xl-2 {
    flex: 0 0 auto;
    width: 20%;
  }
}
</style>



        <div class="container-fluid feature py-5">
            <div class="container py-5">
                <div class="text-center mx-auto pb-5 wow fadeInUp" data-wow-delay="0.2s" style="max-width: 800px; visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                    
                    <h1 class="display-5 mb-4">Jaminan Mutu dan Kualitas Terbaik</h1>
                  
                </div>
                <div class="row g-4">




                    <div class="col-md-6 col-lg-6 col-xl-2 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <img src="<?php echo"$d[alamat_website]/foto_galeri/1-HALAL.png"?>" style="height: auto;max-width: 100%;">
                    </div>

                     <div class="col-md-6 col-lg-6 col-xl-2 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <img src="<?php echo"$d[alamat_website]/foto_galeri/2-BPOM.png"?>" style="height: auto;max-width: 100%;">
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-2 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <img src="<?php echo"$d[alamat_website]/foto_galeri/3-HAKI.png"?>" style="height: auto;max-width: 100%;">
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-2 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <img src="<?php echo"$d[alamat_website]/foto_galeri/8-CPKB.png"?>" style="height: auto;max-width: 100%;">
                    </div>
                    <div class="col-md-6 col-lg-6 col-xl-2 wow fadeInUp" data-wow-delay="0.2s" style="visibility: visible; animation-delay: 0.2s; animation-name: fadeInUp;">
                        <img src="<?php echo"$d[alamat_website]/foto_galeri/iso.png"?>" style="height: auto;max-width: 100%;">
                    </div>
                   






                </div>
            </div>
        </div>
 <?php  

    }
    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='faq'){
    $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

  <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Panduan & Garansi</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">FAQ</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->

<div class="container-fluid faq py-5 bg-light">
            <div class="container py-5">
            
                      
                     <div class="accordion rounded p-2" id="accordionExample">
  <div class="row g-4 justify-content-center">

    <?php
    $queryterbaru = "SELECT * FROM tag ORDER BY id_tag ASC";
    $hasilterbaru = mysqli_query($konek, $queryterbaru);
    $no = 0;
    while($t = mysqli_fetch_array($hasilterbaru)) {
      $no++;
      $isFirst = ($no == 1);
    ?>
    
    <div class="col-lg-10">
      <div class="accordion-item shadow-sm rounded border-0">
        <h2 class="accordion-header" id="heading<?php echo $t['id_tag']; ?>">
          <button class="accordion-button <?php echo !$isFirst ? 'collapsed' : ''; ?> bg-light fw-semibold text-white wawa fw-bold"
            type="button"
            data-bs-toggle="collapse"
            data-bs-target="#collapse<?php echo $t['id_tag']; ?>"
            aria-expanded="<?php echo $isFirst ? 'true' : 'false'; ?>"
            aria-controls="collapse<?php echo $t['id_tag']; ?>">

            <i class="bi bi-tag me-2 text-white"></i>
            <?php echo"$t[nama_tag]"?>
          </button>
        </h2>
        <div id="collapse<?php echo $t['id_tag']; ?>"
          class="accordion-collapse collapse <?php echo $isFirst ? 'show' : ''; ?>"
          aria-labelledby="heading<?php echo $t['id_tag']; ?>"
          data-bs-parent="#accordionExample">
          <div class="accordion-body">
           
            <?php echo"$t[tgl_mulai]"?>
          </div>
        </div>
      </div>
    </div>

    <?php } ?>

  </div>
</div>

            </div>
        </div>

 <?php  

    }
    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='detailblog'){
    $query5 = "SELECT * FROM agenda WHERE tema_seo='$_GET[tema_seo]'";       
              $hasil5 = mysqli_query($konek, $query5);
              $r=mysqli_fetch_array($hasil5);
               $tanggal = tgl_indo($r['tgl_posting']);
               $baca         = $r['dibaca']+1;
              ?>

            
    <!-- Header Start -->
            <div class="container-fluid bg-breadcrumb d-none d-lg-block" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$r[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  height: 50px;
  background-size: cover;">
               
            
        </div>
        <!-- Navbar & Hero End -->

<div class="container-fluid blog py-5">
            <div class="container pb-5">
              
                <div class="row g-4 justify-content-center">


                    <div class="col-md-8">
                        <div class="blog-item bg-light rounded p-4" >
                                                      
                            <div class="my-4">
                                 <img src="<?php echo"$d[alamat_website]/foto_banner/$r[gambar]"?>" style="width: 100%;">

                                  <h1 style="padding-top:2rem"> <?php echo"$r[tema]"?></h1>
                                  <p class="mb-0" style="padding-bottom:2rem"> 
                                    <span><i class="fas fa-user me-2"></i> Admin</span>

                                    <span style="padding-left: 20px;"><i class="fas fa-calendar me-2"></i> <?php echo"$tanggal"?></span>

                                     <span style="padding-left: 20px;"><i class="fas fa-eye  me-2"></i> <?php echo"$r[dibaca]"?>x</span>
                                    


                                </p>   

                                                

                                <?php echo"$r[isi_agenda]"?>
                            </div>
   
                        </div>
                    </div>


                  <div class="col-md-4">
                  


              <div class="blog-item bg-light rounded p-4" >
                  <h1 style="padding-left: 10px"> <a href="#" class="h4">Related Post</a></h1>

                  <?php 
      $query2  = "SELECT * FROM agenda ORDER BY rand() LIMIT 10";
      $tampil2 = mysqli_query($konek, $query2);
      while ($r2=mysqli_fetch_array($tampil2)){
       $tanggal = tgl_indo($r2['tgl_posting ']); // konversi ke format tanggal indonesia
                    $tgl = explode(' ', $tanggal); // pisahkan penanggalan -> $tgl[0] = tanggal, $tgl[1] = bulan, $tgl[2] = tahun 
                      
        ?>


                  <div class="d-flex" style="padding: 10px">

                     <div class="bg-white rounded-circle">
                        <a href="<?php echo"$d[alamat_website]/artikel-$r2[tema_seo]"?>">
                                        <img src="<?php echo"$d[alamat_website]/foto_banner/$r2[gambar]"?>" class="rounded-circle p-2" style="width: 80px; height: 80px; border: 1px solid; border-color: var(--bs-primary);" alt=""></a>
                                    </div>
                                    <div class="my-auto text-end" style="text-align: left !important;padding-left: 15px">
                                        <a href="<?php echo"$d[alamat_website]/artikel-$r2[tema_seo]"?>">
                                        <h5 style="font-size: 1rem;"><?php echo"$r2[tema]"?></h5>
                                        </a>
                                        <p class="mb-0"><?php echo"$tanggal"?></p>

                                    </div>
                                   
                                </div>



              <?php } ?>
              </div>







                </div>


                </div>
          
        </div> 
 </div> 
 <?php  
$dibaca = mysqli_query($konek, "UPDATE agenda SET dibaca=$r[dibaca]+1 WHERE tema_seo='$_GET[tema_seo]'");  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='product'){
        
  
        
        
           $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Produk Kami</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Our Produk</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->







         <!-- Abvout Start -->
        <div class="container-fluid blog py-5">
            <div class="container py-5">
             
                <div class="row g-5 align-items-center justify-content-center text-center">
<?php
              // Tampilkan semua video 
                $queryvideo = "SELECT * FROM video  ORDER BY id_video DESC";
              $hasilvideo = mysqli_query($konek, $queryvideo);
              
              while ($g=mysqli_fetch_array($hasilvideo)) {
                
                ?>
<div class="col-xl-4 px-3">
                            <a href="<?php echo"$d[alamat_website]/layanan-$g[video_seo]"?>">
                            <img src="<?php echo"$d[alamat_website]/foto_video/$g[gambar]"?>" class="img-fluid w-100" style="width: 100%;height:350px;object-fit: cover;margin-top: 0px;border-radius: 10px 10px 0px 0px;">
                          </a>
                        <div class="blog-item p-4" style="border-radius: 0px 0px 10px 10px;">   
                            <div class="text-left"> 
                        <a href="<?php echo"$d[alamat_website]/layanan-$g[video_seo]"?>" class="h5 d-inline-block mb-3 "><?php echo"$g[judul_video]"?></a>

                        
                        
                        
                        <h3 style="color:red"><?php echo"$g[link_youtube]"?></h3>
                    </div>
        
                        

                      
                      <div class="text-center w-100 pt-2 px-5"> 
                        <a href="<?php echo"$d[alamat_website]/layanan-$g[video_seo]"?>" class="btn btn-primary rounded-pill py-3" style="font-size: 1rem;font-weight: 700;color:#fff;border-radius: 10px !important;padding: 10px 30px !important;width: 100%;">Detail Produk
                        </a>
                        </div>
                    </div>
                    </div>
                    
                  <?php } ?>

                </div>
            </div>
        </div>
        <!-- About End -->




















 <?php  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='blog'){
       // Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Our Blog</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Blog</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->

        <style>
    .pagination .page-link {
  color: #ce2522;
  border: 1px solid #ce2522;
}

.pagination .page-link:hover {
  background-color: #f8d7da;
  border-color: #ce2522;
}

.pagination .active .page-link {
  background-color: #ce2522;
  border-color: #ce2522;
  color: #fff;
}

</style>



<!-- Blog Start -->
<div class="container-fluid blog py-5">
    <div class="container py-5">
        <div class="row g-5 align-items-center">

            <?php 
            
            
            $p = new paging_berita;
	            $batas  = 9;
	            $posisi = $p->cariPosisi($batas);
	            
	            
             $query  = "SELECT * FROM agenda ORDER BY id_agenda DESC LIMIT $posisi,$batas";
        $tampil = mysqli_query($konek, $query);
           while($g=mysqli_fetch_array($tampil)){
                $isi_agenda = strip_tags($g['isi_agenda']);
                $isi = substr($isi_agenda, 0, 170);
                $isi = substr($isi, 0, strrpos($isi, " "));
                
                  $tanggal = tgl_indo($g['tgl_posting']);
            ?>
                <div class="col-xl-4 wow fadeInLeft" data-wow-delay="0.2s">
                    
                    <div class="blog-item p-2" style="box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.5);">
                    <a href="<?php echo "$d[alamat_website]/artikel-$g[tema_seo]"; ?>">
                        <img src="<?php echo "$d[alamat_website]/foto_banner/$g[gambar]"; ?>" class="img-fluid w-100" style="height:300px; object-fit: cover; border-radius: 10px 10px 0 0;">
                    </a>
                   
                         <div class="text-start p-4 ">
                         <p class="mb-4"><i class="fas fa-calendar me-2"></i> <?php echo $tanggal; ?> <i class="fas fa-eye ms-2 me-1"></i> <?php echo $g['dibaca'] ?>x</p>
                         
                         
                        <a href="<?php echo "$d[alamat_website]/artikel-$g[tema_seo]"; ?>" class="h4 d-inline-block mb-3"><?php echo $g['tema']; ?></a>
                        <p class="mb-4"><?php echo $isi; ?>...</p>
                        <a href="<?php echo "$d[alamat_website]/artikel-$g[tema_seo]"; ?>" style="font-size: 1rem; font-weight: 700; color: #000;">Selengkapnya <i class="fa fa-arrow-right ms-1"></i></a></div>
                    </div>
                </div>
            <?php } 
            
            
            
              // query untuk paging halaman berita per kategori
              $querydata   = mysqli_query($konek, "SELECT * FROM agenda");
              $jmldata     = mysqli_num_rows($querydata);
              $jmlhalaman  = $p->jumlahHalaman($jmldata, $batas);
		          $linkHalaman = $p->navHalaman($_GET['halberita'], $jmlhalaman);                  
            ?>
        <nav class="d-flex justify-content-center mt-4" aria-label="Page navigation">
  <div class="btn-group" role="group">
    <?php echo"$linkHalaman"?>
  </div>
</nav>
        

        </div>


    </div>
</div>
<!-- Blog End -->
    <?php  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='videos'){
            $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Videos</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Videos</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->

<style>
    .pagination .page-link {
  color: #ce2522;
  border: 1px solid #ce2522;
}

.pagination .page-link:hover {
  background-color: #f8d7da;
  border-color: #ce2522;
}

.pagination .active .page-link {
  background-color: #ce2522;
  border-color: #ce2522;
  color: #fff;
}

</style>



<!-- Blog Start -->
<div class="container-fluid blog py-5">
    <div class="container py-5">
        <div class="row g-5 align-items-center justify-content-center">

            <?php 
            
             $p = new paging_kategori;
	            $batas  = 9;
	            $posisi = $p->cariPosisi($batas);

	            
	            
             $query  = "SELECT * FROM polling ORDER BY id_polling DESC LIMIT $posisi,$batas";
        $tampil = mysqli_query($konek, $query);
           while($g=mysqli_fetch_array($tampil)){
         
            ?>
                <div class="col-xl-4 wow fadeInLeft" data-wow-delay="0.2s">
                    
                   
                  <iframe width="100%" height="315" src="https://www.youtube.com/embed/<?php echo"$g[pilihan]"?>" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
                </div>
            <?php } 
            
            // query untuk paging halaman berita per kategori
              $querydata   = mysqli_query($konek, "SELECT * FROM polling");
              $jmldata     = mysqli_num_rows($querydata);
              $jmlhalaman  = $p->jumlahHalaman($jmldata, $batas);
		          $linkHalaman = $p->navHalaman($_GET['halkategori'], $jmlhalaman);           
            
            ?>
        
         <nav class="d-flex justify-content-center mt-4" aria-label="Page navigation">
  <div class="btn-group" role="group">
    <?php echo"$linkHalaman"?>
  </div>
</nav>

        </div>


    </div>
</div>
<!-- Blog End -->





     <?php  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='galeri'){
            $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Our Project</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Gallery</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->

<div class="container-fluid faq py-5">
    <div class="container py-5">
        <div class="text-center mx-auto pb-4 wow fadeInUp animated" data-wow-delay="0.2s" style="max-width: 800px;">
            <h1 class="display-6 fw-bold text-dark mb-3">Gallery Foto</h1>
            <hr class="mx-auto" style="width: 80px; border: 2px solid #5e201c; opacity: 1;">
        </div>

        <div class="gallery text-center">
            <?php
            $query = "SELECT * FROM galeri ORDER BY id_galeri DESC";
            $result = mysqli_query($konek, $query);
            $no = 1;
            while ($g = mysqli_fetch_array($result)) {
                $imgUrl = $d['alamat_website'].'/foto_galeri/'.$g['gambar'];
                echo '
                <a href="#" data-bs-toggle="modal" data-bs-target="#galleryModal'.$no.'">
                    <img src="'.$imgUrl.'" alt="'.$g['judul_galeri'].'">
                    
                    <h5 class="pt-3"> '.$g['judul_galeri'].'</h5>
                </a>
               

                <!-- Modal -->
                <div class="modal fade" id="galleryModal'.$no.'" tabindex="-1" aria-hidden="true">
                  <div class="modal-dialog modal-dialog-centered modal-lg">
                    <div class="modal-content bg-transparent border-0">
                      <div class="modal-body p-0">
                        <img src="'.$imgUrl.'" class="img-fluid w-100 rounded" alt="'.$g['judul_galeri'].'">
                        
                       
                      </div>
                    </div>
                  </div>
                </div>
                ';
                $no++;
            }
            ?>
        </div>
    </div>
</div>
<!-- Gallery End -->

<style>
.gallery {
    column-count: 3;
    column-gap: 10px;
}
.gallery a {
    display: inline-block;
    margin-bottom: 10px;
    width: 100%;
    cursor: pointer;
}
.gallery img {
    width: 100%;
    display: block;
    border-radius: 8px;
    break-inside: avoid;
    transition: transform 0.2s ease;
}
.gallery img:hover {
    transform: scale(1.05);
}
/* Responsif */
@media (max-width: 992px) {
    .gallery { column-count: 2; }
}
@media (max-width: 576px) {
    .gallery { column-count: 1; }
}
</style>


 <?php  
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='logout'){
      
        session_unset();
session_destroy();

// Redirect ke homepage atau login
header("Location: login");
exit();
    } /*** END .Hubungi Aksi ***/

    /*** BEGIN .Hasil Polling ***/
    elseif ($_GET['module']=='pendaftaran'){
    	 



       // Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Registration</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a >Home</a></li>
                        <li class="breadcrumb-item active text-primary">Registration</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->








        	<!-- Login / Register Section -->
<div class="container d-flex align-items-center justify-content-center min-vh-100">
  <div class="row shadow-lg rounded-4 overflow-hidden bg-white" style="max-width: 900px; width: 100%;">
    
    <!-- Bagian Kiri (Brand / Info) -->
    <div class="col-lg-6 d-none d-lg-flex flex-column justify-content-center align-items-center text-white p-5" style="background: linear-gradient(135deg,#ff9800,#ffc107);">
      <h1 class="fw-bold mb-3">Lelangdi.com</h1>
      <p class="fs-5 text-center">A trusted platform for buying and selling premium domains with a secure, fast, and transparent auction system.</p>
    </div>

    <!-- Bagian Kanan (Form) -->
    <div class="col-lg-6 p-5">
      <!-- Login Form -->
       <div id="registerForm" >
        <h3 class="fw-bold mb-4 text-dark">Create New Account</h3>
        <form method="POST" action="<?php echo"$d[alamat_website]/register"?>">
          <div class="mb-3">
            <label class="form-label">Nama Lengkap</label>
            <input type="text" name="nama" class="form-control form-control-lg" placeholder="Enter full name" required>
          </div>
          <div class="mb-3">
            <label class="form-label">Email</label>
            <input type="email" name="email" class="form-control form-control-lg" placeholder="Enter email" required>
          </div>
          <div class="mb-3">
            <label class="form-label">Password</label>
            <input type="password" name="password" class="form-control form-control-lg" placeholder="Create password" required>
          </div>
          <button type="submit" class="btn btn-warning btn-lg w-100 mb-3">Sign Up</button>
        </form>
        <p class="text-center text-muted">Already have an account?
          <a href="<?php echo"$d[alamat_website]/login"?>" class="text-warning fw-bold">Sign In here</a>
        </p>
      </div>

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


 <?php
    } /*** END .Hasil Polling ***/


    /*** BEGIN .Lihat Polling ***/
    elseif ($_GET['module']=='register'){ 





$nama = $_POST['nama'];
$email = $_POST['email'];
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);



   // Cek apakah email sudah ada
    $cek_email = mysqli_query($konek, "SELECT email FROM user_pendaftar WHERE email='$email'");
    if (mysqli_num_rows($cek_email) > 0) {
        echo "<script>alert('Email sudah terdaftar! Silakan gunakan email lain.'); window.history.back();</script>";
        exit;
    }
    









// Generate kode verifikasi
$kode = rand(100000, 999999);

// Aktifkan error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);

// Menyisipkan koneksi ke database
mysqli_query($konek, "INSERT INTO user_pendaftar 
  (nama, email, password, kode_verifikasi, status_akun, tanggal) 
  VALUES 
  ('$nama', '$email', '$password', '$kode', 'pending', '$tgl_sekarang')");



kirimEmailVerifikasi($email, $nama, $kode);


    } 
    
     elseif ($_GET['module']=='verifikasi'){
      
    if (isset($_POST['verifikasi'])) {
    $email = $_POST['email'];
    $kode_input = $_POST['kode'];

    $cek = mysqli_query($konek, "SELECT * FROM user_pendaftar WHERE email='$email'");
    $data = mysqli_fetch_array($cek);

    if ($data['kode_verifikasi'] == $kode_input) {
        mysqli_query($konek, "UPDATE user_pendaftar SET status_akun='aktif' WHERE email='$email'");
        
        echo "
        <div class='container mt-4' style='max-width:600px;'>
            <div class='alert alert-success alert-dismissible fade show shadow-sm rounded-3' role='alert'>
                <h5 class='fw-bold mb-1'>✅ Verifikasi Berhasil!</h5>
                <p class='mb-0'>Akun Anda sudah aktif. Anda akan diarahkan ke halaman login dalam <strong>3 detik</strong>.</p>
            </div>
        </div>
        ";
        echo "<script>
                setTimeout(function() {
                    window.location.href = 'login';
                }, 3000);
              </script>";
    } else {
        echo "
        <div class='container mt-4' style='max-width:600px;'>
            <div class='alert alert-danger alert-dismissible fade show shadow-sm rounded-3' role='alert'>
                <h5 class='fw-bold mb-1'>❌ Kode Salah!</h5>
                <p class='mb-0'>Kode verifikasi yang Anda masukkan tidak sesuai. Silakan coba lagi.</p>
            </div>
        </div>
        ";
    }
}



// Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz);
?>

  <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb d-none d-lg-block" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-0" style="max-width: 900px;">
                  
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->
        
        
        
        
        <div class="container-fluid py-5 bg-light">
  <div class="container d-flex justify-content-center align-items-center py-5" style="max-width: 600px;">
    <div class="card shadow-lg border-0 rounded-4 w-100">
      <div class="card-body p-5 text-center">

        <!-- Judul -->
        <div class="mb-4">
          <div class="rounded-circle bg-warning d-inline-flex align-items-center justify-content-center shadow" 
               style="width:80px; height:80px;">
            <i class="bi bi-shield-lock-fill fs-1 text-white"></i>
          </div>
          <h2 class="fw-bold text-dark mt-4">Verifikasi Akun</h2>
          <p class="text-muted">Masukkan kode verifikasi yang telah kami kirim ke email Anda.</p>
        </div>

        <!-- Form -->
        <form method="POST">
          <input type="hidden" name="email" value="<?php echo $_GET['email']; ?>">

          <div class="mb-4">
            <input type="text" 
                   name="kode" 
                   class="form-control form-control-lg text-center fs-4 fw-bold tracking-widest" 
                   placeholder="••••••" 
                   maxlength="6" 
                   required>
          </div>

          <button type="submit" 
                  class="btn btn-warning btn-lg w-100 fw-bold shadow-sm" 
                  name="verifikasi">
            Verifikasi
          </button>
        </form>

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












    <?php
    } /*** END .Hasil Polling ***/


    /*** BEGIN .Lihat Polling ***/
    elseif ($_GET['module']=='login'){
  
                // Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Login</h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Login</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->

		<!-- Login / Register Section -->
<div class="container d-flex align-items-center justify-content-center min-vh-100">
  <div class="row shadow-lg rounded-4 overflow-hidden bg-white" style="max-width: 900px; width: 100%;">
    
    <!-- Bagian Kiri (Brand / Info) -->
    <div class="col-lg-6 d-none d-lg-flex flex-column justify-content-center align-items-center text-white p-5" style="background: linear-gradient(135deg,#ff9800,#ffc107);">
      <h1 class="fw-bold mb-3">Lelangdi.com</h1>
      <p class="fs-5 text-center">A trusted platform for buying and selling premium domains with a secure, fast, and transparent auction system.</p>
    </div>

    <!-- Bagian Kanan (Form) -->
    <div class="col-lg-6 p-5">
      <!-- Login Form -->
      <div id="loginForm">
        <h3 class="fw-bold mb-4 text-dark">Login to Your Account</h3>
        <form action="proses-login" method="POST">
          <div class="mb-3">
            <label class="form-label">Email</label>
            <input type="email" id="email" name="email" class="form-control form-control-lg" placeholder="Enter your email">
          </div>
          <div class="mb-3">
            <label class="form-label">Password</label>
            <input type="password" id="password" name="password" class="form-control form-control-lg" placeholder="Enter your password">
          </div>
        
          <button type="submit" class="btn btn-warning btn-lg w-100 mb-3">Login</button>
        </form>
        <p class="text-center text-muted">Don’t have an account?
          <a href="<?php echo"$d[alamat_website]/pendaftaran"?>" class="text-warning fw-bold">Sign up here</a>
        </p>
      </div>

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

 <?php if(isset($_SESSION['error'])): ?>
            <script>
                Swal.fire({
                    icon: '<?php echo $_SESSION['error']['type']; ?>',
                    title: '<?php echo $_SESSION['error']['type'] == 'danger' ? "Error" : "Peringatan"; ?>',
                    text: '<?php echo addslashes($_SESSION['error']['message']); ?>',
                    confirmButtonColor: '#667eea'
                });
            </script>
            <?php unset($_SESSION['error']); ?>
            <?php endif; ?>

    <?php
    } /*** END .Lihat Polling ***/
     elseif ($_GET['module']=='proseslogin'){
    $email = mysqli_real_escape_string($konek, $_POST['email']);
    $password = $_POST['password'];

   $query = "SELECT * FROM user_pendaftar WHERE email='$email'";
$result = mysqli_query($konek, $query);

if (mysqli_num_rows($result) == 1) {
    $user = mysqli_fetch_assoc($result);

    if (password_verify($password, $user['password'])) {
        if ($user['status_akun'] == 'aktif') {
            $_SESSION['user'] = $user;
            header("Location: dashboard");
            exit();
        } else {
            echo "<script>
                alert('Akun belum aktif. Silakan verifikasi email Anda terlebih dahulu.');
                window.history.back();
            </script>";
            exit();
        }
    } else {
        echo "<script>
            alert('Password yang Anda masukkan salah.');
            window.history.back();
        </script>";
        exit();
    }
} else {
    echo "<script>
        alert('Email tidak terdaftar dalam sistem.');
        window.history.back();
    </script>";
    exit();
}

}

     
     elseif ($_GET['module']=='dashboard'){
session_start(); // pastikan ini ada di paling atas halaman

if(isset($_SESSION['user'])) {
    $nama_user = $_SESSION['user']['nama']; // misal field nama di database
} else {
    $nama_user = "Guest";
}
      // Tampilkan 5 headline berita terbaru
                $queryterbaruz = "SELECT * FROM banner ORDER BY rand() DESC LIMIT 1";
                $hasilterbaruz = mysqli_query($konek, $queryterbaruz);
                $tz=mysqli_fetch_array($hasilterbaruz); ?>

   <!-- Header Start -->
           <div class="container-fluid bg-breadcrumb" style="background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url(<?php echo"$d[alamat_website]/foto_banner/$tz[gambar]"?>);background-position: center center;
  box-sizing: border-box;
  width: 100%;
  background-size: cover;
  ">
                <div class="container text-center py-5" style="max-width: 900px;">
                    <h4 class="text-white display-4 mb-4 wow fadeInDown" data-wow-delay="0.1s">Welcome <?php echo htmlspecialchars($nama_user); ?></h4>
                    <ol class="breadcrumb d-flex justify-content-center mb-0 wow fadeInDown" data-wow-delay="0.3s">
                        <li class="breadcrumb-item"><a href="index.html">Home</a></li>
                        <li class="breadcrumb-item active text-primary">Dasboard</li>
                    </ol>    
                </div>
            </div>
            <!-- Header End -->
        </div>
        <!-- Navbar & Hero End -->
     
     
     <div class="container mt-5">
  <h2>Catalog Domain</h2>

  <button class="btn btn-primary mb-3" id="tambahBtn">Add Domain</button>

  <div id="formContainer" style="display:none;" class="mb-3">
    <input type="hidden" id="id_berita" value="">
    <input type="text" id="judul" placeholder="Domain" class="form-control mb-2">
    <input type="text" id="regist" placeholder="Regist" class="form-control mb-2">
    <input type="text" id="age" placeholder="Registration Domain" class="form-control mb-2">
    <input type="text" id="harga" placeholder="Maximum Price" class="form-control mb-2">

    <!-- Input tanggal khusus edit -->
    <div id="tanggalWrapper" style="display:none;">
      <input type="date" id="tanggal" class="form-control mb-2">
    </div>

    <button class="btn btn-success" id="simpanBtn">Save</button>
    <button class="btn btn-secondary" id="batalBtn">Cancel</button>
  </div>

  <div id="tableContainer"></div>
  <!-- Note -->
  <div class="alert alert-warning mt-3" style="font-size:0.95rem;">
  <strong>Notice:</strong><br>
  Domains that are not updated within <b>3 months</b> will be <u>automatically hidden</u> from the website.<br>
  Please make sure to always update to the <b>current date</b> so your domain remains active and visible to visitors.
</div>

</div>


<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function(){

  function loadTable(){
    $.get("ajax_berita.php", function(data){
      $("#tableContainer").html(data);
    });
  }

  loadTable(); // load awal

  // Tambah
  $("#tambahBtn").click(function(){
    $("#formContainer").show();
    $("#id_berita").val('');
    $("#judul, #regist, #age, #harga").val('');
    $("#tanggalWrapper").hide(); // hide input tanggal
    $("#tanggal").val('');
  });

  // Batal
  $("#batalBtn").click(function(){
    $("#formContainer").hide();
  });

  // Simpan
  $("#simpanBtn").click(function(){
    var id = $("#id_berita").val();
    var judul = $("#judul").val();
    var regist = $("#regist").val();
    var age = $("#age").val();
    var harga = $("#harga").val();
    var tanggal = $("#tanggal").val(); // kosong kalau tambah

    $.post("ajax_berita.php", {
      id:id, judul:judul, regist:regist, age:age, harga:harga, tanggal:tanggal
    }, function(res){
      alert(res);
      $("#formContainer").hide();
      loadTable();
    });
  });

  // Hapus
  $(document).on("click", ".hapusBtn", function(){
    if(confirm("Yakin mau hapus?")){
      var id = $(this).data("id");
      $.post("ajax_berita.php", {hapus:id}, function(res){
        alert(res);
        loadTable();
      });
    }
  });

  // Edit
  $(document).on("click", ".editBtn", function(){
    var id = $(this).data("id");
    $.getJSON("ajax_berita.php?id="+id, function(data){
      $("#formContainer").show();
      $("#id_berita").val(data.id_berita);
      $("#judul").val(data.judul);
      $("#regist").val(data.isi_berita);
      $("#age").val(data.a1);
      $("#harga").val(data.a2);

      // khusus edit → show tanggal
      $("#tanggalWrapper").show();
      $("#tanggal").val(data.tanggal);
    });
  });

});
</script>

     
     
     <?php
     }
    ?>

