-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReporteContratos.php
More file actions
140 lines (117 loc) · 6.52 KB
/
Copy pathReporteContratos.php
File metadata and controls
140 lines (117 loc) · 6.52 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
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
139
140
<?php
session_start();
require_once 'funciones/corroborar_usuario.php';
Corroborar_Usuario();
ob_start();
require_once "conn/conexion.php";
$conexion = ConexionBD();
// Generación del listado de contratos
require_once 'funciones/CRUD-Contratos.php';
$ListadoContratos = Listar_Contratos($conexion);
$CantidadContratos = count($ListadoContratos);
include('head.php');
?>
<body class="bg-light" style="margin: 0 auto;">
<div class="wrapper" style="margin-bottom: 40px; min-height: 100%; overflow: hidden;">
<div class="container" style="max-width: 97%;">
<div class="table-responsive p-5 mb-4 bg-white shadow-sm" style="max-width: 97%; max-height: 700px; margin-top: 10%; border: 2px solid #a80a0a; border-radius: 14px;">
<h2 class="mb-4 " style="color: #a80a0a; padding: 0 0 20px 0;" >
<strong>Reporte: Contratos de arrendamiento de vehículos </strong>
</h2>
<!-- Tabla con reporte de contratos -->
<table class="table table-striped table-hover" id="tablaContratos">
<thead>
<tr>
<th style='color: #c7240e;'><h3>#</h3></th>
<th>Estado Contrato</th>
<th>Contrato</th>
<th>Fecha Ret.</th>
<th>Fecha Dev.</th>
<th>Apellido</th>
<th>Nombre</th>
<th>DNI</th>
<th>Matrícula</th>
<th>Vehículo</th>
<th>Oficina Ret.</th>
<th>Oficina Dev.</th>
<th>Precio día</th>
<th>Cantidad días</th>
<th>Monto total</th>
</tr>
</thead>
<tbody>
<?php
$contador = 1;
for ($i=0; $i < $CantidadContratos; $i++) { ?>
<tr class='contrato' data-id='<?php echo $ListadoContratos[$i]['IdContrato']; ?>'
onclick="selectRow(this, '<?= $ListadoContratos[$i]['IdContrato'] ?>')">
<td><span style='color: #c7240e;'><h4> <?php echo $contador; ?> </h4></span></td>
<td><?php
$estado = strtolower($ListadoContratos[$i]['EstadoContrato']);
$clase = '';
switch ($estado) {
case 'firmado':
$clase = 'primary'; // azul
break;
case 'activo':
$clase = 'success'; // verde
break;
case 'cancelado':
$clase = 'danger'; // rojo
break;
case 'finalizado':
$clase = 'warning'; // naranja
break;
case 'renovado':
$clase = 'secondary'; // púrpura
break;
default:
$clase = 'info'; // celeste
break;}
echo "<span class='badge badge-$clase'>".$ListadoContratos[$i]['EstadoContrato']."</span>";?>
</td>
<td> <?php echo $ListadoContratos[$i]['IdContrato']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['FechaInicioContrato']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['FechaFinContrato']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['apellidoCliente']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['nombreCliente']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['dniCliente']; ?> </td>
<td> <?php echo $ListadoContratos[$i]['vehiculoMatricula']; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['vehiculoModelo']}, {$ListadoContratos[$i]['vehiculoGrupo']}"; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['CiudadSucursal']}, {$ListadoContratos[$i]['DireccionSucursal']}"; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['CiudadSucursal']}, {$ListadoContratos[$i]['DireccionSucursal']}"; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['PrecioPorDiaContrato']} US$"; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['CantidadDiasContrato']} días"; ?> </td>
<td> <?php echo "{$ListadoContratos[$i]['MontoTotalContrato']} US$"; ?> </td>
</tr>
<?php $contador++; ?>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Botón de acción -->
<div style="margin-top: 10px; margin-bottom: 5%;">
<div class="container d-flex justify-content-center">
<span style="margin-right: 10%;">
<a href="contratosAlquiler.php"> <button class="btn" style="color: white; background-color: #a80a0a;" >
Volver
</button></a>
</span>
<a href="ReporteContratos_pdf.php"> <button class="btn btn-warning" >
Imprimir
</button></a>
</div>
</div>
<div style="">
<?php require_once "foot.php"; ?>
</div>
</body>
</html>
<?php
$html = ob_get_clean();
echo $html; // La variable $html ahora contiene la totalidad de la página. Imprimo en pantalla para que se continue viendo la página web
?>