<?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>
<style>
.butonlar
{background: #F7F7F7;
    border: 2px solid #D4D4D4;
    padding: 3px;
    border-radius: 3px;
    color: #6F6F6F;}
	.butonlar:focus{outline-color:#1D8D54;}
	.btn{background: #1D8D54;
    color: #CACACA;
    padding: 4px;
    border-radius: 3px;
    width: 100%;
    border: none;
    border-bottom: 2px solid #135F38;}
	.btn:hover{background: #177344;
    color: #CACACA;
    padding: 4px;
    border-radius: 3px;
    width: 100%;
    border: none;
    border-bottom: 2px solid #0D482A;}
</style>
	<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" />	

	<title>İstek Gönder | <?php echo $print['title']; ?></title>	
	
		
	<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
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  style="font-size: 12px;
    font-family: Arial;
    color: #1D8D54;"><b><center>Lütfen tüm alanları doldurun!</center></b></font>';

}else{

if(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)){
	
	echo '<font style"    font-size: 12px;
    font-family: Arial;
    color: #1D8D54;"><b><center>Lütfen geçerli bir e-mail adresi girin!</center></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     style="font-size: 12px;
    font-family: Arial;
    color: #1D8D54;"><b><center>Güvenlik kodunu eksik yada yanlış girdiniz. Lütfen tekrar deneyin!</center></b></font>'; }else{	

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

	echo '<font     style="font-size: 12px;
    font-family: Arial;
    color: #1D8D54;"><b><center>İsteğiniz başarılı bir şekilde iletilmiştir.</center></b></font>';	
		
	  } } } } ?> 	
<body style="background:#E6E6E6;">	  
       <form style="width:420px;margin-left:auto;margin-right:auto;" method="post">
              <div style="background: #DADADA;
    width: 400px;
    height: 35px;
    padding-top: 10px;
    padding-left: 20px;
    margin-top: 5px;
    border: 1px solid #D4D4D4;
    border-bottom: 3px solid #BFBCBC;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;"><p style="float: left;padding: 0px;
    margin: 0px;"
	>
              
                <input class="butonlar" placeholder="ad soyad" type="text" name="adsoyad">
              </p>
              <p style="display:none;">
                <label for="email">E-Mail<span class="star">*</span></label>
                <input type="text" name="email" value="dinleyici@radyositesi.com">
              </p>
              <p style="float: left;padding: 0px;
    margin: 0px;">
                
                <input style="margin-left:5px;    " placeholder="istek parça" type="text" name="telefon" class="butonlar">
              </p>
              </div>
			  
			<div style="
    background: #D4D4D4;
    border: 1px solid #D6D6D6;
">  <p style="
    margin: 0;
    padding-top: 10px;
    padding-left: 40px;
">
              
                <textarea placeholder="mesajınız" name="mesaj" rows="10" cols="44" class="butonlar" style="
"></textarea>
              </p>
              <p style="
    float: left;
    padding-top: 20px;
    padding-left: 40px;
">	  
              
                <input style="margin-top: -15px;" placeholder="güvenlik kodu" type="text" name="security" class="butonlar">
              </p><p>
                <input type="hidden" name="submitted" id="submitted" value="true">
              </p>
		<div id="security"><img src="js/security.php" alt="guvenlik" style="border:2px solid #C7C7C7;margin-left: 20px;"></div><br>				  
              			  </div>	
              <p class="submit">
                <button class="btn" name="gonder" type="submit">Gönder</button>
              </p>
            </form>
</body>
</html>
<?php } ?>