Changeset 387 for trunk/info/info/alkisn/alkislage.php
- Timestamp:
- 06/08/17 16:15:04 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/info/info/alkisn/alkislage.php
r377 r387 9 9 2016-03-14 Korrekturen 10 10 2016-11-29 HTML5, Gemeinsam genutzte Datenbanken ermöglichen 11 2017-06-08 Validierung Eingabeparameter, gestreifte Tabelle, Feinkorrekturen 11 12 12 13 ToDo: 13 14 - Balken-Kennzeichen kompatibel machen mit der Eingabe der Navigation fÃŒr Adresse 14 15 - das Modul "alkisgebaeudenw" (alle Geb. auf einem FS) verschneidet die FlÀchen und findet damit auch 15 16 16 Grenz-Uberbauungen und angrenzende GebÀude. Diese fehlen hier, weil nur VerknÃŒpfungen verarbeitet werden. 17 Mit FlÀchen-Verschneidung auch weitere FS anzeigen? 17 18 */ 18 19 session_start(); 19 $id="n"; 20 $cntget = extract($_GET); 20 21 $showkey="n"; // Var. aus Parameter initalisieren 22 $cntget = extract($_GET); // Parameter in Variable umwandeln 23 24 // strikte Validierung aller Parameter 25 if (!isset($gmlid) or !preg_match('#^[0-9A-Za-z]{16}$#', $gmlid)) {die("Eingabefehler gmlid");} 26 if (!isset($gkz) or !preg_match('#^[0-9]{3}$#', $gkz)) {die("Eingabefehler gkz");} 27 if (!preg_match('#^[j|n]{0,1}$#', $showkey)) {die ("Eingabefehler showkey");} 28 if ($showkey == "j") {$showkey=true;} else {$showkey=false;} 29 if (!preg_match('#^[m|p|o]{1}$#', $ltyp)) {die ("Eingabefehler ltyp");} 30 21 31 require_once("alkis_conf_location.php"); 22 32 if ($auth == "mapbender") {require_once($mapbender);} … … 34 44 $tnam = "ax_lagebezeichnungmithausnummer"; break; 35 45 } 36 37 $keys = isset($_GET["showkey"]) ? $_GET["showkey"] : "n";38 if ($keys == "j") {$showkey=true;} else {$showkey=false;}39 46 ?> 40 47 <!doctype html> … … 42 49 <head> 43 50 <meta charset="utf-8"> 51 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 44 52 <title>ALKIS Lagebezeichnung</title> 45 53 <link rel="stylesheet" type="text/css" href="alkisauszug.css"> 46 54 <link rel="shortcut icon" type="image/x-icon" href="ico/Lage_mit_Haus.ico"> 47 <style type='text/css' media='print'>48 .noprint {visibility: hidden;}49 </style>50 55 </head> 51 56 <body> 52 57 <?php 53 58 $con = pg_connect($dbconn." options='--application_name=ALKIS-Auskunft_alkislage.php'"); 54 if (!$con) echo " <p class='err'>Fehler beim Verbinden der DB</p>\n";59 if (!$con) echo "\n<p class='err'>Fehler beim Verbinden der DB</p>"; 55 60 56 61 // L a g e b e z e i c h n u n g … … 80 85 $res = pg_execute("", $v); 81 86 if (!$res) { 82 echo "\n<p class='err'>Fehler bei Lagebezeichnung.</p> \n";83 if ($debug > 2) {echo " <p class='err'>SQL=<br>".$sql."<br>$1 = gml_id = '".$gmlid."'</p>";}87 echo "\n<p class='err'>Fehler bei Lagebezeichnung.</p>"; 88 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>";} 84 89 } 85 90 … … 104 109 $kennz.=$hsnr; 105 110 $untertitel="Hauptgebäude mit Hausnummer"; 106 // Balken 107 echo "<p class='lage'>ALKIS Lagebezeichnung mit Hausnummer ".$kennz." </p>\n"; // Balken 111 echo "\n<p class='lage'>ALKIS Lagebezeichnung mit Hausnummer ".$kennz." </p>"; // Balken 108 112 $osub=""; 109 113 break; … … 113 117 $kennz.=$pseu."-".$lfd; 114 118 $untertitel="NebengebÀude mit laufender Nummer (Lagebezeichnung mit Pseudonummer)"; 115 echo " <p class='lage'>ALKIS Lagebezeichnung NebengebÀude ".$kennz." </p>\n"; // Balken119 echo "\n<p class='lage'>ALKIS Lagebezeichnung NebengebÀude ".$kennz." </p>"; // Balken 116 120 $osub=""; 117 121 break; … … 123 127 $kennz=" - ".$unver; 124 128 $untertitel="Gewanne (unverschlüsselte Lage)"; 125 echo " <p class='lage'>ALKIS Lagebezeichnung Ohne Hausnummer ".$kennz." </p>\n"; // Balken129 echo "\n<p class='lage'>ALKIS Lagebezeichnung Ohne Hausnummer ".$kennz." </p>"; // Balken 126 130 } else { 127 131 $osub="s"; // Sub-Typ Strasse (ohne HsNr) 128 132 $kennz.=$unver; 129 133 $untertitel="Straße ohne Hausnummer"; 130 echo " <p class='lage'>ALKIS Lagebezeichnung Ohne Hausnummer ".$kennz." </p>\n"; // Balken134 echo "\n<p class='lage'>ALKIS Lagebezeichnung Ohne Hausnummer ".$kennz." </p>"; // Balken 131 135 } 132 136 break; 133 137 } 134 138 } else { 135 echo " <p class='err'>Fehler! Kein Treffer fuer Lagebezeichnung mit gml_id='".$gmlid."'</p>";139 echo "\n<p class='err'>Fehler! Kein Treffer fuer Lagebezeichnung mit gml_id='".$gmlid."'</p>"; 136 140 if ($debug > 2) { 137 echo " <p class='err'>SQL=<br>".$sql."<br>$1 = gml_id = '".$gmlid."'</p>";138 } 139 echo " </body></html>";141 echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>"; 142 } 143 echo "\n</body>\n</html>"; 140 144 exit; 141 145 } 142 146 143 echo "\n<h2><img src='ico/Lage_mit_Haus.png' width='16' height='16' alt='HAUS'> Lagebezeichnung</h2>\n"; 144 145 echo "<p>Typ: ".$untertitel."</p>"; 147 echo "\n<h2><img src='ico/Lage_mit_Haus.png' width='16' height='16' alt='HAUS'> Lagebezeichnung</h2>\n" 148 ."<p>Typ: ".$untertitel."</p>"; 146 149 147 150 echo "\n<table class='outer'>\n<tr>\n\t<td>"; // Tab. Kennz. 148 151 // ToDo: !! kleiner, wenn ltyp=0 und die Schluesselfelder leer sind 149 echo "\n\t <table class='kennzla' title='Lage'>"150 ."\n\t <tr>";152 echo "\n\t\t<table class='kennzla' title='Lage'>" 153 ."\n\t\t<tr>"; 151 154 if ($osub != "g") { // nicht bei Gewanne 152 echo "\n\t\t <td class='head'>Land</td>"153 ."\n\t\t <td class='head'>Reg.-Bez.</td>"154 ."\n\t\t <td class='head'>Kreis</td>"155 ."\n\t\t <td class='head'>Gemeinde</td>"156 ."\n\t\t <td class='head'>Straße</td>";155 echo "\n\t\t\t<td class='head'>Land</td>" 156 ."\n\t\t\t<td class='head'>Reg.-Bez.</td>" 157 ."\n\t\t\t<td class='head'>Kreis</td>" 158 ."\n\t\t\t<td class='head'>Gemeinde</td>" 159 ."\n\t\t\t<td class='head'>Straße</td>"; 157 160 } 158 161 switch ($ltyp) { 159 162 case "m": // "Mit HsNr" 160 echo "\n\t\t <td class='head'>Haus-Nr</td>";163 echo "\n\t\t\t<td class='head'>Haus-Nr</td>"; 161 164 break; 162 165 case "p": // "mit PseudoNr" 163 echo "\n\t\t <td class='head'>Haus-Nr</td>"164 ."\n\t\t <td class='head'>lfd.-Nr</td>";166 echo "\n\t\t\t<td class='head'>Haus-Nr</td>" 167 ."\n\t\t\t<td class='head'>lfd.-Nr</td>"; 165 168 break; 166 169 case "o": //"Ohne HsNr" 167 170 if ($osub == "g") { 168 echo "\n\t\t <td class='head'>unverschlüsselte Lage</td>";171 echo "\n\t\t\t<td class='head'>unverschlüsselte Lage</td>"; 169 172 } 170 173 break; 171 174 } 172 echo "\n\t </tr>\n\t<tr>";175 echo "\n\t\t</tr>\n\t\t<tr>"; 173 176 if ($osub != "g") { // nicht bei Gewanne 174 177 175 echo "\n\t\t <td title='Bundesland'>";178 echo "\n\t\t\t<td title='Bundesland'>"; 176 179 if ($showkey) {echo "<span class='key'>".$land."</span><br>";} 177 180 echo $bnam." </td>"; 178 181 179 echo "\n\t\t <td title='Regierungsbezirk'>";182 echo "\n\t\t\t<td title='Regierungsbezirk'>"; 180 183 if ($showkey) {echo "<span class='key'>".$regbez."</span><br>";} 181 184 echo $rnam." </td>"; 182 185 183 echo "\n\t\t <td title='Kreis'>";186 echo "\n\t\t\t<td title='Kreis'>"; 184 187 if ($showkey and $osub != "g") {echo "<span class='key'>".$kreis."</span><br>";} 185 188 echo $knam." </td>"; 186 189 187 echo "\n\t\t <td title='Gemeinde'>";190 echo "\n\t\t\t<td title='Gemeinde'>"; 188 191 if ($showkey and $osub != "g") {echo "<span class='key'>".$gem."</span><br>";} 189 192 echo $gnam." </td>"; 190 193 191 echo "\n\t\t <td title='Straße'>";194 echo "\n\t\t\t<td title='Straße'>"; 192 195 if ($showkey and $osub != "g") {echo "<span class='key'>".$lage."</span><br>";} 193 196 if ($ltyp == "o") { … … 201 204 switch ($ltyp) { 202 205 case "m": 203 echo "\n\t\t <td title='Hausnummer und Zusatz'><span class='wichtig'>".$hsnr."</span></td>";206 echo "\n\t\t\t<td title='Hausnummer und Zusatz'><span class='wichtig'>".$hsnr."</span></td>"; 204 207 break; 205 208 case "p": 206 echo "\n\t\t <td title='Pseudonummer - Nebengebäude zu dieser Hausnummer'>".$pseu."</td>"207 ."\n\t\t <td title='Laufende Nummer Nebengebäude'><span class='wichtig'>".$lfd."</span></td>";209 echo "\n\t\t\t<td title='Pseudonummer - Nebengebäude zu dieser Hausnummer'>".$pseu."</td>" 210 ."\n\t\t\t<td title='Laufende Nummer Nebengebäude'><span class='wichtig'>".$lfd."</span></td>"; 208 211 break; 209 212 case "o": 210 213 if ($osub == "g") { 211 echo "\n\t\t <td title='Gewanne'><span class='wichtig'>".$unver."</span></td>";214 echo "\n\t\t\t<td title='Gewanne'><span class='wichtig'>".$unver."</span></td>"; 212 215 } 213 216 break; 214 217 } 215 echo "\n\t </tr>"216 ."\n\t </table>";218 echo "\n\t\t</tr>" 219 ."\n\t\t</table>"; 217 220 218 221 echo "\n\t</td>\n\t<td>"; … … 221 224 if ($osub != "g") { // Link zu Strasse 222 225 echo "\n\t\t<p class='nwlink noprint'>" 223 ."\n\t\t <a href='alkisstrasse.php?gkz=".$gkz."&gmlid=".$strgml;226 ."\n\t\t\t<a href='alkisstrasse.php?gkz=".$gkz."&gmlid=".$strgml; 224 227 if ($showkey) {echo "&showkey=j";} 225 228 echo "' title='Straße'>Straße <img src='ico/Strassen.png' width='16' height='16' alt=''></a>" … … 235 238 // ++ auch FlÀchenverschneidung? 236 239 if ($ltyp <> "p") { // Pseudonummer linkt nur GebÀude 237 echo "\n\n<a id='fs'></a> <h3><img src='ico/Flurstueck.png' width='16' height='16' alt=''> Flurstücke</h3>\n"240 echo "\n\n<a id='fs'></a>\n<h3><img src='ico/Flurstueck.png' width='16' height='16' alt=''> Flurstücke</h3>" 238 241 ."\n<p>mit dieser Lagebezeichnung.</p>"; 239 242 switch ($ltyp) { … … 251 254 $resf = pg_execute("", $v); 252 255 if (!$resf) { 253 echo " <p class='err'>Fehler bei Flurstück.</p>\n";254 if ($debug > 2) {echo " <p class='err'>SQL=<br>".$sql."<br>$1 = gml_id = '".$gmlid."'</p>";}256 echo "\n<p class='err'>Fehler bei Flurstück.</p>"; 257 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>";} 255 258 } 256 259 echo "\n<table class='fs'>" … … 260 263 ."\n\t<td class='heads fsnr' title='Flurstücksnummer (Zähler / Nenner)'><img src='ico/sort.png' width='10' height='10' alt='' title='Sortierung'>Flurst.</td>" 261 264 ."\n\t<td class='head fla'>Fläche</td>" 262 ."\n\t<td class='head nwlink noprint' title=' Link: weitere Auskunft'>weit.Auskunft</td>"265 ."\n\t<td class='head nwlink noprint' title='Verlinkung zu anderen Nachweis-Arten und verbundenen Objekten'>weitere Auskunft</td>" 263 266 ."\n</tr>"; 264 267 $j=0; 268 $zpaar=false; 265 269 while($rowf = pg_fetch_array($resf)) { 266 270 $flur=str_pad($rowf["flurnummer"], 3, "0", STR_PAD_LEFT); … … 268 272 if ($rowf["nenner"] != "") {$fskenn.="/".$rowf["nenner"];} 269 273 $flae=number_format($rowf["amtlicheflaeche"],0,",",".") . " m²"; 270 echo "\n<tr>" 274 275 if ($zpaar) {$trclass='paa';} else {$trclass='unp';} 276 $zpaar=!$zpaar; 277 278 echo "\n<tr class='".$trclass."'>" 271 279 ."\n\t<td>"; 272 280 if ($showkey) {echo "<span class='key'>".$rowf["gemarkungsnummer"]."</span> ";} … … 276 284 ."\n\t<td class='fla'>".$flae."</td>" 277 285 ."\n\t<td>\n\t\t<p class='nwlink noprint'>" 278 ."\n\t\t <a href='alkisfsnw.php?gkz=".$gkz."&gmlid=".$rowf["gml_id"]."&eig=n";286 ."\n\t\t\t<a href='alkisfsnw.php?gkz=".$gkz."&gmlid=".$rowf["gml_id"]."&eig=n"; 279 287 if ($showkey) {echo "&showkey=j";} 280 288 echo "' title='Flurstücksnachweis'>Flurstück <img src='ico/Flurstueck_Link.png' width='16' height='16' alt=''></a>" … … 290 298 // andere Lage mit gleicher Hausnummer suchen 291 299 if ($ltyp <> "o") { // nicht bei Gewanne (Ohne HsNr) 292 echo "\n\n<a id='lage'></a> <h3><img src='ico/Lage_mit_Haus.png' width='16' height='16' alt=''> Lage</h3>\n"293 ."\n<p> andere Lagebezeichnungen zur gleichen Hausnummer.</p>";300 echo "\n\n<a id='lage'></a>\n<h3><img src='ico/Lage_mit_Haus.png' width='16' height='16' alt=''> Lage</h3>" 301 ."\n<p>Andere Lagebezeichnungen zur gleichen Hausnummer.</p>"; 294 302 $whereclaus="WHERE land= $1 AND regierungsbezirk= $2 AND kreis= $3 AND gemeinde= $4 AND lage= $5 "; 295 303 296 $url=$_SERVER['PHP_SELF']."?gkz=".$gkz ."&id=".$id; // Basis297 if ($showkey) 304 $url=$_SERVER['PHP_SELF']."?gkz=".$gkz; // Basis 305 if ($showkey) {$url.="&showkey=j";} 298 306 $url.="&gmlid="; 299 307 300 308 switch ($ltyp) { 301 case "m": // aktuell: Hausnummer gefunden 309 case "m": // aktuell: Hausnummer gefunden (HauptgebÀude) 302 310 // dazu alle NebengebÀude suchen 303 311 echo "\n<p>Nebengebäude: "; … … 309 317 $res = pg_execute("", $v); 310 318 if (!$res) { 311 echo "\n<p class='err'>Fehler bei Nebengebäude.<br>".$sql."</p> \n";312 if ($debug > 2) {echo " <p class='err'>SQL=<br>".$sql."</p>";}319 echo "\n<p class='err'>Fehler bei Nebengebäude.<br>".$sql."</p>"; 320 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."</p>";} 313 321 } 314 322 $neb=0; … … 321 329 break; 322 330 323 case "p": // aktuell NebengebÀude: Haupt- und NebengebÀude suchen331 case "p": // aktuell NebengebÀude: Haupt- und (andere) NebengebÀude suchen 324 332 echo "\n<p>Hauptgebäude: "; 325 $sql ="SELECT l.gml_id FROM ax_lagebezeichnungmithausnummer l "; 326 $sql.=$whereclaus."AND hausnummer= $6 AND l.endet IS NULL ;"; 333 $sql ="SELECT l.gml_id FROM ax_lagebezeichnungmithausnummer l ".$whereclaus."AND hausnummer= $6 AND l.endet IS NULL ;"; 327 334 328 335 $v = array($land,$regbez,$kreis,$gem,$lage,$pseu); … … 330 337 $res = pg_execute("", $v); 331 338 332 if (!$res) {echo " <p class='err'>Fehler bei Hauptgebäude.<br>".$sql."</p>\n";}339 if (!$res) {echo "\n<p class='err'>Fehler bei Hauptgebäude.<br>".$sql."</p>";} 333 340 $hg=0; 334 341 while($row = pg_fetch_array($res)) { … … 346 353 $res = pg_execute("", $v); 347 354 if (!$res) { 348 echo "\n<p class='err'>Fehler bei Nebengebäude.</p> \n";349 if ($debug > 2) {echo " <p class='err'>SQL=<br>".$sql."</p>";}355 echo "\n<p class='err'>Fehler bei Nebengebäude.</p>"; 356 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."</p>";} 350 357 } 351 358 $neb=0; … … 362 369 // G E B A E U D E 363 370 if ($ltyp <> "o") { // OhneHsNr linkt nur Flurst. 364 echo "\n\n<a id='geb'></a> <h3><img src='ico/Haus.png' width='16' height='16' alt=''> Gebäude</h3>"371 echo "\n\n<a id='geb'></a>\n<h3><img src='ico/Haus.png' width='16' height='16' alt=''> Gebäude</h3>" 365 372 ."\n<p>mit dieser Lagebezeichnung.</p>"; 366 373 switch ($ltyp) { … … 382 389 $res = pg_execute("", $v); 383 390 if (!$res) { 384 echo " <p class='err'>Fehler bei Gebäude.</p>\n";385 if ($debug > 2) {echo " <p class='err'>SQL=<br>".$sql."<br>$1 = gml_id = '".$gmlid."'</p>";}391 echo "\n<p class='err'>Fehler bei Gebäude.</p>"; 392 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>";} 386 393 } 387 394 echo "\n<table class='geb'>" … … 398 405 $ggml=$row["gml_id"]; 399 406 $gfla=$row["flaeche"]; 400 echo "\n \t<tr>"401 ." <td>".$row["name"]."</td>"402 ." <td class='fla'>".$gfla." m²</td>";403 404 echo " <td title='".$row["ud"]."'>";405 if ($showkey) {echo "<span class='key'>". $row["gebaeudefunktion"]."</span> ";}407 echo "\n<tr>" 408 ."\n\t<td>".$row["name"]."</td>" 409 ."\n\t<td class='fla'>".$gfla." m²</td>"; 410 411 echo "\n\t<td title='".htmlentities($row["ud"], ENT_QUOTES, "UTF-8")."'>"; 412 if ($showkey) {echo "<span class='key'>".htmlentities($row["gebaeudefunktion"], ENT_QUOTES, "UTF-8")."</span> ";} 406 413 echo $row["uv"]."</td>"; 407 414 408 echo " <td title='".$row["hd"]."'>";409 if ($showkey) {echo "<span class='key'>". $row["bauweise"]."</span> ";}415 echo "\n\t<td title='".htmlentities($row["hd"], ENT_QUOTES, "UTF-8")."'>"; 416 if ($showkey) {echo "<span class='key'>".htmlentities($row["bauweise"], ENT_QUOTES, "UTF-8")."</span> ";} 410 417 echo $row["hv"]."</td>"; 411 418 412 echo " <td title='".$row["zd"]."'>";413 if ($showkey) {echo "<span class='key'>". $row["zustand"]."</span> ";}419 echo "\n\t<td title='".htmlentities($row["zd"] , ENT_QUOTES, "UTF-8")."'>"; 420 if ($showkey) {echo "<span class='key'>".htmlentities($row["zustand"], ENT_QUOTES, "UTF-8")."</span> ";} 414 421 echo $row["zv"]."</td>"; 415 422 416 423 echo "\n\t<td class='nwlink noprint'>" 417 ."<a title='komplette Hausdaten' href='alkishaus.php?gkz=".$gkz."&gmlid=".$ggml 418 ."'>Haus <img src='ico/Haus.png' width='16' height='16' alt=''></a>" 419 ."</td>" 420 ."</tr>"; 424 ."\n\t\t<a title='komplette Hausdaten' href='alkishaus.php?gkz=".$gkz."&gmlid=".$ggml; 425 if ($showkey) {echo "&showkey=j";} 426 echo "'>Haus <img src='ico/Haus.png' width='16' height='16' alt=''></a>" 427 ."\n\t</td>" 428 ."\n</tr>"; 421 429 } 422 430 echo "\n</table>"; 423 431 } 424 425 432 ?> 426 433 427 434 <div class='buttonbereich noprint'> 428 <hr>435 <hr> 429 436 <a title="zurück" href='javascript:history.back()'><img src="ico/zurueck.png" width="16" height="16" alt="zurück"></a> 430 437 <a title="Drucken" href='javascript:window.print()'><img src="ico/print.png" width="16" height="16" alt="Drucken"></a>
Note: See TracChangeset
for help on using the changeset viewer.