summaryrefslogtreecommitdiffstats
path: root/web/template/pkg_search_results.php
diff options
context:
space:
mode:
authorcanyonknight <canyonknight@gmail.com>2012-05-23 15:27:53 -0400
committerLukas Fleischer <archlinux@cryptocrack.de>2012-07-06 11:26:56 +0200
commit84d21e6f30a2f0219f27942998d295d716751bf6 (patch)
tree0ba01d4174c5a5867acfd6aa98392d6c252d08ac /web/template/pkg_search_results.php
parent71f2efd7af4b32eb514c134769fc969e5e64bd2b (diff)
downloadaurweb-84d21e6f30a2f0219f27942998d295d716751bf6.tar.xz
pkg_search_results.php: Pull out DB code
* Move DB code from pkg_search_results.php to already existing function in pkgfuncs.inc.php * Centralization of DB code important in a future transition to PDO interface Signed-off-by: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template/pkg_search_results.php')
-rw-r--r--web/template/pkg_search_results.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/web/template/pkg_search_results.php b/web/template/pkg_search_results.php
index 95590f7..d676c0a 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -46,9 +46,8 @@ if (!$result): ?>
</thead>
<tbody>
-
- <?php for ($i = 0; $row = mysql_fetch_assoc($result); $i++): ?>
- <tr class="<?php echo ($i % 2 == 0) ? 'odd' : 'even' ?>">
+ <?php while (list($indx, $row) = each($searchresults)): ?>
+ <tr class="<?php echo ($indx % 2 == 0) ? 'odd' : 'even' ?>">
<?php if ($SID): ?>
<td><input type="checkbox" name="IDs[<?php echo $row["ID"] ?>]" value="1" /></td>
<?php endif; ?>
@@ -76,7 +75,7 @@ if (!$result): ?>
<?php endif; ?>
</td>
</tr>
- <?php endfor; ?>
+ <?php endwhile; ?>
</tbody>
</table>