Location: PHPKode > projects > Network Managment / Inventory System > clearsite/include/aloe/aloe_timeframeform.php
<?php
extract($_POST);
extract($_GET);

include_once('../db_config.php');
include_once('aloe_config.php');

print "<script type=\"text/javascript\" src=\"../htmlhttprequest.js\"></script>
";

exec("$rrdtool_path first $rrd_data_path/$rrd_data_file", $result);

if ($interface_type == "css_cr") {
	$detail_name = "cr_ID";
	$detail_ID = $cr_ID;
} else if ($interface_type == "cpus") {
	$detail_name = "cpu_ID";
	$detail_ID = $cpu_ID;
} else if ($interface_type == "css_sv") {
	$detail_name = "sv_ID";
	$detail_ID = $sv_ID;
} else if ($interface_type == "css_owner") {
	$detail_name = "owner_ID";
	$detail_ID = $owner_ID;
} else if ($interface_type == "vpn_stats") {
	$detail_name = "device_ID";
	$detail_ID = "$device_ID";
} else if ($interface_type == "wap_stats") {
	$detail_name = "device_ID";
	$detail_ID = "$device_ID";
} else {
	$detail_name = "interface_ID";
	$detail_ID = $interface_ID;
};

$month_array = array("01" => "January",
										 "02" => "February",
										 "03" => "March",
										 "04" => "April",
										 "05" => "May",
										 "06" => "June",
										 "07" => "July",
										 "08" => "August",
										 "09" => "September",
										 "10" => "October",
										 "11" => "November",
										 "12" => "December");

print "
			 <form action=\"$ClearsiteBaseURL/include/aloe/aloe_details.php\" method=\"POST\" onsubmit=\"docClickLoader.submitInto(this, 'customTimeGraph', event)\">
";
if ($detail_name != "none") {
	print "			  <input type=\"hidden\" name=\"$detail_name\" value=\"$detail_ID\">
";
};
print "
			  <input type=\"hidden\" name=\"interface_type\" value=\"$interface_type\">
			  <input type=\"hidden\" name=\"action\" value=\"customtimeframe\">
			  <b class=\"cust_time_b\">Begin:</b> 
			  <select class=\"cust_month\" name=\"beginmonth\">
			   <option> </option>
";
foreach ($month_array as $numeric => $alpha) {
	print "<option value=\"$numeric\"";
	if (date('m', $result[0]) == $numeric) {
		print " selected";
	};
	print ">$alpha</option>
";
};
print "
			  </select>
		  <b class=\"cust_time_b\">Day:</b>
		  <select class=\"cust_day\" name=\"beginday\">
		   <option> </option>
";
for ($x=1;$x<=31; $x++) {
	if ($x<10) {
		print "<option value=\"0$x\"";
		if (date('d', $result[0]) == $x) {
			print " selected";
		};
		print ">$x</option>
";
	} else {
		print "<option value=\"$x\"";
		if (date('d', $result[0]) == $x) {
			print " selected";
		};
		print ">$x</option>
";
	};
};
print "	
			  </select>
			  <b class=\"cust_time_b\">Hour:</b> 
			  <select class=\"cust_hour\" name=\"beginhour\">
";
for ($x=0;$x<=24; $x++) {
	if ($x<10) {
		print "<option value=\"0$x\"";
		if (date('H', $result[0]) == $x) {
			print " selected";
		};
		print ">$x</option>
";
	} else {
		print "<option value=\"$x\"";
		if (date('H', $result[0]) == $x) {
			print " selected";
		};
		print ">$x</option>
";
	};
};
print "	
			  </select>
			  <b class=\"cust_time_b\">Year:</b> 
			  <select class=\"cust_year\" name=\"beginyear\">
";
for ($x=date('Y', $result[0]);$x<=date('Y'); $x++) {
	print "<option value=\"$x\"";
	if (date('Y', $result[0]) == $x) {
		print " selected";
	};
	print ">$x</option>
";
};
print "
			  </select>
			  <br />
			  <b class=\"cust_time_b\">End:</b>&nbsp;&nbsp;&nbsp;&nbsp;
			  <select class=\"cust_month\" name=\"endmonth\">
			   <option> </option>
";
foreach ($month_array as $numeric => $alpha) {
	print "<option value=\"$numeric\"";
	if (date('m', $result[0]) == $numeric) {
		print " selected";
	};
	print ">$alpha</option>
";
};
print "
			  </select>
		  <b class=\"cust_time_b\">Day:</b>
		  <select class=\"cust_day\" name=\"endday\">
		   <option> <option>
";
for ($x=1;$x<=31; $x++) {
	if ($x<10) {
		print "<option value=\"0$x\"";
		if (date('d') == $x) {
			print " selected";
		};
		print ">$x</option>
";
	} else {
		print "<option value=\"$x\"";
		if (date('d') == $x) {
			print " selected";
		};
		print ">$x</option>
";
	};
};
print "	
			  </select>
			  <b class=\"cust_time_b\">Hour:</b>
			  <select class=\"cust_hour\" name=\"endhour\">
			   <option> <option>
";
for ($x=0;$x<=24; $x++) {
	if ($x<10) {
		print "<option value=\"0$x\"";
		if (date('H') == $x) {
			print " selected";
		};
		print ">$x</option>
";
	} else {
		print "			   <option value=\"$x\"";
		if (date('H') == $x) {
			print " selected";
		};
		print ">$x</option>
";
	};
};
print "	
			  </select>
			  <b class=\"cust_time_b\">Year:</b> 
			  <select class=\"cust_year\" name=\"endyear\">
";
for ($x=date('Y', $result[0]);$x<=date('Y'); $x++) {
	print "<option value=\"$x\"";
	if (date('Y') == $x) {
		print " selected";
	};
	print ">$x</option>
";
};
print "
			  </select>
			  <input class=\"button_sub\" type=\"submit\" name=\"\" value=\"Graph\">
			 </form>
";
?>
Return current item: Network Managment / Inventory System