Subversion Repositories eFlore/Applications.cel

Rev

Rev 901 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

// In utf8
// Out utf8

// Utilitaire mise a jour enregistrement inventaire 


Class InventoryCheck extends DBAccessor {


        var $config;
        
        function InventoryCheck($config) {

                $this->config=$config;
        }
        

        function getRessource(){
                
                        $DB=$this->connectDB($this->config,'database_cel');
                        
                        
//                      $query="SELECT id, location, id_location, date_observation, identifiant FROM cel_inventory WHERE transmission=1 ";
                        $query="SELECT id, location, id_location, date_observation, identifiant FROM cel_inventory";
                    $res =& $DB->query($query);
    
                if (DB::isError($res)) {
                die($res->getMessage());
                }
    
                        while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {

                                if ($row['id_location']!="000null") {
                                        $query="select * from locations where name = '".mysql_escape_string($row['location'])."' and code='".mysql_escape_string($row['id_location'])."' limit 1";
                                }
                                else {
                                        $query="select * from locations where name = '".mysql_escape_string($row['location'])."' limit 1";
                                }
                                $resloc =& $DB->query($query);
    
                        if (DB::isError($resloc)) {
                        die($resloc->getMessage());
                        }
                                if ($resloc->numRows() == 0) {
                                        print $row['id']; 
                                        print " ";
                                        print $row['identifiant']; 
                                        print " : ";
                                        print $row['location']; 
                                        print " - ";
                                        print $row['id_location']; 
                                        print " - ";
                                        $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'];
                                        $link_desc=' <a href="'.$lk.'">Correction</a>';
                                        print $link_desc;
                                        print "<br>";
                                        
                                }
                        }
                        
        }
                 
                
}

/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.2  2008-01-30 08:57:28  ddelon
* fin mise en place mygwt
*
* Revision 1.1  2007-06-06 13:31:16  ddelon
* v0.09
*
* Revision 1.3  2007-05-22 12:54:09  ddelon
* Securisation acces utilisateur
*
*
* 
*/

?>