<?php
session_start();
include("config.php");
include("plugin/functions.php");
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_bin'");
$query = mysql_query("select * from settings");
while($print = mysql_fetch_array($query)){ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="description" content="<?php echo $print['description']; ?>" />
	<meta name="keywords" content="<?php echo $print['keywords']; ?>" />	
	<meta name="author" content="radyo sitesi, radyo dinle" />	
	<link rel="shortcut icon" href="/images/favicon.png">
	<title>İletişim | <?php echo $print['title']; ?></title>	
	<link rel="stylesheet" href="/css/sidebar.css">
	<link rel="stylesheet" media="screen" href="css/superfish.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/stylesheet.css" type="text/css" />
	<link rel="stylesheet" media="screen" href="css/color.css" type="text/css" />		
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic" type="text/css" />
	
	<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
	<script src="js/hoverIntent.js" type="text/javascript"></script>
	<script src="js/superfish.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="js/custom.js"></script>
	<script type="text/javascript" src="js/jquery.animate-shadow.js"></script>
<script language="javascript">
	function ChangeCode(){
		var NewSecurity= "<img src='js/security.php?rnd="+Math.random()+"' alt='guvenlik' style='border: 1px solid #999999;' />";
		$("#security").html(NewSecurity);
		return false;
	}
</script>		
</head>
<body>
<?php include("plugin/writelogin.php"); ?> 
<?php include("header.php"); ?> 
  
  <div id="outer-wrapper">
    <div id="content-wrapper">
      <div id="inner-content">
        <div id="entry">
		<div style="    padding-bottom: 0px;" id="post-top">
            <h3 id="post-title">İletişim</h3>
          </div>
          <div id="respond" class="contact">
          
            <p>Bize ulaşmak için aşağıdaki iletişim formunu veya sayfa içerisinde ki diğer iletişim yollarını kullanarak ulaşabilirsiniz.<br><br> En kısa süre de sizinle iletişime geçilecektir.<br><br></p>
			
			<h3>İletişim Formu</h3><br>
<?php
if(isset($_POST['gonder'])){

 $adsoyad = $_POST['adsoyad'];
 $email = $_POST['email'];
 $telefon = $_POST['telefon'];
 $mesaj = $_POST['mesaj'];
 $tarih = date('Y-m-d');
 $ip = $_SERVER['REMOTE_ADDR'];
 
if($adsoyad==""||$email==""||$telefon==""||$mesaj==""){

	echo '<font color="red"><b>Lütfen tüm alanları doldurun!</b></font><br><br>';

}else{

if(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)){
	
	echo '<font color="red"><b>Lütfen geçerli bir e-mail adresi girin!</b></font><br><br>';

	}else{
	
$girilen_kod	= trim(strip_tags($_POST['security']));
$guvenlik_kodu	= trim(strip_tags($_SESSION['koruma']));

if($girilen_kod != $guvenlik_kodu){
		echo '<font color="red"><b>Güvenlik kodunu eksik yada yanlış girdiniz. Lütfen tekrar deneyin!</b></font><br><br>'; }else{	

$kayit = mysql_query("insert into contact(adsoyad,email,telefon,mesaj,tarih,ip) values('$adsoyad','$email','$telefon','$mesaj','$tarih','$ip')"); 

	echo '<font color="green"><b>Mesajınız iletilmiştir. En kısa süre de sizinle iletişime geçeceğiz.</b></font><br><br>';	
		
	  } } } } ?> 			
            <form method="post">
              <p>
                <label for="contactName">Ad Soyad<span class="star">*</span></label>
                <input type="text" name="adsoyad" />
              </p>
              <p>
                <label for="email">E-Mail<span class="star">*</span></label>
                <input type="text" name="email" />
              </p>
              <p>
                <label for="eurl">Telefon<span class="star">*</span></label>
                <input type="text" name="telefon" />
              </p>
              <p>
                <label for="commentsText">Mesaj<span class="star">*</span></label>
                <textarea name="mesaj" rows="10" cols="10"></textarea>
              </p>
              <p>
                <input type="hidden" name="submitted" id="submitted" value="true" />
              </p>
	<div id="security"><img src="js/security.php" alt="guvenlik" style="border: 1px solid #999999;"></div><br>				  
              <p>	  
                <label for="eurl">Güvenlik Kodu<span class="star">*</span></label>
                <input type="text" name="security" />
              </p>			  
              <p class="submit">
                <button class="btn" name="gonder" type="submit">Gönder</button>
              </p>
            </form>
            <div class="clear"></div>
          </div>
        </div>
      </div>
      <div id="sidebar">
       <section style="   background: #F1F4F6;">

	

		<aside class="sidebar-light">

			<div class="latest-blog-posts">

				<h3><i class="fa fa-contact"></i> İletişim Bilgileri</h3>

				<p style="padding-top: 10px;
    padding-left: 8px;
    padding-bottom: 30px;"><?php echo $print['iletisim']; ?></p>

				<div class="social-buttons">

					<a href="<?php echo $print['facebook']; ?>"><i class="fa fa-facebook"></i></a>
					<a href="<?php echo $print['twitter']; ?>"><i class="fa fa-twitter"></i></a>
					<a href="<?php echo $print['instagram']; ?>"><i class="fa fa-instagram"></i></a>
				

				</div>

			</div>

			<div class="latest-blog-posts">

				<h3><i class="fa fa-map"></i> Ulaşım Haritası</h3><br>
<p style="
    padding-left: 8px;
    padding-bottom: 30px;"><?php echo $print['iletisim1']; ?></p>
			

			</div>

		</aside>

	</section>

		
      </div>
      <div class="clear"></div>
    </div>
  </div>
  
  <div id="footer"> <span id="Scroll"><a href="#">&uarr;</a></span>
    <div id="footer_inner">
<?php echo $print['reklam3']; ?>
      <div class="clear"></div>
      <div class="footer_bottom">
        <ul class="footer_menu">
          <li><a href="index<?php echo $print['seourl']; ?>">Anasayfa</a> /</li>		
<?php $whistle = mysql_query("select * from pages order by sira asc"); while($baby = mysql_fetch_array($whistle)){ if($print['seourl']==".php"){ ?>		
          <li><a href="pages.php?url=<?php echo $baby['sefurl']; ?>"><?php echo $baby['baslik']; ?></a> /</li>
	<?php }elseif($print['seourl']==".html"){ ?>	  
          <li><a href="sayfa-<?php echo $baby['sefurl']; ?>.html"><?php echo $baby['baslik']; ?></a> /</li>
	<?php } } ?>	
          <li><a href="iletisim<?php echo $print['seourl']; ?>">İletişim</a></li>
        </ul>
        <p>&copy; Copyright <?php echo date('Y'); ?>, <?php echo $print['title']; ?>. Tüm hakları saklıdır.</p>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<?php } ?>