Ignore:
Timestamp:
06/24/21 15:59:16 (3 years ago)
Author:
frank.jaeger
Message:

Aktualisierungen der ALKIS-Buchauskunft, neues Modul für Bauwerke, Härtung

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/info/info/alkisn/alkisnamstruk.php

    r412 r422  
    77        Version: 
    88        2016-02-24 Version fuer norGIS-ALKIS-Import 
    9         2016-11-29 HTML5, Gemeinsam genutzte Datenbanken ermöglichen 
    10         2017-06-02 Validierung Eingabeparameter, Feinkorrekturen 
    11         2017-10-09 Sauber filtern auf endet IS NULL 
    12         2017-10-17 Deutsches Datumsformat im Geburtsdatum 
    13         2017-12-20 Anlass und Datum zur Adresse ausgeben, wenn es mehrere gibt oder SchlÃŒssel angefordert werden 
    14         2018-04-23 &nodebug 
    15         2018-11-09 Umstellung Full-Schema 
     9        ... 
     10        2020-02-20 Authentifizierung ausgelagert in Function darf_ich() 
     11        2020-12-03 function selbstverlinkung() statt $_SERVER['PHP_SELF'] 
     12        2020-12-15 Input-Validation und Strict Comparisation (===) 
    1613*/ 
     14ini_set("session.cookie_httponly", 1); 
    1715session_start(); 
    1816$multiadress="n"; $showkey="n"; $nodebug=""; // Var. aus Parameter initalisieren 
     
    2018 
    2119// strikte Validierung aller Parameter 
    22 if (!isset($gmlid) or !preg_match('#^[0-9A-Za-z]{16}$#', $gmlid)) {die("Eingabefehler gmlid");} 
    23 if (!isset($gkz) or !preg_match('#^[0-9]{3}$#', $gkz)) {die("Eingabefehler gkz");} 
     20if (isset($gmlid)) { 
     21        if (!preg_match('#^[0-9A-Za-z]{16}$#', $gmlid)) {die("Eingabefehler gmlid");} 
     22} else { 
     23        die("Fehlender Parameter"); 
     24} 
     25if (isset($gkz)) { 
     26        if (!preg_match('#^[0-9]{3}$#', $gkz)) {die("Eingabefehler gkz");} 
     27} else { 
     28        die("Fehlender Parameter"); 
     29} 
    2430if (!preg_match('#^[j|n]{0,1}$#', $showkey)) {die ("Eingabefehler showkey");} 
    25 if ($showkey == "j") {$showkey=true;} else {$showkey=false;} 
     31if ($showkey === "j") {$showkey=true;} else {$showkey=false;} 
    2632if (!preg_match('#^[j|n]{0,1}$#', $multiadress)) {die ("Eingabefehler multiadress");} 
    2733if (!preg_match('#^j{0,1}$#', $nodebug)) {die("Eingabefehler nodebug");} 
    2834 
    2935require_once("alkis_conf_location.php"); 
    30 if ($auth == "mapbender") {require_once($mapbender);} 
    3136include("alkisfkt.php"); 
    32  
    3337?> 
    3438<!doctype html> 
     
    4751</head> 
    4852<body> 
    49  
    5053<?php 
     54$erlaubnis = darf_ich(); if ($erlaubnis === 0) { die('<p class="stop1">Abbruch</p></body>'); } 
     55 
    5156// Mit URL-Parameter "&nodebug=j" kann man die Entwicklungsumgebung (in Conf definiert) ausschalten. 
    5257// Manuell an die URL anfÃŒgen, wirkt nur temporÀr und wird nicht in Links weiter gereicht. 
    53 if ($nodebug == "j") {$debug=0;}  
    54  
    55 echo "<p class='nakennz'>ALKIS Name id=".$gmlid."&nbsp;</p>\n" // Balken 
     58if ($nodebug === "j") {$debug=0;}  
     59 
     60echo "<p class='balken nakennz'>ALKIS Name id=".$gmlid."&nbsp;</p>\n" // Balken 
    5661."\n<h2><img src='ico/Eigentuemer.png' width='16' height='16' alt=''> Person</h2>"; 
    5762$con = pg_connect($dbconn." options='--application_name=ALKIS-Auskunft_alkisnamstruk.php'"); 
     
    6873if (!$res) { 
    6974        echo "\n<p class='err'>Fehler bei Zugriff auf Namensnummer</p>"; 
    70         if ($debug > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities($sql, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>";} 
     75        if ($debug > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";} 
    7176} 
    7277if ($row = pg_fetch_assoc($res)) { 
     
    9297 
    9398        // A d r e s s e 
    94         if ($multiadress == "j") {$plural="n";} else {$plural="";} 
     99        if ($multiadress === "j") {$plural="n";} else {$plural="";} 
    95100        echo "\n\n<h3><img src='ico/Strasse_mit_Haus.png' width='16' height='16' alt=''> Adresse".$plural."</h3>"; 
    96101        // Es können redundante Adressen vorhanden sein, z.B. aus Migration, temporÀr aus LBESAS. 
     
    106111        if (!$resa) { 
    107112                echo "\n<p class='err'>Fehler bei Adressen</p>"; 
    108                 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".$sqla."<br>$1=gml(Person)= '".$gmlid."'</p>";} 
     113                if ($debug > 2) {echo "\n<p class='err'>SQL=<br>". str_replace("$1", "'".$gmlid."'", $sqla)."</p>";} 
    109114        } 
    110115 
     
    113118        while($rowa = pg_fetch_assoc($resa)) { 
    114119                $j++; 
    115                 if ($multiadress == "j" OR $j == 1) { 
     120                if ($multiadress === "j" OR $j === 1) { 
    116121                        $gmla=$rowa["gml_id"]; 
    117122                        $plz=$rowa["plz"]; 
     
    124129                        $datum=$rowa["datum"]; 
    125130                        echo "<table>\n"; 
    126                                 if ($multiadress == "j" OR $showkey) { 
     131                                if ($multiadress === "j" OR $showkey) { 
    127132                                        if ($debug > 0) { // nur Entw.: Sortierung gml_id vs. beginnt? 
    128133                                                echo "\t<tr><td class='dbg'>gml_id:</td><td class='dbg'>".$rowa["gml_id"]."</td></tr>\n"; 
     
    148153        } 
    149154        pg_free_result($resa); 
    150         if ($j == 0) { 
     155        if ($j === 0) { 
    151156                echo "\n<p class='err'>Keine Adressen.</p>"; 
    152157        } elseif ($j > 1) { 
    153158                echo "\n\t\t<p class='nwlink noprint'>" 
    154                 ."\n\t\t\t<a href='".$_SERVER['PHP_SELF']. "?gkz=".$gkz."&amp;gmlid=".$gmlid; 
     159                ."\n\t\t\t<a href='".selbstverlinkung(). "?gkz=".$gkz."&amp;gmlid=".$gmlid; 
    155160                if ($showkey) {echo "&amp;showkey=j";} 
    156                 if ($multiadress == "j") { 
     161                if ($multiadress === "j") { 
    157162                        echo "&amp;multiadress=n' title='mehrfache Adressen unterdr&uuml;cken'>erste Adresse "; 
    158163                } else { 
     
    183188                echo "\n<p class='err'>Fehler bei Grundbuch</p>"; 
    184189                if ($debug > 2) { 
    185                         echo "\n<p class='err'>SQL=<br>".htmlentities($sqlg, ENT_QUOTES, "UTF-8")."<br>$1 = gml_id = '".$gmlid."'</p>"; 
     190                        echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sqlg ), ENT_QUOTES, "UTF-8")."</p>"; 
    186191                } 
    187192        } 
     
    231236 
    232237                        echo "\n\t<td>"; // Anteil 
    233                                 if ($zae == "") { 
     238                                if ($zae == '') { 
    234239                                        echo "&nbsp;"; 
    235240                                } else { 
     
    252257        pg_free_result($resg); 
    253258        echo "</table>"; 
    254         if ($i == 0) {echo "\n<p class='err'>Kein Grundbuch.</p>";} 
     259        if ($i === 0) {echo "\n<p class='err'>Kein Grundbuch.</p>";} 
    255260} else { 
    256261        echo "\n\t<p class='err'>Fehler! Kein Treffer f&uuml;r\n\t<a target='_blank' href='alkisrelationen.php?gkz=".$gkz."&amp;gmlid=".$gmlid."'>".$gmlid."</a>\n</p>\n\n"; 
     
    265270</div> 
    266271 
    267 <?php footer($gmlid, $_SERVER['PHP_SELF']."?", ""); ?> 
     272<?php footer($gmlid, selbstverlinkung()."?", ""); ?> 
    268273 
    269274</body> 
Note: See TracChangeset for help on using the changeset viewer.