5 include($path_to_root . "/includes/db_pager.inc");
6 include($path_to_root . "/includes/session.inc");
8 page(_("Inventory Item Where Used Inquiry"));
10 include($path_to_root . "/includes/ui.inc");
12 check_db_has_stock_items(_("There are no items defined in the system."));
14 start_form(false, true);
16 if (!isset($_POST['stock_id']))
17 $_POST['stock_id'] = get_global_stock_item();
19 echo "<center>" . _("Select an item to display its parent item(s).") . " ";
20 stock_items_list('stock_id', $_POST['stock_id'], false, true);
23 set_global_stock_item($_POST['stock_id']);
24 //-----------------------------------------------------------------------------
25 function select_link($row)
27 return pager_link( $row["parent"]. " - " . $row["description"],
28 "/manufacturing/manage/bom_edit.php?stock_id=" . $row["parent"]);
33 workcentre.name As WorkCentreName,
34 location.location_name,
37 FROM ".TB_PREF."bom as bom, "
38 .TB_PREF."stock_master as parent, "
39 .TB_PREF."workcentres as workcentre, "
40 .TB_PREF."locations as location
41 WHERE bom.parent = parent.stock_id
42 AND bom.workcentre_added = workcentre.id
43 AND bom.loc_code = location.loc_code
44 AND bom.component='" . $_POST['stock_id'] . "'";
47 _("Parent Item") => array('fun'=>'select_link'),
50 _("Quantity Required")
53 $table =& new_db_pager('usage_table', $sql, $cols);
55 if (get_post('_stock_id_update'))
56 $table->set_sql($sql);
58 display_db_pager($table);