Location: PHPKode > projects > Tech Tickets > technician/dateselect.php
<?php
$ffdate = $_GET["ffdate"];
$ftdate = $_GET["ftdate"];

$m = date("m")-1;
$y = date("Y");
if ($m == 0){ $m = '12'; $y = $y-1; }
if (strlen($m) == 1 ){ $m = '0'.$m; }
if ($_GET["ffdate"] == ""){ $ffdate = $m."/".date("d")."/".$y;}
if ($_GET["ftdate"] == ""){ $ftdate = date("m/d/Y");}
?>
<head>
	<title>Date Filter Selection</title>
	<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>
	<script>
	function senddates2(){
		var fd = document.getElementById("fdate").value;
		window.opener.document.getElementById("f-fdate").value = fd;
		var td = document.getElementById("tdate").value;
		window.opener.document.getElementById("f-tdate").value = td;
		window.opener.document.getElementById("datespan").innerHTML = fd + " > " + td;
		window.opener.document.getElementById("filter").submit();
		window.close();
	}
	function cleardates(){
		document.getElementById("fdate").value = "";
		document.getElementById("tdate").value = "";
	}
	</script>
	<SCRIPT LANGUAGE="JavaScript">document.write(getCalendarStyles());</SCRIPT>
	<style>
	td{
		font-size:10px;
		font-family:Verdana, Arial, Helvetica, sans-serif;
	}
	</style>
</head>

<body topmargin="0" bgcolor="#999999">
<table width="0" height="0" align="right" border="0"><tr><td><div id="spot1" align="right"></div></td></tr></table>
<br>
<form>
<table border="0" cellpadding="5" cellspacing="1" bgcolor="#DDDDDD">
<tr bgcolor="#FFFFFF">
	<td colspan="2">
		<strong>Date Filter:</strong>
	</td>
</tr>
<tr bgcolor="#FFFFFF">
	<td>From:</td>
	<td>
		<SCRIPT LANGUAGE="JavaScript">
		var cal1xx = new CalendarPopup("cal");
		cal1xx.showNavigationDropdowns();
		</SCRIPT>
		<INPUT TYPE="text" NAME="fdate" id="fdate" VALUE="<?php echo $ffdate; ?>" SIZE=25>
		<A HREF="#" onClick="cal1xx.select(document.forms[0].fdate,'spot1','MM/dd/yyyy'); return false;" NAME="anchor1xx" ID="anchor1xx">select</A>
	</td>
</tr>
<tr bgcolor="#FFFFFF">
	<td>To:</td>
	<td>
		<SCRIPT LANGUAGE="JavaScript">
		var cal2xx = new CalendarPopup("cal");
		cal1xx.showNavigationDropdowns();
		</SCRIPT>
		<INPUT TYPE="text" NAME="tdate" id="tdate" VALUE="<?php echo $ftdate; ?>" SIZE=25>
		<A HREF="#" onClick="cal1xx.select(document.forms[0].tdate,'spot1','MM/dd/yyyy'); return false;" NAME="anchor2xx" ID="anchor2xx">select</A>
	</td>
</tr>
<tr bgcolor="#FFFFFF">
	<td colspan="2"> Click on the select link to select the date from a calendar.</td>
</tr>
<tr bgcolor="#FFFFFF">
	<td colspan="2">
		<input type="button" value="Submit" onClick="senddates2();" />
		<input type="button" value="Cancel" onClick="window.close()">
		<input type="button" value="Clear" onClick="cleardates()">
	</td>
</tr>
</table>

<DIV ID="cal" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>
</form>

</body>
</html>
Return current item: Tech Tickets