Ignore:
Timestamp:
09/09/10 14:09:03 (14 years ago)
Author:
frank.jaeger
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/var/www/info/alkis/alkisfsnw.php

    r41 r43  
    44        31.08.2010      $style=ALKIS entfernt, alles Kompakt 
    55        02.09.2010  Mit Icons 
     6        07.09.2010  Kennzeichen-Rahmen f. fiktives Blatt, Schluessel anschaltbar 
     7        08.09.2010  .. 
    68 
    79        ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo). 
     
    3840$gmlid=urldecode($_REQUEST["gmlid"]); 
    3941$eig=urldecode($_REQUEST["eig"]); 
     42 
     43// getswitch($idanzeige, $showkey); 
    4044$id = isset($_GET["id"]) ? $_GET["id"] : "n"; 
    41 $idanzeige=false; 
    42 if ($id == "j") {$idanzeige=true;} 
     45if ($id == "j") { 
     46        $idanzeige=true; 
     47} else { 
     48        $idanzeige=false; 
     49} 
     50$keys = isset($_GET["showkey"]) ? $_GET["showkey"] : "n"; 
     51if ($keys == "j") { 
     52        $showkey=true; 
     53} else { 
     54        $showkey=false; 
     55} 
     56 
    4357$dbname = 'alkis05' . $gkz; 
    4458$con = pg_connect("host=".$dbhost." port=" .$dbport." dbname=".$dbname." user=".$dbuser." password=".$dbpass); 
     
    7084        echo "\n<h2><img src='ico/Flurstueck.ico' width='16' height='16' alt=''> Flurst&uuml;ck</h2>\n"; 
    7185} 
    72 echo "\n<table class='outer'>\n<tr>\n\t<td>"; 
    73  
    74         // Tabelle Kennzeichen 
    75         echo "\n\t<table class='kennz' title='Flurst&uuml;ckskennzeichen'>\n\t<tr>"; 
     86echo "\n<table class='outer'>\n<tr>\n\t<td>"; // linke Seite 
     87 
     88        // darin Tabelle Kennzeichen 
     89        echo "\n\t<table class='kennzfs' title='Flurst&uuml;ckskennzeichen'>\n\t<tr>"; 
    7690                echo "\n\t\t<td class='head'>Gmkg</td>\n\t\t<td class='head'>Flur</td>\n\t\t<td class='head'>Flurst-Nr.</td>\n\t</tr>"; 
    77                 echo "\n\t<tr>\n\t\t<td title='Gemarkung'><span class='key'>".$gmkgnr."</span><br>".$gemkname."</td>"; 
     91                echo "\n\t<tr>\n\t\t<td title='Gemarkung'>"; 
     92                if ($showkey) {          
     93                        echo "<span class='key'>".$gmkgnr."</span><br>"; 
     94                }                
     95                echo $gemkname."</td>"; 
    7896                echo "\n\t\t<td title='Flurnummer'>".$flurnummer."</td>"; 
    7997                echo "\n\t\t<td title='Flurst&uuml;cksnummer (Z&auml;hler / Nenner)'><span class='wichtig'>".$flstnummer."</span></td>\n\t</tr>"; 
    8098        echo "\n\t</table>"; 
    8199 
    82 echo "\n\t</td>\n\t<td>"; 
    83  
    84         // Kopf Rechts: FS-Daten 2 Spalten 
     100echo "\n\t</td>\n\t<td>"; // rechte Seite 
     101 
     102        // FS-Daten 2 Spalten 
    85103        echo "\n\t<table class='fsd'>"; 
    86104                echo "\n\t<tr>\n\t\t<td>Entstehung</td>"; 
     
    89107                echo "\n\t\t<td title='Jahrgang / Fortf&uuml;hrungsnummer - Fortf&uuml;hrungsart'>".$row["name"]."</td>\n\t</tr>"; 
    90108        echo "\n\t</table>"; 
    91         if ($idanzeige) { linkgml($gkz, $gmlid, "Flurst&uuml;ck"); } 
     109        if ($idanzeige) {linkgml($gkz, $gmlid, "Flurst&uuml;ck"); } 
    92110echo "\n\t</td>\n</tr>\n</table>"; 
    93111 
     
    99117echo "\n<table class='fs'>"; 
    100118         
    101         // Gebietszugehörigkeit 
    102         fs_gebietszug($con, $row["gemeinde"], $row["kreis"], $row["regierungsbezirk"]); // Gebietszugehoerigkeit 
    103  
    104         // Lagezeilen des Flurstuecks 
    105         fs_lage($con, $gmlid, $gkz); // Adresse, Lagebezeichnung 
    106  
    107         // Nutzungsarten 
    108         fs_nutz($con, $gmlid); // Tatsaechliche Nutzung 
     119        fs_gebietszug($con, $row["gemeinde"], $row["kreis"], $row["regierungsbezirk"], $showkey); // Gebietszugehoerigkeit 
     120 
     121        fs_lage($con, $gmlid, $gkz, $showkey); // Adresse, Lagebezeichnung 
     122 
     123        fs_nutz($con, $gmlid, $showkey); // Tatsaechliche Nutzung 
    109124 
    110125        // Flaeche und Link auf GebÀude-Auswertung 
     
    113128                echo "\n\t<td class='lr'>".$flae."</td>"; // Sp. 2 
    114129                echo "\n\t<td>"; // Sp. 3 
    115                         // Gebaeude-NW 
    116                         echo "\n\t\t<p class='nwlink noprint'>"; 
     130                        echo "\n\t\t<p class='nwlink noprint'>"; // Gebaeude-Verschneidung 
    117131                                echo "\n\t\t\t<a href='alkisgebaeudenw.php?gkz=".$gkz."&amp;gmlid=".$gmlid; 
    118                                 if ($idanzeige) echo "&amp;id=j"; 
     132                                if ($idanzeige) {echo "&amp;id=j";} 
     133                                if ($showkey)   {echo "&amp;id=j";} 
    119134                                echo "' title='Geb&auml;udenachweis'>Geb&auml;ude <img src='ico/Haus.ico' width='16' height='16' alt=''></a>"; 
    120135                        echo "\n\t\t</p>"; 
    121136                echo "\n\t</td>"; 
    122137        echo "\n</tr>"; 
     138 
    123139echo "\n</table>"; 
    124140 
     
    135151                                echo "\n\t\t\t<a href='".$self."gkz=".$gkz."&amp;gmlid=".$gmlid; 
    136152                                if ($idanzeige) { echo "&amp;id=j";} 
    137                                 // Umschalter. FS-Nachw ruft sich selbst mit geaend. Param. auf. Posit. auf Marke #gb 
     153                                if ($showkey)   {echo "&amp;showkey=j";} 
     154                                // Umschalter: FS-Nachw ruft sich selbst mit geaend. Param. auf. Posit. auf Marke #gb 
    138155                                if ($eig=="j") { 
    139156                                        echo "&amp;eig=n#gb' title='Flurst&uuml;cksnachweis'>ohne Eigent&uuml;mer</a>"; 
    140157                                } else {         
    141                                         echo "&amp;eig=j#gb' title='Flurst&uuml;cks- und Eigent&uuml;mernachweis'>mit Eigent&uuml;mer</a>"; 
     158                                        echo "&amp;eig=j#gb' title='Flurst&uuml;cks- und Eigent&uuml;mernachweis'>mit Eigent&uuml;mer"; 
     159                                        echo "<img src='ico/EigentuemerGBzeile.ico' width='16' height='16' alt=''></a>"; 
    142160                                } 
    143161                        echo "\n\t\t</p>"; 
     
    156174$sql.="ORDER BY s.laufendenummer;"; 
    157175$ress=pg_query($con,$sql); 
    158 if (!$ress) echo "\n<p class='err'>Keine Buchungsstelle.<br>\nSQL= ".$sql."</p>\n"; 
     176if (!$ress) { 
     177        echo "\n<p class='err'>Keine Buchungsstelle.<br>\nSQL= ".$sql."</p>\n"; 
     178} 
    159179$bs=0; // Z.Buchungsstelle 
    160180while($rows = pg_fetch_array($ress)) { 
     
    174194        while($rowg = pg_fetch_array($resg)) { 
    175195                $beznam=$rowg["bezeichnung"]; 
     196                $blattkeyg=$rowg["blattart"]; 
     197                $blattartg=blattart($blattkeyg); 
    176198                echo "\n<hr>\n<table class='outer'>"; 
    177199                echo "\n<tr>"; // 1 row only 
     
    179201 
    180202                                // Rahmen mit GB-Kennz 
    181                                 echo "\n\t<table class='kennz' title='Bestandskennzeichen'>"; 
     203                                if ($blattkeyg == 1000) { 
     204                                        echo "\n\t<table class='kennzgb' title='Bestandskennzeichen'>"; 
     205                                }else { 
     206                                        echo "\n\t<table class='kennzgbf' title='Bestandskennzeichen'>"; // dotted 
     207                                }                                
    182208                                        echo "\n\t<tr>\n\t\t<td class='head'>Bezirk</td>"; 
    183                                                 echo "\n\t\t<td class='head'>".blattart($rowg["blattart"])."</td>"; 
     209                                                echo "\n\t\t<td class='head'>".$blattartg."</td>"; 
    184210                                                echo "\n\t\t<td class='head'>Lfd-Nr,</td>"; 
    185211                                                echo "\n\t\t<td class='head'>Buchungsart</td>"; 
    186212                                        echo "\n\t</tr>"; 
    187213                                        echo "\n\t<tr>"; 
    188                                                 echo "\n\t\t<td title='Grundbuchbezirk'><span class='key'>".$rowg["bezirk"]."</span><br>".$beznam."</td>"; 
     214                                                echo "\n\t\t<td title='Grundbuchbezirk'>"; 
     215                                                if ($showkey) {                                          
     216                                                        echo "<span class='key'>".$rowg["bezirk"]."</span><br>";                                                 
     217                                                }                                                
     218                                                echo $beznam."</td>"; 
    189219                                                echo "\n\t\t<td title='Grundbuch-Blatt'><span class='wichtig'>".$rowg["blatt"]."</span></td>"; 
    190220                                                echo "\n\t\t<td title='Bestandsverzeichnis-Nummer (BVNR, Grundst&uuml;ck)'>".$rows["lfd"]."</td>"; 
    191                                                 echo "\n\t\t<td title='Buchungsart'><span class='key'>".$rows["buchungsart"]."</span><br>".buchungsart($rows["buchungsart"])."</td>"; 
     221                                                echo "\n\t\t<td title='Buchungsart'>"; 
     222                                                if ($showkey) { 
     223                                                        echo "<span class='key'>".$rows["buchungsart"]."</span><br>"; 
     224                                                } 
     225                                                echo buchungsart($rows["buchungsart"])."</td>"; 
    192226                                        echo "\n\t</tr>"; 
    193227                                echo "\n\t</table>"; 
     
    204238                                        linkgml($gkz, $rowg["gml_id"], "Buchungsblatt"); 
    205239                                } 
    206                                 echo "\n<br>\n"; 
    207                                 echo "\n\t<p class='nwlink'>weitere Auskunft:<br>\n\t\t<a href='alkisbestnw.php?gkz=".$gkz."&amp;gmlid=".$rowg[0]; 
    208                                 if ($idanzeige) echo "&amp;id=j"; 
    209                                 echo "' title='Grundbuchnachweis mit kompletter Eigent&uuml;merangabe'>Grundbuch-Blatt <img src='ico/GBBlatt_link.ico' width='16' height='16' alt=''></a>\n\t</p>"; 
     240                                echo "\n\t<p class='nwlink'>weitere Auskunft:<br>"; 
     241                                        echo "\n\t\t<a href='alkisbestnw.php?gkz=".$gkz."&amp;gmlid=".$rowg[0]; 
     242                                                if ($idanzeige) {echo "&amp;id=j";} 
     243                                                if ($showkey)   {echo "&amp;showkey=j";} 
     244                                                if ($blattkeyg == 1000) {                                                
     245                                                        echo "' title='Grundbuchnachweis mit kompletter Eigent&uuml;merangabe'>"; 
     246                                                } else { 
     247                                                        echo "' title='Grundbuchnachweis'>"; 
     248                                                }                                                
     249                                                echo $blattartg." <img src='ico/GBBlatt_link.ico' width='16' height='16' alt=''></a>"; 
     250                                echo "\n\t</p>"; 
    210251                        echo "\n</td>"; 
    211252                echo "\n</tr>"; 
    212253                echo "\n</table>"; 
    213254 
    214 /*              im Head der Tabelle bereits entschluesselt 
    215                 if ($rowg["blattart"] <> "1000") { 
    216                         echo "\n<p>Blattart: ".blattart($rowg["blattart"])." (".$rowg["blattart"].").<br>\n";  
    217                 } 
    218 */ 
    219                 // ++++++Weitere Felder ausgeben ??????   oder in SQL weglassen 
    220                 if ($rows["sond"] != "") {echo "<p>Sondereigentum: ".$rows["sond"]."</p>";} 
    221                 if ($rows["nrpl"] != "") {echo "<p>Nr im A-Plan: ".$rows["nrpl"]."</p>";} 
     255                // +++ Weitere Felder ausgeben ?? beschreibungdesumfangsderbuchung 
     256                if ($rows["sond"] != "") { 
     257                        echo "<p class='sond' title='Sondereigentum'>Verbunden mit dem Sondereigentum<br>".$rows["sond"]."</p>"; 
     258                } 
     259                if ($rows["nrpl"] != "") { 
     260                        echo "<p class='nrap' title='Nummer im Aufteilungsplan'>Nummer <span class='wichtig'>".$rows["nrpl"]."</span> im Aufteilungsplan.</p>";          
     261                } 
    222262 
    223263                // E I G E N T U E M E R, zum GB 
    224264                // Person <-benennt< AX_Namensnummer  >istBestandteilVon-> AX_Buchungsblatt 
    225265                if ($eig=="j") { // Wahlweise mit/ohne EigentÃŒmer 
    226                         // echo "\n\n<h4>Eigent&uuml;mer:</h4>\n"; 
    227266                        $gmlblatt = $rowg["gml_id"]; // id blatt 
    228                         $n = eigentuemer($con, $gkz, $idanzeige, $gmlblatt, false); // hier ohne Adresse 
     267                        $n = eigentuemer($con, $gkz, $idanzeige, $gmlblatt, false); // hier aber ohne Adresse 
    229268                        if ($n == 0) { 
    230                                 if ($rowg["blattart"] == 1000) { 
     269                                if ($blattkeyg == 1000) { 
    231270                                        echo "\n<p class='err'>Keine Namensnummer gefunden.</p>"; 
    232271                                        linkgml($gkz, $rowg["gml_id"], "Buchungsblatt"); 
    233272                                } else { 
    234273                                        echo "\n<p>ohne Eigent&uuml;mer.</p>"; 
    235                                         // if ($idanzeige) {linkgml($gkz, $rowg["gml_id"], "Buchungsblatt");} // ist schon sichtbar 
    236274                                } 
    237275                        } 
     
    243281                linkgml($gkz, $rows["gml_id"], "Buchungstelle"); 
    244282        } 
    245         // Test BEGINN 
    246                 //echo "\n<p>Buchungsstelle ".$rows["gml_id"]."</p>"; 
    247                 //if ($idanzeige) {linkgml($gkz, $rows["gml_id"], "Buchungsstelle");} 
    248         // Test ENDE 
    249283 
    250284        // Buchungstelle  >an> Buchungstelle  >istBestandteilVon> BLATT -> Bezirk 
     
    254288        $sql.="b.gml_id AS g_gml, b.bezirk, b.buchungsblattnummermitbuchstabenerweiterung as blatt, b.blattart, "; 
    255289        $sql.="z.bezeichnung ";  // stelle -> amtsgericht 
    256         $sql.="FROM  alkis_beziehungen     an "; // Bez. Stelle - Stelle 
    257         $sql.="JOIN  ax_buchungsstelle      s ON an.beziehung_von=s.gml_id "; 
    258         $sql.="JOIN  alkis_beziehungen      v ON s.gml_id=v.beziehung_von "; // Bez. Stelle - Blatt 
    259         $sql.="JOIN  ax_buchungsblatt       b ON v.beziehung_zu=b.gml_id "; 
     290        $sql.="FROM  alkis_beziehungen an "; // Bez. Stelle - Stelle 
     291        $sql.="JOIN  ax_buchungsstelle s ON an.beziehung_von=s.gml_id "; 
     292        $sql.="JOIN  alkis_beziehungen v ON s.gml_id=v.beziehung_von "; // Bez. Stelle - Blatt 
     293        $sql.="JOIN  ax_buchungsblatt  b ON v.beziehung_zu=b.gml_id "; 
    260294        $sql.="JOIN  ax_buchungsblattbezirk z ON z.land=b.land AND z.bezirk=b.bezirk "; 
    261295        $sql.="WHERE an.beziehung_zu='".$rows["gml_id"]."' "; // id herrschende Buchungsstelle 
     
    264298        $sql.="ORDER BY b.bezirk, b.buchungsblattnummermitbuchstabenerweiterung ;"; 
    265299        $resan=pg_query($con,$sql); 
    266         if (!$resan) echo "\n<p class='err'>Keine weiteren Buchungsstellen.<br>\nSQL=<br>".$sql."</p>\n"; 
     300        if (!$resan) { 
     301                echo "\n<p class='err'>Keine weiteren Buchungsstellen.<br>\nSQL=<br>".$sql."</p>\n"; 
     302        } 
    267303        $an=0; // Stelle an Stelle 
    268304        while($rowan = pg_fetch_array($resan)) { 
    269305                $beznam=$rowan["bezeichnung"]; 
     306                $blattkeyan=$rowan["blattart"]; // Schluessel von Blattart 
     307                $blattartan=blattart($blattkeyan); 
    270308                echo "\n<hr>\n<table class='outer'>"; 
    271309                echo "\n<tr>"; // 1 row only 
     
    273311 
    274312                                // Rahmen mit Kennzeichen GB 
    275                                 echo "\n\t<table class='kennz' title='Bestandskennzeichen'>"; 
     313                                if ($blattkeyan == 1000) { 
     314                                        echo "\n\t<table class='kennzgb' title='Bestandskennzeichen'>"; 
     315                                } else { 
     316                                        echo "\n\t<table class='kennzgbf' title='Bestandskennzeichen'>"; // dotted 
     317                                }                                
    276318                                        echo "\n\t<tr>"; 
    277319                                                echo "\n\t\t<td class='head'>Bezirk</td>"; 
    278                                                 echo "\n\t\t<td class='head'>".blattart($rowan["blattart"])."</td>"; 
     320                                                echo "\n\t\t<td class='head'>".$blattartan."</td>"; 
    279321                                                echo "\n\t\t<td class='head'>Lfd-Nr,</td>"; 
    280322                                                echo "\n\t\t<td class='head'>Buchungsart</td>"; 
    281323                                        echo "\n\t</tr>"; 
    282324                                        echo "\n\t<tr>"; 
    283                                                 echo "\n\t\t<td title='Grundbuchbezirk'><span class='key'>".$rowan["bezirk"]."</span><br>".$beznam."</td>"; 
     325                                                echo "\n\t\t<td title='Grundbuchbezirk'>"; 
     326                                                if ($showkey) {                                          
     327                                                        echo "<span class='key'>".$rowan["bezirk"]."</span><br>"; 
     328                                                }                                                
     329                                                echo $beznam."</td>"; 
    284330                                                echo "\n\t\t<td title='Grundbuch-Blatt'><span class='wichtig'>".$rowan["blatt"]."</span></td>"; 
    285331                                                echo "\n\t\t<td title='Bestandsverzeichnis-Nummer (BVNR, Grundst&uuml;ck)'>".$rowan["lfd"]."</td>"; 
    286                                                 echo "\n\t\t<td title='Buchungsart'><span class='key'>".$rowan["buchungsart"]."</span><br>".buchungsart($rowan["buchungsart"])."</td>"; 
     332                                                echo "\n\t\t<td title='Buchungsart'>"; 
     333                                                if ($showkey) {                                          
     334                                                        echo "<span class='key'>".$rowan["buchungsart"]."</span><br>"; 
     335                                                } 
     336                                                echo buchungsart($rowan["buchungsart"])."</td>"; 
    287337                                        echo "\n\t</tr>"; 
    288338                                echo "\n\t</table>"; 
     
    298348                                } 
    299349                                echo "\n<br>"; 
    300                                 echo "\n\t<p class='nwlink'>weitere Auskunft:<br>\n\t\t<a href='alkisbestnw.php?gkz=".$gkz."&amp;gmlid=".$rowan["g_gml"]; 
    301                                 if ($idanzeige) echo "&amp;id=j"; 
    302                                 echo "' title='Grundbuchnachweis mit kompletter Eigent&uuml;merangabe'>GB-Nachweis</a>\n\t</p>"; 
     350                                echo "\n\t<p class='nwlink'>"; 
     351                                        echo "\n\t\t<a href='alkisbestnw.php?gkz=".$gkz."&amp;gmlid=".$rowan["g_gml"]; 
     352                                                if ($idanzeige) {echo "&amp;id=j";} 
     353                                                if ($showkey)   {echo "&amp;showkey=j";} 
     354                                                echo "' title='Grundbuchnachweis mit kompletter Eigent&uuml;merangabe'>"; 
     355                                                echo $blattartan; 
     356                                                echo " <img src='ico/GBBlatt_link.ico' width='16' height='16' alt=''>";                          
     357                                        echo "</a>"; 
     358                                echo "\n\t</p>"; 
    303359                        echo "\n\t</td>"; 
    304360                echo "\n</tr>"; 
    305361                echo "\n</table>"; 
    306362 
    307                 if ($rowan["blattart"] <> "1000") { 
    308                         echo "\n<p>Blattart: ".blattart($rowan["blattart"])." (".$rowan["blattart"].").<br>\n";  
    309                 } 
    310  
    311                 // +++ Weitere Felder ausgeben oder in SQL weglassen?? 
    312                 if ($rowan["sond"] != '') {echo "<p>Sondereigentum: ".$rowan["sond"]."</p>";} 
    313                 if ($rowan["nrpl"] != '') {echo "<p>Nr im A-Plan: ".$rowan["nrpl"]."</p>";} 
     363                if ($blattkeyan != 1000) { 
     364                        echo "\n<p>Blattart: ".$blattartan." (".$blattkeyan.").<br>\n";  
     365                } 
     366 
     367                // +++ Weitere Felder ausgeben ?? beschreibungdesumfangsderbuchung 
     368                if ($rowan["sond"] != "") { 
     369                        echo "<p class='sond' title='Sondereigentum'>Verbunden mit dem Sondereigentum<br>".$rowan["sond"]."</p>"; 
     370                } 
     371                if ($rowan["nrpl"] != "") { 
     372                        echo "<p class='nrap' title='Nummer im Aufteilungsplan'>Nummer <span class='wichtig'>".$rowan["nrpl"]."</span> im Aufteilungsplan.</p>"; 
     373                } 
    314374 
    315375                if ($eig=="j") { 
    316                         //echo "\n<p>Eigent&uuml;mer vorlÀufig dem GB-Nachweis entnehmen.</p>"; 
    317376                        $gmlblatt = $rowan["g_gml"]; // id blatt 
    318                         $n = eigentuemer($con, $gkz, $idanzeige, $gmlblatt, false); // ohne Adresse 
     377                        $n = eigentuemer($con, $gkz, $idanzeige, $gmlblatt, false, $showkey); // ohne Adresse 
    319378                        // Anzahl $n kontrollieren? Warnen? 
    320379                } 
     
    339398</form> 
    340399 
    341 <?php footer($gkz, $gmlid, $idanzeige, $self, $hilfeurl, "&amp;eig=".$eig); ?> 
     400<?php footer($gkz, $gmlid, $idanzeige, $self, $hilfeurl, "&amp;eig=".$eig, $showkey); ?> 
    342401 
    343402</body> 
Note: See TracChangeset for help on using the changeset viewer.