10 |
|
|
11 |
// Identifiant de l'arrondissement |
// Identifiant de l'arrondissement |
12 |
(isset($_GET['idx']) ? $idx = $_GET['idx'] : $idx = ""); |
(isset($_GET['idx']) ? $idx = $_GET['idx'] : $idx = ""); |
13 |
(isset($_GET['tn']) ? $tn = $_GET['tn'] : $tn = ""); |
(isset($_GET['tableName']) ? $tableName = $_GET['tableName'] : $tableName = ""); |
14 |
(isset($_GET['ds']) ? $ds = $_GET['ds'] : $ds = ""); |
(isset($_GET['linkedField']) ? $linkedField = $_GET['linkedField'] : $linkedField = ""); |
15 |
|
(isset($_GET['nature']) ? $nature = $_GET['nature'] : $nature = ""); |
16 |
$f = new utils("nohtml"); |
$f = new utils("nohtml"); |
17 |
$f->disableLog(); |
$f->disableLog(); |
18 |
|
|
19 |
$sql = |
$sql = |
20 |
"SELECT |
"SELECT |
21 |
$tn, libelle |
$tableName, libelle |
22 |
FROM |
FROM |
23 |
$tn"; |
".DB_PREFIXE."$tableName"; |
24 |
|
|
25 |
if ( isset($idx) && $idx !== '' && $idx !== '*' && is_numeric($idx)){ |
if ( isset($idx) && $idx !== '' && $idx !== '*' && is_numeric($idx)){ |
26 |
|
|
27 |
/*Requête qui récupère les quartiers en fonction de leur arrondissement*/ |
/*Requête qui récupère les quartiers en fonction de leur arrondissement*/ |
28 |
$sql .= |
$sql .= |
29 |
" WHERE |
" WHERE |
30 |
$ds = $idx |
$linkedField = $idx "; |
31 |
ORDER BY |
if($nature != "") { |
32 |
|
$sql .= "AND demande_nature = 2 "; |
33 |
|
} else { |
34 |
|
$sql .= "AND demande_nature = 1 "; |
35 |
|
} |
36 |
|
$sql .= "ORDER BY |
37 |
libelle |
libelle |
38 |
"; |
"; |
39 |
} |
} |
44 |
$listData = ""; |
$listData = ""; |
45 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) { |
46 |
|
|
47 |
$listData .= $row[$tn]."_".$row['libelle'].";"; |
$listData .= $row[$tableName]."_".$row['libelle'].";"; |
48 |
} |
} |
49 |
|
|
50 |
echo json_encode($listData); |
echo json_encode($listData); |