Subversion Repositories eFlore/Applications.cel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
416 aurelien 1
<?php
2
 
3
// In utf8
4
// Out utf8
5
 
6
// Utilitaire mise a jour enregistrement inventaire
7
 
8
 
9
Class InventoryCheck extends DBAccessor {
10
 
11
 
12
	var $config;
13
 
14
	function InventoryCheck($config) {
15
 
16
		$this->config=$config;
17
	}
18
 
19
 
20
	function getRessource(){
21
 
22
			$DB=$this->connectDB($this->config,'database_cel');
23
 
24
 
25
//			$query="SELECT id, location, id_location, date_observation, identifiant FROM cel_inventory WHERE transmission=1 ";
26
			$query="SELECT id, location, id_location, date_observation, identifiant FROM cel_inventory";
27
   		    $res =& $DB->query($query);
28
 
29
	        if (DB::isError($res)) {
30
    	        die($res->getMessage());
31
        	}
32
 
33
			while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {
34
 
35
				if ($row['id_location']!="000null") {
36
					$query="select * from locations where name = '".mysql_escape_string($row['location'])."' and code='".mysql_escape_string($row['id_location'])."' limit 1";
37
				}
38
				else {
39
					$query="select * from locations where name = '".mysql_escape_string($row['location'])."' limit 1";
40
				}
41
				$resloc =& $DB->query($query);
42
 
43
		        if (DB::isError($resloc)) {
44
    		        die($resloc->getMessage());
45
        		}
46
				if ($resloc->numRows() == 0) {
47
					print $row['id'];
48
					print " ";
49
					print $row['identifiant'];
50
					print " : ";
51
					print $row['location'];
52
					print " - ";
53
					print $row['id_location'];
54
					print " - ";
55
					$lk="http://www.tela-botanica.org/cel/jrest/util/cel_inventory.php?PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=0&PME_sys_operation=PME_op_Change&PME_sys_rec=".$row['id'];
56
					$link_desc=' <a href="'.$lk.'">Correction</a>';
57
					print $link_desc;
58
					print "<br>";
59
 
60
				}
61
			}
62
 
63
	}
64
 
65
 
66
}
67
 
68
/* +--Fin du code ---------------------------------------------------------------------------------------+
69
* $Log$
70
* Revision 1.2  2008-01-30 08:57:28  ddelon
71
* fin mise en place mygwt
72
*
73
* Revision 1.1  2007-06-06 13:31:16  ddelon
74
* v0.09
75
*
76
* Revision 1.3  2007-05-22 12:54:09  ddelon
77
* Securisation acces utilisateur
78
*
79
*
80
*
81
*/
82
 
83
?>