This repository was archived by the owner on Mar 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlistNotSetBirthdays.php
More file actions
84 lines (69 loc) · 2.5 KB
/
listNotSetBirthdays.php
File metadata and controls
84 lines (69 loc) · 2.5 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fi" lang="fi">
<?php session_start(); ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Taapeli-aineiston ylläpito</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<?php
include 'inc/checkUserid.php';
include "inc/start.php";
include 'libs/models/GedDateParser.php';
include "inc/dbconnect.php";
/*
* -- Content page starts here -->
*/
echo '<h1>Henkilöt, joilla ei ole syntymäaikaa</h1>';
$query_string = "MATCH (n:Person:" . $userid . ") "
. "WHERE NOT (n)-[:BIRTH]->() WITH n MATCH (n)-[:HAS_NAME]->(m)"
. "RETURN n, m ORDER BY m.last_name, m.first_name";
$query = new Everyman\Neo4j\Cypher\Query($sukudb, $query_string);
$result = $query->getResultSet();
$id = [];
foreach ($result as $row)
{
$id[] = $row[0]->getProperty('id');
$first_name[] = $row[1]->getProperty('first_name');
$last_name[] = $row[1]->getProperty('last_name');
$later_names[] = $row[1]->getProperty('later_names');
}
for ($i=0; $i<sizeof($id); $i++) {
$query_string = "MATCH (n:Person:" . $userid . ")-[:BIRTH_PLACE]->(p) "
. "WHERE n.id='" . $id[$i] . "' RETURN p";
$query = new Everyman\Neo4j\Cypher\Query($sukudb, $query_string);
$result = $query->getResultSet();
foreach ($result as $row)
{
$birth_place[] = $row[0]->getProperty('name');
}
}
echo '<table class="tulos">';
echo '<tr><th>Id</th><th>Etunimet</th><th>Sukunimet</th>
<th>Syntymäaika ja -paikka</th><th></th></tr>';
for ($i = 0; $i < sizeof($id); $i++) {
echo "<tr><td><a href='readIndividData.php?id=" . $id[$i] . "'>"
. $id[$i] . '</a></td><td>'
. $first_name[$i] . '</td><td> ' . $last_name[$i];
if (isset($later_names[$i])) {
echo ' <i>myöh.</i> ' . $later_names[$i];
}
echo '</td><td>';
if (isset($birth_date[$i])) {
echo "<!-- $birth_date[$i] -->";
echo GedDateParser::toDisplay($birth_date[$i]) . ' ';
} else {
echo '- ';
}
if (isset($birth_place[$i])) {
echo $birth_place[$i];
}
echo "</td><td><a href='updateBirthData.php?id=" . $id[$i]
. "'><i>muokkaa</i></a></td></tr>";
}
echo '</table><p> </p>';
/*
* End of content page -->
*/
include "inc/stop.php";