for details. */ ?> BOM Viewer (<?= $model_name ?>)
Show vendors Orphans
Builders Developers FAQ About
query("use ".$db->db_name); $model = $_GET["model"] ? $_GET["model"] : 1; $model_name = $db->get_model_name_by_id($model); if (!strcmp($_GET['list'], 'part')) { require_once("view.php"); require_once("part.php"); $str = dump_parts_for_model ( $model ); } elseif (!strcmp($_GET['list'], 'module')) { require_once("view.php"); require_once ("module.php"); $str = dump_module ( $model ); } elseif ($_GET['part']) { require_once("view.php"); require_once("part.php"); $str = dump_part ( $_GET['part'] ); } elseif ($_GET['module']) { require_once("view.php"); require_once ("module.php"); $str = dump_module ( $_GET['module'] ); } elseif ($_GET['tag']) { require_once("view.php"); $str = dump_tag ( $_GET['tag'] ); } elseif ($_GET['show']) { switch ($_GET['show']) { case "vendor": require_once("view.php"); $str = dump_source($_GET['id']); break; case "orphans": $str = html_parts_sans_source(); break; case "search": $str = search(); break; default: $str = '

Page Not Found

Couldn\'t find any pages marked "'.$_GET['show'].'". Perhaps you have selected a link that doesn\'t go anywhere yet.

'; } } else { $str['file'] = 'home.html'; } if (strcmp($str,'Array')) { $str = array('body' => $str); } if (!$str['title']) { $str['title'] ='RepRap Bill of Materials Viewer'; } } function search() { global $db; global $model; $str .= "

Preferences

". '

If you tell us what region you\'re in, we can generate order forms for the various online stores that best serve your part of the world. This will help cut down on shipping costs.

'. '
'; $str.= '

For which modules do you need parts?
\n"; $str .= '
'; $q = $db->query("SELECT sp.part_id, p.name, sp.source_id from part p, source_part sp WHERE sp.part_id=p.id ORDER BY p.name"); while ($row = $q->fetchRow()) { //$str .= join(' ', array($row['part_id'], $row['source_id'], $row['name'])).'
'; } $str .= "

Orphaned Parts

"; $orphans = html_parts_sans_source(); $str .= $orphans['body']; return array('title'=>'Search', 'body'=>$str); } function html_parts_sans_source() { require_once ("view.php"); global $db; $str .= ''. ''. ''; // return all the parts that have no source $q = $db->query("SELECT p.id, p.name, m.name, m.id, mp.quantity, p.description, p.notes FROM part p, module_part mp, module m ". "WHERE m.id=mp.module_id AND mp.part_id = p.id AND p.id NOT IN (SELECT part_id FROM source_part) ORDER BY p.name;"); $str .= html_part_rows(array('query'=>$q, 'orphans'=>1)).'
Parts With No Sources
'.join("", array('Name', 'Modules', 'Description and Notes', 'Tags')).'
'; return array('title'=>'Orphaned Parts', 'body'=>$str); }