Example #1
0
| of the License, or (at your option) any later version.                  |
|                                                                         |
| This program is distributed in the hope that it will be useful,         |
| but WITHOUT ANY WARRANTY; without even the implied warranty of          |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
| GNU General Public License for more details.                            |
+-------------------------------------------------------------------------+ 
*/
// Last Err: 
session_start();
require ("paths.php");
require($smarty_path."Smarty.class.php");
include "classes.inc";

$smarty = new Smarty;                                                                                                                   // Template engine
$dbSql = new Bweb();

//$smarty->compile_check = true;
//$smarty->debugging = true;
$smarty->template_dir = "./templates";
$smarty->compile_dir = "./templates_c";
$smarty->config_dir     = "./configs";
$smarty->config_load("bacula.conf");                                                                                    // Load config file
$mode = $smarty->get_config_vars("mode");                                                                               // Lite o Extend?

require("lang.php");

//Assign dbs
if ( count($dbSql->dbs) >1 ) {
  $smarty->assign("dbs", $dbSql->dbs);
  $smarty->assign("dbs_now", $_SESSION['DATABASE']);
Example #2
0
<?php

/*
 +-------------------------------------------------------------------------+
 | Copyright 2010-2016, Davide Franco			                           |
 |                                                                         |
 | This program is free software; you can redistribute it and/or           |
 | modify it under the terms of the GNU General Public License             |
 | as published by the Free Software Foundation; either version 2          |
 | of the License, or (at your option) any later version.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
*/
session_start();
include_once 'core/global.inc.php';
// Initialise view and model
$view = new CView();
$dbSql = new Bweb($view);
// Get volumes list (pools.tpl)
$view->assign('pools', $dbSql->GetVolumeList());
// Set page name
$current_page = 'Pools and volumes report';
$view->assign('page_name', $current_page);
// Process and display the template
$view->display('pools.tpl');
Example #3
0
require ("paths.php");
require($smarty_path."Smarty.class.php");
include "classes.inc";

$smarty = new Smarty;

//$smarty->compile_check = true;
//$smarty->debugging = true;

$smarty->template_dir   = "./templates";
$smarty->compile_dir    = "./templates_c";
$smarty->config_dir     = "./configs";
$smarty->config_load("bacula.conf");
require("lang.php");

$dbSql = new Bweb();

if ( $_GET['default'] == 1) {                                                                                                   // Default params, 1 month
        $dbSql->StartDate = strftime("%Y-%m-%d %H:%M:%S",time()-2678400);
        $dbSql->EndDate = strftime("%Y-%m-%d %H:%M:%S",time());
}
else                                                                                                                                            // With params
        $dbSql->PrepareDate($_GET['StartDateMonth'],$_GET['StartDateDay'],$_GET['StartDateYear'],$_GET['EndDateMonth'],$_GET['EndDateDay'],$_GET['EndDateYear']);
        
$bytes = $dbSql->CalculateBytesPeriod($_GET['server'],$dbSql->StartDate,$dbSql->EndDate);
$files = $dbSql->CalculateFilesPeriod($_GET['server'],$dbSql->StartDate,$dbSql->EndDate);
$smarty->assign('startperiod',$dbSql->StartDate);
$smarty->assign('endperiod',$dbSql->EndDate); 
$smarty->assign('bytesperiod',$bytes);
$smarty->assign('filesperiod',$files);