From: Davide Franco Date: Mon, 27 Jun 2011 16:03:08 +0000 (+0200) Subject: bacula-web: Fixed php code in GetJobsStatistics() function X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=67cb6dbbe6d998780b4868876ffa00fe1a718766;p=bacula%2Fbacula bacula-web: Fixed php code in GetJobsStatistics() function --- diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index 081e9e7794..486d3d17e2 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -424,19 +424,17 @@ class Bweb extends DB break; } - $query = 'SELECT COUNT(JobId) AS ' . $type . ' '; + $query = 'SELECT COUNT(JobId) AS count '; $query .= 'FROM Job '; $query .= "WHERE $where "; - - //echo 'query = ' . $query . '
'; - $jobs = $this->db_link->query( $query ); + $res = $this->db_link->query( $query ); - if (PEAR::isError( $jobs ) ) { - die( "Unable to get last $type jobs status from catalog
" . $status->getMessage() ); + if (PEAR::isError( $res ) ) { + $this->TriggerDBError( 'Unable to get last' . $type . 'jobs status from catalog', $res); }else { - $res = $jobs->fetchRow(); - return array( $label , current($res) ); + $result = $res->fetchRow(); + return array( $label, $result['count'] ); } } // end function GetJobsStatistics()