include_once("pkgfuncs_po.inc"); # grab the current list of PackageCategories # function pkgCategories() { $cats = array(); $dbh = db_connect(); $q = "SELECT * FROM PackageCategories "; $q.= "ORDER BY Category ASC"; $result = db_query($q, $dbh); if ($result) { while ($row = mysql_fetch_row($result)) { $cats[$row[0]] = $row[1]; } } return $cats; } # grab the current list of PackageLocations # function pkgLocations() { $locs = array(); $dbh = db_connect(); $q = "SELECT * FROM PackageLocations "; $q.= "ORDER BY Location ASC"; $result = db_query($q, $dbh); if ($result) { while ($row = mysql_fetch_row($result)) { $locs[$row[0]] = $row[1]; } } return $locs; } # display the search form in a boxSoft style # function pkg_search_page($SID="") { global $_REQUEST; # SID: session id cookie # L: PackageLocations.ID # C: PackageCategories.ID # K: Keywords # SB: Sort by # M: search "my packages" # O: Row offset # PP: Per page # D: Direction to advance (Less/More) $locs = pkgLocations(); $cats = pkgCategories(); $devs = getDevelopers(); $tus = getTrustedUsers(); $dbh = db_connect(); # determine paging variables # isset($_REQUEST["PP"]) ? $PP = intval($_REQUEST["PP"]) : $PP = 25; isset($_REQUEST["O"]) ? $O = intval($_REQUEST["O"]) : $O = 0; if (isset($_REQUEST["do_More"])) { $O += $PP; } elseif (isset($_REQUEST["do_Less"])) { $O -= $PP; } if ($O < 0) { $O = 0; } # grab info for user if they're logged in # if ($SID) { $myuid = uid_from_sid($SID); $acct = account_from_sid($SID); } # The search form # $K = str_replace("\"", "", $_REQUEST["K"]); # TODO better testing for # SQL trickery... print "
\n"; return; } # vim: ts=2 sw=2 noet ft=php ?>