cvs: pearweb /include/pepr pepr.php

From: Date: Sat, 04 Sep 2004 23:56:44 +0000
Subject: cvs: pearweb /include/pepr pepr.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-23640@lists.php.net to get a copy of this message
toby Sat Sep 4 19:56:44 2004 EDT Modified files: /pearweb/include/pepr pepr.php Log: * Added possibility to sort proposal received by proposal::getAll(). http://cvs.php.net/diff.php/pearweb/include/pepr/pepr.php?r1=1.46&r2=1.47&ty=u Index: pearweb/include/pepr/pepr.php diff -u pearweb/include/pepr/pepr.php:1.46 pearweb/include/pepr/pepr.php:1.47 --- pearweb/include/pepr/pepr.php:1.46 Tue Aug 31 04:37:15 2004 +++ pearweb/include/pepr/pepr.php Sat Sep 4 19:56:43 2004 @@ -22,7 +22,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2004 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr.php,v 1.46 2004/08/31 08:37:15 mj Exp $ + * @version $Id: pepr.php,v 1.47 2004/09/04 23:56:43 toby Exp $ */ /**#@+ @@ -181,7 +181,7 @@ return new proposal($res); } - function &getAll(&$dbh, $status = null, $limit = null) + function &getAll(&$dbh, $status = null, $limit = null, $order = null) { $sql = "SELECT *, UNIX_TIMESTAMP(draft_date) as draft_date, UNIX_TIMESTAMP(proposal_date) as proposal_date, @@ -191,7 +191,11 @@ if (!empty($status)) { $sql .= " WHERE status = '".$status."'"; } - $sql .= " ORDER BY status ASC, draft_date DESC"; + if (!isset($order)) { + $sql .= " ORDER BY status ASC, draft_date DESC"; + } else { + $sql .= " ORDER BY ".$order; + } if (!empty($limit)) { $sql .= " LIMIT $limit"; }

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