cvs: pearweb /public_html/pepr pepr-qa-stats.php

From: Date: Tue, 01 Mar 2005 17:58:51 +0000
Subject: cvs: pearweb /public_html/pepr pepr-qa-stats.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-29960@lists.php.net to get a copy of this message
toby Tue Mar 1 12:58:51 2005 EDT Modified files: /pearweb/public_html/pepr pepr-qa-stats.php Log: * Fix. http://cvs.php.net/diff.php/pearweb/public_html/pepr/pepr-qa-stats.php?r1=1.4&r2=1.5&ty=u Index: pearweb/public_html/pepr/pepr-qa-stats.php diff -u pearweb/public_html/pepr/pepr-qa-stats.php:1.4 pearweb/public_html/pepr/pepr-qa-stats.php:1.5 --- pearweb/public_html/pepr/pepr-qa-stats.php:1.4 Sat Feb 12 05:29:53 2005 +++ pearweb/public_html/pepr/pepr-qa-stats.php Tue Mar 1 12:58:50 2005 @@ -18,9 +18,12 @@ * @author Tobias Schlitt <toby@php.net> * @copyright Copyright (c) 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr-qa-stats.php,v 1.4 2005/02/12 10:29:53 toby Exp $ + * @version $Id: pepr-qa-stats.php,v 1.5 2005/03/01 17:58:50 toby Exp $ */ +// Should require pear.qa karma later. +// auth_require('pear.admin'); + function getDays($date) { return ceil((time() - $date) / 60 / 60 / 24); } @@ -53,10 +56,10 @@ $resProposals = $dbh->getAll($sql, DB_FETCHMODE_ASSOC); -$proposalIds = array(0 => 0); +$proposalIds = array(0 => 0, 1 => 1); foreach ($resProposals as $proposal) { - $proposalIds[$proposal['id']] = $proposal['id']; + $proposalIds[$proposal['id']] = $proposal['pkg_prop_id']; } // Get IDs from proposals with changes in the last 30 days @@ -64,9 +67,8 @@ $resProposals = $dbh->getAll($sql, DB_FETCHMODE_ASSOC); - foreach ($resProposals as $proposal) { - $proposalIds[$proposal['id']] = $proposal['id']; + $proposalIds[$proposal['pkg_prop_id']] = $proposal['pkg_prop_id']; } $sql = "SELECT @@ -87,15 +89,36 @@ // }}} -// {{{ Fetch results - +// {{{ Fetch for orphan finished proposals +/* +$sql = <<<EOS +SELECT + p.id AS id, + p.pkg_name AS pkg_name, + p.user_handle AS user_handle, + UNIX_TIMESTAMP(p.draft_date) AS draft_date +FROM + package_proposals AS p +WHERE + p.status = "finished" + AND p.vote_date < DATE_ADD(NOW(), INTERVAL -30 DAY) + AND p._date < DATE_ADD(NOW(), INTERVAL -30 DAY) +ORDER BY draft_date DESC +EOS; -// }}} +$res['orphan_drafts'] = $dbh->getAll($sql, DB_FETCHMODE_ASSOC); +*/ +// }}} response_header('PEPr :: Propably orphan proposals'); +echo '<table border="0" width="100%">'; +echo '<tr>'; +echo '<td width="50%" valign="top">'; + // {{{ HTML for orphan drafts echo '<h1>Status &quot;draft&quot;</h1>'; + echo '<table border="0" cellspacing="0">'; echo '<tr>'; echo '<th>Name</th>'; @@ -111,7 +134,12 @@ echo '</tr>'; } echo '</table>'; + // }}} + +echo '</td>'; +echo '<td width="50%" valign="top">'; + // {{{ HTML for orphan proposals echo '<h1>Status &quot;proposal&quot;</h1>'; echo '<table border="0" cellspacing="0">'; @@ -138,3 +166,6 @@ echo '</table>'; // }}} +echo '</td>'; +echo '</tr>'; +echo '</table>';

« previous php.pear.cvs (#29960) next »