[26] | 1 | <?php
|
---|
[123] | 2 | /* Modul: alkisrelationen.php
|
---|
| 3 |
|
---|
[49] | 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.
|
---|
[123] | 7 | Dies ist fuer die Entwicklung der Auskunft gedacht (Sonderfaelle) nicht fuer den Anwender.
|
---|
| 8 |
|
---|
[132] | 9 | Version:
10.11.2011 Relationen-ZÀhler ausgeben, ab 5 Zeilen nicht mehr 'auf einen Blick' erkennbar. |
---|
| 10 | 30.11.2011 import_request_variables |
---|
[275] | 11 | 2013-04-08 deprecated "import_request_variables" ersetzt
|
---|
| 12 | */
|
---|
[26] | 13 | session_start(); |
---|
[132] | 14 | //import_request_variables("G"); // php 5.3 deprecated, php 5.4 entfernt |
---|
[275] | 15 | $cntget = extract($_GET);
|
---|
| 16 | require_once("alkis_conf_location.php");
|
---|
[123] | 17 | if ($auth == "mapbender") {require_once($mapbender);} |
---|
[132] | 18 | $otyp=htmlentities($otyp, ENT_QUOTES, "UTF-8"); |
---|
| 19 | ?>
|
---|
[26] | 20 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 21 | <html>
|
---|
| 22 | <head>
|
---|
| 23 | <meta name="author" content="b600352" >
|
---|
[275] | 24 | <meta http-equiv="cache-control" content="no-cache">
|
---|
[26] | 25 | <meta http-equiv="pragma" content="no-cache">
|
---|
| 26 | <meta http-equiv="expires" content="0">
|
---|
| 27 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
| 28 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
[123] | 29 | <link rel="shortcut icon" type="image/x-icon" href="ico/Beziehung.ico">
|
---|
[41] | 30 | <title>ALKIS-Relationen-Browser</title>
|
---|
[26] | 31 | </head>
|
---|
| 32 | <body>
|
---|
| 33 | <?php
|
---|
| 34 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
| 35 | echo "\n<p class='bezieh'>Beziehungen ".$gmlid."</p>"; // Balken
|
---|
[123] | 36 |
|
---|
| 37 | echo "\n\n<h2><img src='ico/Beziehung.ico' width='16' height='16' alt=''> Beziehungen</h2>";
|
---|
[41] | 38 | if (!$con) { |
---|
[123] | 39 | echo "\n<p class='err'>Fehler beim Verbinden der DB.</p>";
|
---|
| 40 | } else {
|
---|
[26] | 41 | echo "\n\n<h3 title='Die gml_is ist global eindeutig'>ALKIS-".$otyp." mit gml_id = '".$gmlid."'</h3>";
|
---|
[123] | 42 | $sql="SELECT beziehungsart, beziehung_zu FROM alkis_beziehungen WHERE beziehung_von= $1;";
|
---|
[61] | 43 | $v = array($gmlid);
|
---|
| 44 | $res = pg_prepare("", $sql);
|
---|
| 45 | $res = pg_execute("", $v);
|
---|
| 46 |
|
---|
[64] | 47 | echo "\n<table>";
|
---|
[26] | 48 | if (!$res) {
|
---|
[123] | 49 | echo "\n<tr>\n\t<td colspan=3><b>Keine</b> Beziehungen vom Objekt</td>\n</tr>";
|
---|
[26] | 50 | } else {
|
---|
| 51 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>vom</b> Objekt zu ..</td>\n</tr>";
|
---|
| 52 | $i=0;
|
---|
| 53 | while($row = pg_fetch_array($res)) {
|
---|
| 54 | echo "\n<tr>\n\t<td>".$otyp."</td>";
|
---|
| 55 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
| 56 | echo "\n\t<td>\n\t\t<a href='".$_SERVER['PHP_SELF']."?gkz=".$gkz."&gmlid=".$row["beziehung_zu"]."'>".$row["beziehung_zu"]."</a>";
|
---|
[102] | 57 | echo "\n\t</td>\n</tr>";
|
---|
[26] | 58 | $i++;
|
---|
| 59 | }
|
---|
| 60 | if ($i == 0) { |
---|
[123] | 61 | echo "<tr><td colspan=3>.. keine</td></tr>"; |
---|
| 62 | } elseif ($i > 4) { |
---|
[128] | 63 | echo "\n<tr>\n\t<td colspan=3>".$i." Relationen</td>\n</tr>"; |
---|
| 64 | }
|
---|
[123] | 65 | }
|
---|
[26] | 66 | $sql="SELECT beziehungsart, beziehung_von FROM alkis_beziehungen WHERE beziehung_zu= $1;";
$v = array($gmlid);
|
---|
[123] | 67 | $res = pg_prepare("", $sql);
|
---|
[61] | 68 | $res = pg_execute("", $v);
|
---|
| 69 |
|
---|
| 70 | if (!$res) {
|
---|
| 71 | echo "<tr><td colspan=3><b>Keine</b> Beziehungen zum Objekt</td></tr>";
|
---|
[26] | 72 | } else {
|
---|
| 73 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>zum</b> Objekt von ..</td>\n</tr>";
|
---|
| 74 | $i=0;
|
---|
| 75 | while($row = pg_fetch_array($res)) {
|
---|
| 76 | echo "\n<tr>\n\t<td>";
|
---|
| 77 | echo "\n\t\t<a href='".$_SERVER['PHP_SELF']."?gkz=".$gkz."&gmlid=".$row["beziehung_von"]."'>".$row["beziehung_von"]."</a>";
|
---|
| 78 | echo "\n\t</td>";
|
---|
[102] | 79 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
[26] | 80 | echo "\n\t<td>".$otyp."</td>\n</tr>";
|
---|
| 81 | $i++;
|
---|
| 82 | }
|
---|
| 83 | if ($i == 0) { |
---|
| 84 | echo "\n<tr>\n\t<td colspan=3>.. keine</td>\n</tr>"; |
---|
[123] | 85 | } elseif ($i > 4) { |
---|
| 86 | echo "\n<tr>\n\t<td colspan=3>".$i." Relationen</td>\n</tr>"; |
---|
[128] | 87 | }
|
---|
| 88 | }
|
---|
[123] | 89 | echo "\n</table>";
|
---|
[26] | 90 | }
|
---|
| 91 | echo "\n<hr>\n<p class='nwlink'>\n\t<a target='_blank' href='".$hilfeurl."' title='Dokumentation'>Hilfe zur ALKIS-Auskunft</a>\n</p>\n";
|
---|
| 92 | ?>
|
---|
| 93 |
|
---|
[123] | 94 | </body>
|
---|
[49] | 95 | </html> |
---|