File: /home/sinanpasha/public_html/risale/risalepanel/iletisim-guncelle.php
<?php
//yonetici kontrol dosyasını çagırır.
include ("include-panel/yonetici-kontrol.php");
// Link ile gönderilen guncelle_id değişkenini $_GET ile çek.
$guncelle_id = $_GET ["guncelle_id"];
$bilgiler = mysql_query(" select * from iletisim where iletisim_id='1' ");
$dizi = mysql_fetch_array($bilgiler);
$sayfa_title = $dizi ["sayfa_title"];
$description = $dizi ["description"];
$adres = $dizi ["adres"];
$telefon = $dizi ["telefon"];
$gsm = $dizi ["gsm"];
$email = $dizi ["email"];
$harita = $dizi ["harita"];
$durum = $dizi ["durum"];
if ( $_POST ["button"] ) {
//Butona basınca Formdan bilgileri $_POST ile tekrar çek.
$sayfa_title = $_POST ["sayfa_title"];
$description = $_POST ["description"];
$adres = $_POST ["adres"];
$telefon = $_POST ["telefon"];
$gsm = $_POST ["gsm"];
$email = $_POST ["email"];
$harita = $_POST ["harita"];
$durum = $_POST ["durum"];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Risale Store</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/prettyPhoto.css" rel="stylesheet">
<link href="css/price-range.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<link href="css/amazingslider-1.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<link rel="shortcut icon" href="images/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="images/ico/apple-touch-icon-57-precomposed.png">
<SCRIPT language=javascript>
function textareaLimiter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
else countfield.value = maxlimit - field.value.length;
}
</SCRIPT>
</head><!--/head-->
<body>
<?php include("include-panel/header-top.php") ?>
<?php include("include-panel/header.php") ?>
<section>
<div class="container">
<div class="row">
<div class="col-sm-9 padding-right">
<div class="features_items"><!--features_items-->
<h2 class="title text-center">hakkımızda Güncelle</h2>
<div class="col-sm-12">
<div id="page_content">
<form name="form1" method="post" action="">
<table width="450" border="0" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="110" scope="col">Sayfa Başlık</td>
<td width="10" scope="col">:</td>
<td width="172" scope="col"><input name="sayfa_title" type="text" id="sayfa_title" value="<?php echo $sayfa_title;?>" size="25" maxlength="50"></td>
<td width="93" scope="col"> </td>
</tr>
<tr>
<td>Description</td>
<td>:</td>
<td><textarea name="description" cols="25" rows="4" id="description" onKeyUp="textareaLimiter(this.form.description,this.form.descLen,160);" onKeyDown="textareaLimiter(this.form.description,this.form.descLen,160);"><?php echo $description;?></textarea></td>
<td><input name="descLen" value="160" size="4" maxlength="3" readonly ></td>
</tr>
<tr>
<td>Adres</td>
<td>:</td>
<td><textarea name="adres" cols="25" rows="4" id="adres" onKeyUp="textareaLimiter(this.form.description,this.form.descLen,160);" onKeyDown="textareaLimiter(this.form.description,this.form.descLen,160);"><?php echo $adres;?>
</textarea></td>
<td> </td>
</tr>
<tr>
<td valign="top">Telefon</td>
<td>:</td>
<td><input name="telefon" type="text" id="telefon" value="<?php echo $telefon;?>" size="25" maxlength="50"></td>
<td> </td>
</tr>
<tr>
<td valign="top">Gsm</td>
<td>:</td>
<td><input name="gsm" type="text" id="gsm" value="<?php echo $gsm;?>" size="25" maxlength="50"></td>
<td> </td>
</tr>
<tr>
<td valign="top">Eposta</td>
<td>:</td>
<td><input name="email" type="text" id="email" value="<?php echo $email;?>" size="25" maxlength="50"></td>
<td> </td>
</tr>
<tr>
<td>Harita kodu</td>
<td>:</td>
<td><textarea name="harita" cols="25" rows="4" id="harita" onKeyUp="textareaLimiter(this.form.description,this.form.descLen,160);" onKeyDown="textareaLimiter(this.form.description,this.form.descLen,160);"><?php echo $harita;?>
</textarea></td>
<td> </td>
</tr>
<tr>
<td>Onay</td>
<td>:</td>
<td><input name="durum" type="checkbox" id="durum" value="1" <?php if ( $durum==1 ) { echo ' checked="CHECKED" '; } ?> ></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="button" id="button" value="Güncelle"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>
<?php
if ( $_POST ["button"] ) {
// Butona basılmış ise kontrolleri yap
if (!$sayfa_title) {
echo "sayfa adı giriniz";
} elseif (!$description) {
echo "Description giriniz";
} else {
// Kategori güncelle başladı
$guncelle = mysql_query("update iletisim set sayfa_title='$sayfa_title',description='$description',adres='$adres',telefon='$telefon',gsm='$gsm',email='$email',harita='$harita', durum='$durum' where iletisim_id='1' ");
if ($guncelle) {
echo "Güncellendi";
header("refresh:3;url=anasayfa.php");
} else {
echo "HATA :Güncellenemedi";
}
//--------------------------
}
//--------------------------------------
}
?>
</td>
<td> </td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<?php include("include-panel/footer.php") ?>
<script src="sliderengine/jquery.js"></script>
<script src="sliderengine/amazingslider.js"></script>
<script src="sliderengine/initslider-1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.scrollUp.min.js"></script>
<script src="js/price-range.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js"></script>
</body>
</html>