From 0d029322400852f29b684fee04567046b25ea6e4 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Sat, 23 Jul 2011 10:54:00 +0200 Subject: [PATCH] bacula-web: Added client information on client report page --- gui/bacula-web/client-report.php | 35 +++++++++++++++++----- gui/bacula-web/style/default.css | 9 ++++++ gui/bacula-web/templates/client-report.tpl | 17 ++++++++++- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/gui/bacula-web/client-report.php b/gui/bacula-web/client-report.php index fea5d291fa..fd4291eb08 100644 --- a/gui/bacula-web/client-report.php +++ b/gui/bacula-web/client-report.php @@ -14,13 +14,32 @@ | GNU General Public License for more details. | +-------------------------------------------------------------------------+ */ - session_start(); - include_once( 'config/global.inc.php' ); + session_start(); + include_once( 'config/global.inc.php' ); - $dbSql = new Bweb(); - - // Enter your code here ... - - // Process and display the template - $dbSql->tpl->display('client-report.tpl'); + $dbSql = new Bweb(); + $clientid = ''; + $client = ''; + $client_jobs = array(); + + $http_post = CHttpRequest::getRequestVars( $_POST ); + $http_get = CHttpRequest::getRequestVars( $_GET ); + + if( isset( $http_post['client_id'] ) ) + $clientid = $http_post['client_id']; + elseif( isset( $http_get['client_id'] ) ) + $clientid = $http_get['client_id']; + else + die( "Application error: Client not specified " ); + + // Client informations + $client = $dbSql->getClientInfos($clientid); + + $dbSql->tpl->assign( 'client_name', $client['name']); + $dbSql->tpl->assign( 'client_os', $client['os']); + $dbSql->tpl->assign( 'client_arch', $client['arch']); + $dbSql->tpl->assign( 'client_version', $client['version']); + + // Process and display the template + $dbSql->tpl->display('client-report.tpl'); ?> diff --git a/gui/bacula-web/style/default.css b/gui/bacula-web/style/default.css index 92a134c04c..57d7124206 100644 --- a/gui/bacula-web/style/default.css +++ b/gui/bacula-web/style/default.css @@ -139,6 +139,11 @@ a:link, a:visited, a:hover, a:visited { text-align: center; } +.box h3, .box h4 { + text-align:left; + margin-left: 10px; +} + .box p.title { /*height: 25px;*/ text-align: center; @@ -162,6 +167,10 @@ a:link, a:visited, a:hover, a:visited { vertical-align: middle; } +.box table { + +} + .box table tr td { padding: 3px; font-size: 8pt; diff --git a/gui/bacula-web/templates/client-report.tpl b/gui/bacula-web/templates/client-report.tpl index e2af4e5de1..b1c09b0dfd 100644 --- a/gui/bacula-web/templates/client-report.tpl +++ b/gui/bacula-web/templates/client-report.tpl @@ -16,10 +16,25 @@

Client(s) Report

+ +

Client informations

+ + + + + + + + + + + + + +
Client name: {$client_name}
Client version: {$client_version}
Client os: {$client_os}
Client arch: {$client_arch}
-
{include file="footer.tpl"} -- 2.39.5