<?php
	include("../pages/vars.php");
	include("../pages/db.php");
	include("password.php");
	
	session_start();
	$s_secure = $_SESSION['s_secure'];			
	$admin_access = "no";
	$msg = "gverdi dablokilia";

if($s_secure == $u_secure && isset($_SESSION['s_secure']))
{
	$admin_access = "yes";
	$msg = "";
	//
	if($_SERVER['REQUEST_METHOD'] == "POST" && $cur_id != "")
	{
		$msg = "informacia ganaxlebulia";
		mysql_query("UPDATE gsms_reklama SET text = '$t2', title = '$t3', email = '$t4', count = '$t9', date = '$t12', status = '$status' WHERE id = '$cur_id'");
	}
	else
	{
		// $msg = "informacia ganaxlebulia";
	}

	if($cur_id != "")
	{
		$result = mysql_query("SELECT * FROM gsms_reklama WHERE id = '$cur_id'", $db);
		if($myrow = mysql_fetch_array($result))
		{
			$admin_access = "yes";
			// $msg = "";
			// $ = $myrow[''];
			$s1 = $myrow['id'];
			$status = $myrow['status'];
			$s2 = $myrow['text'];
			$s3 = $myrow['title'];
			$s4 = $myrow['email'];
			$s9 = $myrow['count'];
			$s12 = $myrow['date'];
		}
	}
	else
	{
		// $msg = "gverdi dablokilia";
	}
}
?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Georgiansms.com | Admin</title>
<link rel="shortcut icon" href="../js_css/favicon.ico">
<link href="../js_css/iframe.css" rel="stylesheet">
</head>

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#1AB9F1">
<script language="javascript" src="../js_css/admin.js"></script>
<form name="form1" action="<?=$_SERVER['REQUEST_URI']?>" method="POST">
<table border="0" width="897" id="table1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo">&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><b>admin zona (<font face='Tahoma,Arial,Verdana' size='1'>SMS</font> reklama)</b>&nbsp;</td>
	<tr>
<?php
	if($admin_access == "yes")
	{
?>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><a href="admin_book.php?u_secure=<?=$u_secure?>" class="eng">Back</a>&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo">&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">statusi</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo">
		<select name="status" class="in_eng">
		<option class="onew" value="0"<? if($status=="0"){echo(" selected ");} ?>>Hidden</option>
		<option class="oact" value="1"<? if($status=="1"){echo(" selected ");} ?>>Active</option>
		</select></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">nomeri</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="cur_id" class="in_eng" size="5" maxlength="2" value="<?=$s1?>" readonly></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">texti</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="t2" class="in_eng" size="120" maxlength="140" value="<?=$s2?>"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">dasaxeleba</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="t3" class="in_eng" size="50" maxlength="15" value="<?=$s3?>"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">eleqtronuli fosta</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="t4" class="in_eng" size="50" maxlength="50" value="<?=$s4?>"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">gagzavna</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="t9" class="in_eng" size="10" maxlength="10" value="<?=$s9?>"><input type="hidden" name="u_secure" class="in_eng" size="10" value="<?=$u_secure?>"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">TariRi</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="text" name="t12" class="in_eng" size="12" maxlength="10" value="<?=$s12?>"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">moqmedeba</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo"><input type="submit" value="Change info" class="bu_eng3" style="cursor:hand;"></td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="567" class="geo">&nbsp;</td>
	</tr>
<?php
	}
?>
	<tr>
		<td height="19" colspan="3" width="297" class="geo" align="center">&nbsp;</td>
	</tr>
	<tr>
		<td height="19" colspan="3" width="297" class="geo" align="center">&nbsp;<?=$msg?></td>
	</tr>
</table>
</form>
</body>

</html>