<?php
/*
--------------------------------------------------------------------------------
Project: Genealogy
From: 11-sept-2010
To:
Version: 0.6 du 06/03/2011
Author: Pierre FAUQUE, pierre@fauque.net
Filename: showlist.php (v0.2 27-oct-2010)
--------------------------------------------------------------------------------
*/
require("init.php");
//---------------------------------------------------
$name = ""; // Current name (for groups of last name)
$nbp = 0; // Number of people
$nbf = 0; // Number of females
$nbm = 0; // Number of males
$nbu = 0; // Number of unknown
//---------------------------------------------------
?><html>
<head>
<title><?php echo TIT_ANL; ?></title>
<link rel="stylesheet" href="genscr.css" type="text/css" media="screen">
<link rel="stylesheet" href="genprt.css" type="text/css" media="print">
<script language="javascript" type="text/javascript">
function getgedcom() {
var gedf = "<?php echo GEDFILE; ?>";
msg = "<?php echo TXT_DG; ?>";
if(confirm(msg)) { window.location = "ged.php"; }
else { viewgedcom(); }
}
function viewgedcom() {
// This function exists only in the demo version as well as the 'showged.php' file
var gedf = "family.ged";
msg = "You don't want to download \""+gedf+"\" file.\n"
+ "However in this demo you can see this file\n\n"
+ "Click on [OK] to view this file\n"
+ "Click on [Cancel] to abort";
if(confirm(msg)) { window.location = "showged.php"; }
}
function showHelp() {
W=500; H=screen.height;
url="help.php?ww="+W; // width provided as parameter to calculate the position
options = "width="+W+",height="+H+",toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=yes";
newwin = open(url,"help",options);
}
</script>
</head>
<body>
<h1><?php echo TIT_ANL; ?></h1>
<?php
$request = "SELECT * FROM ".TB_PEOPLE." ORDER BY lname,fname;";
$result = ExecRequest($request,$connexion);
while($r = mysql_fetch_object($result)) {
if($r->lname != $name) {
$name = $r->lname;
echo "<div class=\"nom\">$name</div>\n";
}
switch($r->sex) {
case 'M': $icon = "<img src='".ICODIR."/m.jpg'>"; $nbm++; break;
case 'F': $icon = "<img src='".ICODIR."/f.jpg'>"; $nbf++; break;
case 'U': $icon = "<img src='".ICODIR."/u.jpg'>"; $nbu++; break;
}
if($r->bsour || $r->dsour) { $doc = "<img src='".ICODIR."/doc.jpg'>"; } else { $doc = "<img src='".ICODIR."/nopic.jpg'>"; }
if($r->pic) { $photo = "<img src='".ICODIR."/pic.jpg'>"; } else { $photo = "<img src='".ICODIR."/nopic.jpg'>"; }
if($r->bdate) { $bdate = " ($r->bdate)"; } else { $bdate = ""; }
echo "<div class=\"prenom\">$doc$photo $icon <a href=\"showpers.php?id=$r->idpers\">$r->fname".$bdate."</a></div>\n";
$nbp++; $doc='';
}
if($nbu) {$inc = " ; <?php echo TXT_UNK; ?>: $nbu"; } else { $inc = ""; }
echo "<p>$nbp ".TXT_PRS." (<img src='".ICODIR."/f.jpg'>: $nbf ; <img src='".ICODIR."/m.jpg'>: $nbm"."$inc)</p>\n";
echo "<p class='dates'>".lastMAJ($connexion)."<br/>".TXT_DPR." : ".date("d/m/Y H:i $hour")."</p>";
if($phone) { buttons(512); } else { buttons(797); }
?>
</body>
</html>
|