-
Notifications
You must be signed in to change notification settings - Fork 1
/
get.php
26 lines (21 loc) · 998 Bytes
/
get.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
//header("access-control-allow-origin: *");
$id=filter_input(INPUT_GET, 'id',FILTER_VALIDATE_INT);
$secret= filter_input(INPUT_GET, 'secret',FILTER_SANITIZE_STRING);
$con=pg_connect("dbname=gis") or print("cant connect");
$query="SELECT name, strasse, hausnr, plz, email, ST_X(pos) AS lon, ".
"ST_Y(pos) AS lat, newsletter, ".
"saveanschrift, showinmap, bezirk, mailchecked, lastchanged, ".
"created, antragdate, lastasked, antrag_strasse, mailcontact, ".
"adrchecked, status, belegwiderspruchabgabe, belegantragsabgabe, ".
"urteildatum, klagedatum, widerspruchantwort, widersprucheingang, ".
"antwortaufantrag, lastasked, id, secret, automail ".
"FROM antraege WHERE id=$1 and secret=$2;";
$result = pg_prepare($con, "my_query", $query);
$result = pg_execute($con, "my_query", array($id, $secret));
if (!$result) {
echo "An error occured.\n";
exit;
}
$row = pg_fetch_array($result, NULL, PGSQL_ASSOC);
print json_encode($row);