public function get_child($id_parent, $data) { global $dbh; global $pmb_nomenclature_record_children_link; $query = "select * from notices_relations where linked_notice='" . $id_parent . "' and relation_type='" . $pmb_nomenclature_record_children_link . "'"; $result = pmb_mysql_query($query, $dbh); if (pmb_mysql_num_rows($result)) { while ($row = pmb_mysql_fetch_object($result)) { $child_id = $row->num_notice; $child = new nomenclature_record_child($child_id); $child_data = $child->get_data(); if ($child_data["num_formation"] != $data["num_formation"]) { continue; } if ($child_data["num_musicstand"] != $data["num_musicstand"]) { continue; } if ($child_data["num_instrument"] != $data["num_instrument"]) { continue; } if ($child_data["num_voice"] != $data["num_voice"]) { continue; } if ($child_data["other"] != $data["other"]) { continue; } if ($child_data["effective"] != $data["effective"]) { continue; } if ($child_data["order"] != $data["order"]) { continue; } return $child_id; } } return 0; }
public static function get_index($id) { $record_child = new nomenclature_record_child($id); return $record_child->get_index(); }