<?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($u_event == "add" && $your_name && $info)
	{
		$result_day = mysql_query("SELECT * FROM holiday WHERE event_date = '$info'",$db);
		if($myrow_day = mysql_fetch_array($result_day))
		{
			$msg = "aseTi TariRi aris ukve";
		}
		else
		{
			mysql_query("INSERT INTO holiday values('','$your_name','$info')");
			$msg = "damatebulia";
		}
	}
	//
	if($u_event == "delete" && $user_id)
	{
		mysql_query("DELETE FROM holiday WHERE id = '$user_id'");
		$msg = "waSlilia";
	}
}
?>
<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="597" id="table1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="467" class="geo">&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="467" class="geo"><b>admin zona (kalendari)</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="467" 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="467" class="geo">&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="467" class="geo">saxeli - ricxvi - Tve - <input type=text class="in_geo" name="sms_geo" size="15" value="" maxlength="55">&nbsp;<input type=text class="in_geo" name="bd_day" size="2" value="" maxlength="2">&nbsp;<input type=text class="in_geo" name="bd_month" size="2" value="" maxlength="2">&nbsp;<a href="javascript:add_calendar('<?=$u_secure?>','add');" class="eng">Add</a>&nbsp;</td>
	</tr>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="467" class="geo">&nbsp;</td>
	</tr>
<?php
		$result = mysql_query("SELECT * FROM holiday ORDER BY event_date ASC",$db);
		if($myrow = mysql_fetch_array($result))
		{
			$icount = 0;
			do
			{
				$rep_date = $myrow['event_date'];
				$rep_date = str_replace('-01-','-Jan-',$rep_date);
				$rep_date = str_replace('-02-','-Feb-',$rep_date);
				$rep_date = str_replace('-03-','-Mar-',$rep_date);
				$rep_date = str_replace('-04-','-Apr-',$rep_date);
				$rep_date = str_replace('-05-','-May-',$rep_date);
				$rep_date = str_replace('-06-','-Jun-',$rep_date);
				$rep_date = str_replace('-07-','-Jul-',$rep_date);
				$rep_date = str_replace('-08-','-Aug-',$rep_date);
				$rep_date = str_replace('-09-','-Sep-',$rep_date);
				$rep_date = str_replace('-10-','-Oct-',$rep_date);
				$rep_date = str_replace('-11-','-Nov-',$rep_date);
				$rep_date = str_replace('-12-','-Dec-',$rep_date);
				$rep_date = str_replace('0000','this Year',$rep_date);
				$icount = $icount + 1;
				echo("<tr>");
				echo('<td width="120" class="geo" align="right">&nbsp;</td>');
				echo('<td width="10">&nbsp;</td>');
				echo('<td width="467" class="geo">'.$icount.'. '.$myrow['holiday_name'].' - <font face="Tahoma,Verdana,Arial">'.$rep_date.$font_e.'<br><a href="javascript:delete_calendar(\''.$myrow["id"].'\',\''.$u_secure.'\',\'delete\');" class="eng">Delete</a><br>&nbsp;</td>');
				echo("</tr>");
			}
			while($myrow = mysql_fetch_array($result));
		}
?>
	<tr>
		<td width="120" class="geo" align="right">&nbsp;</td>
		<td width="10">&nbsp;</td>
		<td width="467" 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>