<?php
	//process the $sdate here
	if ($_GET["y"]) {
		$sdate2 = build_date($_GET["y"], $_GET["m"], $_GET["d"],$_GET["hr"],$_GET["min"]);
	} elseif ($_POST["y"]) {
		$sdate2 = build_date($_POST["y"], $_POST["m"], $_POST["d"],$_POST["hr"],$_POST["min"]);
//	} elseif (session_start() && $_SESSION["sdate"]) { //session?
//		$sdate = $_SESSION["sdate"];
//		if (preg_match("/[^0-9\-]/", $sdate) || strlen($sdate)!=10) $sdate = "";
	} else {
		$sdate2 = false;
	}
	
	if ($_GET['agencyid']) $agencyid2 = intval($_GET['agencyid']); else $agencyid2 = false;
	
	
	@session_start();
	if ($sdate2) $_SESSION["sdate"] = $sdate = $sdate2;
	if ($agencyid2) $_SESSION["agencyid"] = $agencyid = $agencyid2;
?>