mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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>
This commit is contained in:
parent
71f2efd7af
commit
84d21e6f30
2 changed files with 8 additions and 4 deletions
|
@ -602,6 +602,11 @@ function pkg_search_page($SID="", $dbh=NULL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
include('pkg_search_form.php');
|
include('pkg_search_form.php');
|
||||||
|
|
||||||
|
while ($row = mysql_fetch_assoc($result)) {
|
||||||
|
$searchresults[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
include('pkg_search_results.php');
|
include('pkg_search_results.php');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -46,9 +46,8 @@ if (!$result): ?>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
|
<?php while (list($indx, $row) = each($searchresults)): ?>
|
||||||
<?php for ($i = 0; $row = mysql_fetch_assoc($result); $i++): ?>
|
<tr class="<?php echo ($indx % 2 == 0) ? 'odd' : 'even' ?>">
|
||||||
<tr class="<?php echo ($i % 2 == 0) ? 'odd' : 'even' ?>">
|
|
||||||
<?php if ($SID): ?>
|
<?php if ($SID): ?>
|
||||||
<td><input type="checkbox" name="IDs[<?php echo $row["ID"] ?>]" value="1" /></td>
|
<td><input type="checkbox" name="IDs[<?php echo $row["ID"] ?>]" value="1" /></td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -76,7 +75,7 @@ if (!$result): ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endfor; ?>
|
<?php endwhile; ?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Reference in a new issue