'Expire Inventory'); $startActivities['812'] = array('success'=>'Expire Inventory'); $startActivities['2562'] = array('start'=>'Event Records Delete'); $startActivities['2564'] = array('success'=>'Event Records Delete'); $startActivities['2102'] = array('start'=>'Activity Log Delete'); $startActivities['2102'] = array('success'=>'Activity Log Delete'); $startActivities['2280'] = array('start'=>'DB Backup'); $startActivities['4550'] = array('success'=>'DB Backup'); $startActivities['406'] = array('start'=>'Session'); $startActivities['403'] = array('success'=>'Session'); # Admin schedules $tsmActivitys = TSMQuery($_REQUEST['server_id'],"select date(DATE_TIME) as DATE,time(DATE_TIME) as TIME,MSGNO from ACTLOG where ORIGINATOR='SERVER' and DATE_TIME \> '$reportStart' and MSGNO in (".implode(",",array_keys($startActivities)).")"); foreach ($tsmActivitys as $tsmActivity) { $datetime = $tsmActivity['DATE']." ".(preg_replace('/(.*:.*):.*/',"$1",$tsmActivity['TIME'])); $msgNum = $tsmActivity['MSGNO']; # Do we know this message number? if (isset($startActivities[$msgNum])) { # New Event. if (isset($startActivities[$msgNum]['start'])) { $activity[$startActivities[$msgNum]['start']][]['start'] = $datetime; } else if (isset($startActivities[$msgNum]['success'])) { $item = (isset($activity[$startActivities[$msgNum]['success']]) ? count($activity[$startActivities[$msgNum]['success']])-1 : 0); # Is there a start event. if (! isset($activity[$startActivities[$msgNum]['success']][$item]['start'])) { $activity[$startActivities[$msgNum]['success']][$item]['start'] = $datetime; } $activity[$startActivities[$msgNum]['success']][$item]['end'] = $datetime; } else { print "Che? Unknown index??"; } } else { } } // A new graph with automatic size $graph = new GanttGraph(0,0,"auto"); $item = 0; # Admin Schedules foreach ($activity as $tsmSchedAdmin => $value) { foreach ($value as $instance) { printf ("Drawing [%s] [%s] [%s] [%s]
",$item,$tsmSchedAdmin,$instance['start'],($instance['end'] ? $instance['end'] : $instance['start'])); $activity = new GanttBar($item,$tsmSchedAdmin,$instance['start'],($instance['end'] ? $instance['end'] : $instance['start'])); $item++; $graph->Add($activity); } } $graph->SetMarginColor('white'); $graph->SetFrame(false); // We want to display day, hour and minute scales $graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN); $graph->hgrid->Show(); $graph->hgrid->SetRowFillColor('darkred@0.85'); $graph->hgrid->line->SetColor('red@0.85'); $graph->hgrid->line->Show(false); // A new activity on row '0' // Setup hour format $graph->scale->hour->SetIntervall(1); $graph->scale->hour->SetStyle(HOURSTYLE_H24); $graph->scale->minute->SetIntervall(30); // Display the Gantt chart $graph->Stroke(); die(); # Block Title $blockTitle = _('Server Status for').' '.TSMServerName($_REQUEST['server_id']); $blockBody = ''; # Client Details $blockBody .= ''; #$blockBody .= sprintf('', # count($tsmClientsTotal)); $blockBody .= ''; # End $blockBody .= '
 Clients 
 '. # classValue(_('%s clients registered to this TSM server.'),'value'). # ' 
 
'; $left = ''; # Use default left blocks. $centre = buildBlock("centre",$blockTitle,$blockBody); $right = ''; # Use default right blocks. print buildPage($left,$centre,$right); ?>