getMessage()); } /* prepare the search */ require_once 'Search.php'; if( !Search::test_db() ) Search::make_db(); /* a function to make urls */ function url( $arr = array() ) { $get = $_GET; /* control for order reversal */ if( $get['s'] == $arr['s'] ) { if( $get['o'] == 'asc' ) $arr['o'] = 'desc'; elseif( $get['o'] == 'desc' ) $arr['o'] = 'asc'; else $arr['o'] = 'desc'; } else unset($get['o']); $res = array_merge($get, $arr); foreach( $res as $k => $v ) $res_text .= "$k=" . urlencode($v) . "&"; $res_text = substr($res_text, 0, -1); echo "?$res_text"; } /* make menus */ $brand_menu = ""; $res = $db->query("select distinct brand from `SURVEY` order by BRAND"); while( $res->fetchInto($row) ) $brand_menu .= ""; $condition_menu = ""; $res = $db->query("select distinct `condition` from `SURVEY` order by `CONDITION`"); while( $res->fetchInto($row) ) $condition_menu .= ""; ?> Mar Dustrial Surplus Inventory Report
Updated as of

" : "" ?> " : "" ?> KEYWORDS OR NUMBERS: BRAND: CONDITION:
setLimit(10000); list($count,$match_ids) = $search->kwSearch($_GET['kw']); } /* if we didn't run a kw search, or we did and it found results, do the rest of the processing */ if( !$searched or ($searched and $count) ) { /* start the query array */ $q_arr = array(); /* check for brand limit */ if( $_GET['brand'] ) { $where_limit_arr[] = "brand=?"; $q_arr[] = $_GET['brand']; } if( $_GET['condition'] ) { $where_limit_arr[] = "`condition`=?"; $q_arr[] = $_GET['condition']; } if( count($where_limit_arr) ) $where_limit = "where " . join(" and ", $where_limit_arr); /* get sort order */ if( $_GET['s'] ) { $order_by = "order by `!`"; $q_arr[] = $_GET['s']; if( in_array($_GET['o'], array('asc', 'desc')) ) $order_by .= " " . $_GET['o']; } /* run the query */ $res = $db->query("select * from `SURVEY` $where_limit $order_by", $q_arr); if( $res->numRows() ) { /* first build the match list */ while( $res->fetchInto($row, DB_FETCHMODE_ASSOC) ) if( !count($match_ids) or in_array($row['MD_NUM'], $match_ids) ) $rows[] = $row; /* then display it */ if( count($rows) ) { foreach( $rows as $row ) { foreach( $row as $k => $v ) $nrow[$k] = ($v != "NULL") ? $v : ""; $color = 1 - $color; $color_text = $color ? "TrOdd" : "TrRows"; ?> " : "" ?>
MD NUM CONFIGURATION BRAND MODEL SIZE HP TYPE RATIO CONDITION DISPOSITION Picture On File
YES
There are no parts that match your search specifications.