Gestion d'une image par dfault si l'image n'existe pas

This commit is contained in:
Rodolphe Quiedeville 2003-04-04 12:07:37 +00:00
parent fbd40cd6a7
commit 0b81ae900e

View File

@ -385,11 +385,18 @@ class Livre {
$sql .= " WHERE products_id = " . $this->oscid;
$this->image = $this->ref.".jpg";
if(! file_exists(OSC_CATALOG_DIRECTORY."images/".$this->ref.".jpg"))
{
$this->image = OSC_IMAGE_DEFAULT;
}
if ( $this->db->query($sql) )
{
$sql = "UPDATE ".DB_NAME_OSC.".products ";
$sql .= "SET products_model = '".$this->ref."'";
$sql .= ", products_image = '".strtolower($this->ref).".jpg'";
$sql .= ", products_image = '".$this->image."'";
$sql .= ", products_price = ".$this->price."";
$sql .= " WHERE products_id = " . $this->oscid;