No permissions !"); // show_footer(); // exit; // } ?> Undefined serviceid !"); show_footer(); exit; } $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); ?> "; echo "",$service["name"],"";; show_table_v_delimiter(); $result=DBselect("select h.hostid,h.host from hosts h,items i where h.status in (0,2) and h.hostid=i.hostid group by h.hostid,h.host order by h.host"); $year=date("Y"); for($year=date("Y")-2;$year<=date("Y");$year++) { if( isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] == $year) ) { echo "["; } echo "".$year.""; if(isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] == $year) ) { echo "]"; } echo " "; } show_table_header_end(); ?> "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "\n"; $col=0; $year=date("Y"); for($year=date("Y")-2;$year<=date("Y");$year++) { if( isset($HTTP_GET_VARS["year"]) && ($HTTP_GET_VARS["year"] != $year) ) { continue; } $start=mktime(0,0,0,1,1,$year); $wday=date("w",$start); if($wday==0) $wday=7; $start=$start-($wday-1)*24*3600; for($i=0;$i<53;$i++) { $period_start=$start+7*24*3600*$i; $period_end=$start+7*24*3600*($i+1); if($period_start>time()) { break; } $stat=calculate_service_availability($service["serviceid"],$period_start,$period_end); if($col++%2==0) { echo ""; } else { echo ""; } echo ""; echo ""; $t=sprintf("%2.2f%%",$stat["problem"]); $t_time=sprintf("%dd %dh %dm",$stat["problem_time"]/(24*3600),($stat["problem_time"]%(24*3600))/3600,($stat["problem_time"]%(3600))/(60)); $f=sprintf("%2.2f%%",$stat["ok"]); $f_time=sprintf("%dd %dh %dm",$stat["ok_time"]/(24*3600),($stat["ok_time"]%(24*3600))/3600,($stat["ok_time"]%(3600))/(60)); echo ""; echo ""; echo ""; if($service["showsla"]==1) { if($stat["ok"]>=$service["goodsla"]) { echo ""; } else { echo ""; } } else { echo ""; } echo ""; } } echo "
FromTillOKProblemsPercentageSLA
"; echo date("d M Y",$period_start); echo ""; echo date("d M Y",$period_end); echo ""; echo "$f_time" ; echo ""; echo "$t_time" ; echo ""; echo "$f/$t" ; echo "".$service["goodsla"]."%".$service["goodsla"]."%-
"; show_footer(); ?>