. * * @category Main * @package RPMPHP * * @author Remi Collet * @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 * @version SVN: $Id: ajouter_adherent.php 836 2010-02-27 08:11:44Z trashy $ * @link http://github.com/remicollet/rpmphp/ * @since The begining of times. */ require 'main.inc.php'; $smarty->assign('ariane', $ariane); $smarty->assign('page_title', 'Packages in Fedora repositories'); try { $db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS); $sql='SELECT * FROM repo ORDER BY ID'; $res=$db->query($sql); $repositories = null; if ( $res ) { for ( $i=0, $prev="xx"; $repo=$res->fetchObject(); $i++, $prev=$repo->main ) { $repositories[] = array( 'repo_name' => ($repo->main != $prev ? $repo->main : " "), 'active' => ($repo->main != $prev ? ($repo->active ? "Yes" : "no") : " " ), 'sub_name' => $repo->sub, 'url' => $repo->url, 'date' => date("r", $repo->stamp) ); } $smarty->assign('repositories', $repositories); } } catch(PDOException $e) { $smarty->assign( 'error', sprintf("%s ERREUR : %s\n", date("r"), $e->getMessage()) ); } $page_content = $smarty->fetch('index.tpl'); $smarty->assign('page_content', $page_content); $smarty->display('main.tpl'); ?>