<?php
require_once('../../../includes/load.php');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $marca = remove_junk($db->escape($_POST['marca']));
	$modelo = remove_junk($db->escape($_POST['modelo']));
    $placa = remove_junk($db->escape($_POST['placa']));
    $anio = remove_junk($db->escape($_POST['anio']));
    $motor = remove_junk($db->escape($_POST['motor']));
    $parametro = remove_junk($db->escape($_POST['parametro']));
    $utilizacion = remove_junk($db->escape($_POST['utilizacion']));
    $rendimiento = remove_junk($db->escape($_POST['rendimiento']));
    $codigo = remove_junk($db->escape($_POST['codigo']));
    $activo = remove_junk($db->escape($_POST['activo']));
    $anio = remove_junk($db->escape($_POST['anio']));
    $motor = remove_junk($db->escape($_POST['motor']));
    $parametro = remove_junk($db->escape($_POST['parametro']));
    $utilizacion = remove_junk($db->escape($_POST['utilizacion']));
    $rendimiento = remove_junk($db->escape($_POST['rendimiento']));
    $registro=date("Y-m-d H:i:s");

 
    $query ="INSERT INTO vehiculo( NOMB_VEHIC, MODELO_VEHIC, COD_ACTIVO, PLACA, anio, num_motor, mtto_prevkm, mes_propiokm, rend_combkm, ESTADO, created_at) VALUES ('$marca','$modelo','$codigo','$placa','$anio','$motor','$parametro','$utilizacion','$rendimiento','$activo','$registro')";
   
    if ($db->query($query)) {
        echo 'success';
    } else {
        echo 'fail';
    }
} 



