コード例 #1
0
function AddParents($family, $person)
{
    $fatherID = "P" . (MaxPersonNumber($family) + 1);
    $motherID = "P" . (MaxPersonNumber($family) + 2);
    $newFamily = new XElement("\n        <Family>\n            <ParentID>{$fatherID}</ParentID>\n            <ParentID>{$motherID}</ParentID>\n            <ChildID>{$person->getAttribute('id')}</ChildID>\n        </Family>\n    ");
    $family->AppendChild(CreateParent("Male", $fatherID));
    $family->AppendChild(CreateParent("Female", $motherID));
    $family->AppendChild($newFamily);
}
コード例 #2
0
ファイル: tools.php プロジェクト: rbrother/family-database
function NextPersonID($family)
{
    return "P" . (MaxPersonNumber($family) + 1);
}