-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuses.php
138 lines (87 loc) · 1.93 KB
/
buses.php
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once('php/setupdb.php');
if(isset($_GET['delete'])){
$id=$_GET['delete'];
$bus = R::load(BUSES, $id );
R::trash($bus);
}
if(isset($_POST['form'])){
$bus = R::dispense(BUSES);
$bus->idTelefono=$_POST['idTelefono'];
$bus->nombre=$_POST['nombre'];
$bus->posiciones=$_POST['posiciones'];
$bus->codigo=$_POST['codigo'];
$bus->mensaje=$_POST['mensaje'];
R::store($bus);
}
?>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-1"></div>
<div class="col-xs-10">
<table class="table table-condensed table-striped">
<tr>
<td>
idTelefono
</td>
<td>
Nombre
</td>
<td>
Posiciones
</td>
<td>
Codigo
</td>
<td>
Mensaje
</td>
<td>
Eliminar
</td>
</tr>
<?php
$buses = R::findAll(BUSES);
foreach($buses as $bus) {
echo '
<tr>
<td>
'.$bus->idTelefono.'
</td>
<td>
'.$bus->nombre.'
</td>
<td>
'.str_replace(":", "<br/>", $bus->posiciones).'
</td>
<td>
'.$bus->codigo.'
</td>
<td>
'.$bus->mensaje.'
</td>
<td><a href="buses.php?delete='.$bus->id.'"><button class="btn btn-default">Eliminar</button></a></td>
</tr>
';
}
?>
</table>
<br/>
</div>
<div class="col-xs-1"></div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="js/buses.js"></script>
</body>
</html>