' ?> euscan
query($sql); echo ""; while ($row = $results->fetchArray()) { $new = $row['versions'] - $row['ebuilds']; $color = $new == 0 ? 'green' : 'red'; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
CategoryEbuildsNew versions
{$row['category']}{$row['ebuilds']}$new
"; } else if ($act == "herds") { $sql = "SELECT herd, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM herds"; $sql.= " JOIN package_herds ON herds.id = herd_id"; $sql.= " JOIN packages ON package_herds.package_id = packages.id"; $sql.= " JOIN versions ON versions.package_id = packages.id"; $sql.= " GROUP BY herd"; $results = $db->query($sql); echo ""; while ($row = $results->fetchArray()) { $new = $row['versions'] - $row['ebuilds']; $color = $new == 0 ? 'green' : 'red'; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
HerdEbuildsNew versions
{$row['herd']}{$row['ebuilds']}$new
"; } else if ($act == "maintainers") { $sql = "SELECT maintainer, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM maintainers"; $sql.= " JOIN package_maintainers ON maintainers.id = maintainer_id"; $sql.= " JOIN packages ON package_maintainers.package_id = packages.id"; $sql.= " JOIN versions ON versions.package_id = packages.id"; $sql.= " GROUP BY maintainer"; $results = $db->query($sql); echo ""; while ($row = $results->fetchArray()) { $new = $row['versions'] - $row['ebuilds']; $color = $new == 0 ? 'green' : 'red'; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
MaintainerEbuildsNew versions
{$row['maintainer']}{$row['ebuilds']}$new
"; } else if ($act == "categories") { $sql = "SELECT category, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM packages JOIN versions ON package_id = packages.id"; $sql.= " GROUP BY category"; $results = $db->query($sql); echo ""; while ($row = $results->fetchArray()) { $new = $row['versions'] - $row['ebuilds']; $color = $new == 0 ? 'green' : 'red'; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
CategoryEbuildsNew versions
{$row['category']}{$row['ebuilds']}$new
"; } else if ($act == 'packages') { $db_cat = $db->escapeString($cat); $db_herd = $db->escapeString($herd); $db_mtnr = $db->escapeString($mtnr); if ($db_cat) { $sql = "SELECT category, package, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM packages JOIN versions ON package_id = packages.id"; $sql.= " WHERE category = '$db_cat'"; $sql.= " GROUP BY category, package"; } else if ($db_herd) { $sql = "SELECT category, package, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM herds"; $sql.= " JOIN package_herds ON herds.id = herd_id"; $sql.= " JOIN packages ON package_herds.package_id = packages.id"; $sql.= " JOIN versions ON versions.package_id = packages.id"; $sql.= " WHERE herd LIKE '$db_herd'"; $sql.= " GROUP BY category, package"; } else if ($db_mtnr) { $sql = "SELECT category, package, COUNT(version) as versions, SUM(packaged) as ebuilds"; $sql.= " FROM maintainers"; $sql.= " JOIN package_maintainers ON maintainers.id = maintainer_id"; $sql.= " JOIN packages ON package_maintainers.package_id = packages.id"; $sql.= " JOIN versions ON versions.package_id = packages.id"; $sql.= " WHERE maintainer LIKE '%$db_mtnr%'"; $sql.= " GROUP BY category, package"; } if ($sql) { $results = $db->query($sql); echo ""; while ($row = $results->fetchArray()) { $new = $row['versions'] - $row['ebuilds']; $catpkg = "{$row['category']}/{$row['package']}"; $color = $new == 0 ? 'green' : 'red'; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
CategoryEbuildsNew versions
$catpkg{$row['ebuilds']}$new
"; } } else if ($act == 'package') { $pkg = explode("/", $pkg); if (count($pkg) == 2) { $cat = $db->escapeString($pkg[0]); $pkg = $db->escapeString($pkg[1]); } else { $cat = $pkg = ""; } $sql = "SELECT * FROM packages WHERE category = '$cat' AND package = '$pkg'"; $infos = $db->query($sql); $infos = $infos->fetchArray(); if ($infos) { echo "

{$infos['category']}/${infos['package']}

"; $sql = "SELECT * FROM versions WHERE package_id = ${infos['id']} AND packaged = 1"; $results = $db->query($sql); echo '

Packaged versions:

'; echo '

Upstream versions:

'; } else { echo '
Invalid package
'; } } ?>