[26] | 1 | <?php
|
---|
| 2 | /* alkisrelationen.php
|
---|
| 3 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
| 4 | Verfolgt die Beziehungen von ALKIS-Objekten in der Tabelle 'alkis_beziehungen'.
|
---|
| 5 | Link durch "&id=j;" in den anderen Modulen zuschaltbar.
|
---|
| 6 | Ist eher fuer die Entwicklung der Auskunft gedacht (Sonderfaelle) als fuer den Anwender.
|
---|
| 7 | Parameter: gkz, gml_id
|
---|
| 8 | Version:
|
---|
| 9 | 26.01.2010 internet-Version mit eigener conf
|
---|
| 10 | */
|
---|
| 11 | ini_set('error_reporting', 'E_ALL');
|
---|
| 12 | session_start();
|
---|
| 13 | // Mapbender-Authentifizierung
|
---|
| 14 | require_once("/data/mapwww/http/php/mb_validateSession.php");
|
---|
| 15 | require_once("/data/conf/alkis_www_conf.php");
|
---|
| 16 | ?>
|
---|
| 17 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 18 | <html>
|
---|
| 19 | <head>
|
---|
| 20 | <meta name="author" content="F. Jaeger">
|
---|
| 21 | <meta http-equiv="cache-control" content="no-cache">
|
---|
| 22 | <meta http-equiv="pragma" content="no-cache">
|
---|
| 23 | <meta http-equiv="expires" content="0">
|
---|
| 24 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
| 25 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
| 26 | <title>ALKIS-Relationen-Browser</title>
|
---|
| 27 | </head>
|
---|
| 28 | <body>
|
---|
| 29 | <?php
|
---|
| 30 | $gkz=urldecode($_REQUEST["gkz"]);
|
---|
| 31 | $gmlid=isset($_GET["gmlid"]) ? $_GET["gmlid"] : 0;
|
---|
| 32 | $style=isset($_GET["style"]) ? $_GET["style"] : "kompakt";
|
---|
| 33 | $otyp=isset($_GET["otyp"]) ? $_GET["otyp"] : "Objekt";
|
---|
| 34 | $dbname = 'alkis05' . $gkz;
|
---|
| 35 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
| 36 | echo "\n<p class='bezieh'>Beziehungen ".$gmlid."</p>";
|
---|
| 37 | echo "\n\n<h2>ALKIS-Beziehungen</h2>";
|
---|
| 38 | if (!$con) {echo "\n<p class='err'>Fehler beim Verbinden der DB.</p>";
|
---|
| 39 | } else {
|
---|
| 40 | echo "\n<p>von ALKIS-".$otyp."</p>";
|
---|
| 41 | echo "\n\n<h3 title='Die gml_is ist global eindeutig'>".$gmlid."</h3>";
|
---|
| 42 | $sql="SELECT beziehungsart, beziehung_zu FROM alkis_beziehungen WHERE beziehung_von='".$gmlid."';";
|
---|
| 43 | $res=pg_query($con,$sql);
|
---|
| 44 | echo "\n<table>";
|
---|
| 45 | if (!$res) { // vorab Anzahl der Saetze ermitteln?
|
---|
| 46 | echo "\n<tr>\n\t<td colspan=3><b>Keine</b> Beziehungen vom Objekt</td>\n</tr>";
|
---|
| 47 | } else {
|
---|
| 48 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>vom</b> Objekt zu ..</td>\n</tr>";
|
---|
| 49 | $i=0;
|
---|
| 50 | while($row = pg_fetch_array($res)) {
|
---|
| 51 | echo "\n<tr>\n\t<td>".$otyp."</td>";
|
---|
| 52 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
| 53 | echo "\n\t<td>\n\t\t<a href='".$self."gkz=".$gkz."&gmlid=".$row["beziehung_zu"]."&style=".$style."'>".$row["beziehung_zu"]."</a>";
|
---|
| 54 | echo "\n\t</td>\n</tr>";
|
---|
| 55 | $i++;
|
---|
| 56 | }
|
---|
| 57 | if ($i == 0) echo "<tr><td colspan=3>.. keine</td></tr>";
|
---|
| 58 | }
|
---|
| 59 | $sql="SELECT beziehungsart, beziehung_von FROM alkis_beziehungen WHERE beziehung_zu='".$gmlid."';";
|
---|
| 60 | $res=pg_query($con,$sql);
|
---|
| 61 | if (!$res) {
|
---|
| 62 | echo "<tr><td colspan=3><b>Keine</b> Beziehungen zum Objekt</td></tr>";
|
---|
| 63 | } else {
|
---|
| 64 | echo "\n<tr>\n\t<td class='head' colspan=3><br>Beziehungen <b>zum</b> Objekt von ..</td>\n</tr>";
|
---|
| 65 | $i=0;
|
---|
| 66 | while($row = pg_fetch_array($res)) {
|
---|
| 67 | echo "\n<tr>\n\t<td>";
|
---|
| 68 | echo "\n\t\t<a href='".$self."gkz=".$gkz."&gmlid=".$row["beziehung_von"]."&style=".$style."'>".$row["beziehung_von"]."</a>";
|
---|
| 69 | echo "\n\t</td>";
|
---|
| 70 | echo "\n\t<td class='bez'>".$row["beziehungsart"]."</td>";
|
---|
| 71 | echo "\n\t<td>".$otyp."</td>\n</tr>";
|
---|
| 72 | $i++;
|
---|
| 73 | }
|
---|
| 74 | if ($i == 0) echo "\n<tr>\n\t<td colspan=3>.. keine</td>\n</tr>";
|
---|
| 75 | }
|
---|
| 76 | echo "\n</table>";
|
---|
| 77 | }
|
---|
| 78 | echo "\n<hr>\n<p class='nwlink'>\n\t<a target='_blank' href='".$hilfeurl."' title='Dokumentation'>Hilfe zur ALKIS-Auskunft</a>\n</p>\n";
|
---|
| 79 | ?>
|
---|
| 80 | </body>
|
---|
| 81 | </html> |
---|