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