. * * @category Main * @package RPMPHP * * @author Johan Cwiklinski * @copyright 2010 Remi Collet * @license http://www.gnu.org/licenses/agpl-3.0-standalone.html AGPL License 3.0 or (at your option) any later version * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. */ require 'config.inc.php'; require '/usr/share/php/Smarty/Smarty.class.php'; $smarty = new Smarty(); $smarty->template_dir = 'smarty/templates/rpmphp'; $smarty->compile_dir = 'smarty/templates_c'; $smarty->cache_dir = 'smarty/cache'; $smarty->config_dir = 'smarty/configs'; $ariane[] = array( 'url' => './', 'text' => 'Reports home' ); /** * Get repositories list * * @param object $db a reference to the database * * @return array */ function listRepos($db) { $repos = array(); $res=$db->query("SELECT * FROM repo WHERE active=1 ORDER BY ID"); if ( $res ) { while ($repo = $res->fetchObject()) { $repos[$repo->main][$repo->sub]=$repo; } } // echo "
"; print_r($repos);echo "
"; foreach ( $repos as $repomain ) { foreach ($repomain as $repo) { $repos[$repo->main][$repo->sub] = $repo; break; } } return $repos; } ?>