-function check_for_recursive_bom($ultimate_parent, $component_to_check)
-{
-
- /* returns true ie 1 if the bom contains the parent part as a component
- ie the bom is recursive otherwise false ie 0 */
-
- $sql = "SELECT component FROM ".TB_PREF."bom WHERE parent=".db_escape($component_to_check);
- $result = db_query($sql,"could not check recursive bom");
-
- if ($result != 0)
- {
- while ($myrow = db_fetch_row($result))
- {
- if ($myrow[0] == $ultimate_parent)
- {
- return 1;
- }
-
- if (check_for_recursive_bom($ultimate_parent, $myrow[0]))
- {
- return 1;
- }
- } //(while loop)
- } //end if $result is true
-
- return 0;
-
-} //end of function check_for_recursive_bom
-
-//--------------------------------------------------------------------------------------------------
-