Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
Nula sincro.
#10
Te pongo el fichero completo, copialo todo incluidos los corchetes de cierre finales:


Código:
<?php


// Configuration
require_once '../config.php';
require_once './token.php';
if ($token != $_POST['token']) {
   die;
}
if (!isset($_POST['tipo'])) {
   die;
}
$conexion = mysqli_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD) or die('Error');
mysqli_set_charset($conexion, 'utf8');
mysqli_select_db($conexion, DB_DATABASE);
if ($_POST['tipo'] == 'CAT') {
   $category_id = '';
   $result = mysqli_query($conexion, 'select category_id from ' . DB_PREFIX . 'category where image = \'data/' . $_POST['item'] . '.jpg\'');
   if (mysqli_num_rows($result) > 0) {
       $row = mysqli_fetch_array($result);
       $category_id = $row['category_id'];
       if ($category_id != '') {
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_description where category_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_path where category_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_path where path_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_filter where category_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_to_layout where category_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category_to_store where category_id = ' . $category_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'url_alias where query = \'category_id=' . $category_id . '\'');
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'category where category_id = ' . $category_id);
       }
   }
}
if ($_POST['tipo'] == 'PRO') {
   $product_id = '';
   $result = mysqli_query($conexion, 'select product_id from ' . DB_PREFIX . 'product where model = \'' . $_POST['item'] . '\'');
   if (mysqli_num_rows($result) > 0) {
       $row = mysqli_fetch_array($result);
       $product_id = $row['product_id'];
       if ($product_id != '') {
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_description where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_to_store where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_image where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_attribute where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_discount where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_filter where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_option where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_option_value where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_related where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_reward where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_special where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_to_download where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product_to_layout where product_id = ' . $product_id);
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'url_alias where query = \'product_id=' . $product_id . '\'');
           $result2 = mysqli_query($conexion, 'delete from ' . DB_PREFIX . 'product where product_id = ' . $product_id);
       }
   }
}
?>
Oscar Guirado
Sysme Software

Sysme Software
Veravap
Responder


Mensajes en este tema
Nula sincro. - por FRAN948 - 01-10-2019, 10:12 AM
RE: CABREO MÁXIMO - por sysme - 01-10-2019, 10:43 AM
RE: CABREO MÁXIMO - por FRAN948 - 01-10-2019, 11:07 AM
RE: CABREO MÁXIMO - por sysme - 01-10-2019, 11:26 AM
RE: CABREO MÁXIMO - por FRAN948 - 01-10-2019, 11:36 AM
RE: CABREO MÁXIMO - por FRAN948 - 01-10-2019, 11:43 AM
RE: CABREO MÁXIMO - por FRAN948 - 01-10-2019, 12:32 PM
RE: CABREO MÁXIMO - por sysme - 01-10-2019, 01:21 PM
RE: CABREO MÁXIMO - por FRAN948 - 01-10-2019, 04:03 PM
RE: CABREO MÁXIMO - por sysme - 02-10-2019, 08:52 AM
RE: CABREO MÁXIMO - por FRAN948 - 02-10-2019, 10:02 AM
RE: CABREO MÁXIMO - por sysme - 02-10-2019, 10:53 AM
RE: CABREO MÁXIMO - por FRAN948 - 02-10-2019, 11:30 AM
RE: CABREO MÁXIMO - por FRAN948 - 02-10-2019, 11:57 AM

Salto de foro:


Usuarios navegando en este tema: 4 invitado(s)

Contáctanos | Sysme Software | Volver arriba | | Archivo (Modo simple) | Sindicación RSS