<?php
//Include the head file
require("../../inc/header.inc");
?>

<script language="JavaScript">
	//the function is called when the sel_date_from value changed
	function sel_date_from_change()
	{
		var down_date_from=document.myform.sel_date_from.value;
		var down_date_to=document.myform.sel_date_to.value;
		//var scrollY=document.body.scrollTop;
		if(down_date_from<=down_date_to)
			down_date_to=down_date_from;
  	//var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&scroll_y='+scrollY;
		var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to;
		window.location.href=urll;
	}
</script>
<base target="service_general_down">
<body  leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<form action="service_general_down.php" method="post" name="myform">
<?php
adjust_head_frame("up");
adjust_title_head_frame("up");
	echo "<table id=\"table_up\" border=0 width=\"100%\">";
	echo "<tr>";
	echo "<td width=50% align=\"left\">";
	echo "$strTitlePerformance > iPALIM > $strService";
	echo "</td>";
	echo "<td align=\"right\">";
	$helpId="3.11.1";
	showHelp($helpId);
	echo "</td>";
	echo "</tr>";
	echo "<tr>";
	echo "<td width=50% align=\"left\">";
	
if(!isset($sel_date_from))
	$sel_date_from=0;
if(!isset($sel_date_to))
	$sel_date_to=0;
//selection date define
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
?>
<select name="sel_date_from" onChange="javascript:sel_date_from_change()">
			<?php
				for($i=0;$i<7;$i++)
		  	{
			 		if($i==$sel_date_from)
		  			echo "<option selected value=$i>${day.$i}</option>";			
		  		else
		  			echo "<option value=$i>${day.$i}</option>";
				}
			?>
</select>to
<select name="sel_date_to">
			<?php
				for($i=0;$i<=$sel_date_from;$i++)
		  	{
			 		if($i==$sel_date_to)
		  			echo "<option selected value=$i>${day.$i}</option>";			
		  		else
		  			echo "<option value=$i>${day.$i}</option>";
				}
			?>
</select>
<span onClick="javascript:myform.submit()" style="cursor:hand">
	<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
</span>
<?php			

	echo "</td>";
	echo "<td align=\"right\">";
?>
<span onClick="window.print();" style="cursor:hand">
	<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
</span>
<?php
	echo "</td>";
	echo "</tr>";
	echo "</table>";

adjust_title_tail_frame("up");
adjust_content_head_frame("up");
adjust_content_tail_frame("up");	
?>

</form>
