<?php
## Global Bağlantı Dosyaları
session_start(); ## -> Oturum Başlatıldı
require_once('../../../vi_connect.php'); ## Mysql Bağlantısı
require_once('../../../vi_global.php'); ## Global Fonksiyonlar
$giris_kontrol = $_SESSION['kullanici_id']; 

## Global Mysql Ayarları
$genel_getir=mysql_query("SELECT * FROM genelayarlar WHERE id='1'"); 
$getir=mysql_fetch_array($genel_getir); 
$geayar_telefon = $getir['geayar_telefon'];
$geayar_mail = $getir['geayar_mail'];
$geayar_siteadresi = $getir['geayar_siteadresi'];
$geayar_adres = $getir['geayar_adres'];
$geayar_logo = $getir['resim'];
$geayar_footer_logo = $getir['geayar_footer_logo'];
$geayar_bakim =  $getir['geayar_bakim'];
$geayar_default_dil =  $getir['geayar_default_dil'];
$geayar_analytics =  $getir['geayar_analytics'];

## -> Dil Fonkisyonu
$lang = g("lang");

$sayfatur = g("sayfatur");
$verino = g("verino");

if(
$sayfatur == "hizmetsayfa"
OR $sayfatur == "normalsayfa"
OR $sayfatur == "urundetay"
OR $sayfatur == "blogdetay"
OR $sayfatur == "projedetay"
OR $sayfatur == "bolgesayfa"
){ ## -> İçerik sayfaları ise kullanıcı girdiği içeriğin dil yapısını görür.
	
if($sayfatur == "hizmetsayfa"){
$dil_tanimla=mysql_query("SELECT * FROM hizmetler WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}

if($sayfatur == "normalsayfa"){
$dil_tanimla=mysql_query("SELECT * FROM sayfalar WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}

if($sayfatur == "urundetay"){
$dil_tanimla=mysql_query("SELECT * FROM urunler WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}

if($sayfatur == "projedetay"){
$dil_tanimla=mysql_query("SELECT * FROM projeler WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}

if($sayfatur == "bolgesayfa"){
$dil_tanimla=mysql_query("SELECT * FROM hizmetbolgeleri WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}

if($sayfatur == "blogdetay"){
$dil_tanimla=mysql_query("SELECT * FROM bloglar WHERE seo_url='$verino'"); 
$dil_tanims=mysql_fetch_array($dil_tanimla); 
$veri_dil_bul = $dil_tanims['veri_dil'];
}


$iyap=mysql_query("SELECT * FROM diller WHERE id='$veri_dil_bul' "); 
$getir=mysql_fetch_array($iyap); 
$v_b_a_o = $getir['seo_url'];	
$_SESSION['dil_secim'] = "$v_b_a_o";
$dil_no = $_SESSION['dil_secim']; 

}else{
	
## -> Standart sayfalar ise kullanıcı girdiği içeriğin dil yapısını görür.
if(empty($lang)){}else{$_SESSION['dil_secim']   = "$lang";}
if(empty($_SESSION['dil_secim'])){ $_SESSION['dil_secim'] = "$geayar_default_dil";}
$dil_no = $_SESSION['dil_secim']; 
}


$dil_getir=mysql_query("SELECT * FROM diller WHERE seo_url='$dil_no'"); 
$dil_v_getir=mysql_fetch_array($dil_getir); 
$dil_durum = $dil_v_getir['id'];
$_SESSION['dil_ara_at'] = "$dil_durum";
$d_g_site_baslik = $dil_v_getir['m5'];
$d_g_site_aciklama = $dil_v_getir['m6'];
$d_g_site_anahtar = $dil_v_getir['m7'];
$d_g_hizmet_incele = $dil_v_getir['m8'];
$d_g_hizmet_d_tum = $dil_v_getir['m9'];



if($geayar_bakim == "evet"){if(empty($giris_kontrol)){header("Location: $geayar_siteadresi/bakim/"); exit; }else{$y_d_bakim = "ok";} }else{}
	
$modul_getir=mysql_query("SELECT * FROM moduller WHERE modul_adi='tema'"); 
$getir=mysql_fetch_array($modul_getir); 
$tema_dil_m = $getir['modul_v1'];
$tema_bar_m = $getir['modul_v2'];
$tema_bar_renk = $getir['modul_v3'];
$tema_menu_renk = $getir['modul_v4'];
$tema_footer_renk = $getir['modul_v5'];
$tema_btn_renk = $getir['modul_v6'];
				
?>
	<!DOCTYPE html>
	<html lang="<?php echo $dil_no;?>">
	<head>
	<base href="<?php echo $geayar_siteadresi;?>" />
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name='copyright' content='pavilan'>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
	
	<?php 
	## Global Seo Değişkenleri
	include("seometa.php"); 
	?>
	<!-- Hreflang Etiketleri -->
	<?php
	$hrefal_al = mysql_query("SELECT * FROM diller ORDER BY id ASC limit 0,999");
	while($yaz=mysql_fetch_array($hrefal_al)){
	$id = $yaz['id'];
	$d_d_bas = $yaz['baslik'];
	$d_d_url = $yaz['seo_url'];
	echo '<link rel="alternate" hreflang="'.$d_d_url.'" href="'.$geayar_siteadresi.'/anasayfa/?lang='.$d_d_url.'" />
	';
	}?>
	
	<link rel="icon" href="vi-includes/tema/vi-mars/favicon.png" type="image/png">
	<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&amp;display=swap" rel="stylesheet">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/animate.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/bootstrap.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/cubeportfolio.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/font-awesome.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/jquery.fancybox.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/magnific-popup.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/owl-carousel.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/slicknav.min.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/reset.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/styles.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/style.css">
	<link rel="stylesheet" href="vi-includes/tema/vi-mars/css/responsive.css">
	
	<?php echo $geayar_analytics;?>
	
	</head>
	<body id="bg" style="">
	<?php if($y_d_bakim == "ok"){?>
	<style>
	.bakimuyari
	{
	width:100%;
	height:50px;
	background:#DB3A34;
	color:white;
	padding-top:15px;
	}
	</style>
	
	<div class="bakimuyari">
	<div class="container">
	Dikkat: Bu site bakım moduna alındı. Şuan siteniz ziyaretçiler tarafından görüntülenemez. Yöneticiler siteyi halen görmeye devam edebilir.
	</div>
	</div>
	
	<?php } ?>
	
	<?php
	$wp_modul=mysql_query("SELECT * FROM moduller WHERE modul_adi='whatsapp'"); 
	$getir=mysql_fetch_array($wp_modul); 
	$modul_durum = $getir['modul_durum'];
	$wp_cihaz_m = $getir['modul_v1'];
	$wp_s_konum = $getir['modul_v2'];
	$wp_no_m = $getir['modul_v3'];
	$wp_simge_m = $getir['modul_v4'];
	if($modul_durum == "acik"){
	if($wp_cihaz_m == "mobile"){$wp_cihaz_g = "mobile";}
	if($wp_cihaz_m == "desktop"){$wp_cihaz_g = "desktop";}
	if($wp_cihaz_m == "tumu"){$wp_cihaz_g = "";}
	
	?>
	<a href="https://api.whatsapp.com/send?phone=9<?php echo $wp_no_m;?>" class="wpon <?php echo $wp_cihaz_m;?>">
	<img src="vi-includes/moduller/whatsapp/images/<?php echo $wp_simge_m;?>.png" alt="wp" width="60" height="60">
	</a>
	<style>
	.wpon{<?php echo $wp_s_konum;?>:25px;position:fixed;z-index:999999999;bottom:35px}
	</style>
	<?php } ?>
	
	
	
	<div id="page" class="site"> 
	<header class="header">
	<?php if($tema_bar_m == "evet"){?>
	<div class="mobile" style="width:100%;height:14px;background:<?php echo $tema_bar_renk;?>;font-size:11px;">
	<div style="height:9px;width:100%;"></div>
	<a href="tel:<?php echo $geayar_telefon;?>" style="margin-left:2px;" class="text-white"><i class="fa fa-phone" style="color:<?php echo $tema_btn_renk;?>"></i> <?php echo $dil_v_getir['m39'];?>: <?php echo $geayar_telefon;?></a>
	<a href="mailto:<?php echo $geayar_mail;?>" class="text-white"><i class="fa fa-envelope-open" style="margin-left:5px;color:<?php echo $tema_btn_renk;?>"></i> <?php echo $dil_v_getir['m40'];?>: <?php echo $geayar_mail;?></a>
<a href="/anasayfa/?lang=tr"><img border="0" src="/vi-includes/images/diller/tr8000.png" width="18" height="15"></a> | <a href="/anasayfa/?lang=en"><img border="0" src="/vi-includes/images/diller/en1671.png" width="20" height="18"></a> </P>
	</div>
	<div class="topbar" style="background:<?php echo $tema_bar_renk;?>">
	<div class="container">
	<div class="row">
	<div class="col-lg-8 col-12">
	

	
	<div class="top-contact desktop">
	<a href="tel:<?php echo $geayar_telefon;?>"><div class="single-contact"><i class="fa fa-phone" style="color:<?php echo $tema_btn_renk;?>"></i><?php echo $dil_v_getir['m39'];?>: <?php echo $geayar_telefon;?></div></a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="mailto:<?php echo $geayar_mail;?>"><div class="single-contact"><i class="fa fa-envelope-open" style="color:<?php echo $tema_btn_renk;?>"></i><?php echo $dil_v_getir['m40'];?>: <?php echo $geayar_mail;?></div>	</a>&nbsp;&nbsp;&nbsp;&nbsp;
	
	</div>
							
	</div>	
	<div class="col-lg-4 col-12">
	<div class="topbar-right">
	<ul class="social-icons desktop">
	
	<?php
	$icerik_al = mysql_query("SELECT * FROM sosyal_medya ORDER BY id ASC limit 0,999");
	while($yaz=mysql_fetch_array($icerik_al)){
	$id = $yaz['id'];
	$sc_icon = $yaz['sc_icon'];
	$sc_baslik = $yaz['sc_baslik'];
	$sc_renk = $yaz['sc_renk'];
	$sc_link = $yaz['sc_link'];
	
	echo '
	<li><a href="'.$sc_link.'" target="_blank" title="'.$sc_baslik.' alt='.$sc_baslik.'"><i class="fa fa-'.$sc_icon.'"></i></a></li>
	';
	
	}?>
	
	</ul>
	
	<?php if($tema_dil_m == "evet"){?>
	<div class="dropdown button" style="z-index:100000000000000">
	<button class="bizwheel-btn btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    <?php
	$genel_getir=mysql_query("SELECT * FROM diller WHERE id='$dil_durum'"); 
	$getir=mysql_fetch_array($genel_getir); 
	$v_s_dil_baslik = $getir['baslik'];
	$v_s_dil_res = $getir['resim'];
	echo "<img src='$v_s_dil_res' alt='$v_s_dil_baslik' width='20'> $v_s_dil_baslik";
	?>
	</button>
	<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
	<?php
	$icerik_al = mysql_query("SELECT * FROM diller ORDER BY id ASC limit 0,999");
	while($yaz=mysql_fetch_array($icerik_al)){
	$id = $yaz['id'];
	$d_l_baslik = $yaz['baslik'];
	$d_l_seo = $yaz['seo_url'];
	$d_l_res = $yaz['resim'];
	
	echo '
	<a class="dropdown-item" href="anasayfa/?lang='.$d_l_seo.'"><img src="'.$d_l_res.'" alt="'.$d_l_baslik.'" title="'.$d_l_baslik.'" width="25"> '.$d_l_baslik.'</a>
	';
	
	}?>
	</div>
	</div>
	<?php } ?>
	
	</div>
	</div>
	
	</div>
	</div>
	</div>
	<?php } ?>
			
	<div class="middle-header" style="background:<?php echo $tema_menu_renk;?>;">
	<div class="container">
	<div class="row">
	<div class="col-12">
	<div class="middle-inner">
	<div class="row">
	<div class="col-md-2">
	
	<div class="logo desktop">
	<div class="img-logo">
	<a href="">
	<img src="<?php echo $geayar_logo;?>" alt="logo">
	</a>
	</div>
	</div>	

	<div class="logo mobile">
	<div class="img-logo">
	<a href=" ">
	<img src="<?php echo $geayar_logo;?>" alt="logo" width="120" style="margin-top:-5px;">
	</a>
	</div>
	</div>	
	
	<div class="mobile-nav" style="margin-top:-30px;"></div>
	</div>
	<div class="col-md-10">
	<div class="menu-area" >
									
	<nav class="navbar navbar-expand-lg">
	<div class="navbar-collapse">	
	<div class="nav-inner">	
	<div class="menu-home-menu-container">
	<!-- Naviagiton -->
	<ul id="nav" class="nav main-menu menu navbar-nav">
															
	<?php
	
	## Dinamik Menü Fonkisyonu
	if(empty($s)){ $nav_color = "";}else{ $nav_color = "text-dark";}
	$sayfaal = mysql_query("SELECT * FROM menuler WHERE menu_ust_menu='' AND veri_dil='$dil_durum' ORDER BY menu_sira ASC limit 0,999");
	while($yaz=mysql_fetch_array($sayfaal)){

	$m_id = $yaz['id'];
	$m_baslik = $yaz['menu_baslik'];
	$menu_link = $yaz['menu_link'];
	
	$u_menu_bul=mysql_query("SELECT * FROM menuler WHERE menu_ust_menu='$m_id'"); 
	$getir=mysql_fetch_array($u_menu_bul); 
	$ab_al = $getir['menu_baslik'];
	$ust_m_id = $getir['id'];
	$menu_link = $yaz['menu_link'];
	
	if(empty($menu_link)){$o_m_yaz = '';}else{$o_m_yaz = 'href="'.$menu_link.'"';}
	if(empty($ab_al)){
		
	echo '<li class="nav-item "><a class="nav-link '.$nav_color.'" '.$o_m_yaz.'>'.$m_baslik.'</a></li>';
	
	}else{
		
	echo '
	<li class="nav-item">
	<a class="nav-link '.$nav_color.'">'.$m_baslik.'
	</a>
	<ul class="sub-menu">';
	$alt_al = mysql_query("SELECT * FROM menuler WHERE menu_ust_menu='$m_id' ORDER BY id ASC limit 0,999");
	while($yaz1=mysql_fetch_array($alt_al)){
	$m_alt_baslik = $yaz1['menu_baslik'];
	$menu_link = $yaz1['menu_link'];
	
	echo'
	<li>
	<a href="'.$menu_link.'">'.$m_alt_baslik.'</a>
	</li>
	';
    }
	echo'	
	</ul>
	</li>
	';	
	}
	}?>

	<?php 
	$i_m_kontrol=mysql_query("SELECT * FROM moduller WHERE modul_adi='iletisim'"); 
	$getir=mysql_fetch_array($i_m_kontrol); 
	$iletisim_m_durum1 = $getir['modul_durum']; 
	$iletisim_m_durum2 = $getir['modul_v5']; 
	if($iletisim_m_durum1 == "acik"){
	if($iletisim_m_durum2 == "evet"){ ?>
	<li class="nav-item"><a style="margin-top:-7px;" href="iletisim/">
	<button type="button" class="btn btn-warning text-white" style="background:<?php echo $tema_btn_renk;?>;border:0px solid black;"> <?php echo $dil_v_getir['m35'];?> </button>
	</a></li>
	<?php } } ?>
	
	</ul>
	
	</div>
	</div>
	</div>
	</nav>
										
	</div>
	</div>
	</div>
	</div>
	</div>
	</div>
	</div>
	</div>

	</header>

	<style>
	.section-title h1 span:before {
    content: ""; position: absolute; left: 50%;
    bottom: -8px; border-top: 8px solid <?php echo $tema_btn_renk;?>;
    border-left: 8px solid transparent;border-right: 8px solid transparent;
    margin-left: -8px;}
	</style>
		
