/
couples.php
45 lines (38 loc) · 1.61 KB
/
couples.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/***************************************************************************
* couples.php *
* Yggdrasil: Search for couples *
* *
* Copyright (C) 2009-2011 by Leif B. Kristensen <leif@solumslekt.org> *
* All rights reserved. For terms of use, see LICENSE.txt *
***************************************************************************/
require "./settings/settings.php";
require_once "./langs/$language.php";
$title = "$_Search_for_couples";
$form = 'couple';
$focus= 'husb';
require "./header.php";
require "./functions.php";
echo "<div class=\"normal\">";
echo "<h2>$title</h2>\n";
echo "<form id=\"couple\" action=\"" . $_SERVER['PHP_SELF'] . "\">\n<div>\n";
echo "$_Husband: <input type=\"text\" size=\"12\" name=\"husb\" />\n";
echo "$_Wife: <input type=\"text\" size=\"12\" name=\"wife\" />\n";
echo "<input type=\"submit\" value=\"$_Search\" />\n";
echo "</div>\n</form>\n\n";
$husb = isset($_GET['husb']) ? $_GET['husb'] : '';
$wife = isset($_GET['wife']) ? $_GET['wife'] : '';
if ($husb && $wife) {
$handle = pg_query("select * from couples where p1n ilike '$husb%' and p2n ilike '$wife%'");
echo "<p>";
while ($row = pg_fetch_assoc($handle)) {
echo $row['sort_date']
. ' ' . get_name_and_dates("./family.php", $row['p1'])
. ' ' . get_name_and_dates("./family.php", $row['p2'])
. "<br />\n";
}
echo "</p>\n";
}
echo "</div>\n";
include "./footer.php";
?>