1 | <?php
|
---|
2 | /* Modul: alkisnamstruk.php
|
---|
3 |
|
---|
4 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo).
|
---|
5 | Namens- und Adressdaten fuer einen Eigentuemer aus ALKIS PostNAS
|
---|
6 |
|
---|
7 | Version:
|
---|
8 | 02.11.2011 $sqla, $sqlg, Meldungen mit $debug steuern |
---|
9 | 17.11.2011 Parameter der Functions geÀndert |
---|
10 | 30.11.2011 import_request_variables |
---|
11 | |
---|
12 | ToDo:
|
---|
13 | Sortierung der GrundbÃŒcher zum Namen
|
---|
14 | */
|
---|
15 | session_start(); |
---|
16 | import_request_variables("G");
|
---|
17 | require_once("alkis_conf_location.php");
|
---|
18 | if ($auth == "mapbender") {require_once($mapbender);}
|
---|
19 | include("alkisfkt.php");
|
---|
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 | |
---|
24 | ?>
|
---|
25 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|
26 | <html>
|
---|
27 | <head>
|
---|
28 | <meta name="author" content="b600352" >
|
---|
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>
|
---|
34 | <link rel="stylesheet" type="text/css" href="alkisauszug.css">
|
---|
35 | <link rel="shortcut icon" type="image/x-icon" href="ico/Eigentuemer_2.ico">
|
---|
36 | <style type='text/css' media='print'>
|
---|
37 | .noprint {visibility: hidden;}
|
---|
38 | </style>
|
---|
39 | </head>
|
---|
40 | <body>
|
---|
41 | <?php
|
---|
42 | $con = pg_connect("host=".$dbhost." port=".$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass);
|
---|
43 | // Balken
|
---|
44 | echo "<p class='nakennz'>ALKIS Name id=".$gmlid." </p>\n";
|
---|
45 |
|
---|
46 | echo "\n<h2><img src='ico/Eigentuemer.ico' width='16' height='16' alt=''> Person</h2>\n";
|
---|
47 | if (!$con) "\n<p class='err'>Fehler beim Verbinden der DB</p>\n";
|
---|
48 |
|
---|
49 | $sql="SELECT nachnameoderfirma, anrede, vorname, geburtsname, geburtsdatum, namensbestandteil, akademischergrad ";
|
---|
50 | $sql.="FROM ax_person WHERE gml_id= $1;";
|
---|
51 |
|
---|
52 | $v = array($gmlid);
|
---|
53 | $res = pg_prepare("", $sql);
|
---|
54 | $res = pg_execute("", $v);
|
---|
55 |
|
---|
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"];
|
---|
64 |
|
---|
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";
|
---|
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";
|
---|
73 | echo "\n</table>\n<hr>\n";
|
---|
74 |
|
---|
75 | // A d r e s s e
|
---|
76 | echo "\n<h3><img src='ico/Strasse_mit_Haus.ico' width='16' height='16' alt=''> Adresse</h3>\n";
|
---|
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 ?;";
|
---|
82 |
|
---|
83 | $v = array($gmlid);
|
---|
84 | $resa = pg_prepare("", $sqla);
|
---|
85 | $resa = pg_execute("", $v);
|
---|
86 |
|
---|
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 | |
---|
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++;
|
---|
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>";
|
---|
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 ***
|
---|
123 | echo "\n<hr>\n<h3><img src='ico/Grundbuch_zu.ico' width='16' height='16' alt=''> Grundbücher</h3>\n";
|
---|
124 | // person <benennt< namensnummer >istBestandteilVon> Buchungsblatt
|
---|
125 | // >bestehtAusRechtsverhaeltnissenZu> namensnummer (Nebenzweig/SonderfÀlle?)
|
---|
126 |
|
---|
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 | |
---|
140 | $v = array($gmlid);
|
---|
141 | $resg = pg_prepare("", $sqlg);
|
---|
142 | $resg = pg_execute("", $v);
|
---|
143 |
|
---|
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 | }
|
---|
150 | $j=0;
|
---|
151 | echo "<table class='eig'>";
|
---|
152 | echo "\n<tr>";
|
---|
153 | echo "\n\t<td class='head'>Bezirk</td>";
|
---|
154 | echo "\n\t<td class='head'>Blattart</td>";
|
---|
155 | echo "\n\t<td class='head'>Blatt</td>";
|
---|
156 | echo "\n\t<td class='head'>Namensnummer</td>";
|
---|
157 | echo "\n\t<td class='head'>Anteil</td>";
|
---|
158 | echo "\n\t<td class='head nwlink noprint' title='Link: weitere Auskunft'>weit. Auskunft</td>";
|
---|
159 | echo "\n</tr>";
|
---|
160 |
|
---|
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"];
|
---|
166 | $blattkey=$rowg["blattart"];
|
---|
167 | $blattart=blattart($blattkey);
|
---|
168 |
|
---|
169 | echo "\n<tr>";
|
---|
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"];
|
---|
176 | echo "</td>";
|
---|
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>";
|
---|
187 | if ($idanzeige) {
|
---|
188 | linkgml($gkz, $gmlg, "Grundbuchblatt");
}
|
---|
189 | echo "</td>";
|
---|
190 |
|
---|
191 | echo "\n\t<td class='gbl'>"; // Namensnummer
|
---|
192 | If ($namnum == "") {
|
---|
193 | echo " ";
|
---|
194 | } else {
|
---|
195 | echo $namnum;
|
---|
196 | }
|
---|
197 | if ($idanzeige) {
|
---|
198 | linkgml($gkz, $gmln, "Namensnummer");
|
---|
199 | }
|
---|
200 | echo "</td>";
|
---|
201 |
|
---|
202 | echo "\n\t<td class='gbl'>"; // Anteil
|
---|
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'>";
|
---|
211 | echo "\n\t\t<p class='nwlink noprint'>";
|
---|
212 | echo "\n\t\t\t<a href='alkisbestnw.php?gkz=".$gkz."&gmlid=".$gmlg;
|
---|
213 | if ($idanzeige) {echo "&id=j";}
|
---|
214 | if ($showkey) {echo "&showkey=j";}
|
---|
215 | echo "' title='Bestandsnachweis'>";
|
---|
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>";
|
---|
219 |
|
---|
220 | echo "\n</tr>";
|
---|
221 | // +++ >bestehtAusRechtsverhaeltnissenZu> namensnummer ??
|
---|
222 | // z.B. eine Namennummer "Erbengemeinschaft" zeigt auf Namensnummern mit EigentÃŒmern
|
---|
223 | $i++;
|
---|
224 | }
|
---|
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 | }
|
---|
230 | ?>
|
---|
231 |
|
---|
232 | <form action=''>
|
---|
233 | <div class='buttonbereich noprint'>
|
---|
234 | <hr> |
---|
235 | <a title="zurück" href='javascript:history.back()'><img src="ico/zurueck.ico" width="16" height="16" alt="zurück" /></a> |
---|
236 | <a title="Drucken" href='javascript:window.print()'><img src="ico/print.ico" width="16" height="16" alt="Drucken" /></a> |
---|
237 | <!-- <a title="Export als CSV" href='javascript:ALKISexport()'><img src="ico/download.ico" width="16" height="16" alt="Export" /></a> |
---|
238 | <a title="Seite schließen" href="javascript:window.close()"><img src="ico/close.ico" width="16" height="16" alt="Ende" /></a> --> |
---|
239 | </div>
|
---|
240 | </form>
|
---|
241 |
|
---|
242 | <?php footer($gmlid, $_SERVER['PHP_SELF']."?", ""); ?>
|
---|
243 |
|
---|
244 | </body>
|
---|
245 | </html> |
---|