Add hoodfile via hoodid
This commit is contained in:
parent
c6d416fd9a
commit
360b41e3c0
6
get_hoodid.sh
Executable file
6
get_hoodid.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
hoodfile=$(grep -l "id\": \"$1\"" hood/* )
|
||||||
|
[ -z $hoodfile ] && echo "no hood $1" && exit
|
||||||
|
|
||||||
|
cat $hoodfile
|
13
index.php
13
index.php
|
@ -1,10 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
$lat = $_GET['lat'];
|
$lat = $_GET['lat'] ?? null;
|
||||||
$lo = $_GET['long'];
|
$lo = $_GET['long'] ?? null;
|
||||||
|
$hoodid = $_GET['hoodid'] ?? null;
|
||||||
|
|
||||||
|
if (empty($hoodid)) {
|
||||||
if ((!is_numeric($lat)) || (!is_numeric($lo))) {exit("lat/long not numeric!");};
|
if ((!is_numeric($lat)) || (!is_numeric($lo))) {exit("lat/long not numeric!");};
|
||||||
|
|
||||||
$hoodfile = shell_exec("./get_hood.sh $lat $lo");
|
$hoodfile = shell_exec("./get_hood.sh $lat $lo");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ((!is_numeric($hoodid))) {exit("hoodid not numeric!");};
|
||||||
|
$hoodfile = shell_exec("./get_hoodid.sh $hoodid");
|
||||||
|
}
|
||||||
echo $hoodfile;
|
echo $hoodfile;
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user