[26] | 1 | <?php
|
---|
[123] | 2 | /* Modul: alkisnamstruk.php
|
---|
| 3 |
|
---|
[49] | 4 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
[123] | 5 | Namens- und Adressdaten fuer einen Eigentuemer aus ALKIS PostNAS
|
---|
| 6 |
|
---|
[41] | 7 | Version:
|
---|
[129] | 8 | 02.11.2011 $sqla, $sqlg, Meldungen mit $debug steuern |
---|
| 9 | 17.11.2011 Parameter der Functions geÀndert |
---|
[132] | 10 | 30.11.2011 import_request_variables |
---|
[123] | 11 | |
---|
| 12 | ToDo:
|
---|
[132] | 13 | Sortierung der GrundbÃŒcher zum Namen
|
---|
[26] | 14 | */
|
---|
[132] | 15 | session_start(); |
---|
| 16 | import_request_variables("G");
|
---|
[123] | 17 | require_once("alkis_conf_location.php");
|
---|
| 18 | if ($auth == "mapbender") {require_once($mapbender);}
|
---|
[26] | 19 | include("alkisfkt.php");
|
---|
[132] | 20 | if ($id == "j") { $idanzeige=true;} else {$idanzeige=false;}
|
---|
| 21 | $keys = isset($_GET["showkey"]) ? $_GET["showkey"] : "n";
|
---|
| 22 | if ($keys == "j") {$showkey=true;} else {$showkey=false;} |
---|
| 23 | |
---|
[26] | 24 | ?>
|
---|
| 25 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
| 26 | <html>
|
---|
| 27 | <head>
|
---|
[49] | 28 | <meta name="author" content="F. Jaeger krz" >
|
---|
[26] | 29 | <meta http-equiv="cache-control" content="no-cache">
|
---|
| 30 | <meta http-equiv="pragma" content="no-cache">
|
---|
| 31 | <meta http-equiv="expires" content="0">
|
---|
| 32 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
---|
| 33 | <title>ALKIS Person und Adresse</title>
|
---|
[123] | 34 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
| 35 | <link rel="shortcut icon" type="image/x-icon" href="ico/Eigentuemer_2.ico">
|
---|
[41] | 36 | <style type='text/css' media='print'>
|
---|
[60] | 37 | .noprint {visibility: hidden;}
|
---|
[41] | 38 | </style>
|
---|
[26] | 39 | </head>
|
---|
| 40 | <body>
|
---|
| 41 | <?php
|
---|
| 42 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
[123] | 43 | // Balken
|
---|
[41] | 44 | echo "<p class='nakennz'>ALKIS Name id=".$gmlid." </p>\n";
|
---|
[123] | 45 |
|
---|
[41] | 46 | echo "\n<h2><img src='ico/Eigentuemer.ico' width='16' height='16' alt=''> Person</h2>\n";
|
---|
[26] | 47 | if (!$con) "\n<p class='err'>Fehler beim Verbinden der DB</p>\n";
|
---|
[123] | 48 |
|
---|
[26] | 49 | $sql="SELECT nachnameoderfirma, anrede, vorname, geburtsname, geburtsdatum, namensbestandteil, akademischergrad ";
|
---|
[61] | 50 | $sql.="FROM ax_person WHERE gml_id= $1;";
|
---|
| 51 |
|
---|
| 52 | $v = array($gmlid);
|
---|
| 53 | $res = pg_prepare("", $sql);
|
---|
[123] | 54 | $res = pg_execute("", $v);
|
---|
[61] | 55 |
|
---|
[26] | 56 | if (!$res) {echo "\n<p class='err'>Fehler bei Zugriff auf Namensnummer</p>\n";}
|
---|
| 57 | if ($idanzeige) { linkgml($gkz, $gmlid, "Person"); }
|
---|
| 58 | if ($row = pg_fetch_array($res)) {
|
---|
| 59 | $vor=htmlentities($row["vorname"], ENT_QUOTES, "UTF-8");
|
---|
| 60 | $nam=htmlentities($row["nachnameoderfirma"], ENT_QUOTES, "UTF-8");
|
---|
| 61 | $geb=htmlentities($row["geburtsname"], ENT_QUOTES, "UTF-8");
|
---|
| 62 | $anr=anrede($row["anrede"]);
|
---|
| 63 | $aka=$row["akademischergrad"];
|
---|
[123] | 64 |
|
---|
[26] | 65 | echo "<table>\n";
|
---|
| 66 | echo "\t<tr><td class='nhd'>Anrede:</td><td class='nam'>".$anr."</td></tr>\n";
|
---|
| 67 | echo "\t<tr><td class='nhd'>Nachname oder Firma:</td><td class='nam'>".$nam."</td></tr>\n";
|
---|
| 68 | echo "\t<tr><td class='nhd'>Vorname:</td><td class='nam'>".$vor."</td></tr>\n";
|
---|
| 69 | echo "\t<tr><td class='nhd'>Geburtsname:</td><td class='nam'>".$geb."</td></tr>\n";
|
---|
[76] | 70 | echo "\t<tr><td class='nhd'>Geburtsdatum:</td><td class='nam'>".$row["geburtsdatum"]." </td></tr>\n";
|
---|
| 71 | echo "\t<tr><td class='nhd'>Namensbestandteil:</td><td class='nam'>".$row["namensbestandteil"]." </td></tr>\n";
|
---|
| 72 | echo "\t<tr><td class='nhd'>akademischer Grad:</td><td class='nam'>".$aka." </td></tr>\n";
|
---|
[26] | 73 | echo "\n</table>\n<hr>\n";
|
---|
[64] | 74 |
|
---|
[26] | 75 | // A d r e s s e
|
---|
[41] | 76 | echo "\n<h3><img src='ico/Strasse_mit_Haus.ico' width='16' height='16' alt=''> Adresse</h3>\n";
|
---|
[123] | 77 | $sqla ="SELECT a.gml_id, a.ort_post, a.postleitzahlpostzustellung AS plz, a.strasse, a.hausnummer, a.bestimmungsland ";
|
---|
| 78 | $sqla.="FROM ax_anschrift a ";
|
---|
| 79 | $sqla.="JOIN alkis_beziehungen b ON a.gml_id=b.beziehung_zu ";
|
---|
| 80 | $sqla.="WHERE b.beziehung_von= $1 ";
|
---|
| 81 | $sqla.="AND b.beziehungsart='hat';"; //"ORDER BY ?;";
|
---|
[64] | 82 |
|
---|
[61] | 83 | $v = array($gmlid);
|
---|
[123] | 84 | $resa = pg_prepare("", $sqla);
|
---|
[61] | 85 | $resa = pg_execute("", $v);
|
---|
| 86 |
|
---|
[123] | 87 | if (!$resa) { |
---|
| 88 | echo "\n<p class='err'>Fehler bei Adressen</p>\n"; |
---|
| 89 | if ($debug > 2) { |
---|
| 90 | echo "<p class='err'>SQL=<br>".$sqla."<br>$1=gml(Person)= '".$gmlid."'</p>\n"; |
---|
| 91 | } |
---|
| 92 | }
|
---|
| 93 | |
---|
[26] | 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++;
|
---|
[123] | 112 |
|
---|
| 113 | // Name und Adresse Kompakt (im Rahmen)
|
---|
[45] | 114 | // Alles was man fuer ein Anschreiben braucht
|
---|
[123] | 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>";
|
---|
[45] | 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
|
---|
[60] | 125 | // >bestehtAusRechtsverhaeltnissenZu> namensnummer (Nebenzweig/SonderfÀlle?)
|
---|
[26] | 126 |
|
---|
[123] | 127 | $sqlg ="SELECT n.gml_id AS gml_n, n.laufendenummernachdin1421 AS lfd, n.zaehler, n.nenner, ";
|
---|
| 128 | $sqlg.="g.gml_id AS gml_g, g.bezirk, g.buchungsblattnummermitbuchstabenerweiterung as nr, g.blattart, ";
|
---|
| 129 | $sqlg.="b.bezeichnung AS beznam ";
|
---|
| 130 | $sqlg.="FROM alkis_beziehungen bpn ";
|
---|
| 131 | $sqlg.="JOIN ax_namensnummer n ON bpn.beziehung_von=n.gml_id ";
|
---|
| 132 | $sqlg.="JOIN alkis_beziehungen bng ON n.gml_id=bng.beziehung_von ";
|
---|
| 133 | $sqlg.="JOIN ax_buchungsblatt g ON bng.beziehung_zu=g.gml_id ";
|
---|
| 134 | $sqlg.="LEFT JOIN ax_buchungsblattbezirk b ON g.land = b.land AND g.bezirk = b.bezirk ";
|
---|
| 135 | $sqlg.="WHERE bpn.beziehung_zu= $1 ";
|
---|
| 136 | $sqlg.="AND bpn.beziehungsart='benennt' AND bng.beziehungsart='istBestandteilVon' ";
|
---|
| 137 | $sqlg.="ORDER BY g.bezirk, g.buchungsblattnummermitbuchstabenerweiterung;";
|
---|
| 138 | // buchungsblatt... mal mit und mal ohne fuehrende Nullen, bringt die Sortierung durcheinander
|
---|
| 139 | |
---|
[61] | 140 | $v = array($gmlid);
|
---|
[123] | 141 | $resg = pg_prepare("", $sqlg);
|
---|
| 142 | $resg = pg_execute("", $v);
|
---|
[61] | 143 |
|
---|
[123] | 144 | if (!$resg) { |
---|
| 145 | echo "\n<p class='err'>Fehler bei Grundbuch</p>\n"; |
---|
| 146 | if ($debug > 2) {
|
---|
| 147 | echo "\n<p class='err'>SQL=".$sqlg."</p>\n";
|
---|
| 148 | } |
---|
| 149 | }
|
---|
[26] | 150 | $j=0;
|
---|
[123] | 151 | echo "<table class='eig'>";
|
---|
| 152 | echo "\n<tr>";
|
---|
[45] | 153 | echo "\n\t<td class='head'>Bezirk</td>";
|
---|
[123] | 154 | echo "\n\t<td class='head'>Blattart</td>";
|
---|
[45] | 155 | echo "\n\t<td class='head'>Blatt</td>";
|
---|
[123] | 156 | echo "\n\t<td class='head'>Namensnummer</td>";
|
---|
[45] | 157 | echo "\n\t<td class='head'>Anteil</td>";
|
---|
[123] | 158 | echo "\n\t<td class='head nwlink noprint' title='Link: weitere Auskunft'>weit. Auskunft</td>";
|
---|
| 159 | echo "\n</tr>";
|
---|
[45] | 160 |
|
---|
[26] | 161 | while($rowg = pg_fetch_array($resg)) {
|
---|
| 162 | $gmln=$rowg["gml_n"];
|
---|
| 163 | $gmlg=$rowg["gml_g"];
|
---|
| 164 | $namnum=kurz_namnr($rowg["lfd"]);
|
---|
| 165 | $zae=$rowg["zaehler"];
|
---|
[123] | 166 | $blattkey=$rowg["blattart"];
|
---|
| 167 | $blattart=blattart($blattkey);
|
---|
[26] | 168 |
|
---|
| 169 | echo "\n<tr>";
|
---|
[123] | 170 |
|
---|
| 171 | echo "\n\t<td class='gbl'>"; // GB-Bezirk"
|
---|
| 172 | if ($showkey) {
|
---|
| 173 | echo "<span class='key'>".$rowg["bezirk"]."</span> ";
|
---|
| 174 | }
|
---|
| 175 | echo $rowg["beznam"];
|
---|
[26] | 176 | echo "</td>";
|
---|
[123] | 177 |
|
---|
| 178 | echo "\n\t<td class='gbl'>"; // Blattart
|
---|
| 179 | if ($showkey) {
|
---|
| 180 | echo "<span class='key'>".$blattkey."</span> ";
|
---|
| 181 | }
|
---|
| 182 | echo $blattart;
|
---|
| 183 | echo "</td>";
|
---|
| 184 |
|
---|
| 185 | echo "\n\t<td class='gbl'>"; // Blatt
|
---|
| 186 | echo "<span class='wichtig'>".$rowg["nr"]."</span>";
|
---|
[45] | 187 | if ($idanzeige) {
|
---|
| 188 | linkgml($gkz, $gmlg, "Grundbuchblatt");
}
|
---|
[123] | 189 | echo "</td>";
|
---|
[26] | 190 |
|
---|
[123] | 191 | echo "\n\t<td class='gbl'>"; // Namensnummer
|
---|
| 192 | If ($namnum == "") {
|
---|
| 193 | echo " ";
|
---|
| 194 | } else {
|
---|
| 195 | echo $namnum;
|
---|
| 196 | }
|
---|
| 197 | if ($idanzeige) {
|
---|
[45] | 198 | linkgml($gkz, $gmln, "Namensnummer");
|
---|
| 199 | }
|
---|
[123] | 200 | echo "</td>";
|
---|
[45] | 201 |
|
---|
[26] | 202 | echo "\n\t<td class='gbl'>"; // Anteil
|
---|
[123] | 203 | If ($zae == "") {
|
---|
| 204 | echo " ";
|
---|
| 205 | } else {
|
---|
| 206 | echo $zae."/".$rowg["nenner"]." Anteil";
|
---|
| 207 | }
|
---|
| 208 | echo "</td>";
|
---|
| 209 |
|
---|
| 210 | echo "\n\t<td class='gbl'>";
|
---|
[26] | 211 | echo "\n\t\t<p class='nwlink noprint'>";
|
---|
[123] | 212 | echo "\n\t\t\t<a href='alkisbestnw.php?gkz=".$gkz."&gmlid=".$gmlg;
|
---|
[43] | 213 | if ($idanzeige) {echo "&id=j";}
|
---|
[123] | 214 | if ($showkey) {echo "&showkey=j";}
|
---|
[43] | 215 | echo "' title='Bestandsnachweis'>";
|
---|
[123] | 216 | echo $blattart;
|
---|
| 217 | echo "\n\t\t\t<img src='ico/GBBlatt_link.ico' width='16' height='16' alt=''></a>";
|
---|
| 218 | echo "\n\t\t</p>";
echo "\n\t</td>";
|
---|
[45] | 219 |
|
---|
[43] | 220 | echo "\n</tr>";
|
---|
[26] | 221 | // +++ >bestehtAusRechtsverhaeltnissenZu> namensnummer ??
|
---|
| 222 | // z.B. eine Namennummer "Erbengemeinschaft" zeigt auf Namensnummern mit EigentÃŒmern
|
---|
| 223 | $i++;
|
---|
[60] | 224 | }
|
---|
[26] | 225 | echo "</table>";
|
---|
| 226 | if ($i == 0) {echo "\n<p class='err'>Kein Grundbuch.</p>\n";}
|
---|
| 227 | } else {
|
---|
| 228 | 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";
|
---|
| 229 | }
|
---|
[41] | 230 | ?>
|
---|
[26] | 231 |
|
---|
| 232 | <form action=''>
|
---|
| 233 | <div class='buttonbereich noprint'><hr>
|
---|
| 234 | <input type='button' name='back' value='<<' title='Zurück' onClick='javascript:history.back()'>
|
---|
| 235 | <input type='button' name='print' value='Druck' title='Seite Drucken' onClick='window.print()'>
|
---|
| 236 | <input type='button' name='close' value='X' title='Fenster schließen' onClick='window.close()'>
|
---|
| 237 | </div>
|
---|
| 238 | </form>
|
---|
| 239 |
|
---|
| 240 | <?php footer($gmlid, $_SERVER['PHP_SELF']."?", ""); ?>
|
---|
| 241 |
|
---|
[129] | 242 | </body>
|
---|
[26] | 243 | </html> |
---|