<?php
$kop="index";
include ("header.php");
include ("menu.php");
include('include/person_cls.php');
global $Taalkeuze;
$persoon_cls = New persoon_cls;
$person_qry= "SELECT *, STR_TO_DATE(pers_changed_date,'%d %b %Y') AS datum FROM ".$_SESSION['tree_prefix']."person
ORDER BY datum DESC, pers_changed_time DESC
LIMIT 0,100";
$numberofpersons_qry= "SELECT *, pers_id AS number FROM ".$_SESSION['tree_prefix']."person
ORDER BY number DESC";
$person_result = mysql_query($person_qry,$db);
$numberofpersons_result = mysql_query($numberofpersons_qry,$db);
$number_of_rows = mysql_num_rows($numberofpersons_result);
//echo '<div style="margin: 36px 0 24px 0; text-align: center"><h2>'.$language["overview_latest_changes"].'</h2></div>';
echo '<h2 class="centreren">'.$language["changes_overview"].'</h2>';
echo '<div style="height: 400px; width: 90%; margin-left: 5%; overflow-y: scroll;">';
echo '<table class="humo">';
echo '<tr>';
//echo '<th style="font-size: 90%">No.</th>';
//echo '<th style="font-size: 90%; text-align: center">M/F</th>';
echo '<th style="font-size: 90%; text-align: left">'.$language["changes_changed_new"].'</th>';
echo '<th style="font-size: 90%; text-align: left">'.$language["changes_when_changed"].'</th>';
echo '<th style="font-size: 90%; text-align: left">'.$language["changes_when_new"].'</th>';
//echo '<th style="font-size: 90%; text-align: left">'.$language["birth_date"].'</th>';
//echo '<th style="font-size: 90%; text-align: left">'.$language["birth_place"].'</th>';
echo '</tr>';
$rowcounter=0;
while ($person=mysql_fetch_object($person_result)){
$rowcounter++;
echo '<tr>';
//echo '<td style="text-align: center; font-size: 90%">'.$rowcounter.'</td>';
echo '<td style="font-size: 90%">';
$persoon_cls->construct($person);
echo $persoon_cls->person_popup_menu($person);
if ($person->pers_sexe=="M"){
echo '<img src="'.$cms['cms_path'].'images/man.gif" alt="man">';
}
elseif ($person->pers_sexe=="F"){
echo '<img src="'.$cms['cms_path'].'images/woman.gif" alt="woman">';
}
else{
echo '<img src="'.$cms['cms_path'].'images/unknown.gif" alt="unknown">';
}
echo '<a href="gezin.php?database='.$_SESSION['tree_prefix'].'&id='.$person->pers_indexnr.'&hoofdpersoon='.$person->pers_gedcomnumber.'">';
echo $persoon_cls->naam($person);
echo '</a>';
echo '</td><td style="font-size: 90%">';
echo '<span style="white-space: nowrap">'.strtolower($person->pers_changed_date).' - '.$person->pers_changed_time.'</span>';
echo '</td><td style="font-size: 90%">';
echo '<span style="white-space: nowrap">'.strtolower($person->pers_new_date).' - '.$person->pers_new_time.'</span></td>';
//echo '<td style="font-size: 90%">';
//echo '<span style="white-space: nowrap">'.strtolower($person->pers_birth_date).'</span></td>';
//echo '<td style="font-size: 90%">';
// $place = strtolower($person->pers_birth_place);
// $pers_birth_place = ucfirst($place);
// echo '<span style="white-space: nowrap">'.ucfirst($place).'</span>';
//echo '</td>';
echo '</tr>';
}
echo '</table>';
echo '</div>';
//Total number of persons in the family-tree
//echo '<p style="margin: 24px 0 -4px 0; font-size: 90%">';
//echo $language["control_latest_changes"].': '.$number_of_rows;
//echo '</p>';
//Date and time first person added to the family-tree
//$maxi_qry= "SELECT *, STR_TO_DATE(pers_new_date,'%d %b %Y') AS maxi FROM ".$_SESSION['tree_prefix']."person
//ORDER BY maxi ASC
//LIMIT 0,1";
//$maxi_result = mysql_query($maxi_qry,$db) or die(mysql_error());
//while ($maxi=mysql_fetch_object($maxi_result)){
// echo '<p style="margin: -2px 0 0 0; font-size: 90%">'.$language["date_first_person"].': '.$maxi->pers_new_date;
// echo '</p>';
//}
include ("footer.php");
?>