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