diff --git a/_imgs/Thumbs.db b/_imgs/Thumbs.db index 1f59414..4b49076 100644 Binary files a/_imgs/Thumbs.db and b/_imgs/Thumbs.db differ diff --git a/_incl/prod.css b/_incl/prod.css index 87c09bc..a45c980 100644 --- a/_incl/prod.css +++ b/_incl/prod.css @@ -25,7 +25,7 @@ .producto_precio_ocasion2 { font-family: "Times New Roman", Times, serif; - font-size: 28px; + font-size: 24px; color: #CB2C54; font-weight: normal; } diff --git a/_incl/shoopOfertas.php b/_incl/shoopOfertas.php index b62a2c1..65759ba 100644 --- a/_incl/shoopOfertas.php +++ b/_incl/shoopOfertas.php @@ -12,6 +12,7 @@ var $cuantas; var $numOfertas; var $curTipo; +//LA QUE VIENE POR DEFECTO CON LA TIENDA - (NO SE USA) function shoopOfertas($cuantos, $categoria = '', $tipo = 1){ // esta es mi entrada en la clase, aqu? inicializo las globales. $this->numOfertas = 0; @@ -63,6 +64,62 @@ var $curTipo; } } +//Esta clase sale para hacer ofertas igual que ocasiones, segun como ya viene hecho +class shoopOfertaNueva{ +var $result; +var $cuantas; +var $numOfertas; +var $curTipo; + + function shoopOfertaNueva($cuantos, $categoria = '', $tipo = 1){ + // esta es mi entrada en la clase, aqu? inicializo las globales. + $this->numOfertas = 0; + $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; + + $this->result = mysql_query($query, $conn); + $this->numOfertas = mysql_num_rows($this->result); + } + } + + function getNum() { + return $this->numOfertas; + } + + function getNextOferta(){ + $oferta = ''; + + 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'))) { + $oferta = array ( 'categoria_id' => $row['oferta_categoria'], + 'nombre' => $row['oferta_nombre'], + 'id' => $row['oferta_id'], + 'estado' => $row['oferta_estado'], + 'fab_id' => $row['oferta_fab_id'], + 'fab_nombre' => $row['fab_nombre'], + 'pvp' => $row['oferta_pvp'], + 'descripcion' => $row['oferta_descripcion']); + } else { + $oferta = $this->getNextOferta(); + } + } + return $oferta; // es un array + } +} class shoopOcasion{ var $result; @@ -81,7 +138,7 @@ var $curTipo; $conn = db_connect(); if($conn) { - $query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion + $query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion, ocasion_fab_id FROM shoop_ocasion WHERE ocasion_unidades > 0 ORDER BY RAND()'; @@ -106,6 +163,7 @@ var $curTipo; $ocasion = array ( 'categoria_id' => $row['ocasion_categoria'], 'nombre' => $row['ocasion_nombre'], 'id' => $row['ocasion_id'], + 'fab_id' => $row['ocasion_fab_id'], 'estado' => $row['ocasion_estado'], 'precio' => $row['ocasion_precio'], 'pvp' => $row['ocasion_pvp'], diff --git a/admin/shoop/ocasion_db.php b/admin/shoop/ocasion_db.php index eb1aeb1..47880b1 100644 --- a/admin/shoop/ocasion_db.php +++ b/admin/shoop/ocasion_db.php @@ -27,19 +27,20 @@ $ocasion_estado=$_REQUEST['ocasion_estado']; $ocasion_pvp=$_REQUEST['ocasion_pvp']; $ocasion_precio=$_REQUEST['ocasion_precio']; $ocasion_unidades=$_REQUEST['ocasion_unidades']; +$ocasion_fab_id=$_REQUEST['ocasion_fab_id']; $conn = db_connect(); if($conn) { switch($operacion) { case "add": - $sql = 'INSERT INTO shoop_ocasion(ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades) VALUES("' . $ocasion_categoria . '", "' . $ocasion_nombre . '", "' . $ocasion_descripcion . '", "' . $ocasion_estado . '", "' . $ocasion_pvp . '", "' . $ocasion_precio . '", "' . $ocasion_unidades . '");'; + $sql = 'INSERT INTO shoop_ocasion(ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades, ocasion_fab_id) VALUES("' . $ocasion_categoria . '", "' . $ocasion_nombre . '", "' . $ocasion_descripcion . '", "' . $ocasion_estado . '", "' . $ocasion_pvp . '", "' . $ocasion_precio . '", "' . $ocasion_unidades . '", "' . $ocasion_fab_id . '");'; $result = mysql_query($sql, $conn) or header('Location: ../error.php'); $id = mysql_insert_id($conn); break; case "edit": - $sql = 'UPDATE shoop_ocasion SET ocasion_categoria="' . $ocasion_categoria . '", ocasion_nombre="' . $ocasion_nombre . '", ocasion_descripcion="' . $ocasion_descripcion . '", ocasion_estado="' . $ocasion_estado . '", ocasion_pvp="' . $ocasion_pvp . '", ocasion_precio="' . $ocasion_precio . '", ocasion_unidades="' . $ocasion_unidades . '" WHERE ocasion_id = ' . $id; - $result = mysql_query($sql, $conn) or header('Location: ../error.php'); + $sql = 'UPDATE shoop_ocasion SET ocasion_categoria="' . $ocasion_categoria . '", ocasion_nombre="' . $ocasion_nombre . '", ocasion_descripcion="' . $ocasion_descripcion . '", ocasion_estado="' . $ocasion_estado . '", ocasion_pvp="' . $ocasion_pvp . '", ocasion_precio="' . $ocasion_precio . '", ocasion_unidades="' . $ocasion_unidades . '", ocasion_fab_id="' . $ocasion_fab_id .'" WHERE ocasion_id = ' . $id; +$result = mysql_query($sql, $conn) or header('Location: ../error.php'); break; case "del": diff --git a/admin/shoop/ocasion_edit.php b/admin/shoop/ocasion_edit.php index 8ced038..33a053c 100644 --- a/admin/shoop/ocasion_edit.php +++ b/admin/shoop/ocasion_edit.php @@ -33,6 +33,7 @@ $ocasion_estado = ""; $ocasion_pvp = ""; $ocasion_precio = ""; $ocasion_unidades = ""; +$ocasion_fab_id = ""; switch($operacion) { @@ -42,7 +43,7 @@ switch($operacion) case "edit"; $conn = db_connect(); if($conn) { - $query = "SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades FROM shoop_ocasion WHERE ocasion_id = " . $id; + $query = "SELECT ocasion_id, ocasion_fab_id, ocasion_categoria, ocasion_nombre, ocasion_descripcion, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_unidades FROM shoop_ocasion WHERE ocasion_id = " . $id; $result = mysql_query($query, $conn); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); @@ -53,6 +54,8 @@ switch($operacion) $ocasion_pvp = $row['ocasion_pvp']; $ocasion_precio = $row['ocasion_precio']; $ocasion_unidades = $row['ocasion_unidades']; + $ocasion_fab_id = $row['ocasion_fab_id']; + } } break; @@ -127,6 +130,20 @@ define("MAX_SIZE", $max_size); + + Marca + + + + + + + + + Nombre diff --git a/admin/shoop/oferta.php b/admin/shoop/oferta.php index a0e09f9..2f434bb 100644 --- a/admin/shoop/oferta.php +++ b/admin/shoop/oferta.php @@ -11,13 +11,13 @@ include('../db.php'); -ocasión +Oferta - +
[ añadir ocasión ][ añadir oferta ]
diff --git a/admin/shoop/oferta_edit.php b/admin/shoop/oferta_edit.php index 7864cdb..f11540e 100644 --- a/admin/shoop/oferta_edit.php +++ b/admin/shoop/oferta_edit.php @@ -65,7 +65,7 @@ define("MAX_SIZE", $max_size);
- +
Detalles del producto de ocasión
Detalles del producto de oferta
diff --git a/bann2_ocasion.php b/bann2_ocasion.php index dbdee32..d405609 100644 --- a/bann2_ocasion.php +++ b/bann2_ocasion.php @@ -9,16 +9,25 @@ - + -    25 ? '...' : ''); ?> - - -*/ -?>

PVP:
- Oferta:
+ Ocasión:

-
- find_item($prod_id)) echo $cart->find_item($prod_id) . ' unidad' . ($cart->find_item($prod_id) > 1 ? 'es' : '') . ' en su cesta'; ?> + + + +
- +
'; + } + ?> +
+ +
-
€'); ?>
+
€'); ?>
-
+

Precio PVP:
diff --git a/bann2_oferta.php b/bann2_oferta.php new file mode 100644 index 0000000..fc9a123 --- /dev/null +++ b/bann2_oferta.php @@ -0,0 +1,39 @@ +
+ + + + + + + + + + + + + + + + +
+
+
'; + } + ?> +
+ + +
+
€'); ?>
+
+
+
+
+ +

Precio PVP:
+
+
\ No newline at end of file diff --git a/categorias.php b/categorias.php index fe32bc6..2b01528 100644 --- a/categorias.php +++ b/categorias.php @@ -80,4 +80,5 @@
  • OCASIÓN
  • +
  • OFERTAS
  • diff --git a/ocasion.php b/ocasion.php index c5d96ca..d45bf6a 100644 --- a/ocasion.php +++ b/ocasion.php @@ -25,8 +25,9 @@ if(!is_object($cart)) $cart = new wfCart(); $result = false; $conn = db_connect(); if($conn) { - $query = 'SELECT ocasion_id, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion + $query = 'SELECT ocasion_id, ocasion_fab_id, fab_nombre, ocasion_categoria, ocasion_nombre, ocasion_estado, ocasion_pvp, ocasion_precio, ocasion_descripcion FROM shoop_ocasion + LEFT JOIN shoop_fabricantes on (ocasion_fab_id=fab_id) WHERE ocasion_unidades > 0 ORDER BY ocasion_categoria, ocasion_id'; @@ -154,6 +155,7 @@ include('top.htm'); $ocasion_pvp = $row['ocasion_pvp']; $ocasion_precio = $row['ocasion_precio']; $ocasion_descripcion = $row['ocasion_descripcion']; + $fab_nombre = $row['fab_nombre']; if($ocasion_categoria != $curSeccion){ $curSeccion = $ocasion_categoria; @@ -168,18 +170,12 @@ include('top.htm'); ?>
    ' . $ocasion_estado . ')': "") . (strlen($ocasion_descripcion) ? '
    ' . $ocasion_descripcion . '': "") ; ?>
    +   ' . $ocasion_estado . ')': "") . (strlen($ocasion_descripcion) ? '
    ' . $ocasion_descripcion . '': "") ; ?>
    ' . $prod_fab_id . ' ' . $prod_modelo . ''; ?>CONSULTAR' : miNumberFormat($prod_precio) . '€'); ?>

    '; } diff --git a/oferta_add.php b/oferta_add.php new file mode 100644 index 0000000..2c12534 --- /dev/null +++ b/oferta_add.php @@ -0,0 +1,28 @@ +add_item($_REQUEST['id'], + 1, + $_REQUEST['precio'], + array( 'tipo'=>'OFERTA', + 'marca'=>'', + 'modelo'=>$_REQUEST['modelo'], + 'color'=>'', + 'acabados'=>'')); + + header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']); +?> \ No newline at end of file diff --git a/oferta_ficha.php b/oferta_ficha.php new file mode 100644 index 0000000..ada4822 --- /dev/null +++ b/oferta_ficha.php @@ -0,0 +1,233 @@ +Tienda > Oferta'; + } +} +?> + + + + + +clave audio + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + +
    + +
    +
    +


    + + + + + + + + + + + + + + + + + + + + + '; + } + ?> + + + + 0) { +?> + + +
    +
    +
    +
    + Oferta PVP:
    +
    + + +
    + +
    '; + } + ?> +
    + +
    + + + + + + + + + + + + + + + + + + + + +
    DESCRIPCIÓN

    ", htmlentities(stripslashes($prod_intro))); ?>
    Dimensiones: ' . $prod_dimensiones; ?>
    Peso: ' . $prod_peso; ?>
    Volumen: ' . $prod_volumen; ?>
    ' . $row['catop_label'] . ': ' . $row['procat_valor']; ?>
    +
    + ventajas +
    + + diff --git a/ofertas.php b/ofertas.php new file mode 100644 index 0000000..af7344b --- /dev/null +++ b/ofertas.php @@ -0,0 +1,194 @@ + 0 + ORDER BY oferta_categoria, oferta_id'; + + $result = mysql_query($query, $conn); + if($result) { + $numProductos = mysql_num_rows($result); + $topLabel = 'Tienda > Material de oferta'; + } + } + +// #################################################### +// llegados a este punto sabemos en que estado esta la pagina +// tenemos, incluso, los resultados de la busqueda, if any +?> + + + + + +clave audio + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + +
    + +
    + +
    +
    + + + + + + + + + + + +
    +getNum()){ + $arrayOferta = $miOferta->getNextOferta(); + if(!empty($arrayOferta)) + include('bann2_oferta.php'); +?> +
    + + + + + +
    Este es un listado parcial de productos en oferta.
    + Estos precios incluyen IVA. +
    + + + + + + + + + + + + + + + + + + + +
    PVP Oferta
    +   ': "") ; ?> €
    + +
    + + \ No newline at end of file diff --git a/top.htm b/top.htm index b97d45b..d7d7e47 100644 --- a/top.htm +++ b/top.htm @@ -9,6 +9,13 @@