<?php
if (file_exists("embedded/functions/site_functions.php"))
	{
	include_once("embedded/functions/site_functions.php");
	}
else
	{
include_once("../../embedded/functions/site_functions.php");
	}
$language=$_SESSION['language'];	
if ($language==1)
	{
	$title1="Επιλέξτε μέρα:";
	}
else
	{
	$title1="Select Day:";
	}
if (($_GET['m']) && !empty($_GET['m']) && ($_GET['d']) && !empty($_GET['d']))
{
db_open();
$q= strip_tags(htmlspecialchars(mysql_real_escape_string(trim($_GET["m"]))));
$d= strip_tags(htmlspecialchars(mysql_real_escape_string(trim($_GET["d"]))));
if(is_numeric($d) && ($d==2 || $d==1))
	{
	if ($d==1)
		{
		$id="day";
		}
	else
		{
		$id="day_d";
		}
		if (preg_match("/[^0-9\' ']/", $q))
			{
			echo'<select id ='.$id.' name="day" title= "Select day" disabled="true"><option value="Day">'.$title1.'</option></select>';
			}
		else
			{
			$m = $_GET['m'];
				if (is_numeric($m))
				{
					if	($m=='1' ||$m=='2' ||$m=='3' ||$m=='4' ||$m=='5' ||$m=='6' ||$m=='7' ||$m=='8' ||$m=='9' ||$m=='10' ||$m=='11' ||$m=='12')
					{
					$k=days_in_month($m,'2012');
					echo'<select id ='.$id.' name="day" title="'.$title1.'" ><option value="Day">'.$title1.'</option>';
					for ($i=1; $i<=$k;$i++)
					{
					echo "<option value='$i'>$i</option>";
					}
					echo"</select>";
					}
				}
		
			}
	}

db_close();
	}
?>		