Subversion Repositories eFlore/Applications.cel

Rev

Rev 423 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
416 aurelien 1
<?php
2
 
3
// In : utf8
4
// Out : utf8
5
 
6
// Liste des communes par utilisateur
7
 
8
Class InventoryLocationList extends DBAccessor {
9
 
10
 
11
	var $config;
12
 
13
	function InventoryLocationList($config) {
14
 
15
		$this->config=$config;
16
	}
17
 
18
 
19
	function getElement($uid){
20
 
21
 
22
			// Controle detournement utilisateur
23
		    session_start();
24
		 	$this->controleUtilisateur($uid[0]);
25
 
26
	     	$DB=$this->connectDB($this->config,'database_cel');
27
 
28
			$value=array();
29
 
30
	        $query = 'SELECT DISTINCT id_location, location, lieudit, station FROM cel_inventory
31
			WHERE identifiant="'.$DB->escapeSimple($uid[0]).'" ORDER BY id_location ASC, location ASC, lieudit ASC, station ASC' ;
32
 
33
	        //print $query
34
 
35
	        $res =& $DB->query($query);
36
 
37
	        if (DB::isError($res)) {
38
    	        die($res->getMessage());
39
        	}
40
 
41
 
42
            while ($row =& $res->fetchrow(DB_FETCHMODE_ORDERED)) {
43
            	$value[] = $row;
44
    	    }
45
 
423 aurelien 46
			$output = json_encode($value);
416 aurelien 47
 
48
			print($output);
49
 
50
			return true;
51
 
52
	}
53
 
54
 
55
 
56
}
57
 
58
 
59
/* +--Fin du code ---------------------------------------------------------------------------------------+
60
* $Log$
61
* Revision 1.6  2008-01-30 08:57:28  ddelon
62
* fin mise en place mygwt
63
*
64
* Revision 1.5  2007-05-22 12:54:09  ddelon
65
* Securisation acces utilisateur
66
*
67
*
68
*
69
*/
70
 
71
?>