1 | <?php
|
---|
2 | /* Modul: alkisrelationen.php
|
---|
3 |
|
---|
4 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
5 | Verfolgt die Beziehungen von ALKIS-Objekten in der Tabelle 'alkis_beziehungen'.
|
---|
6 | Link durch "&id=j;" in den anderen Modulen zuschaltbar.
|
---|
7 | Dies ist fuer die Entwicklung der Auskunft gedacht (Sonderfaelle) nicht fuer den Anwender.
|
---|
8 |
|
---|
9 | Version:
|
---|
10 | 01.10.2010 htmlentities $otyp
|
---|
11 | 14.12.2010 Pfad zur Conf
|
---|
12 | 17.12.2010 Astrid Emde: Prepared Statements (pg_query -> pg_prepare + pg_execute)
|
---|
13 | 11.07.2011 Ersetzen $self durch $_SERVER['PHP_SELF']."?" |
---|
14 | 02.11.2011 h3
|
---|
15 | */
|
---|
16 | ini_set('error_reporting', 'E_ALL');
|
---|
17 | session_start();
|
---|
18 | $gkz=urldecode($_REQUEST["gkz"]);
|
---|
19 | require_once("alkis_conf_location.php");
|
---|
20 | if ($auth == "mapbender") {
require_once($mapbender);
|
---|
21 | }
|
---|
22 | ?>
|
---|
23 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
24 | <html>
|
---|
25 | <head>
|
---|
26 | <meta name="author" content="F. Jaeger krz" >
|
---|
27 | <meta http-equiv="cache-control" content="no-cache">
|
---|
28 | <meta http-equiv="pragma" content="no-cache">
|
---|
29 | <meta http-equiv="expires" content="0">
|
---|
30 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
31 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
32 | <link rel="shortcut icon" type="image/x-icon" href="ico/Beziehung.ico">
|
---|
33 | <title>ALKIS-Relationen-Browser</title>
|
---|
34 | </head>
|
---|
35 | <body>
|
---|
36 | <?php
|
---|
37 | $gmlid=isset($_GET["gmlid"]) ? $_GET["gmlid"] : 0;
|
---|
38 | $otyp=isset($_GET["otyp"]) ? $_GET["otyp"] : "Objekt";
|
---|
39 | $otyp=htmlentities($otyp, ENT_QUOTES, "UTF-8");
|
---|
40 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
41 | echo "\n<p class='bezieh'>Beziehungen ".$gmlid."</p>"; // Balken
|
---|
42 |
|
---|
43 | echo "\n\n<h2><img src='ico/Beziehung.ico' width='16' height='16' alt=''> Beziehungen</h2>";
|
---|
44 | if (!$con) { |
---|
45 | echo "\n<p class='err'>Fehler beim Verbinden der DB.</p>";
|
---|
46 | } else {
|
---|
47 | echo "\n\n<h3 title='Die gml_is ist global eindeutig'>ALKIS-".$otyp." mit gml_id = '".$gmlid."'</h3>";
|
---|
48 | $sql="SELECT beziehungsart, beziehung_zu FROM alkis_beziehungen WHERE beziehung_von= $1;";
|
---|
49 | $v = array($gmlid);
|
---|
50 | $res = pg_prepare("", $sql);
|
---|
51 | $res = pg_execute("", $v);
|
---|
52 |
|
---|
53 | echo "\n<table>";
|
---|
54 | if (!$res) {
|
---|
55 | echo "\n<tr>\n\t<td colspan=3><b>Keine</b> Beziehungen vom Objekt</td>\n</tr>";
|
---|
56 | } else {
|
---|
57 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>vom</b> Objekt zu ..</td>\n</tr>";
|
---|
58 | $i=0;
|
---|
59 | while($row = pg_fetch_array($res)) {
|
---|
60 | echo "\n<tr>\n\t<td>".$otyp."</td>";
|
---|
61 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
62 | echo "\n\t<td>\n\t\t<a href='".$_SERVER['PHP_SELF']."?gkz=".$gkz."&gmlid=".$row["beziehung_zu"]."'>".$row["beziehung_zu"]."</a>";
|
---|
63 | echo "\n\t</td>\n</tr>";
|
---|
64 | $i++;
|
---|
65 | }
|
---|
66 | if ($i == 0) { |
---|
67 | echo "<tr><td colspan=3>.. keine</td></tr>"; |
---|
68 | }
|
---|
69 | }
|
---|
70 | $sql="SELECT beziehungsart, beziehung_von FROM alkis_beziehungen WHERE beziehung_zu= $1;";
$v = array($gmlid);
|
---|
71 | $res = pg_prepare("", $sql);
|
---|
72 | $res = pg_execute("", $v);
|
---|
73 |
|
---|
74 | if (!$res) {
|
---|
75 | echo "<tr><td colspan=3><b>Keine</b> Beziehungen zum Objekt</td></tr>";
|
---|
76 | } else {
|
---|
77 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>zum</b> Objekt von ..</td>\n</tr>";
|
---|
78 | $i=0;
|
---|
79 | while($row = pg_fetch_array($res)) {
|
---|
80 | echo "\n<tr>\n\t<td>";
|
---|
81 | echo "\n\t\t<a href='".$_SERVER['PHP_SELF']."?gkz=".$gkz."&gmlid=".$row["beziehung_von"]."'>".$row["beziehung_von"]."</a>";
|
---|
82 | echo "\n\t</td>";
|
---|
83 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
84 | echo "\n\t<td>".$otyp."</td>\n</tr>";
|
---|
85 | $i++;
|
---|
86 | }
|
---|
87 | if ($i == 0) { |
---|
88 | echo "\n<tr>\n\t<td colspan=3>.. keine</td>\n</tr>"; |
---|
89 | }
|
---|
90 | }
|
---|
91 | echo "\n</table>";
|
---|
92 | }
|
---|
93 | echo "\n<hr>\n<p class='nwlink'>\n\t<a target='_blank' href='".$hilfeurl."' title='Dokumentation'>Hilfe zur ALKIS-Auskunft</a>\n</p>\n";
|
---|
94 | ?>
|
---|
95 |
|
---|
96 | </body>
|
---|
97 | </html> |
---|