Example #1
0
?>
	<table class="center <?php 
print $TEXT_DIRECTION;
?>
 width90">
		<tr>
			<td colspan="2" class="topbottombar">
			<?php 
global $gBitUser;
print "<h2>Bitweaver PhpGedView Port" . $VERSION . "<br />";
print tra("Administration");
print "</h2>";
print tra("Current System Time");
print " " . get_changed_date(date("j M Y")) . " - " . date($TIME_FORMAT);
print "<br />" . tra("User Time");
print " " . get_changed_date(date("j M Y", time() - $_SESSION["timediff"])) . " - " . date($TIME_FORMAT, time() - $_SESSION["timediff"]);
if ($gBitUser->IsAdmin()) {
    if ($err_write) {
        print "<br /><span class=\"error\">";
        print $pgv_lang["config_still_writable"];
        print "</span><br /><br />";
    }
    if ($verify_msg) {
        print "<br />";
        print "<a href=\"useradmin.php?action=listusers&amp;filter=admunver\" class=\"error\">" . $pgv_lang["admin_verification_waiting"] . "</a>";
        print "<br /><br />";
    }
    if ($warn_msg) {
        print "<br />";
        print "<a href=\"useradmin.php?action=listusers&amp;filter=warnings\" class=\"error\" >" . $pgv_lang["admin_user_warnings"] . "</a>";
        print "<br /><br />";
Example #2
0
/**
 * print fact DATE TIME
 *
 * @param string $factrec	gedcom fact record
 * @param boolean $anchor	option to print a link to calendar
 * @param boolean $time		option to print TIME value
 * @param string $fact		optional fact name (to print age)
 * @param string $pid		optional person ID (to print age)
 * @param string $indirec	optional individual record (to print age)
 */
function print_fact_date($factrec, $anchor = false, $time = false, $fact = false, $pid = false, $indirec = false)
{
    global $factarray, $pgv_lang, $SEARCH_SPIDER;
    $ct = preg_match("/2 DATE (.+)/", $factrec, $match);
    if ($ct > 0) {
        print " ";
        // link to calendar
        if ($anchor && empty($SEARCH_SPIDER)) {
            print get_date_url($match[1]);
        } else {
            print get_changed_date(trim($match[1]));
        }
        // time
        if ($time) {
            $timerec = get_sub_record(2, "2 TIME", $factrec);
            if (empty($timerec)) {
                $timerec = get_sub_record(2, "2 DATE", $factrec);
            }
            $tt = preg_match("/[2-3] TIME (.*)/", $timerec, $tmatch);
            if ($tt > 0) {
                print " - <span class=\"date\">" . $tmatch[1] . "</span>";
            }
        }
        if ($fact and $pid) {
            // age of parents at child birth
            if ($fact == "BIRT") {
                print_parents_age($pid, $match[1]);
            } else {
                if ($fact != "CHAN") {
                    if (!$indirec) {
                        $indirec = find_person_record($pid);
                    }
                    // do not print age after death
                    $deatrec = get_sub_record(1, "1 DEAT", $indirec);
                    if (empty($deatrec) || compare_facts($factrec, $deatrec) != 1 || strstr($factrec, "1 DEAT")) {
                        print get_age($indirec, $match[1]);
                    }
                }
            }
        }
        print " ";
    } else {
        // 1 DEAT Y with no DATE => print YES
        // 1 DEAT N is not allowed
        // It is not proper GEDCOM form to use a N(o) value with an event tag to infer that it did not happen.
        $factrec = str_replace("\r\nPGV_OLD\r\n", "", $factrec);
        $factrec = str_replace("\r\nPGV_NEW\r\n", "", $factrec);
        $factdetail = preg_split("/ /", trim($factrec));
        if (isset($factdetail)) {
            if (count($factdetail) == 3) {
                if (strtoupper($factdetail[2]) == "Y") {
                    print $pgv_lang["yes"];
                }
            }
        }
    }
    // gedcom indi age
    $ages = array();
    $agerec = get_gedcom_value("AGE", 2, $factrec);
    $daterec = get_sub_record(2, "2 DATE", $factrec);
    if (empty($agerec)) {
        $agerec = get_gedcom_value("AGE", 3, $daterec);
    }
    $ages[0] = $agerec;
    // gedcom husband age
    $husbrec = get_sub_record(2, "2 HUSB", $factrec);
    if (!empty($husbrec)) {
        $agerec = get_gedcom_value("AGE", 3, $husbrec);
    } else {
        $agerec = "";
    }
    $ages[1] = $agerec;
    // gedcom wife age
    $wiferec = get_sub_record(2, "2 WIFE", $factrec);
    if (!empty($wiferec)) {
        $agerec = get_gedcom_value("AGE", 3, $wiferec);
    } else {
        $agerec = "";
    }
    $ages[2] = $agerec;
    // print gedcom ages
    foreach ($ages as $indexval => $agerec) {
        if (!empty($agerec)) {
            print "<span class=\"label\">";
            if ($indexval == 1) {
                print $pgv_lang["husband"];
            } else {
                if ($indexval == 2) {
                    print $pgv_lang["wife"];
                } else {
                    print $factarray["AGE"];
                }
            }
            print "</span>: ";
            $age = get_age_at_event($agerec);
            print PrintReady($age);
            print " ";
        }
    }
}