/[openfoncier]/trunk/app/listData.php
ViewVC logotype

Diff of /trunk/app/listData.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 641 by vpihour, Fri Nov 9 13:24:59 2012 UTC revision 1184 by fmichon, Wed Jan 9 09:34:50 2013 UTC
# Line 5  Line 5 
5  * @package openfoncier  * @package openfoncier
6  * @version SVN : $Id$  * @version SVN : $Id$
7  */  */
8      $DEBUG=1;  
9      require_once "../obj/utils.class.php";  require_once "../obj/utils.class.php";
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->isAccredited(array("demande","demande_modifier","demande_ajouter"), "OR");
18        $f->disableLog();
19      $sql =  
20          "SELECT  $sql =
21              $tn, libelle      "SELECT
22          FROM          $tableName, libelle
23              $tn";      FROM
24                ".DB_PREFIXE."$tableName";
25      if ( isset($idx) && $idx !== '' && $idx !== '*' && is_numeric($idx)){  
26            if ( isset($idx) && $idx !== '' && $idx !== '*' && is_numeric($idx)){
27          /*Requête qui récupère les quartiers en fonction de leur arrondissement*/      
28          $sql .=      /*Requête qui récupère les quartiers en fonction de leur arrondissement*/
29              " WHERE      $sql .=
30                  $ds = $idx          " WHERE
31              ORDER BY              $linkedField = $idx ";
32                  libelle      if($nature != "") {
33              ";          $sql .= "AND demande_nature = 2 ";
34        } else {
35            $sql .= "AND demande_nature = 1 ";
36      }      }
37            $sql .= "ORDER BY
38      $res = $f->db->query($sql);              libelle
39      $f->isDatabaseError($res);          ";
40        }
41      $listData = "";  
42      while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {  $res = $f->db->query($sql);
43            $f->isDatabaseError($res);
44          $listData .= $row[$tn]."_".$row['libelle'].";";  
45      }  $listData = "";
46        while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
47      echo json_encode($listData);      
48        $listData .= $row[$tableName]."_".$row['libelle'].";";
49    }
50    
51    echo json_encode($listData);
52    
53  ?>  ?>

Legend:
Removed from v.641  
changed lines
  Added in v.1184

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26