FOG en EHU  1.0.0(r304)
FOGenEHU
packages/web/management/phpimages/hostloginhistory.phpgraph.php
Ir a la documentación de este archivo.
00001 <?php
00002 session_start();
00003 
00004 require_once( "../../commons/config.php" );
00005 require_once( "../../commons/functions.include.php" );
00006 
00007 $conn = mysql_connect( MYSQL_HOST, MYSQL_USERNAME, MYSQL_PASSWORD);
00008 if ( $conn )
00009 {
00010         @mysql_select_db( MYSQL_DATABASE );
00011 }
00012 
00013 require_once( "../lib/UserLoginEntry.class.php" );
00014 require_once("../lib/jpgraph/" . getSetting( $conn, "FOG_JPGRAPH_VERSION" ) . "/src/jpgraph.php");
00015 require_once("../lib/jpgraph/" . getSetting( $conn, "FOG_JPGRAPH_VERSION" ) . "/src/jpgraph_gantt.php");
00016 
00017 $graph = new GanttGraph(575,-1);
00018 $graph->ShowHeaders( GANTT_HDAY | GANTT_HHOUR );
00019 $graph->scale->hour->SetStyle(HOURSTYLE_HAMPM);
00020 $graph->scale->hour->SetIntervall(2);
00021 if ( function_exists( "imageantialias" ) )
00022         $graph->img->SetAntiAliasing();
00023 $graph->SetBackgroundImage("../images/bandwidthbg.jpg",BGIMG_FILLFRAME);
00024 $graph->title->Set(_("Host Login History"));
00025 $graph->scale->day->SetStyle( DAYSTYLE_LONGDAYDATE2 );
00026 $graph->scale->actinfo->SetColTitles(array('',_('Username')));
00027 $graph-> scale->actinfo->SetBackgroundColor('gray:0.7@0.5'); 
00028 
00029 
00030 $cnt = 0;
00031 $lastUser = "";
00032 $blFirst = true;
00033 for ( $i = 0; $i < count( $_SESSION["fog_logins"] ); $i++ )
00034 {
00035         $entry = unserialize( $_SESSION["fog_logins"][$i]  );
00036         if ( $entry != null )
00037         {
00038                 if ( $blFirst )
00039                         $blFirst = false;
00040                 else
00041                 {
00042                         if ( $lastUser != $entry->getUser() )
00043                                 $cnt++;
00044                 }
00045 
00046                 $icon = new IconImage( '../images/user.png');           
00047                 $activity = new GanttBar($cnt,array($icon,$entry->getUser()),$entry->getLogInTime(),$entry->getLogOutTime() );
00048                 $activity->SetPattern(GANTT_SOLID,"green");
00049                 if ( ! $entry->isClean() )
00050                 {
00051                         $activity ->leftMark->Show();    
00052                         $activity ->leftMark->SetFillColor( "red");
00053                         $activity ->leftMark->title-> SetColor( "white");               
00054                         $activity ->leftMark->SetWidth( 6 ) ;           
00055                         $activity ->leftMark->SetType( MARK_FILLEDCIRCLE);              
00056                         $activity ->leftMark->title->Set(_("?"));                       
00057                         $activity ->leftMark->SetColor( "red"); 
00058                         $activity->SetPattern(GANTT_SOLID,"yellow");
00059                 }
00060 
00061                 $graph->Add($activity);
00062                 $lastUser = $entry->getUser();
00063         }
00064 }
00065 $graph->Stroke();
00066 ?>
 Todo Clases Archivos Funciones Variables Enumeraciones