\r
$dbSql = new Bweb();\r
\r
- $backupjob_name = "";\r
- $days = array();\r
+ $backupjob_name = "";
+ $backupjob_bytes = 0;
+ $backupjob_files = 0;
\r
+ $days = array();
+ $days_stored_bytes = array();
+ $days_stored_files = array();
+
+ // ===============================================================
// Get Backup Job name from GET or POST\r
+ // ===============================================================
if( isset( $_POST["backupjob_name"] ) )\r
$backupjob_name = $_POST["backupjob_name"];\r
elseif( isset( $_GET["backupjob_name"] ) )\r
$today = ( mktime() - ($c * LAST_DAY) );\r
array_push( $days, array( 'start' => date( "Y-m-d 00:00:00", $today ), 'end' => date( "Y-m-d 23:59:00", $today ) ) );\r
}\r
+
// Generate Backup Job report period string\r
$backupjob_period = "From " . date( "Y-m-d", mktime()-LAST_WEEK ) . " to " . date( "Y-m-d", mktime() );\r
+
+ // ===============================================================
// Last 7 days stored Bytes graph\r
+ // ===============================================================
$graph = new BGraph( "graph2.png" );\r
\r
- $days_stored_bytes = array();\r
- $backupjob_bytes = 0;\r
-\r
foreach( $days as $day )\r
array_push( $days_stored_bytes, $dbSql->GetStoredBytesByJob( $backupjob_name, $day['start'], $day['end'] ) );\r
\r
$graph->Render();\r
$dbSql->tpl->assign('graph_stored_bytes', $graph->Get_Image_file() );
\r
+ // ===============================================================
// Getting last 7 days stored files graph\r
+ // ===============================================================
$graph = new BGraph("graph3.png" );\r
\r
- $days_stored_files = array();\r
- $backupjob_files = 0;\r
- \r
foreach( $days as $day )\r
array_push( $days_stored_files, $dbSql->GetStoredFilesByJob( $backupjob_name, $day['start'], $day['end'] ) );\r
\r
while( $job = $result->fetchRow( DB_FETCHMODE_ASSOC ) ) {\r
$job['Level'] = $joblevel[ $job['Level'] ];\r
array_push( $jobs, $job);\r
- }\r
- \r
+ }
}else\r
die( "Unable to get last jobs from catalog " . $result->getMessage() );\r
\r
$dbSql->tpl->assign('jobs', $jobs );
- \r
$dbSql->tpl->assign('backupjob_name', $backupjob_name );
$dbSql->tpl->assign('backupjob_period', $backupjob_period );
$dbSql->tpl->assign('backupjob_bytes', $backupjob_bytes );