-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhistory.php
More file actions
48 lines (48 loc) · 1.79 KB
/
history.php
File metadata and controls
48 lines (48 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
include('manager/bd-access.php');
session_start();
$auxID = $_SESSION['usr'];
$db = Database::getInstance();
$mysqli = $db->getConnection();
$selectQuery = ("SELECT id FROM usernames WHERE username = '$auxID';" );
$idPoop = $mysqli->query($selectQuery)->fetch_array();
$id = $idPoop['id'];
$query = ("SELECT * FROM reservaciones WHERE user_id = $id");
$results = $mysqli->query($query);
?>
<!DOCTYPE html>
<html>
<head>
<title>NOPM | Autobuses de la Mayab</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://bootswatch.com/yeti/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</head>
<body>
<table class="table table-hover">
<caption>Historial de compras</caption>
<thead>
<tr>
<th>Nombre</th>
<th>Origen</th>
<th>Destino</th>
<th>Fecha y Hora</th>
</tr>
</thead>
<?php foreach ($results as $result): ?>
<tbody>
<tr>
<td><?php print_r($result['nombre']); ?></td>
<td><?php print_r($result['origen']); ?></td>
<td><?php print_r($result['destino']); ?></td>
<td><?php print_r($result['fecha_hora']); ?></td>
</tr>
</tbody>
<?php endforeach; ?>
</table>
<a href="index.php" role="button" class="btn btn-primary btn-lg">Inicio</a>
</body>
</html>