diff --git a/_incl/shoopOfertas.php b/_incl/shoopOfertas.php index 65759ba..24f09a0 100644 --- a/_incl/shoopOfertas.php +++ b/_incl/shoopOfertas.php @@ -77,17 +77,14 @@ var $curTipo; $this->contador = 0; $this->result = false; $this->curTipo = $tipo; - - $cuantos = $cuantos * 4; - + $conn = db_connect(); if($conn) { $query = 'SELECT oferta_id, oferta_fab_id, fab_nombre, oferta_categoria, oferta_nombre, oferta_estado, oferta_pvp, oferta_descripcion FROM shoop_oferta LEFT JOIN shoop_fabricantes on (oferta_fab_id=fab_id) WHERE oferta_unidades > 0 - ORDER BY RAND()'; -// LIMIT ' . $cuantos; + ORDER BY RAND() LIMIT '. $cuantos; $this->result = mysql_query($query, $conn); $this->numOfertas = mysql_num_rows($this->result); @@ -104,7 +101,7 @@ var $curTipo; if($this->contador < $this->numOfertas) { $row = mysql_fetch_array($this->result); $this->contador ++; - if(file_exists('_ofr/' . $row['oferta_id'] . ($this->curTipo != 2 ? '_168.jpg' : '_247.jpg'))) { +// if(file_exists('_ofr/' . $row['oferta_id'] . ($this->curTipo != 2 ? '_168.jpg' : '_247.jpg'))) { $oferta = array ( 'categoria_id' => $row['oferta_categoria'], 'nombre' => $row['oferta_nombre'], 'id' => $row['oferta_id'], @@ -113,9 +110,9 @@ var $curTipo; 'fab_nombre' => $row['fab_nombre'], 'pvp' => $row['oferta_pvp'], 'descripcion' => $row['oferta_descripcion']); - } else { - $oferta = $this->getNextOferta(); - } +// } else { +// $oferta = $this->getNextOferta(); +// } } return $oferta; // es un array } @@ -133,17 +130,15 @@ var $curTipo; $this->contador = 0; $this->result = false; $this->curTipo = $tipo; - - $cuantos = $cuantos * 4; $conn = db_connect(); if($conn) { - $query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion, ocasion_fab_id + $query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion, ocasion_fab_id, fab_nombre FROM shoop_ocasion - WHERE ocasion_unidades > 0 - ORDER BY RAND()'; -// LIMIT ' . $cuantos; - + LEFT JOIN shoop_fabricantes on (ocasion_fab_id=fab_id) + WHERE (ocasion_unidades > 0) + ORDER BY RAND() LIMIT '. $cuantos; + $this->result = mysql_query($query, $conn); $this->numOcasiones = mysql_num_rows($this->result); } @@ -159,18 +154,19 @@ var $curTipo; if($this->contador < $this->numOcasiones) { $row = mysql_fetch_array($this->result); $this->contador ++; - if(file_exists('_ocs/' . $row['ocasion_id'] . ($this->curTipo != 2 ? '_168.jpg' : '_247.jpg'))) { +// if(file_exists('_ocs/' . $row['ocasion_id'] . ($this->curTipo != 2 ? '_168.jpg' : '_247.jpg'))) { $ocasion = array ( 'categoria_id' => $row['ocasion_categoria'], 'nombre' => $row['ocasion_nombre'], 'id' => $row['ocasion_id'], 'fab_id' => $row['ocasion_fab_id'], + 'fab_nombre' => $row['fab_nombre'], 'estado' => $row['ocasion_estado'], 'precio' => $row['ocasion_precio'], 'pvp' => $row['ocasion_pvp'], 'descripcion' => $row['ocasion_descripcion']); - } else { - $ocasion = $this->getNextOcasion(); - } +// } else { +// $ocasion = $this->getNextOcasion(); +// } } return $ocasion; // es un array } diff --git a/admin/shoop/oferta_db.php b/admin/shoop/oferta_db.php index 49397a4..2dfe6bd 100644 --- a/admin/shoop/oferta_db.php +++ b/admin/shoop/oferta_db.php @@ -55,6 +55,7 @@ $conn = db_connect(); if ($operacion != "del") { // modifico la imagen. uploadImagenOferta($id, 247, 95, 168, 102); + uploadPDFOferta($id); // y vuelvo a la pantalla correspondiente header('Location: oferta_edit.php?op=edit&id=' . $id); } diff --git a/admin/shoop/oferta_edit.php b/admin/shoop/oferta_edit.php index f11540e..fb4f4e6 100644 --- a/admin/shoop/oferta_edit.php +++ b/admin/shoop/oferta_edit.php @@ -70,11 +70,7 @@ define("MAX_SIZE", $max_size);
| Categoría | -Imagen | -
| + | Categoría |