PATH:
var
/
www
/
vhosts
/
lahuertaatomica.es
/
httpdocs
/
admin
/
modules
/
clientes
/
Editing: update.php
<?php $error = abs(intval($_GET["error"])); $idcliente = abs(intval($_GET["idcliente"])); if ($_POST) { $cliente = trim(strip_tags($_POST["cliente"])); $token = trim(strip_tags($_POST["token"])); if ($_FILES["imagen"]["error"] == 0) { $consulta = "select Logo from clientes where IDCliente = " . $idcliente; $valor = mysqli_query($conexion,$consulta); $valor_array = mysqli_fetch_assoc($valor); $imagen_antigua = $valor_array["Imagen"]; $imagen = clean_name($_FILES["imagen"]["name"]); } if ($cliente != "") { $consulta = "update clientes set Cliente = '" . mysqli_real_escape_string($conexion,$cliente) . "', Token = '" . mysqli_real_escape_string($conexion,$token) . "'"; if ($_FILES["imagen"]["error"] == 0) { $consulta .= ", Imagen = '" . mysqli_real_escape_string($conexion,$imagen) . "'"; } $consulta .= " where IDCliente = " . $idcliente; $resultado = mysqli_query($conexion,$consulta); if ($resultado) { if ($_FILES["imagen"]["error"] == 0) { $origen = $_FILES["imagen"]["tmp_name"]; $destino = "../store/logos/" . $imagen; $resultado = move_uploaded_file($origen,$destino); unlink("../store/logos/" . $imagen_antigua); if ($resultado) { $error = 1; } else { $error = 3; } } else { $error = 1; } } else { $error = 2; } } else { $error = 9; } } $consulta = "select * from clientes where IDCliente = " . $idcliente; $registro = mysqli_query($conexion,$consulta); $cliente = mysqli_fetch_assoc($registro); $ruta = obtenerPlantilla($seccion); if (file_exists($ruta)) { require_once($ruta); } ?>
SAVE
CANCEL