Subversion Repositories eFlore/Applications.cel

Rev

Rev 798 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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