<?php

    include("../../classes/database.class.php");
    include("../../classes/carroModel.class.php");
    include("../../classes/carroController.class.php");

    
    $idUsuario = $_POST["idUsuario"];    
    $idFamilia = $_POST["idFamilia"];
    $nomeCarro = $_POST["nomeCarro"];
    $precoCarro = $_POST["precoCarro"];
    $matricula = $_POST["matricula"];

    if($nomeCarro == ""){
        $nomeCarro = null;
    }
    if($preco == ""){
        $preco = null;
    }
    if($matricula == ""){
        $matricula = null;
    }

    $modelo = new CarroController($idUsuario, $idFamilia, $nomeCarro, $precoCarro, $matricula);
    $id = $modelo->createCarro();
    echo $id;

    //, $arCondicionado, $assentoInfantil, $gps, $bagagem, $som, $triangulo, $extintor, $macaco, $chaves, $luvas, $lanterna, $documentos