Infused Solutions » phpGene » Family Script

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<?php
    
include("db.inc.php");
    include(
"html.inc.php");
    include(
"gen.inc.php");
    
    
//Declare Global Variables
    
$sources = array();
    
$familyicon = "<img height=\"20\" width=\"20\" border=\"0\" src=\"family.gif\" alt=\"Go to Family Page\">";
    
$pedigreeicon = "<img height=\"20\" width=\"20\" border=\"0\" src=\"pedigree.gif\" alt=\"Go to Pedigree\">";
    
$privateicon = "<img height=\"15\" width=\"15\" border=\"0\" src=\"privatized.gif\" alt=\"Private\">";
    
$imageicon = "<img height=\"20\" width=\"20\" border=\"0\" src=\"camera.gif\" alt=\"View Photos/Images\">";
    
    
//Declare Functions
    
function display_topnav($name) {
        
open_table(array("width"=>"100%","border"=>"0","cellpadding"=>"8","cellspacing"=>"0"));
            
open_row();
                
open_column(array("class" => "b9", "align" => "left", "valign" => "top"));
                    print
"<a href=\"surnames.php\">Surnames</a> : ";
                    print
"<a href=\"surnames.php?sn=".$name["sname"]."\">".$name["sname"]."</a> : ";
                    print
$name["gname"]." ".$name["sname"];
                
close_column();
            
close_row();
            
open_row();
                
open_column(array("class" => "n8"));
                    print
"<hr size=\"1\">";
                
close_column();
            
close_row();
            
open_row();
            
open_column(array("class"=>"n8"));
    }
    
    function
display_indiv($name,$facts,$events,$parents,$fathername,$mothername,$notes,$images) {
        global
$shownotes, $sources, $familyicon, $pedigreeicon, $privateicon, $imageicon, $noteicon;
        
open_table(array("width"=>"100%","border"=>"0","cellpadding"=>"1","cellspacing"=>"0"));
            
open_row();
                
open_column(array("class"=>"b8","nowrap"=>"1","colspan"=>"2"));
                    print
"<a href=\"".$_SERVER["PHP_SELF"]."?indiv=".$name["indkey"]."\">";
                    print
$name["gname"]." ".$name["sname"];
                    print
"</a> (".$name["sex"].")\n";
                
close_column();
                
open_column(array("class"=>"n8","nowrap"=>"1"));
                    print
"<a href=\"family.php?indiv=".$name["indkey"]."\">".$familyicon."</a>";
                    print
"<img height=\"20\" width=\"2\" border=\"0\" src=\"../images/spacer.gif\">";
                    print
"<a href=\"pedigree.php?indiv=".$name["indkey"]."\">".$pedigreeicon."</a>";
                    if (
$images) {
                        print
"<img height=\"20\" width=\"5\" border=\"0\" src=\"../images/spacer.gif\">";
                        print
"<a href=\"display_images.php?indiv=".$name["indkey"]."\">".$imageicon."</a>";
                    }
                
close_column();
            
close_row();
            
open_row();
                
open_column(array("class"=>"n8","width"=>"100","nowrap"=>"1")); print "Birth:"; close_column();
                
open_column(array("class"=>"n8","width"=>"150","nowrap"=>"1",));
                    if (
$facts["birth"] == "Private") { print $privateicon; }
                    else { print
$facts["birth"]."&nbsp;"; close_column(); }
                
open_column(array("class"=>"n8","width"=>"400","nowrap"=>"1")); print $facts["birthplace"]."&nbsp;";
                    if (
$facts["birthfactkey"]) {
                        
$birthsources = get_sources($facts["birthfactkey"]);
                        for (
$i = 0; $i < count($birthsources); $i++) {
                            
$birthsource = $birthsources[$i];
                            
array_push($sources,$birthsource);
                            print
"<a href=\"#".count($sources)."\">".count($sources)."</a> ";
                        }
                    }
                
close_column();
            
close_row();
            
open_row();
                
open_column(array("class"=>"n8","nowrap"=>"1")); print "Death:"; close_column();
                
open_column(array("class"=>"n8","nowrap"=>"1")); print $facts["death"]."&nbsp;"; close_column();
                
open_column(array("class"=>"n8","nowrap"=>"1")); print $facts["deathplace"]."&nbsp;";
                    if (
$facts["deathfactkey"]) {
                        
$deathsources = get_sources($facts["deathfactkey"]);
                        for (
$i = 0; $i < count($deathsources); $i++) {
                            
$deathsource = $deathsources[$i];
                            
array_push($sources,$deathsource);
                            print
"<a href=\"#".count($sources)."\">".count($sources)."</a> ";
                        }
                    }
                
close_column();
            
close_row();

            
open_row();
                
open_column(array("class"=>"n8","nowrap"=>"1")); print "Father:"; close_column();
                if (
$parents["father"]) {
                    
open_column(array("class"=>"n8","colspan"=>"2","nowrap"=>"1"));
                        print
"<a href=\"".$_SERVER["PHP_SELF"]."?indiv=".$parents["father"]."\">".$fathername["gname"]." ".$fathername["sname"]."</a>";
                    
close_column();
                }
            
close_row();
            
open_row();
                
open_column(array("class"=>"n8","nowrap"=>"1")); print "Mother:"; close_column();
                if (
$parents["mother"]) {
                    
open_column(array("class"=>"n8","colspan"=>"2","nowrap"=>"1"));
                        print
"<a href=\"".$_SERVER["PHP_SELF"]."?indiv=".$parents["mother"]."\">".$mothername["gname"]." ".$mothername["sname"]."</a>";
                    
close_column();
                }
            
close_row();
            if (
$events) {
                for (
$i = 0; $i < count($events); $i++) {
                    
open_row();
                        
open_column(array("class"=>"n8","nowrap"=>"1")); print $events[$i]["type"].":"; close_column();
                        
open_column(array("class"=>"n8","nowrap"=>"1")); print $events[$i]["date"]."&nbsp;"; close_column();
                        
open_column(array("class"=>"n8","nowrap"=>"1")); print $events[$i]["place"]."&nbsp;";
                                
$eventsources = get_sources($events[$i]["factkey"]);
                                for (
$j = 0; $j < count($eventsources); $j++) {
                                    
$eventsource = $eventsources[$j];
                                    
array_push($sources,$eventsource);
                                    print
"<a href=\"#".count($sources)."\">".count($sources)."</a> ";
                                }
                        
close_column();
                    
close_row();
                }
            }
            if (
$notes) {
                
open_row();
                    
open_column(array("class"=>"n8","valign"=>"top","nowrap"=>"1")); print "Notes:"; close_column();
                    
open_column(array("class"=>"n8","colspan"=>"2")); print "<i>".$notes."&nbsp;</i>"; close_column();
                
close_row();
            }
            
open_row();
                
open_column(array("class"=>"n8","colspan"=>"3")); print "&nbsp;"; close_column();
            
close_row();
        
close_table();
    }
    
    function
display_marriage($mnum,$mfacts,$mendstatus,$mnotes) {
        global
$sources, $privateicon;
        
open_table(array("width"=>"100%","border"=>"0","cellpadding"=>"1","cellspacing"=>"0"));
            
open_row();
                
open_column(array("class"=>"n8","width"=>"100","nowrap"=>"1")); print "Marriage ".$mnum.":"; close_column();
                
open_column(array("class"=>"n8","width"=>"150","nowrap"=>"1"));
                    if (
$mfacts["marriage"] == "Private") { print $privateicon; }
                    else { print
$mfacts["marriage"]."&nbsp;"; }
                
close_column();
                
open_column(array("class"=>"n8","width"=>"400","nowrap"=>"1")); print $mfacts["marriageplace"]."&nbsp;";
                    if (
$mfacts["marriagefactkey"]) {
                        
$marriagesources = get_sources($mfacts["marriagefactkey"]);
                        for (
$i = 0; $i < count($marriagesources); $i++) {
                            
$marriagesource = $marriagesources[$i];
                            
array_push($sources,$marriagesource);
                            print
"<a href=\"#".count($sources)."\">".count($sources)."</a> ";
                        }
                    }
                
close_column();
            
close_row();
            if (
$mendstatus) {
                
open_row();
                    
open_column(array("class"=>"n8","width"=>"100","nowrap"=>"1")); print "End Status: "; close_column();
                    
open_column(array("class"=>"n8","colspan"=>"2","nowrap"=>"1")); print $mendstatus; close_column();
                
close_row();
            }
            if (
$mnotes) {
                
open_row();
                    
open_column(array("class"=>"n8","valign"=>"top","nowrap"=>"1")); print "Notes:"; close_column();
                    
open_column(array("class"=>"n8","colspan"=>"2")); print "<i>".$mnotes."&nbsp;</i>"; close_column();
                
close_row();
            }
            
open_row();
                
open_column(array("class"=>"n8","colspan"=>"3")); print "&nbsp;"; close_column();
            
close_row();
        
close_table();
    }

    function
display_children($children,$mnum) {
        global
$privateicon;
        
open_table(array("border"=>"0","cellpadding"=>"1","cellspacing"=>"0"));
            
open_row();
                
open_column(array("class"=>"n8","colspan"=>"3")); print "Children from Marriage ".$mnum.":"; close_column();
            
close_row();
            
open_row();
                
open_column(array("class"=>"n8","colspan"=>"3")); print "&nbsp;"; close_column();
            
close_row();
            for (
$j = 0; $j < count($children); $j++) {
                
$child = $children[$j];
                
$cnum = $j + 1;
                    
$cname = get_name($child); //array contains (gname, sname, aka, sex, famkey)
                    
$cfacts = get_vitals($child); //array contains (birth, birthplace, death, deathplace, baptism, baptismplace, burial, burialplace)
                    
open_row();
                        
open_column(array("class"=>"n8","width"=>"15")); print $cnum; close_column();
                        
open_column(array("class"=>"n8","width"=>"250","nowrap"=>"1"));
                            print
"<a href=\"".$_SERVER["PHP_SELF"]."?indiv=".$cname["indkey"]."\">";
                            print
$cname["gname"]." ".$cname["sname"];
                            print
"</a>";
                            print
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
                        
close_column();
                        
open_column(array("class"=>"n8","width"=>"150","nowrap"=>"1"));
                            if (
$cfacts["birth"] == "Private") { print $privateicon; }
                            else { print
$cfacts["birth"]."&nbsp;"; }
                        
close_column;
                        
open_column(array("class"=>"n8","width"=>"150","nowrap"=>"1")); print $cfacts["death"]."&nbsp;"; close_column;
                    
close_row();
                }
            
open_row();
                
open_column(array("class"=>"n8","colspan"=>"3")); print "&nbsp;"; close_column();
            
close_row();
        
close_table();
    }
    
    function
display_sources() {
        global
$sources;
        
open_table(array("border"=>"0","cellpadding"=>"1","cellspacing"=>"0"));
                
open_row();
                    
open_column(array("class"=>"n8","colspan"=>"2")); print "&nbsp;"; close_column();
                
close_row();
                
open_row();
                    
open_column(array("class"=>"n8","colspan"=>"2")); print "Sources:"; close_column();
                
close_row();
                
open_row();
                    
open_column(array("class"=>"n8","colspan"=>"2")); print "&nbsp;"; close_column();
                
close_row();
                for (
$i = 0; $i < count($sources); $i++) {
                    
$num = $i +1;
                    
open_row();
                        
open_column(array("class"=>"n8","width"=>"15","valign"=>"top")); print "<a name=\"".$num."\"></a>".$num; close_column();
                        
open_column(array("class"=>"n8")); print $sources[$i]; close_column();
                    
close_row();
                }
        
close_table();
    }
    
    if (
$indiv) {
        
//Get basic data about the individual
        
$name = get_name($indiv); //array contains (gname, sname, aka, sex, famkey, notekey)
        
$parents = get_parents($indiv); //array contains (famkey, father, mother)
        
if ($parents["father"]) { $fathername = get_name($parents["father"]); } //array contains (gname, sname, aka, sex, famkey)
        
if ($parents["mother"]) { $mothername = get_name($parents["mother"]); } //array contains (gname, sname, aka, sex, famkey)
        
if ($name["sex"] == "M") { $spouses = get_wives($indiv); } //array contains (famkey, indkey)
        
if ($name["sex"] == "F") { $spouses = get_husbands($indiv); } //array contains (famkey, indkey)
        
$facts = get_vitals($indiv);
        
$events = get_events($indiv);
        
$notes = get_notes($name["notekey"]);
        
$images = get_images($indiv);
    }
?>
<head>
<title>Infused.org Genealogy - Family Page for <?php print $name["gname"]." ".$name["sname"]; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="EN-US">
<meta name="description" content="">
<meta name="author" content="Keith Morrison, keithm@infused.org">
<meta name="copyright" content="(c)2000-2003 Keith Morrison, Infused Solutions">
<meta name="robots" content="FOLLOW,INDEX">
<meta name="keywords" content="">
<link rel="stylesheet" href="styles2.css">
</head>
<body text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFCC33" vlink="#FFCC33" alink="#FF9900" background="/images/dark_grey_lines.gif">
<?php virtual("small_header.htm"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td align="left" valign="top" width="165">
      <?php virtual("genealogy_menu.htm"); ?>
    </td>
<td align="left" valign="top">
<?php
    
    
    
if ($name) {
        
//Display to top navigation bar
        
display_topnav($name);

        
//Display the individual record
        
display_indiv($name,$facts,$events,$parents,$fathername,$mothername,$notes,$images);

        
//Display any spouses and children
        
if ($spouses) {    
            for (
$i = 0; $i < count($spouses); $i++) {
                unset(
$sfathername);
                unset(
$smothername);
                
$family = $spouses[$i]["famkey"];
                
$spouse = $spouses[$i]["indkey"];
                
$mendstatus = $spouses[$i]["endstatus"];
                
$notekey = $spouses[$i]["notekey"];
                
$mnum = $i + 1;
                
$mfacts = get_marriage($family);
                
$mnotes = get_notes($notekey);
                
                
display_marriage($mnum,$mfacts,$mendstatus,$mnotes);
                
                
$sname = get_name($spouse); //array contains (gname, sname, aka, sex, famkey)
                
$sparents = get_parents($spouse); //array contains (famkey, father, mother)
                
if ($sparents["father"]) { $sfathername = get_name($sparents["father"]); } //array contains (gname, sname, aka, sex, famkey)
                
if ($sparents["mother"]) { $smothername = get_name($sparents["mother"]); } //array contains (gname, sname, aka, sex, famkey)
                
$sfacts = get_vitals($spouse);
                
$sevents = get_events($spouse);
                
$snotes = get_notes($sname["notekey"]);
                
$simages = get_images($spouse);
                
                
open_table(array("border"=>"0","cellpadding"=>"0","cellspacing"=>"0","width"=>"100%"));
                    
open_row();
                        
open_column(array("width"=>"10")); print "&nbsp;"; close_column();
                        
open_column(array("class"=>"n8"));
                            
display_indiv($sname,$sfacts,$sevents,$sparents,$sfathername,$smothername,$snotes,$simages);
                        
close_column();
                    
close_row();
                
close_table();
                
                
$children = get_children($family);
                if (
$children) {
                    
open_table(array("border"=>"0","cellpadding"=>"0","cellspacing"=>"0","width"=>"100%"));
                        
open_row();
                            
open_column(array("width"=>"20")); print "&nbsp;"; close_column();
                            
open_column(array("class"=>"n8")); display_children($children,$mnum); close_column();
                        
close_row();
                    
close_table();
                }
            }
        }
    }
    
    if (
$sources) { display_sources(); }
    
close_table();
?>
</td>
</tr>
<tr align="center" valign="top">
<td class="smallprint" colspan="2">
</td>
</tr>
</table>
<?php include("small_footer.htm"); ?>
</body>
</html>

© 1999-2003 Keith Morrison, Infused Solutions
infused.org software - phpGene