function GetItemParentID(&$rows, $id) { if (!$id) { return 0; } $row =& JLMSDocs::GetItembyID($rows, $id); if (!is_null($row)) { return $row->parent_id; } return 0; }