<pre>
<?php

require_once("clases.php");
print_r($_POST);


$rutas = [];
if(file_exists(__DIR__ . "/rutas.txt")){
    $rutas = unserialize(file_get_contents(__DIR__ . "/rutas.txt"));
}

if(isset($_POST)){
    foreach ($_POST['asiento'] as $key => $bus) {
        foreach ($bus as $keya => $asiento) {
            $rutas[$_POST['keyruta']]->VenderTicket($key, $keya);
        }    
    }
}

file_put_contents(__DIR__ . "/rutas.txt", serialize($rutas));
header("Location: ../index.php");
exit();
?>