You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.7 KiB

<?php
/**
* List all vehiculos with a link to edit
*/
require "../../config.php";
require "../../common.php";
try {
$connection = new PDO($dsn, $username, $password, $options);
$sql = "SELECT * FROM vehiculos";
$statement = $connection->prepare($sql);
$statement->execute();
$result = $statement->fetchAll();
} catch(PDOException $error) {
echo $sql . "<br>" . $error->getMessage();
}
?>
<?php require "../templates/header.php"; ?>
<section id="five" class="main style1">
<div class="container">
<section>
<h2>Actualizar vehículos</h2>
<table>
<thead>
<tr>
<th>#</th>
<th>Marca</th>
<th>Modelo</th>
<th>Matrícula</th>
<th>Editar</th>
</tr>
</thead>
<tbody>
<?php foreach ($result as $row) : ?>
<tr>
<td><?php echo escape($row["identificador"]); ?></td>
<td><?php echo escape($row["marca"]); ?></td>
<td><?php echo escape($row["modelo"]); ?></td>
<td><?php echo escape($row["matricula"]); ?></td>
<td><a
href="update-single.php?identificador=<?php echo escape($row["identificador"]); ?>">Edit</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<a href="menu.php" class="button small">Volver</a>
</section>
</div>
</section>
<?php require "../templates/footer.php"; ?>