-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
72 lines (69 loc) · 2.81 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRUD con PHP usando Programación Orientada a Objetos</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/custom.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-8"><h2>Listado de <b>Clientes</b></h2></div>
<div class="col-sm-4">
<a href="create.php" class="btn btn-info add-new"><i class="fa fa-plus"></i> Agregar cliente</a>
</div>
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>Nombres</th>
<th>Teléfono</th>
<th>Dirección</th>
<th>E-mail</th>
<th>Acciones</th>
</tr>
</thead>
<tbody>
<?php
include ('database.php');
$clientes = new Database();
$listado=$clientes->read();
?>
<?php
while ($row=mysqli_fetch_object($listado)){
$id=$row->id;
$nombres=$row->nombres." ".$row->apellidos;
$telefono=$row->telefono;
$direccion=$row->direccion;
$email=$row->correo_electronico;
?>
<tr>
<td><?php echo $nombres;?></td>
<td><?php echo $telefono;?></td>
<td><?php echo $direccion;?></td>
<td><?php echo $email;?></td>
<td>
<a href="update.php?id=<?php echo $id;?>" class="edit" title="Editar" data-toggle="tooltip"><i class="material-icons"></i></a>
<a href="delete.php?id=<?php echo $id;?>" class="delete" title="Eliminar" data-toggle="tooltip"><i class="material-icons"></i></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>