Ignore:
Timestamp:
12/30/21 17:49:00 (2 years ago)
Author:
frank.jaeger
Message:

Web-GIS-Auskunft und Mapbender2-Navigation: neue Konfigurations-Parameter und verbessertes Grundbuch-Modul

File:
1 edited

Legend:

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

    r422 r425  
    66 
    77        Version: 
    8         2016-02-24 Version fuer norGIS-ALKIS-Import 
     8        2016-02-24 Version fÃŒr norGIS-ALKIS-Import 
    99        ... 
    1010        2020-02-20 Authentifizierung ausgelagert in Function darf_ich() 
    1111        2020-12-03 function selbstverlinkung() statt $_SERVER['PHP_SELF'] 
    1212        2020-12-15 Input-Validation und Strict Comparisation (===) 
     13        2021-12-09 Neue Parameter: $katAmtMix (Kataster-Amt-Mix), $PrntBtn (Drucken-SchaltflÀche). Gruppenwechsel Bezirk. 
    1314*/ 
    1415ini_set("session.cookie_httponly", 1); 
     
    5354<?php 
    5455$erlaubnis = darf_ich(); if ($erlaubnis === 0) { die('<p class="stop1">Abbruch</p></body>'); } 
     56$dbg=$debug; // CONF in Arbeits-Variable 
    5557 
    5658// Mit URL-Parameter "&nodebug=j" kann man die Entwicklungsumgebung (in Conf definiert) ausschalten. 
    57 // Manuell an die URL anfÃŒgen, wirkt nur temporÀr und wird nicht in Links weiter gereicht. 
    58 if ($nodebug === "j") {$debug=0;}  
     59// Wirkt temporÀr und wird nicht in Links weiter gereicht. 
     60if ($nodebug === "j") {$dbg=0;}  
    5961 
    6062echo "<p class='balken nakennz'>ALKIS Name id=".$gmlid."&nbsp;</p>\n" // Balken 
     
    7375if (!$res) { 
    7476        echo "\n<p class='err'>Fehler bei Zugriff auf Namensnummer</p>"; 
    75         if ($debug > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";} 
     77        if ($dbg > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sql), ENT_QUOTES, "UTF-8")."</p>";} 
     78} 
     79if ($dbg > 0) { 
     80        $zeianz=pg_num_rows($res); 
     81        if ($zeianz > 1){ 
     82                echo "\n<p class='err'>Die Abfrage liefert mehr als eine Person!</p>"; 
     83                if ($dbg > 2) {echo "\n<p class='dbg'>SQL=<br>".htmlentities(str_replace("$1","'".$gmlid."'",$sql), ENT_QUOTES, "UTF-8")."</p>";} 
     84        } 
    7685} 
    7786if ($row = pg_fetch_assoc($res)) { 
     
    111120        if (!$resa) { 
    112121                echo "\n<p class='err'>Fehler bei Adressen</p>"; 
    113                 if ($debug > 2) {echo "\n<p class='err'>SQL=<br>". str_replace("$1", "'".$gmlid."'", $sqla)."</p>";} 
     122                if ($dbg > 2) {echo "\n<p class='err'>SQL=<br>". str_replace("$1", "'".$gmlid."'", $sqla)."</p>";} 
    114123        } 
    115124 
     
    130139                        echo "<table>\n"; 
    131140                                if ($multiadress === "j" OR $showkey) { 
    132                                         if ($debug > 0) { // nur Entw.: Sortierung gml_id vs. beginnt? 
     141                                        if ($dbg > 0) { // nur Entw.: Sortierung gml_id vs. beginnt? 
    133142                                                echo "\t<tr><td class='dbg'>gml_id:</td><td class='dbg'>".$rowa["gml_id"]."</td></tr>\n"; 
    134143                                        } 
     
    176185        ."FROM ax_person p JOIN ax_namensnummer n ON p.gml_id=n.benennt " 
    177186        ."JOIN ax_buchungsblatt g ON g.gml_id=n.istbestandteilvon " 
    178         ."LEFT JOIN ax_buchungsblattbezirk b ON g.land=b.land AND g.bezirk=b.bezirk " 
     187        ."LEFT JOIN ax_buchungsblattbezirk b ON g.land=b.land AND g.bezirk=b.bezirk ".UnqKatAmt("g","b") 
    179188        ."LEFT JOIN ax_blattart_buchungsblatt wb ON g.blattart = wb.wert " 
    180189        ."WHERE p.gml_id= $1 AND p.endet IS NULL AND n.endet IS NULL AND b.endet IS NULL " 
     
    187196        if (!$resg) { 
    188197                echo "\n<p class='err'>Fehler bei Grundbuch</p>"; 
    189                 if ($debug > 2) { 
     198                if ($dbg > 2) { 
    190199                        echo "\n<p class='err'>SQL=<br>".htmlentities(str_replace("$1", "'".$gmlid."'", $sqlg ), ENT_QUOTES, "UTF-8")."</p>"; 
    191200                } 
     
    203212        $i=0; 
    204213        $zpaar=false; 
     214        $gwbeznam=''; 
    205215        while($rowg = pg_fetch_assoc($resg)) { 
    206216                $gmln=$rowg["gml_n"]; 
     
    211221                $blattart=$rowg["blattartv"]; // Value 
    212222                if ($zpaar) {$trclass='paa';} else {$trclass='unp';} 
     223                $beznam=$rowg["beznam"]; 
    213224                $zpaar=!$zpaar; 
    214225                echo "\n<tr class='".$trclass."'>" 
    215226                        ."\n\t<td>"; // GB-Bezirk <td class='gbl'> 
    216227                                if ($showkey) {echo "<span class='key'>".$rowg["bezirk"]."</span> ";} 
    217                                 echo $rowg["beznam"] 
    218                         ."</td>"; 
     228                                if ($gwbeznam != $beznam){ 
     229                                        echo "<b>".$beznam."</b>"; 
     230                                        $gwbeznam=$beznam; 
     231                                } else { 
     232                                        echo $beznam; 
     233                                } 
     234                        echo "</td>"; 
    219235 
    220236                        echo "\n\t<td>"; // Blattart 
     
    259275        if ($i === 0) {echo "\n<p class='err'>Kein Grundbuch.</p>";} 
    260276} else { 
    261         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"; 
    262 } 
     277        echo "\n\t<p class='err'>Fehler! Kein Treffer f&uuml;r Person".$gmlid."</p>\n"; 
     278} 
     279pg_free_result($res); 
     280 
     281echo "\n<div class='buttonbereich noprint'>\n<hr>" 
     282        ."\n\t<a title='zur&uuml;ck' href='javascript:history.back()'><img src='ico/zurueck.png' width='16' height='16' alt='zur&uuml;ck'></a>&nbsp;"; 
     283if ($PrntBtn==true){echo "\n\t<a title='Drucken' href='javascript:window.print()'><img src='ico/print.png' width='16' height='16' alt='Drucken'></a>&nbsp;";} 
     284echo "\n\t<a title='Export als CSV' href='javascript:ALKISexport()'><img src='ico/download.png' width='16' height='16' alt='Export'></a>&nbsp;" 
     285."\n</div>"; 
     286 
     287footer($gmlid, selbstverlinkung()."?", ""); 
    263288?> 
    264  
    265 <div class='buttonbereich noprint'> 
    266 <hr> 
    267         <a title="zur&uuml;ck" href='javascript:history.back()'><img src="ico/zurueck.png" width="16" height="16" alt="zur&uuml;ck"></a>&nbsp; 
    268         <a title="Drucken" href='javascript:window.print()'><img src="ico/print.png" width="16" height="16" alt="Drucken"></a>&nbsp; 
    269         <a title="Export als CSV" href='javascript:ALKISexport()'><img src="ico/download.png" width="16" height="16" alt="Export"></a>&nbsp; 
    270 </div> 
    271  
    272 <?php footer($gmlid, selbstverlinkung()."?", ""); ?> 
    273289 
    274290</body> 
Note: See TracChangeset for help on using the changeset viewer.