<?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/historial.php');
include('../includes/functions.php');
include('../includes/esquemas.php');
include('../class/Schema.php');
include('../class/MotherCar.php');
include('../class/Expediente.php');
include('../class/Bibliotecas.php');
include('../class/Static.php');
$cookieUser = filter_input(INPUT_COOKIE, 'usuario') ?? null; 
$cookieIdioma = filter_input(INPUT_COOKIE, 'idioma') ?? null; 
if((!isset($usuarioSession) or $awa_session_id != $awa_id) or (isset($cookieUser) AND $cookieUser != $staticUsu )){
    eatCookies();
    header('Location:../index.php');}
empty($cookieIdioma)?
    include('../lg/LG_' . $cookieIdioma . '.php'):
    include('../lg/LG_SP.php');

$MotherCar = new MotherCar($con);

$MotherCar->set_codigo_vehiculo_tabla_vehiculos($_SESSION['CODIGO_COCHE']);
$MotherCar->set_llaves(Statics::SafeInput($con, $_POST['llaves']));
$MotherCar->set_velocidades(Statics::SafeInput($con, $_POST['velocidades']));
$MotherCar->set_motor_cc(Statics::SafeInput($con, $_POST['motor']));
$MotherCar->set_procedencia(Statics::SafeInput($con, $_POST['procedencia']));
$MotherCar->update_vehiculo();

$_SESSION['MSG_INFO'] = 'SECUNDARIO';
Statics::add_trace_history($con, $usuarioSession, $_SESSION['CODIGO_COCHE'], 2, $datos_principales_lg);
header("Location:../resultados-editar.php");
