コード例 #1
0
ファイル: package-stats.php プロジェクト: stof/pearweb
} else {
    echo '<input type="hidden" name="rid" value="" />' . "\n";
}
echo "  </td>\n";
echo '  <td><input type="submit" name="submit" value="Go" /></td>' . "\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
if (isset($_GET['pid']) && (int) $_GET['pid']) {
    include_once 'pear-database-statistics.php';
    include_once 'pear-database-package.php';
    $info = package::info($_GET['pid'], null, false);
    if (isset($info['releases']) && sizeof($info['releases']) > 0) {
        echo '<h2>&raquo; Statistics for Package &quot;<a href="/package/' . $info['name'] . '">' . $info['name'] . "</a>&quot;</h2>\n";
        $td = "Number of releases: <strong>" . count($info['releases']) . "</strong><br />\n";
        $td .= 'Total downloads: <strong>' . number_format(statistics::package($_GET['pid']), 0, '.', ',') . "</strong><br />\n";
    } else {
        $td = 'No package or release found.';
    }
    ?>
    <table cellspacing="0" cellpadding="3" style="border: 0px; width: 90%;">
    <caption style="background-color: #CCCCCC;">General Statistics</caption>
    <tr>
     <td style="text-align: left;"><?php 
    echo $td;
    ?>
</td>
    </tr>
    </table>

<?php