Ejemplo n.º 1
0
        }
        // Job speed
        $start = $job['starttime'];
        $end = $job['endtime'];
        $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
        if ($seconds !== false && $seconds > 0) {
            $speed = $job['jobbytes'] / $seconds;
            $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
        } else {
            $job['speed'] = 'N/A';
        }
        // Job bytes more easy to read
        $job['jobbytes'] = CUtils::Get_Human_Size($job['jobbytes']);
        $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
        $jobs[] = $job;
    }
    // end while
} catch (Exception $e) {
    CErrorHandler::displayError($e);
}
$view->assign('jobs', $jobs);
$view->assign('backupjob_name', $backupjob_name);
$view->assign('backupjob_period', $backupjob_period);
$view->assign('backupjob_bytes', $backupjob_bytes);
$view->assign('backupjob_files', $backupjob_files);
// Set page name
$current_page = 'Backup job report';
$view->assign('page_name', $current_page);
// Process and display the template
$view->display('backupjob-report.tpl');
Ejemplo n.º 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');
Ejemplo n.º 3
0
            $check['check_result'] = $icon_result[CDBUtils::isConnected($dbSql->db_link)];
            break;
        case 'php-timezone':
            $timezone = ini_get('date.timezone');
            if (!empty($timezone)) {
                $check['check_result'] = $icon_result[true];
            } else {
                $check['check_result'] = $icon_result[false];
            }
            break;
    }
}
// Testing graph capabilities
$data = array(array('test', 100), array('test1', 150), array('test1', 180), array('test1', 456));
// Pie graph
$pie_graph = new CGraph("testpage-graph03.jpg");
$pie_graph->SetData($data, 'pie');
$view->assign('pie_graph', $pie_graph->Render());
unset($pie_graph);
// Bar graph
$bar_graph = new CGraph("testpage-graph04.jpg");
$bar_graph->SetData($data, 'bars');
$view->assign('bar_graph', $bar_graph->Render());
unset($bar_graph);
// Set page name
$current_page = 'Test page';
$view->assign('page_name', $current_page);
// Template rendering
$view->assign('checks', $check_list);
$view->display('test.tpl');
Ejemplo n.º 4
0
 function dispatch(&$data)
 {
     $db =& new CDatabase();
     if (function_exists("config_database")) {
         config_database($db);
     }
     $sanitize =& new CSanitize();
     $validate =& new CValidate();
     if (function_exists('config_controller_class')) {
         $controllername = config_controller_class();
         $controller = new $controllername();
     } else {
         $controller = new CController();
     }
     $controller->RequestHandle();
     $controller->SetDatabase($db);
     $controller->SetSanitize($sanitize);
     $controller->SetValidate($validate);
     if (function_exists("config_models")) {
         config_models($controller);
     }
     if (function_exists('config_components')) {
         config_components($controller);
     }
     if (!function_exists('is_session') || is_session()) {
         session_start();
     }
     $this->_check_secure($controller);
     if (function_exists("config_controller")) {
         config_controller($controller);
     }
     if (function_exists("action")) {
         action($controller);
     }
     if (function_exists('after_action')) {
         after_action($controller);
     }
     $template = $controller->GetTemplateFile();
     $viewfile = $controller->GetViewFile();
     $variable = $controller->GetVariable();
     $sqllog = $controller->GetSqlLog();
     $is_debug = $controller->GetDebug();
     if (function_exists('config_view_class')) {
         $viewname = config_view_class();
         $view = new $viewname();
     } else {
         $view = new CView();
     }
     $view->SetFile($template, $viewfile);
     $view->SetVariable($variable);
     $view->SetSanitize($sanitize);
     $view->SetController($controller);
     $view->SetDebug($is_debug);
     $view->SetSqlLog($sqllog);
     $view->display();
     if (function_exists('after_render')) {
         after_render($controller);
     }
     $data = $variable;
     return $controller;
 }