The Digital Ark

Return to Search ]\n"; } getPrevious('public_','person',$id); getNext('public_','person',$id); echo "

$name"; if ($titles != ""){ echo ", $titles"; } echo " ($birth - $death)

\n"; if ($portrait != "" && $portrait > 0){ $sqlquery2 = "SELECT image.image_id, filename_new FROM image LEFT JOIN file ON image.image_id = file.table_id WHERE file.from_table = 'image' and image.image_id = ? "; $query2 = $db->prepare($sqlquery2); $query2->execute(array($portrait)); $row = $query2->fetch(PDO::FETCH_ASSOC); echo "\n"; $image_id = $row['image_id']; $filename = $row['filename_new']; $thumb = explode(".",$filename)[0]; $thumb .= ".jpg"; $image_string = "
\n"; echo "$image_string
\n"; echo "
\n"; } $sqlquery2 = "SELECT person_id_primary, last, first FROM person_alias LEFT JOIN person ON person_id_primary = person_id WHERE person_id_alias =?"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_alias LEFT JOIN person ON person_id_primary = person_id WHERE person_id_alias =?"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); echo "

\n"; for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $alias_id = $row2['person_id_primary']; if ($row['first'] != ""){ $alias_name = $row2['first']." ".$row2['last']; }else{ $alias_name = $row2['last']; } echo "Alias for $alias_name
\n"; } echo "

\n"; } $sqlquery2 = "SELECT person_id_alias, last, first FROM person_alias LEFT JOIN person ON person_id_alias = person_id WHERE person_id_primary = ?"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_alias LEFT JOIN person ON person_id_alias = person_id WHERE person_id_primary = ?"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); echo "

\n"; for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $alias_id = $row2['person_id_alias']; if ($row2['first'] != ""){ $alias_name = $row2['first']." ".$row2['last']; }else{ $alias_name = $row2['last']; } echo "Alias $alias_name
\n"; } echo "

\n"; } if ($annotation != ""){ echo "$annotation\n"; } if ($dnb_url != ""){ echo "Dictionary of National Biography entry:\n"; echo "$dnb_url\n"; } if ($other_bio_url != ""){ echo "Other biography:\n"; echo "$other_bio_url\n"; } /*code for viewing attached URLs is called; set url_table according to the form you're on*/ get_url($id, 'person'); $sqlquery2 = "SELECT role.role_id, role_name FROM person_role LEFT JOIN role ON person_role.role_id = role.role_id WHERE person_id = ? ORDER BY role_name"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_role LEFT JOIN role ON person_role.role_id = role.role_id WHERE person_id = ?"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); echo "\n"; for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $role_id = $row2['role_id']; $role_name = $row2['role_name']; echo "$role_name
\n"; } echo "
\n"; } $sqlquery2 = "SELECT person_location_id, l1.location_id, l1.location_name, location_role_name, location_type_name, l2.location_name AS in FROM person_location LEFT JOIN location AS l1 ON person_location.location_id = l1.location_id LEFT JOIN location_role ON person_location.location_role_id = location_role.location_role_id LEFT JOIN location_type ON l1.location_type=location_type_id LEFT JOIN location_location ON l1.location_id = location_location.location_id_1 LEFT JOIN location AS l2 ON location_location.location_id_2 = l2.location_id WHERE person_id = ? ORDER BY location_role_name"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_location LEFT JOIN location ON person_location.location_id = location.location_id LEFT JOIN location_role ON person_location.location_role_id = location_role.location_role_id LEFT JOIN location_type ON location.location_type=location_type_id WHERE person_id = ?"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); echo "Relevant locations:\n"; for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $person_location_id = $row2['person_location_id']; $location_id = $row2['location_id']; $location_location_name = $row2['location_name']; $location_role = $row2['location_role_name']; $location_type = $row2['location_type_name']; echo "$location_role $location_location_name"; if ($row2['in'] != ""){ echo ", ".$row2['in']; } echo "
\n"; } } echo "
\n"; $sqlquery2 = "SELECT person_person.*, relationship.*, last, first, birth, death FROM person_person LEFT JOIN relationship ON person_person_relation = relationship_id LEFT JOIN person ON person_id_2 = person.person_id WHERE person_id_1 = ? ORDER BY last, first, death"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_person LEFT JOIN relationship ON person_person_relation = relationship_id LEFT JOIN person ON person_id_2 = person.person_id WHERE person_id_1 = ?"; $relation_header = "Relationships:\n"; $header = 0;//use to set if header has been displayed $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ echo $relation_header; $header = 1; $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $person_person_id = $row2['person_person_id']; $person_other = $row2['person_id_2']; $relationship = $row2['relationship_name']; if ($relationship == ""){ $relationship = "unspecified to"; } if ($row2['first'] != ""){ $person_other_name = $row2['first']." ".$row2['last']; }else{ $person_other_name = $row2['last']; } $person_other_dates = $row2['birth']."-".$row2['death']; echo "$first $last was a $relationship $person_other_name ($person_other_dates)
\n"; } echo "
\n"; } $sqlquery2 = "SELECT person_person.*, relationship.*, last, first, birth, death FROM person_person LEFT JOIN relationship ON person_person_relation = relationship_id LEFT JOIN person ON person_id_1 = person.person_id WHERE person_id_2 = ? ORDER BY last, first, death"; $countquery2 = "SELECT COUNT(*) AS total_rows FROM person_person LEFT JOIN relationship ON person_person_relation = relationship_id LEFT JOIN person ON person_id_1 = person.person_id WHERE person_id_2 = ?"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ if ($header == 0){ echo $relation_header; } $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $person_person_id = $row2['person_person_id']; $person_other = $row2['person_id_1']; $relationship = $row2['relationship_name']; if ($relationship == ""){ $relationship = "unspecified to"; } if ($row2['first'] != ""){ $person_other_name = $row2['first']." ".$row2['last']; }else{ $person_other_name = $row2['last']; } $person_other_dates = $row2['birth']."-".$row2['death']; echo "$person_other_name ($person_other_dates) was a $relationship $first $last
\n"; } } echo "
\n"; link_person_to($id, 'manuscript'); link_person_to($id, 'msitem'); link_person_to($id, 'print'); link_person_to($id, 'printitem'); link_object_to($id, 'person'); $sqlquery2 = "SELECT image_person_id, image_person.image_id, image.name, filename_new FROM image_person LEFT JOIN image ON image_person.image_id = image.image_id LEFT JOIN file ON image.image_id = file.table_id WHERE person_id = ? AND file.from_table='image'";//22 is role_id for subject of a work of art should we need to narrow down with AND image_person.role_id = 22 $countquery2 = "SELECT COUNT(*) AS total_rows FROM image_person LEFT JOIN image ON image_person.image_id = image.image_id LEFT JOIN file ON image.image_id = file.table_id WHERE person_id = ? AND file.from_table='image'"; $cquery2 = $db->prepare($countquery2); $cquery2->execute(array($id)); $crow2 = $cquery2->fetch(PDO::FETCH_ASSOC); $nRows2 = $crow2['total_rows']; if ($nRows2 > 0){ echo "Linked images:\n"; $query2 = $db->prepare($sqlquery2); $query2->execute(array($id)); for($i2=0; $row2 = $query2->fetch(PDO::FETCH_ASSOC); $i2++){ $image_id = $row2['image_id']; $filename = $row2['filename_new']; $thumb = explode(".",$filename)[0]; $thumb .= ".jpg";// all thumbs are jpg $image_name = $row2['name']; $image_string = "\n"; echo "$image_string
\n"; } echo "
\n"; } echo "References in Documents:\n"; echo "\n"; $catalogs_unique = array(); foreach ($catalogs_test as $group=>$cat){ foreach ($cat as $key=>$val){ $catalogs_unique[$key] = $val; } } $catalogs = array_unique($catalogs_unique); foreach ($catalogs AS $xf=>$nice){ $xml_path = "./XML/$xf".".xml"; if (file_exists($xml_path)){ $xml = simplexml_load_file($xml_path); $xml->registerXPathNamespace('tei', 'http://www.tei-c.org/ns/1.0'); foreach ($xml->xpath("//tei:*[@ref='$id' and @type='person']/../..") as $result){ $result = $result->asXML(); $result = str_replace($last, "$last", $result); echo "
$nice $result
\n"; } } } echo "
\n"; ?>