* @version $Revision: 1.8 $ $Date: 2004/10/13 17:25:28 $ * @package Mobot Backend * */ include_once('config.php'); require_once('int_libs/mobot.php'); $manuf_id = $_REQUEST["manuf_id"]; if($_REQUEST["manuf_id"]) { if(!is_numeric($manuf_id)) { $name = urldecode($_REQUEST["manuf_id"]); $manuf_id = mobot_get_manuf_id_from_name($name); } } else { $manuf_id = 0; } $app_url = "/mobot/motherboards/$manuf_id/"; $sort = get_sort_array(); //print_r($_REQUEST); $header = array('Part Number', 'Manufacturer', 'Shop'); if(isset($sort[1]) && isset($sort[2])) { $x = $header[$sort[1]]; if($sort[2] == 1) { $y = 'ASC'; } elseif($sort[2] == 2) { $y = 'DESC'; } $orderby = "ORDER BY '$x' $y "; } if($manuf_id) { $where = "WHERE mm.manuf_id = $manuf_id"; } $t = new table(); $t->set_table_class('tablemobot'); $head_array = array(sorted_header('Part Number', 0, $app_url), sorted_header('Manufacturer', 1, $app_url), 'Shop'); //print_r($head_array); $t->set_thead($head_array); $t->set_tfoot('Powered by MOBOT', 3); $db = new db_mysql(); $db->select_db('mobot'); $sql = "SELECT mm.mobos_id, mm.manuf_id, mm.name AS 'Part Number', mm.price_link AS 'Shop', mm1.name AS 'Manufacturer' FROM mobos AS mm LEFT JOIN manuf AS mm1 ON mm.manuf_id = mm1.manuf_id $where $orderby LIMIT $sort[0], $sort[3]"; //echo $sql; $db->set_sql($sql); $db->query(); if ($row = $db->fetch_array()) { if($manuf_id) { $mname = $row["Manufacturer"]; } $body_array = array(); do { $body_array[] = motherboard_link($row["Part Number"], $row["Manufacturer"]); $body_array[] = manufacturer_link($row["Manufacturer"]); if($row["Shop"]) { $body_array[] = 'Price Check'; } else { $body_array[] = 'Price Check'; } $t->set_tbody($body_array); unset($body_array); } while ($row = $db->fetch_array()); } $db->close(); $db = new db_mysql(); $db->select_db('mobot'); $db->set_sql("SELECT * FROM mobos AS mm $where"); $db->query(); $numrec = $db->num_rows(); $db->close(); $template = new template(); $template->title = "MOBOT: Motherboards $mname"; $template->section = 'mobot'; $template->description = 'Largest Motherboard database on the web.'; $template->open_page(); ?>
Motherboards :: MOBOT :: Motherboard Database
build_pagenav(); $p->show_pagenav(); $t->show_table(); $p->show_pagenav(); ?>
close_page(); ?>