From 8ef9b1d0d81103555b3db3911b46f45956dd0291 Mon Sep 17 00:00:00 2001 From: roberto Date: Mon, 30 May 2011 17:04:37 +0000 Subject: [PATCH] =?UTF-8?q?Se=20hace=20la=20parte=20de=20administraci?= =?UTF-8?q?=C3=B3n=20de=20ofertas=20(ojo=20crear=20tabla=20ofetashoop=5Fof?= =?UTF-8?q?erta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.ClaveAudio_Web/trunk@12 44ade383-bb54-5b4f-835b-923f7702b206 --- admin/menu.htm | 1 + admin/shoop/oferta.php | 101 ++++++++++++++++++++ admin/shoop/oferta_db.php | 65 +++++++++++++ admin/shoop/oferta_edit.php | 183 ++++++++++++++++++++++++++++++++++++ admin/shoop/upload.php | 44 +++++++++ index.php | 2 +- 6 files changed, 395 insertions(+), 1 deletion(-) create mode 100644 admin/shoop/oferta.php create mode 100644 admin/shoop/oferta_db.php create mode 100644 admin/shoop/oferta_edit.php diff --git a/admin/menu.htm b/admin/menu.htm index 2e5cc05..c2e766c 100644 --- a/admin/menu.htm +++ b/admin/menu.htm @@ -12,4 +12,5 @@
  • Categorías
  • Productos
  • OCASIÓN
  • +
  • OFERTAS
  • PEDIDOS
  • \ No newline at end of file diff --git a/admin/shoop/oferta.php b/admin/shoop/oferta.php new file mode 100644 index 0000000..a0e09f9 --- /dev/null +++ b/admin/shoop/oferta.php @@ -0,0 +1,101 @@ + + + + + + +ocasión + + + + + + + +
    [ añadir ocasión ]
    + + 0 */ + ORDER BY oferta_categoria, oferta_id"; + $result = mysql_query($query, $conn); +?> + + + + + + + + + + + + + + + + + + + + + + + +An error has occurred while accessing the database: ' . mysql_error(); + } +?> +
    MarcaNombreUds.PVP 
      ' . $oferta_nombre . '' . (strlen($oferta_estado) ? ' (' . $oferta_estado . ')': "") . (strlen($oferta_descripcion) ? '
      ' . $oferta_descripcion . '': "") ; ?>
     [ editar ]
    + + + + + + + + + + + + + + + + + + + diff --git a/admin/shoop/oferta_db.php b/admin/shoop/oferta_db.php new file mode 100644 index 0000000..49397a4 --- /dev/null +++ b/admin/shoop/oferta_db.php @@ -0,0 +1,65 @@ + \ No newline at end of file diff --git a/admin/shoop/oferta_edit.php b/admin/shoop/oferta_edit.php new file mode 100644 index 0000000..7864cdb --- /dev/null +++ b/admin/shoop/oferta_edit.php @@ -0,0 +1,183 @@ + + + +oferta + + + + + + +
    + + + + + +
    Detalles del producto de ocasión
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Categoría Imagen
    + + + + + + + + + + +
    + + + + + +
    + + + + + + + +
    + + +
    +
    +
    Marca
    + +
    Nombre
    Descripción
    Estado
    + +
    PVP
    Unidades
    + + + + + + + +
    + [ atrás ]   + [ Ok ] + + [ borrar ] +
    +
    + + \ No newline at end of file diff --git a/admin/shoop/upload.php b/admin/shoop/upload.php index 32ebb33..08244e9 100644 --- a/admin/shoop/upload.php +++ b/admin/shoop/upload.php @@ -95,6 +95,50 @@ } } + function uploadImagenOferta($prodID, $size1_w, $size1_h, $size2_w=0, $size2_h=0, $mascara='') { + $path = "../../_ofr/"; // este directorio tiene que tener chmod 777 + $upload_file_name = "ofr_imagen"; // el nombre del campo tipo file de nuestro formulario + $acceptable_file_types = "image/gif|image/jpeg|image/pjpeg"; // acepta GIF et JPEG + $default_extension = ""; + $mode = 1; // OPTIONS: + // 1 = overwrite mode + // 2 = create new with incremental extention + // 3 = do nothing if exists, highest protection + + +// un poco de limpieza previa + // este es el temporal + $glob = glob($path . $prodID. '_tmp'); + limpia($glob); + + limpia($path . '_' . $size1_w . '.jpg'); + limpia($path . '_' . $size2_w . '.jpg'); +// fin de la limpia + + if(strlen($_FILES['ofr_imagen']['name'])) { + $my_uploader = new uploader('es'); // Create a new instance of the class + $my_uploader->max_filesize(150000); // OPTIONAL: set the max filesize of uploadable files in bytes + $my_uploader->max_image_size(1600, 1600); // OPTIONAL: if you're uploading images, you can set the max pixel dimensions + // UPLOAD the file + if ($my_uploader->upload($upload_file_name, $acceptable_file_types, $default_extension)) { + $my_uploader->save_file($path, $prodID . '_tmp', $mode); + if (!$my_uploader->error) { + $my_uploader->resize($prodID . '_' . $size1_w . '.jpg', $size1_w, $size1_h, 60); + if($size2_w) { + $my_uploader->resize($prodID . '_' . $size2_w . '.jpg', $size2_w, $size2_h, 60); + } + $my_uploader->delete_file; + } + } + if ($my_uploader->error) { + echo $my_uploader->error; + } + + $glob = glob($path . $proid. '_tmp'); + limpia($glob); + } + } + function uploadImagenMarca($prodID, $size_w, $size_h, $mascara='') { $path = "../../_logos/c/"; // este directorio tiene que tener chmod 777 $upload_file_name = "marca_imagen"; // el nombre del campo tipo file de nuestro formulario diff --git a/index.php b/index.php index 40aa191..02e7661 100644 --- a/index.php +++ b/index.php @@ -115,7 +115,7 @@ ini_set ('display_errors', '0');
    getNum()){ $arrayOferta = $miOferta->getNextOferta(); include('bann1.php');