<?php

$query3 = "SELECT judul_website FROM identitas";
    $hasil3 = mysqli_query($konek, $query3);
    $data3  = mysqli_fetch_array($hasil3);


if (isset($_GET['judul_seo'])){
    $query = "SELECT judul FROM berita WHERE judul_seo='$_GET[judul_seo]'";
    $hasil = mysqli_query($konek, $query);
    $data  = mysqli_fetch_array($hasil);
    
    if(isset($data)) {
      echo "$data[judul]";
    } 
    else{
      $query2 = "SELECT judul_website FROM identitas";
      $hasil2 = mysqli_query($konek, $query2);
      $data2  = mysqli_fetch_array($hasil2);
		  echo "$data2[judul_website]";
    }
}

elseif ($_GET['module']=='kontak'){
    echo "Contact Us - $data3[judul_website]";
}

elseif ($_GET['module']=='tentangkami'){
    echo "About Us - $data3[judul_website]";
}

elseif ($_GET['module']=='galeri'){
    echo "Gallery - $data3[judul_website]";
}


elseif ($_GET['module']=='produk'){
     $query2215 = "SELECT * FROM kategori WHERE kategori_seo='$_GET[kategori_seo]'";
    $hasil2215 = mysqli_query($konek, $query2215);
    $data2215  = mysqli_fetch_array($hasil2215);
    echo "$data2215[nama_kategori] - $data3[judul_website]";
}

elseif ($_GET['module']=='testimoni'){
    echo "Testimoni - $data3[judul_website]";
}
elseif ($_GET['module']=='blog'){
    echo "Blog - $data3[judul_website]";
}

elseif ($_GET['module']=='layanan'){
   $query221 = "SELECT * FROM kategori WHERE kategori_seo='$_GET[kategori_seo]'";
    $hasil221 = mysqli_query($konek, $query221);
    $data221  = mysqli_fetch_array($hasil221);
    echo "$data221[nama_kategori]";
}



elseif ($_GET['module']=='detailblog'){
   $query22 = "SELECT * FROM agenda WHERE tema_seo='$_GET[tema_seo]'";
    $hasil22 = mysqli_query($konek, $query22);
    $data22  = mysqli_fetch_array($hasil22);
    echo "$data22[tema]";
}



elseif ($_GET['module']=='detaillayanan'){
   $query221 = "SELECT * FROM video WHERE video_seo='$_GET[video_seo]'";
    $hasil221 = mysqli_query($konek, $query221);
    $data221  = mysqli_fetch_array($hasil221);
    echo "$data221[judul_video] - $data3[judul_website]";
}



else{
    $query2 = "SELECT judul_website FROM identitas";
    $hasil2 = mysqli_query($konek, $query2);
    $data2  = mysqli_fetch_array($hasil2);
	  echo "$data2[judul_website]";
}
?>
