[26] | 1 | <?php
|
---|
[41] | 2 | /* Modul: alkisnamstruk.php |
---|
| 3 | Version:
|
---|
| 4 | 30.08.2010 $style=ALKIS entfernt, alles Kompakt |
---|
[43] | 5 | 02.09.2010 Mit Icons |
---|
[45] | 6 | 06.09.2010 Schluessel anschaltbar |
---|
| 7 | 15.09.2010 Function "buchungsart" durch JOIN ersetzt, Tabelle GB einzeilig
|
---|
[41] | 8 | |
---|
[26] | 9 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
| 10 | Namens- und Adressdaten fuer einen Eigentuemer aus ALKIS PostNAS
|
---|
[41] | 11 |
|
---|
[45] | 12 | ToDo: Sortierung der Grundbücher zum Namen
|
---|
[26] | 13 | */
|
---|
| 14 | ini_set('error_reporting', 'E_ALL & ~ E_NOTICE');
|
---|
| 15 | session_start();
|
---|
| 16 | // Bindung an Mapbender-Authentifizierung
|
---|
| 17 | require_once("/data/mapwww/http/php/mb_validateSession.php");
|
---|
| 18 | require_once("/data/conf/alkis_www_conf.php");
|
---|
| 19 | include("alkisfkt.php");
|
---|
| 20 | ?>
|
---|
| 21 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 22 | <html>
|
---|
| 23 | <head>
|
---|
[45] | 24 | <meta name="author" content="b600352" >
|
---|
[26] | 25 | <meta http-equiv="cache-control" content="no-cache">
|
---|
| 26 | <meta http-equiv="pragma" content="no-cache">
|
---|
| 27 | <meta http-equiv="expires" content="0">
|
---|
| 28 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
| 29 | <title>ALKIS Person und Adresse</title>
|
---|
[41] | 30 | <link rel="stylesheet" type="text/css" href="alkisauszug.css"> |
---|
| 31 | <link rel="shortcut icon" type="image/x-icon" href="ico/Eigentuemer_2.ico"> |
---|
| 32 | <style type='text/css' media='print'>
|
---|
| 33 | .noprint { visibility: hidden;}
|
---|
| 34 | </style>
|
---|
[26] | 35 | </head>
|
---|
| 36 | <body>
|
---|
| 37 | <?php
|
---|
| 38 | $gmlid=urldecode($_REQUEST["gmlid"]);
|
---|
| 39 | $gkz=urldecode($_REQUEST["gkz"]);
|
---|
[43] | 40 | $id = isset($_GET["id"]) ? $_GET["id"] : "n"; |
---|
| 41 | if ($id == "j") { |
---|
| 42 | $idanzeige=true; |
---|
| 43 | } else { |
---|
| 44 | $idanzeige=false; |
---|
| 45 | }
|
---|
| 46 | $keys = isset($_GET["showkey"]) ? $_GET["showkey"] : "n";
|
---|
| 47 | if ($keys == "j") { |
---|
| 48 | $showkey=true; |
---|
| 49 | } else { |
---|
| 50 | $showkey=false; |
---|
| 51 | }
|
---|
[26] | 52 | $dbname = 'alkis05' . $gkz;
|
---|
| 53 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
[41] | 54 | |
---|
| 55 | // Balken |
---|
| 56 | echo "<p class='nakennz'>ALKIS Name id=".$gmlid." </p>\n";
|
---|
| 57 | |
---|
| 58 | echo "\n<h2><img src='ico/Eigentuemer.ico' width='16' height='16' alt=''> Person</h2>\n";
|
---|
[26] | 59 | if (!$con) "\n<p class='err'>Fehler beim Verbinden der DB</p>\n";
|
---|
[43] | 60 | |
---|
[26] | 61 | $sql="SELECT nachnameoderfirma, anrede, vorname, geburtsname, geburtsdatum, namensbestandteil, akademischergrad ";
|
---|
| 62 | $sql.="FROM ax_person WHERE gml_id='".$gmlid."'";
|
---|
[43] | 63 | |
---|
[26] | 64 | $res=pg_query($con,$sql);
|
---|
| 65 | if (!$res) {echo "\n<p class='err'>Fehler bei Zugriff auf Namensnummer</p>\n";}
|
---|
| 66 | if ($idanzeige) { linkgml($gkz, $gmlid, "Person"); }
|
---|
| 67 | if ($row = pg_fetch_array($res)) {
|
---|
| 68 | $vor=htmlentities($row["vorname"], ENT_QUOTES, "UTF-8");
|
---|
| 69 | $nam=htmlentities($row["nachnameoderfirma"], ENT_QUOTES, "UTF-8");
|
---|
| 70 | $geb=htmlentities($row["geburtsname"], ENT_QUOTES, "UTF-8");
|
---|
| 71 | $anr=anrede($row["anrede"]);
|
---|
| 72 | $aka=$row["akademischergrad"];
|
---|
[43] | 73 | |
---|
[26] | 74 | echo "<table>\n";
|
---|
| 75 | echo "\t<tr><td class='nhd'>Anrede:</td><td class='nam'>".$anr."</td></tr>\n";
|
---|
| 76 | echo "\t<tr><td class='nhd'>Nachname oder Firma:</td><td class='nam'>".$nam."</td></tr>\n";
|
---|
| 77 | echo "\t<tr><td class='nhd'>Vorname:</td><td class='nam'>".$vor."</td></tr>\n";
|
---|
| 78 | echo "\t<tr><td class='nhd'>Geburtsname:</td><td class='nam'>".$geb."</td></tr>\n";
|
---|
| 79 | echo "\t<tr><td class='nhd'>Geburtsdatum:</td><td class='nam'>".$row["geburtsdatum"]."</td></tr>\n";
|
---|
| 80 | echo "\t<tr><td class='nhd'>Namensbestandteil:</td><td class='nam'>".$row["namensbestandteil"]."</td></tr>\n";
|
---|
| 81 | echo "\t<tr><td class='nhd'>akademischer Grad:</td><td class='nam'>".$aka."</td></tr>\n";
|
---|
| 82 | echo "\n</table>\n<hr>\n";
|
---|
| 83 |
|
---|
| 84 | // A d r e s s e
|
---|
[41] | 85 | echo "\n<h3><img src='ico/Strasse_mit_Haus.ico' width='16' height='16' alt=''> Adresse</h3>\n";
|
---|
[26] | 86 | $sql ="SELECT a.gml_id, a.ort_post, a.postleitzahlpostzustellung AS plz, a.strasse, a.hausnummer, a.bestimmungsland ";
|
---|
| 87 | $sql.="FROM ax_anschrift a ";
|
---|
| 88 | $sql.="JOIN alkis_beziehungen b ON a.gml_id=b.beziehung_zu ";
|
---|
| 89 | $sql.="WHERE b.beziehung_von='".$gmlid."' ";
|
---|
| 90 | $sql.="AND b.beziehungsart='hat';"; //"ORDER BY ?;";
|
---|
| 91 | //echo "\n<p class='err'>".$sql."</p>\n";
|
---|
| 92 | $resa=pg_query($con,$sql);
|
---|
| 93 | if (!$resa) echo "\n<p class='err'>Fehler bei Adressen.<br>\nSQL= ".$sql."</p>\n";
|
---|
| 94 | $j=0;
|
---|
| 95 | while($rowa = pg_fetch_array($resa)) {
|
---|
| 96 | $gmla=$rowa["gml_id"];
|
---|
| 97 | $plz=$rowa["plz"];
|
---|
| 98 | $ort=htmlentities($rowa["ort_post"], ENT_QUOTES, "UTF-8");
|
---|
| 99 | $str=htmlentities($rowa["strasse"], ENT_QUOTES, "UTF-8");
|
---|
| 100 | $hsnr=$rowa["hausnummer"];
|
---|
| 101 | $land=htmlentities($rowa["bestimmungsland"], ENT_QUOTES, "UTF-8");
|
---|
| 102 | if ($idanzeige) { linkgml($gkz, $gmla, "Adresse"); }
|
---|
| 103 |
|
---|
| 104 | echo "<table>\n";
|
---|
| 105 | echo "\t<tr><td class='nhd'>PLZ:</td><td class='nam'>".$plz."</td></tr>\n";
|
---|
| 106 | echo "\t<tr><td class='nhd'>Ort:</td><td class='nam'>".$ort."</td></tr>\n";
|
---|
| 107 | echo "\t<tr><td class='nhd'>Strasse:</td><td class='nam'>".$str."</td></tr>\n";
|
---|
| 108 | echo "\t<tr><td class='nhd'>Hausnummer:</td><td class='nam'>".$hsnr."</td></tr>\n";
|
---|
| 109 | echo "\t<tr><td class='nhd'>Land:</td><td class='nam'>".$land."</td></tr>\n";
|
---|
| 110 | echo "\n</table>\n<br>\n";
|
---|
| 111 | $j++;
|
---|
[45] | 112 | |
---|
| 113 | // Name und Adresse Kompakt (im Rahmen) |
---|
| 114 | // Alles was man fuer ein Anschreiben braucht
|
---|
| 115 | echo "<img src='ico/Namen.ico' width='16' height='16' alt='Brief' title='Anschrift'>"; // Symbol "Brief" |
---|
| 116 | echo "\n<div class='adr' title='Anschrift'>".$anr." ".$aka." ".$vor." ".$nam."<br>"; |
---|
| 117 | echo "\n".$str." ".$hsnr."<br>"; |
---|
| 118 | echo "\n".$plz." ".$ort."</div>";
|
---|
[26] | 119 | }
|
---|
| 120 | if ($j == 0) {echo "\n<p class='err'>Keine Adressen.</p>\n";}
|
---|
| 121 |
|
---|
| 122 | // *** G R U N D B U C H ***
|
---|
[41] | 123 | echo "\n<hr>\n<h3><img src='ico/Grundbuch_zu.ico' width='16' height='16' alt=''> Grundbücher</h3>\n";
|
---|
[26] | 124 | // person <benennt< namensnummer >istBestandteilVon> Buchungsblatt
|
---|
| 125 | // >bestehtAusRechtsverhaeltnissenZu> namensnummer (Nebenzweig/Sonderfälle?)
|
---|
| 126 |
|
---|
| 127 | $sql ="SELECT n.gml_id AS gml_n, n.laufendenummernachdin1421 AS lfd, n.zaehler, n.nenner, ";
|
---|
[45] | 128 | $sql.="g.gml_id AS gml_g, g.bezirk, g.buchungsblattnummermitbuchstabenerweiterung as nr, g.blattart, "; |
---|
| 129 | $sql.="b.bezeichnung AS beznam ";
|
---|
[26] | 130 | $sql.="FROM alkis_beziehungen bpn ";
|
---|
| 131 | $sql.="JOIN ax_namensnummer n ON bpn.beziehung_von=n.gml_id ";
|
---|
| 132 | $sql.="JOIN alkis_beziehungen bng ON n.gml_id=bng.beziehung_von ";
|
---|
| 133 | $sql.="JOIN ax_buchungsblatt g ON bng.beziehung_zu=g.gml_id ";
|
---|
[45] | 134 | |
---|
| 135 | $sql.="JOIN ax_buchungsblattbezirk b ON g.land = b.land AND g.bezirk = b.bezirk "; |
---|
| 136 | |
---|
[26] | 137 | $sql.="WHERE bpn.beziehung_zu='".$gmlid."' ";
|
---|
| 138 | $sql.="AND bpn.beziehungsart='benennt' AND bng.beziehungsart='istBestandteilVon' ";
|
---|
| 139 | $sql.="ORDER BY g.bezirk, g.buchungsblattnummermitbuchstabenerweiterung ;";
|
---|
| 140 |
|
---|
| 141 | //echo "\n<p class='err'>".$sql."</p>\n";
|
---|
| 142 | $resg=pg_query($con,$sql);
|
---|
| 143 | if (!$resg) echo "\n<p class='err'>Fehler bei Grundbuch.<br>\nSQL= ".$sql."</p>\n";
|
---|
| 144 | $j=0;
|
---|
[45] | 145 | echo "<table class='eig'>"; |
---|
| 146 | |
---|
| 147 | echo "\n<tr>"; |
---|
| 148 | echo "\n\t<td class='head'>Bezirk</td>";
|
---|
| 149 | echo "\n\t<td class='head'>Blattart</td>"; |
---|
| 150 | echo "\n\t<td class='head'>Blatt</td>";
|
---|
| 151 | echo "\n\t<td class='head'>Namensnummer</td>"; |
---|
| 152 | echo "\n\t<td class='head'>Anteil</td>";
|
---|
| 153 | echo "\n\t<td class='head nwlink' title='Link: weitere Auskunft'>weit. Auskunft</td>"; |
---|
| 154 | echo "\n</tr>"; |
---|
| 155 |
|
---|
[26] | 156 | while($rowg = pg_fetch_array($resg)) {
|
---|
| 157 | $gmln=$rowg["gml_n"];
|
---|
| 158 | $gmlg=$rowg["gml_g"];
|
---|
| 159 | $namnum=kurz_namnr($rowg["lfd"]);
|
---|
| 160 | $zae=$rowg["zaehler"];
|
---|
[45] | 161 | $blattkey=$rowg["blattart"]; |
---|
| 162 | $blattart=blattart($blattkey); |
---|
[26] | 163 |
|
---|
| 164 | echo "\n<tr>";
|
---|
[45] | 165 | |
---|
| 166 | echo "\n\t<td class='gbl'>"; // GB-Bezirk" |
---|
| 167 | if ($showkey) { |
---|
| 168 | echo "<span class='key'>".$rowg["bezirk"]."</span> "; |
---|
| 169 | } |
---|
| 170 | echo $rowg["beznam"]; |
---|
[26] | 171 | echo "</td>";
|
---|
[45] | 172 | |
---|
| 173 | echo "\n\t<td class='gbl'>"; // Blattart |
---|
| 174 | if ($showkey) { |
---|
| 175 | echo "<span class='key'>".$blattkey."</span> "; |
---|
| 176 | } |
---|
| 177 | echo $blattart; |
---|
| 178 | echo "</td>"; |
---|
| 179 | |
---|
| 180 | echo "\n\t<td class='gbl'>"; // Blatt |
---|
| 181 | echo "<span class='wichtig'>".$rowg["nr"]."</span>"; |
---|
| 182 | if ($idanzeige) {
|
---|
| 183 | linkgml($gkz, $gmlg, "Grundbuchblatt");
} |
---|
| 184 | echo "</td>";
|
---|
[26] | 185 | |
---|
[45] | 186 | echo "\n\t<td class='gbl'>"; // Namensnummer |
---|
| 187 | If ($namnum == "") { |
---|
| 188 | echo " "; |
---|
| 189 | } else { |
---|
| 190 | echo $namnum; |
---|
| 191 | } |
---|
| 192 | if ($idanzeige) {
|
---|
| 193 | linkgml($gkz, $gmln, "Namensnummer");
|
---|
| 194 | } |
---|
| 195 | echo "</td>";
|
---|
| 196 | |
---|
| 197 | echo "\n\t<td class='gbl'>"; // Anteil |
---|
| 198 | If ($zae == "") { |
---|
| 199 | echo " "; |
---|
| 200 | } else { |
---|
| 201 | echo $zae."/".$rowg["nenner"]." Anteil"; |
---|
| 202 | } |
---|
| 203 | echo "</td>"; |
---|
| 204 |
|
---|
[26] | 205 | echo "\n\t<td class='gbl'>";
|
---|
| 206 | echo "\n\t\t<p class='nwlink noprint'>"; |
---|
[43] | 207 | echo "\n\t\t\t<a href='alkisbestnw.php?gkz=".$gkz."&gmlid=".$gmlg;
|
---|
| 208 | if ($idanzeige) {echo "&id=j";} |
---|
| 209 | if ($showkey) {echo "&showkey=j";}
|
---|
| 210 | echo "' title='Bestandsnachweis'>"; |
---|
[45] | 211 | echo $blattart; |
---|
| 212 | echo "\n\t\t\t<img src='ico/GBBlatt_link.ico' width='16' height='16' alt=''></a>"; |
---|
[43] | 213 | echo "\n\t\t</p>";
echo "\n\t</td>";
|
---|
[45] | 214 |
|
---|
[43] | 215 | echo "\n</tr>";
|
---|
[26] | 216 | // +++ >bestehtAusRechtsverhaeltnissenZu> namensnummer ??
|
---|
| 217 | // z.B. eine Namennummer "Erbengemeinschaft" zeigt auf Namensnummern mit Eigentümern
|
---|
| 218 | $i++;
|
---|
| 219 | }
|
---|
| 220 | echo "</table>";
|
---|
| 221 | if ($i == 0) {echo "\n<p class='err'>Kein Grundbuch.</p>\n";}
|
---|
| 222 | } else {
|
---|
| 223 | echo "\n\t<p class='err'>Fehler! Kein Treffer für\n\t<a target='_blank' href='alkisrelationen.php?gkz=".$gkz."&gmlid=".$gmlid."'>".$gmlid."</a>\n</p>\n\n";
|
---|
| 224 | }
|
---|
[41] | 225 | ?>
|
---|
[26] | 226 |
|
---|
| 227 | <form action=''>
|
---|
| 228 | <div class='buttonbereich noprint'><hr>
|
---|
| 229 | <input type='button' name='back' value='<<' title='Zurück' onClick='javascript:history.back()'>
|
---|
| 230 | <input type='button' name='print' value='Druck' title='Seite Drucken' onClick='window.print()'>
|
---|
| 231 | <input type='button' name='close' value='X' title='Fenster schließen' onClick='window.close()'>
|
---|
| 232 | </div>
|
---|
| 233 | </form>
|
---|
| 234 |
|
---|
| 235 | <?php footer($gkz, $gmlid, $idumschalter, $idanzeige, $self, $hilfeurl, "", $showkey); ?>
|
---|
| 236 |
|
---|
[45] | 237 | </body>
|
---|
[26] | 238 | </html> |
---|