[362] | 1 | <?php |
---|
| 2 | /* alkisinlaybaurecht.php - Inlay fuer Template: Baurecht |
---|
| 3 | ALKIS-Buchauskunft, Kommunales Rechenzentrum Minden-Ravensberg/Lippe (Lemgo). |
---|
[422] | 4 | Ãhnlich alkisbaurecht, aber nur Basisdaten, kein Footer und keine FlurstÃŒcks-Verschneidung. |
---|
[362] | 5 | |
---|
| 6 | Version: |
---|
| 7 | 2016-02-24 Version fuer norGIS-ALKIS-Import |
---|
[422] | 8 | .... |
---|
| 9 | 2020-02-03 Fenster-Weite |
---|
| 10 | 2020-02-20 Authentifizierung ausgelagert in Function darf_ich() |
---|
| 11 | 2020-12-15 Input-Validation und Strict Comparisation (===) |
---|
[362] | 12 | */ |
---|
[422] | 13 | ini_set("session.cookie_httponly", 1); |
---|
[362] | 14 | session_start(); |
---|
[387] | 15 | $cntget = extract($_GET); // Parameter in Variable umwandeln |
---|
| 16 | // strikte Validierung aller Parameter |
---|
[422] | 17 | if (isset($gmlid)) { |
---|
| 18 | if (!preg_match('#^[0-9A-Za-z]{16}$#', $gmlid)) {die("Eingabefehler gmlid");} |
---|
| 19 | } else { |
---|
| 20 | die("Fehlender Parameter"); |
---|
| 21 | } |
---|
| 22 | if (isset($gkz)) { |
---|
| 23 | if (!preg_match('#^[0-9]{3}$#', $gkz)) {die("Eingabefehler gkz");} |
---|
| 24 | } else { |
---|
| 25 | die("Fehlender Parameter"); |
---|
| 26 | } |
---|
[387] | 27 | |
---|
[422] | 28 | include "alkis_conf_location.php"; |
---|
| 29 | include "alkisfkt.php"; |
---|
| 30 | |
---|
| 31 | // Wert fÃŒr "width=" aus der Function "imFenster" synchron halten mit "@media screen body width" aus "alkisauszug.css" |
---|
[402] | 32 | echo <<<END |
---|
[377] | 33 | <!doctype html> |
---|
| 34 | <html lang="de"> |
---|
[362] | 35 | <head> |
---|
[377] | 36 | <meta charset="utf-8"> |
---|
[387] | 37 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
---|
[362] | 38 | <title>ALKIS Bau-, Raum- oder Bodenordnungsrecht</title> |
---|
| 39 | <link rel="stylesheet" type="text/css" href="alkisauszug.css"> |
---|
| 40 | <link rel="shortcut icon" type="image/x-icon" href="ico/Gericht.ico"> |
---|
| 41 | <script type="text/javascript"> |
---|
| 42 | function imFenster(dieURL) { |
---|
| 43 | var link = encodeURI(dieURL); |
---|
[422] | 44 | window.open(link,'','left=30,top=30,width=750,height=800,resizable=yes,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes'); |
---|
[362] | 45 | } |
---|
| 46 | </script> |
---|
| 47 | </head> |
---|
[422] | 48 | <body style='width: 98%;'> |
---|
[402] | 49 | END; |
---|
[422] | 50 | |
---|
| 51 | $erlaubnis = darf_ich(); if ($erlaubnis === 0) { die('<p class="stop1">Abbruch</p></body>'); } |
---|
| 52 | |
---|
| 53 | // Body des Inlay muss in Mapbender-Feature-Info-PopUp passen. Kleiner als 750 aus css. |
---|
[377] | 54 | $con = pg_connect($dbconn." options='--application_name=ALKIS-Auskunft_alkisinlaybaurecht.php'"); |
---|
[387] | 55 | if (!$con) echo "\n<p class='err'>Fehler beim Verbinden der DB</p>"; |
---|
[362] | 56 | |
---|
[422] | 57 | // Keine Spalten, die eine BerechtigungsprÌfung nach Gemeinde ermöglichen: |
---|
[416] | 58 | $sql ="SELECT r.ogc_fid, r.name, r.stelle, r.bezeichnung AS rechtbez, a.beschreibung AS adfbez, d.bezeichnung AS stellbez, round(st_area(r.wkb_geometry)::numeric,0) AS flae |
---|
[362] | 59 | FROM ax_bauraumoderbodenordnungsrecht r |
---|
[412] | 60 | LEFT JOIN ax_artderfestlegung_bauraumoderbodenordnungsrecht a ON r.artderfestlegung = a.wert |
---|
[389] | 61 | LEFT JOIN ax_dienststelle d ON r.land=d.land AND r.stelle=d.stelle |
---|
| 62 | WHERE r.gml_id= $1 AND r.endet IS NULL AND d.endet IS NULL;"; |
---|
[362] | 63 | |
---|
| 64 | $v = array($gmlid); |
---|
| 65 | $res = pg_prepare("", $sql); |
---|
| 66 | $res = pg_execute("", $v); |
---|
| 67 | |
---|
| 68 | if (!$res) { |
---|
[387] | 69 | echo "\n<p class='err'>Fehler bei Baurecht.</p>"; |
---|
[422] | 70 | if ($debug > 2) {echo "\n<p class='err'>SQL=<br>".str_replace("$1", "'".$gmlid."'", $sql)."</p>";} |
---|
[362] | 71 | } |
---|
[387] | 72 | echo "\n<h2><img src='ico/Gericht.png' width='16' height='16' alt=''> Bau-, Raum- oder Bodenordnungsrecht</h2>"; |
---|
[362] | 73 | |
---|
[402] | 74 | if ($row = pg_fetch_assoc($res)) { |
---|
[362] | 75 | echo "\n<table>" |
---|
| 76 | ."\n<tr>" |
---|
| 77 | ."\n\t<td class='li'>Art der Festlegung:</td>\n\t<td>" |
---|
| 78 | ."<span class='wichtig'>".$row["adfbez"]."</span></td>" |
---|
| 79 | ."\n</tr>"; |
---|
| 80 | $enam=$row["name"]; |
---|
| 81 | if ($enam != "") { |
---|
| 82 | echo "\n<tr>" |
---|
| 83 | ."\n\t<td class='li'>Eigenname des Gebietes:</td>\n\t<td>".$enam."</td>" |
---|
| 84 | ."\n</tr>"; |
---|
| 85 | } |
---|
| 86 | echo "\n<tr>" |
---|
| 87 | ."\n\t<td class='li'>Verfahrensnummer:</td>\n\t<td>".$row["rechtbez"]."</td>" |
---|
| 88 | ."\n</tr>"; |
---|
| 89 | $stell=$row["stelle"]; |
---|
| 90 | if ($stell != "") { |
---|
| 91 | echo "\n<tr>" |
---|
| 92 | ."\n\t<td class='li'>Dienststelle:</td>\n\t<td>".$row["stellbez"]."</td>" |
---|
| 93 | ."\n</tr>"; |
---|
| 94 | } |
---|
| 95 | echo "\n<tr>" |
---|
| 96 | ."\n\t<td class='li'>Fläche:</td>"; |
---|
| 97 | $flae=number_format($row["flae"],0,",",".")." m²"; |
---|
| 98 | echo "\n\t<td>".$flae."</td>" |
---|
| 99 | ."\n</tr>" |
---|
| 100 | ."\n</table>"; |
---|
| 101 | } else { |
---|
| 102 | echo "\n<p class='err'>Fehler! Kein Treffer bei gml_id=".$gmlid."</p>"; |
---|
| 103 | } |
---|
| 104 | |
---|
| 105 | echo "\n<p class='nwlink'>" |
---|
| 106 | ."\n\t<a href='javascript:imFenster(\"alkisbaurecht.php?gkz=".$gkz."&gmlid=".$gmlid."\")' " |
---|
| 107 | ."' title='Bau-, Raum- oder Bodenordnungsrecht'>Weitere Auskunft <img src='ico/Gericht.png' width='16' height='16' alt=''></a>" |
---|
| 108 | ."\n</p>"; |
---|
| 109 | |
---|
| 110 | ?> |
---|
| 111 | |
---|
| 112 | </body> |
---|
| 113 | </html> |
---|