This repository has been 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
/
showContent.php
81 lines (61 loc) · 2.27 KB
/
showContent.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
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
<!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">
<head>
<?php session_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Taapeli - Käyttäjän luomat tiedot</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
<?php
include 'inc/checkUserid.php';
include "inc/start.php";
include "inc/dbconnect.php";
/*
* -- Content page starts here -->
*/
if (!isset($_GET['user'])) {
echo '<p>Ei valittua henkilöä</p></body></html>';
die;
}
// Tiedoston käsittelyn muuttujat
$user = htmlentities($_GET['user']);
$query_string = "MATCH (n:Person:" . $user . ") RETURN COUNT(n)";
$query = new Everyman\Neo4j\Cypher\Query($sukudb, $query_string);
$result = $query->getResultSet();
foreach ($result as $rows)
{
$counter_p = $rows[0];
}
$query_string = "MATCH (n:Person:" . $user . ")-[r]-() RETURN TYPE(r), COUNT(*) ORDER BY TYPE(r)";
$query = new Everyman\Neo4j\Cypher\Query($sukudb, $query_string);
$result = $query->getResultSet();
foreach ($result as $rows)
{
$type[] = $rows[0];
$counter[] = $rows[1];
}
echo '<h1>Käyttäjän ' . $user . ' lataamat tiedot</h1>';
echo '<h3>Henkilöitä kannassa: ' . $counter_p . '</h3>';
echo '<table class="tulos">';
echo '<tr><th>Relaation nimi</th><th>Lukumäärä</th></tr>';
for ($i=0; $i<sizeof($type); $i++) {
echo "<tr><td>" . $type[$i] . "</td><td align='right'>" . $counter[$i] . "</td></tr>";
}
echo "</table><h2>Toiminnot</h2><ul><li>";
if ($_SESSION['userid'] == $user) {
?>
<form action="deleteUser.php" method="get" enctype="multipart/form-data">
Poista käyttäjän <i><?php echo $user; ?></i> tallettamat tiedot
<input type="hidden" name="user" value="<?php echo $user; ?>" />
<input type="submit" value="Poista tiedot"/>
</form>
<?php
} else {
echo "Voit poistaa vain kirjautuneen käyttäjän itse tallettamat tiedot";
};
echo "</li></ul><p> </p>";
/*
* -- End of content page -->
*/
include "inc/stop.php";