3 require_once ("paths.php");
4 require_once ($smarty_path."Smarty.class.php");
5 require_once ("bweb.inc.php");
6 require_once ("config.inc.php");
8 $smarty = new Smarty();
13 // Smarty configuration
14 $smarty->compile_check = true;
15 $smarty->debugging = false;
16 $smarty->force_compile = true;
18 $smarty->template_dir = "./templates";
19 $smarty->compile_dir = "./templates_c";
20 $smarty->config_dir = "./configs";
24 if( isset( $_POST["backupjob_name"] ) )
25 $backupjob_name = $_POST["backupjob_name"];
26 elseif( isset( $_GET["backupjob_name"] ) )
27 $backupjob_name = $_GET["backupjob_name"];
29 die( "Please specify a backup job name " );
31 $smarty->assign('backupjob_name', $backupjob_name );
33 // Last 7 days stored Bytes graph
35 $graph = new BGraph( "graph2.png" );
38 // Get the last 7 days interval (start and end)
39 for( $c = 6 ; $c >= 0 ; $c-- ) {
40 $today = ( mktime() - ($c * LAST_DAY) );
41 array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) );
44 $days_stored_bytes = array();
46 foreach( $days as $day ) {
47 array_push( $days_stored_bytes, $dbSql->GetStoredBytesByJob( $backupjob_name, $day['start'], $day['end'] ) );
50 $graph->SetData( $days_stored_bytes, 'bars', 'text-data' );
51 $graph->SetGraphSize( 400, 230 );
54 $smarty->assign('graph_stored_bytes', $graph->Get_Image_file() );
57 // Process and display the template
58 $smarty->display('backupjob-report.tpl');