<?php

/***************************************************************************
 *   get_coprincipal.php                                                   *
 *   Yggdrasil: return person id input field + name for dynamic update     *
 *                                                                         *
 *   Copyright (C) 2006-2011 by Leif B. Kristensen <*****@*****.**>   *
 *   All rights reserved. For terms of use, see LICENSE.txt                *
 ***************************************************************************/
require "../settings/settings.php";
require "../functions.php";
$person = $_GET['person'];
$event = $_GET['event'];
$event_type = $_GET['event_type'];
if (has_coprincipal($event_type)) {
    $coprincipal = get_second_principal($event, $person);
    echo "Med <input type=\"text\" size=\"10\" value=\"{$coprincipal}\" ";
    // dynamic AJAX update of source text
    echo "name=\"coprincipal\" onchange=\" get_name(this.value)\">";
    echo "<span id=\"name\">";
    echo ' ' . linked_name($coprincipal, '../family.php');
    echo "</span>\n";
}
?>

Ejemplo n.º 2
0
     // preliminary hack to display non-participant of probate event
     // note that tag type id is hard coded, which is prbly not a good idea.
     if ($row['event_type_number'] == 31 && !is_principal($person, $event)) {
         $event_string .= $_Mentioned_in_probate_after . ' ' . get_principals($event);
         if (!($row['event_note'] = get_participant_note($person, $event))) {
             $fade = 1;
         }
         $principal = 0;
     } else {
         $event_string .= get_tag_name($tag);
     }
     // fuzzydate() returns empty string if date is undetermined
     $event_string .= conc(fuzzydate($row['event_date']));
     $event_string .= conc($row['event_place']);
     // is there a second principal of this event?
     if (fetch_val("SELECT get_event_type({$event})") == 2 && ($coprincipal = get_second_principal($event, $person))) {
         $event_string .= conc(fetch_val("select prepose({$tag}, '{$language}')")) . conc(linked_name($coprincipal)) . conc(child_of($coprincipal));
     }
     if ($row['event_note']) {
         $event_string .= ': ' . $row['event_note'];
     }
 }
 if ($fade) {
     $event_string = span_type($event_string, "faded");
 }
 // display links to edit / delete actions
 if ($principal) {
     // probably okay to delete one-person events
     if (fetch_val("SELECT get_event_type({$event})") == 1) {
         $delstr = to_url('./forms/event_delete.php', array('person' => $person, 'event' => $event), $_delete);
     } else {