$accessoris = $form->crearElement("codi_accessori");
$accessoris->setTipus("array");
$accessoris->setRestriccio(false);
include 'classes/Llistes/LlistaVenedors.php';
$venedors = new LlistaVenedors();
include 'classes/Llistes/LlistaClients.php';
$clients = new LlistaClients();
include 'classes/Llistes/LlistaVehicle.php';
$vehicles = new LlistaVehicle();
if (count($_POST)) {
    if ($form->valida($_POST)) {
        $infos = array();
        array_push($infos, $venedor, $client, $vehicle, $datai, $kmi);
        $lloguer = new Lloguer();
        $lloguer->setInfos($infos);
        $lloguer->setAccessoris($accessoris->getValor());
        if ($lloguer->save()) {
            header('location: lloga_vehicle.php?inserit');
            exit;
        } else {
            $errors = $lloguer->getErrors();
        }
    } else {
        $errors = $form->mostrarErrors();
    }
} else {
    $errors = $form->mostrarErrors();
}
?>