diff options
Diffstat (limited to 'main.inc.php')
-rw-r--r-- | main.inc.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/main.inc.php b/main.inc.php index e94a62b..bbc300c 100644 --- a/main.inc.php +++ b/main.inc.php @@ -47,4 +47,31 @@ $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 "<pre>"; print_r($repos);echo "</pre>"; + foreach ( $repos as $repomain ) { + foreach ($repomain as $repo) { + $repos[$repo->main][$repo->sub] = $repo; + break; + } + } + return $repos; +} + ?>
\ No newline at end of file |