diff options
Diffstat (limited to 'all.php')
-rw-r--r-- | all.php | 39 |
1 files changed, 29 insertions, 10 deletions
@@ -57,14 +57,27 @@ function report ($db) { global $what, $smarty; $packages = null; - $repos = listRepos($db); + $rpmrepo = new TableRpmRepo($db); + $repos = $rpmrepo->getAllRepoHash(); $smarty->assign('repos', $repos); if (substr($what, 0, 1)=='%') { - $sql=sprintf("SELECT DISTINCT name FROM rpm WHERE SUBSTRING(name,1,1)='%s' ORDER BY name", substr($what, 1, 1)); + $sql = sprintf( + "SELECT DISTINCT name + FROM rpm + WHERE SUBSTRING(name,1,1)='%s' + ORDER BY name", + substr($what, 1, 1) + ); } else { - $sql=sprintf("SELECT DISTINCT name FROM acls WHERE owner='%s' ORDER BY name", $what); + $sql = sprintf( + "SELECT DISTINCT name + FROM acls + WHERE owner='%s' + ORDER BY name", + $what + ); } //echo "<p>SQL=$sql</p>"; @@ -107,14 +120,16 @@ function report ($db) $display=""; $class=""; foreach ($repomain as $repo) { - if (isset($rpms[$repo->main."-".$repo->sub])) { - $rpm=$rpms[$repo->main."-".$repo->sub]; + if (isset($rpms[$repo['main']."-".$repo['sub']])) { + $rpm=$rpms[$repo['main']."-".$repo['sub']]; - $maxver = (isset($rpms["devel-"]) ? $rpms["devel-"]->ver : ""); + $maxver = (isset($rpms["devel-"]) + ? $rpms["devel-"]->ver + : ""); - switch ($repo->sub) { + switch ($repo['sub']) { case "base": - if (isset($rpms[$repo->main."-updates"])) { + if (isset($rpms[$repo['main']."-updates"])) { $display .= sprintf( "%s-%s<br/>", $rpm->ver, @@ -126,7 +141,9 @@ function report ($db) $rpm->ver, $rpm->rel ); - $class = ($rpm->ver == $maxver ? "check" : "attn"); + $class = ($rpm->ver == $maxver + ? "check" + : "attn"); } break; case "": @@ -174,7 +191,9 @@ function report ($db) try { $db = new PDO ("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS); - $sql="SELECT DISTINCT CONCAT('%',SUBSTRING(name,1,1)) as init FROM rpm ORDER BY init"; + $sql="SELECT DISTINCT CONCAT('%',SUBSTRING(name,1,1)) as init + FROM rpm + ORDER BY init"; $res=$db->query($sql); if ( $res ) { while ( $s = $res->fetchObject() ) { |