";
$result=DBselect("select graphid,name from graphs order by name");
while($row=DBfetch($result))
{
if(!check_right("Graph","R",$row["graphid"]))
{
continue;
}
if( isset($HTTP_GET_VARS["graphid"]) && ($HTTP_GET_VARS["graphid"] == $row["graphid"]) )
{
echo "[";
}
// BEGIN - IGMI - keep support
$str="";
if(isset($HTTP_GET_VARS["keep"]))
{
if($HTTP_GET_VARS["keep"] == 1)
{
if(isset($HTTP_GET_VARS["from"]))
{
$str=$str."&from=".$HTTP_GET_VARS["from"];
}
if(isset($HTTP_GET_VARS["period"]))
{
$str=$str."&period=".$HTTP_GET_VARS["period"];
}
}
$str=$str."&keep=".$HTTP_GET_VARS["keep"];
}
echo "".$row["name"]."";
// END - IGMI - keep support
// echo "".$row["name"]."";
if(isset($HTTP_GET_VARS["graphid"]) && ($HTTP_GET_VARS["graphid"] == $row["graphid"]) )
{
echo "]";
}
echo " ";
}
if(DBnum_rows($result) == 0)
{
echo "No graphs to display";
}
echo "";
show_table_header_end();
echo "
";
}
?>
".$row["name"]."";
}
else
{
$map="".$row["name"]."";
}
// END - IGMI - keep support added
}
else
{
$map="Select graph to display";
}
if(!isset($HTTP_GET_VARS["from"]))
{
$HTTP_GET_VARS["from"]=0;
}
if(!isset($HTTP_GET_VARS["period"]))
{
$HTTP_GET_VARS["period"]=3600;
}
show_table_header($map);
echo "
| "; if(isset($HTTP_GET_VARS["graphid"])) { echo ""; } else { echo "..."; } echo " | "; echo "
| ";
echo(" ");
echo("Period: ");
$hour=3600;
$a=array("1h"=>3600,"2h"=>2*3600,"4h"=>4*3600,"8h"=>8*3600,"12h"=>12*3600,
"24h"=>24*3600,"week"=>7*24*3600,"month"=>31*24*3600,"year"=>365*24*3600);
foreach($a as $label=>$sec)
{
echo "[";
if($HTTP_GET_VARS["period"]>$sec)
{
$tmp=$HTTP_GET_VARS["period"]-$sec;
echo("-");
}
else
{
echo "-";
}
echo("");
echo($label."");
$tmp=$HTTP_GET_VARS["period"]+$sec;
echo("+");
echo "] ";
}
// echo("[week] ");
// echo("[month] ");
// echo("[year] ");
/* echo("or ");
$tmp=$HTTP_GET_VARS["period"]+$hour;
echo("[");
echo("+1h] ");
if ($HTTP_GET_VARS["period"]>$hour)
{
$tmp=$HTTP_GET_VARS["period"]-$hour;
// echo("[");
echo("[");
echo("-1h] ");
}
else
{
echo("[-1h] ");
}*/
echo(" ");
echo " | ";
echo ""; echo(" Keep period: "); if($HTTP_GET_VARS["keep"] == 1) { echo("[On]"); } else { echo("[Off]"); } echo " | "; echo "
| ";
if(isset($HTTP_GET_VARS["stime"]))
{
echo(" ");
echo("Move: ");
$day=24;
$a=array("1h"=>1,"2h"=>2,"4h"=>4,"8h"=>8,"12h"=>12,
"24h"=>24,"week"=>7*24,"month"=>31*24,"year"=>365*24);
foreach($a as $label=>$hours)
{
echo "[";
$stime=$HTTP_GET_VARS["stime"];
$tmp=mktime(substr($stime,8,2),substr($stime,10,2),0,substr($stime,4,2),substr($stime,6,2),substr($stime,0,4));
$tmp=$tmp-3600*$hours;
$tmp=date("YmdHi",$tmp);
echo("-");
echo($label);
$stime=$HTTP_GET_VARS["stime"];
$tmp=mktime(substr($stime,8,2),substr($stime,10,2),0,substr($stime,4,2),substr($stime,6,2),substr($stime,0,4));
$tmp=$tmp+3600*$hours;
$tmp=date("YmdHi",$tmp);
echo("+");
echo "] ";
}
echo(" ");
}
else
{
echo("");
echo("Move: ");
$day=24;
$a=array("1h"=>1,"2h"=>2,"4h"=>4,"8h"=>8,"12h"=>12,
"24h"=>24,"week"=>7*24,"month"=>31*24,"year"=>365*24);
foreach($a as $label=>$hours)
{
echo "[";
$tmp=$HTTP_GET_VARS["from"]+$hours;
echo("-");
echo($label);
if($HTTP_GET_VARS["from"]>=$hours)
{
$tmp=$HTTP_GET_VARS["from"]-$hours;
echo("+");
}
else
{
echo "+";
}
echo "] ";
}
echo(" ");
}
echo " | ";
echo "";
// echo(" ");
echo "";
// echo(" ");
echo " | ";
echo "