/** * Updates file size in db of a modified image */ public function saveData() { $parsedFilename = $this->fileName['parsedFilename']; $data = $this->mastroProduct->getData(); unset($data['qty']); $fileName = self::$imageNames[$parsedFilename]; $this->mastroProduct->getProductFromCsv()->getImageDb()->exec('INSERT OR IGNORE INTO product (code,ean13,modify_date,create_date) VALUES ( \''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($parsedFilename).'\', \''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['EAN13']).'\', DATETIME(\'now\'), DATETIME(\'now\') ); '); $this->mastroProduct->getProductFromCsv()->getImageDb()->exec('UPDATE product SET descrizione=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['DESCRIZIONE']).'\', vendita=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['VENDITA']).'\', image=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($fileName).'\', size=\''.filesize($this->mastroProduct->getProductFromCsv()->getConfig('BMP_DIR').DIRECTORY_SEPARATOR.$fileName).'\', md5=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString(md5(serialize($data))).'\', expire_date=NULL, modify_date=DATETIME(\'now\') WHERE ean13=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['EAN13']).'\' ; '); if(key_exists('corrupted',$data) && $data['corrupted']==1) $this->mastroProduct->getProductFromCsv()->getImageDb()->exec('UPDATE product SET corrupted=\'1\' WHERE ean13=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['EAN13']).'\' ; '); $this->mastroProduct->getProductFromCsv()->getImageDb()->exec('UPDATE product SET create_date=DATETIME(\'now\') WHERE ean13=\''.$this->mastroProduct->getProductFromCsv()->getImageDb()->escapeString($data['EAN13']).'\' AND (create_date=\'\' OR create_date IS NULL)'); }