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