128 |
{ |
{ |
129 |
// Produit non deja existant |
// Produit non deja existant |
130 |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product "; |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product "; |
131 |
$sql .= " (datec, ref, fk_user_author, fk_product_type, price)"; |
$sql.= " (datec, "; |
132 |
$sql .= " VALUES (now(), '".$this->ref."', ".$user->id.",$this->type, '" . $this->price . "')"; |
if ($this->ref) $sql.= "ref, "; |
133 |
|
$sql.= "fk_user_author, fk_product_type, price)"; |
134 |
|
$sql.= " VALUES (now(), "; |
135 |
|
if ($this->ref) $sql.= "'".$this->ref."', "; |
136 |
|
$sql.= $user->id.", ".$this->type.", '" . $this->price . "')"; |
137 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
138 |
if ( $result ) |
if ( $result ) |
139 |
{ |
{ |
199 |
|
|
200 |
if (! $this->libelle) $this->libelle = 'LIBELLE MANQUANT'; |
if (! $this->libelle) $this->libelle = 'LIBELLE MANQUANT'; |
201 |
|
|
202 |
$this->ref = trim($this->ref); |
$this->ref = trim(sanitize_string($this->ref)); |
|
$this->ref = ereg_replace("\"","",$this->ref); |
|
|
$this->ref = ereg_replace("'","",$this->ref); |
|
|
|
|
203 |
$this->libelle = trim($this->libelle); |
$this->libelle = trim($this->libelle); |
204 |
$this->description = trim($this->description); |
$this->description = trim($this->description); |
205 |
$this->note = trim($this->note); |
$this->note = trim($this->note); |