<?php
    session_start();
    $usuarioSession = $_SESSION['USUARIO'];
    $grupo = $_SESSION['GRUPO'];
    $contacto = $_SESSION['CONTACTO'];
    $awa_session_id = $_SESSION['AWA_SESION_ID'];
    include('../includes/conex.php');
    include('../includes/eat.php');
    include('../includes/functions.php');
    include('../includes/historial.php');
    if(!isset($usuarioSession) or $awa_session_id != $awa_id)
    {
      eatCookies();
      header('Location:../index.php');
    }
    if(isset($_COOKIE['usuario']) AND $_COOKIE['usuario'] != $staticUsu )
    {
      eatCookies();
      header('Loction:../index.php');
    }
    if(isset($_COOKIE['idioma']))
    {
      include('../lg/LG_' . $_COOKIE['idioma'] . '.php');
    }
    else
    {
      include('../lg/LG_SP.php');
    }
    
        $clave0 = htmlspecialchars(mysqli_real_escape_string($con,$_POST['clave0']));
        $clave1 = htmlspecialchars(mysqli_real_escape_string($con,$_POST['clave1']));
        $merged = $clave0.$clave1;
        $sql = "SELECT DOCUMENTO, ALIAS, TASACION FROM VEHICULOS_TASACIONES_DOCS WHERE DOCUMENTO = ?";
        $stmt = $con->prepare($sql);
        $stmt->bind_param('s',$merged);
        $stmt->execute();
        $res = $stmt->get_result();
        if($res->num_rows)
        {
            $fila = $res->fetch_array();
            $tasacion = '
                <input type="hidden" name="alias" value="' . $fila['ALIAS'] . '">
                <input type="hidden" name="tasacion" value="' . $fila['TASACION'] . '">';
        }
        else
        {
            $tasacion = '';
        }
        echo '
            <form action="php_o/resultados-eliminar-img.php" method="post">
                <input type="hidden" name="clave" value="' . $merged . '">
                ' . $tasacion . '
                <button type="submit" class="btn btn-danger btn-block">' . $eliminar_lg . '</button>           
            </form>';
?>