<?php
  error_reporting(0);
?>
<!DOCTYPE HTML>
<html lang = "en">
	<head>
		<title><?php include "teraskreasi_titel.php"; ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="robots" content="index, follow">
		<meta name="description" content="<?php include "teraskreasi1.php"; ?>">
		<meta name="keywords" content="<?php include "teraskreasi2.php"; ?>">
		<meta name="author" content="phpmu.com">
		<meta http-equiv="imagetoolbar" content="no">
		<meta name="language" content="Indonesia">
		<meta name="revisit-after" content="7">
		<meta name="webcrawlers" content="all">
		<meta name="rating" content="general">
		<meta name="spiders" content="all">

		<link rel="shortcut icon" href="favicon.png" />
		<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss.xml" />
			<?php $c = mysql_fetch_array(mysql_query("SELECT * FROM background")); 
			  $iden = mysql_fetch_array(mysql_query("SELECT * FROM identitas")); 
			?>
		<link rel="stylesheet" href="<?php echo "$f[folder]/background/lightbox.css" ?>">
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/reset.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/main-stylesheet.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/lightbox.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/shortcode.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/fonts.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/gambars.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/responsive.css" ?>" />
		<link type="text/css" rel="stylesheet" href="<?php echo "$f[folder]/background/$c[gambar]/demo-settings.css" ?>" />
		<script type="text/javascript">
			function validasi(form){
				if (form.nama_komentar.value == ""){ alert("Anda belum mengisikan Nama"); form.nama_komentar.focus(); return (false); }							
				if (form.email.value == ""){ alert("Anda belum mengisikan Email"); form.email.focus(); return (false); }									
				if (form.isi_komentar.value == ""){ alert("Anda belum menuliskan Komentar"); form.isi_komentar.focus(); return (false); }																		
			return (true);
			}
		</script>
		<link rel="stylesheet" href="<?php echo "$f[folder]"; ?>/lightbox/lightbox.css">
	</head>

	<body>
	<div class='demo-settings'></div>
		<div class="boxed">		
			<div class="header">
				<?php include "header.php"; ?>
			</div>
			
			<div class="content">
				<div class="wrapper">
				
					
						<?php
							$atas=mysql_query("SELECT * FROM iklanatas where id_iklanatas='1'");
							$iat=mysql_fetch_array($atas);
									$string = $iat['gambar'];
										if ($iat['gambar'] == ''){
										}else{
										echo "<div class='ad-banner'><a href='$iat[url]' target='_blank'>";
											if(preg_match("/swf\z/i", $string)) {
												echo "<embed style='margin-top:-10px' src='foto_iklantengah/$iat[gambar]' quality='high' type='application/x-shockwave-flash'>";
											} else {
												echo "<img style='margin-top:-10px; margin-bottom:-5px' src='foto_iklanatas/$iat[gambar]' title='$iat[judul]' />";
											}
										echo "</a></div>";
										}
						?>					
					
					
					<div class="breaking-news">
						<span class="the-title">Sekilas Info</span>
						<ul>
							<?php
							  $info=mysql_query("SELECT * FROM sekilasinfo ORDER BY id_sekilas  DESC LIMIT 10");
							  while($te=mysql_fetch_array($info)){
								echo "<li><a href='#'>$te[info]</a></li>";
							  }
							?>
							
						</ul>
						
					</div>

					<div style='background:#fff; border:6px solid #fff' class="main-content">
						<?php
							if ($_GET['module']=='home'){ 
								include "home.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
							}elseif ($_GET['module']=='detailberita'){
								include "detailberita.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_berita.php"; 
									echo "</div>";
							
							}elseif ($_GET['module']=='konsultasi'){
								include "konsultasi.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_berita.php"; 
									echo "</div>";
							
							}elseif ($_GET['module']=='detailkategori'){
								include "detailkategori.php";
								echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='hasilcari'){
								include "hasilcari.php";
								
							}elseif ($_GET['module']=='semuaplaylist'){
								include "semua-video.php";
								
							}elseif ($_GET['module']=='semuaagenda'){
								include "semua-agenda.php";
								
							}elseif ($_GET['module']=='detailagenda'){
								include "semua-agenda-detail.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='detailtag'){
								include "detailtag.php";
								
							}elseif ($_GET['module']=='detailmenu'){
								include "detailmenu.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='hasilpoling'){
								include "polling-hasil.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='lihatpoling'){
								include "polling-lihat.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='detailalbum'){
								include "berita-foto-detail.php";
									echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
									echo "</div>";
								
							}elseif ($_GET['module']=='hubungikami'){
								include "hubungi.php";
								
							}elseif ($_GET['module']=='hubungiaksi'){
								include "hubungiaksi.php";
								
							}elseif ($_GET['module']=='semuaalbum'){
								include "berita-foto.php";
								
							}elseif ($_GET['module']=='play'){
								include "play.php";
								echo "<div class='main-sidebar right'>";
										include "sidebar_video.php"; 
								echo "</div>";
								
							}elseif ($_GET['module']=='hasilcari'){
								include "hasilcari.php";
								
							}elseif ($_GET['module']=='indeksberita'){
								include "indexs-berita.php";
								
							}elseif ($_GET['module']=='semuadownload'){
								include "semua-download.php";
								echo "<div class='main-sidebar right'>";
										include "sidebar_kanan_statis.php"; 
								echo "</div>";
								
							}elseif ($_GET['module']=='notfound'){
								include "404.php";}
						?>
						<div class="clear-float"></div>

					</div>
			
				</div>
			</div>
			
			<div class="footer">
				<?php include "footer.php"; ?>
			</div>
			<?php
			  // Statistik user
			  $ip      = $_SERVER['REMOTE_ADDR']; // Mendapatkan IP komputer user
			  $tanggal = date("Ymd"); // Mendapatkan tanggal sekarang
			  $waktu   = time(); // 

			  // Mencek berdasarkan IPnya, apakah user sudah pernah mengakses hari ini 
			  $s = mysql_query("SELECT * FROM statistik WHERE ip='$ip' AND tanggal='$tanggal'");
			  // Kalau belum ada, simpan data user tersebut ke database
			  if(mysql_num_rows($s) == 0){
				mysql_query("INSERT INTO statistik(ip, tanggal, hits, online) VALUES('$ip','$tanggal','1','$waktu')");
			  } 
			  else{
				mysql_query("UPDATE statistik SET hits=hits+1, online='$waktu' WHERE ip='$ip' AND tanggal='$tanggal'");
			  }
			?>
		<!-- END .boxed -->
		</div>

		<!-- Scripts -->
		<script type="text/javascript" src="<?php echo "$f[folder]/jscript/jquery-latest.min.js" ?>"></script>
		<script type="text/javascript" src="<?php echo "$f[folder]/jscript/theme-scripts.js" ?>"></script>
		<script type="text/javascript" src="<?php echo "$f[folder]/jscript/lightbox.js" ?>"</script>
		<script type="text/javascript" src="<?php echo "$f[folder]/jscript/settings.js" ?>"</script>	
		<script src="<?php echo "$f[folder]/lightbox/lightbox.js" ?>" type="text/javascript"></script>
		<script>
			var lightbox = new Lightbox();
			lightbox.load({
				boxId: 				false,
				dimensions: 		true,
				captions: 			true,
				prevImg: 			false,
				nextImg: 			false,
				hideCloseBtn: 		false,
				closeOnClick: 		true,
				loadingAnimation: 	200,
				animElCount: 		4,
				preload: 			true,
				carousel: 			true,
				animation: 			400,
				nextOnClick: 		true,
				responsive: 		true,
				maxImgSize: 0.8,
				// callbacks
				onopen: 			function(){
					// your code goes here
				},
				onclose: 			function(){
					// your code goes here
				},
				onload: 			function(event){
					// your code goes here
				},
				onresize: 		function(){
					// your code goes here
				},
				onloaderror: 	function(event){
					// your code goes here		
				}
			});
		</script>
	<!-- END body -->

    <footer>
	<center>
		
        </center>
    </footer>
	</body>
<!-- END html -->
</html>