-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraer-rubro.php
88 lines (83 loc) · 2.74 KB
/
traer-rubro.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
<?php
/**
* Devuelve Informes AJAX
*/
require_once('home.php');
require_once('redirect.php');
$fecha_inicio = $_POST['fecha-inicio'];
$fecha_fin = $_POST['fecha-fin'];
$id_rubro = $_POST['id_rubro'];
$pagadores = $_POST['pagadores'];
$rubro = get_item($id_rubro, $bcdb->rubros);
if($pagadores == 'si') :
$data = get_pagadores_rubro($fecha_inicio, $fecha_fin, $id_rubro);
else :
$data = get_recibos_rubro($fecha_inicio, $fecha_fin, $id_rubro);
endif;
?>
<?php if($pagadores == 'no') : ?>
<table>
<caption>Ingresos recaudados desde el <?php print strftime("%d %b %Y", strtotime($fecha_inicio)); ?> hasta el <?php print strftime("%d %b %Y", strtotime($fecha_fin)); ?> en el rubro <?php print $rubro['descripcion']; ?></caption>
<thead>
<tr>
<th>Código</th>
<th>Concepto</th>
<th>Monto <abbr title="Nuevos Soles">S/.</abbr></th>
</tr>
</thead>
<tbody>
<?php if ($data): ?>
<?php $alt = "even"; ?>
<tr class="<?php print $alt ?>">
<td><?php print $rubro['codigo']; ?></td>
<td><?php print $rubro['descripcion']; ?></td>
<td class="align-right"><?php print nuevos_soles($data['total']); ?></td>
<?php $alt = ($alt == "even") ? "odd" : "even"; ?>
</tr>
<?php else: ?>
<tr class="<?php print $alt; ?>">
<td colspan="3">No existen datos</th>
</tr>
<?php endif; ?>
</tbody>
<?php if ($data): ?>
<tfoot>
<tr>
<th colspan="2" class="align-right no-border">Total:</th>
<th class="align-right"><?php print nuevos_soles($data['total']); ?></th>
</tr>
</tfoot>
<?php endif; ?>
</table>
<p>Son: <strong><?php print convertir($data['total']); ?></strong></p>
<? else : ?>
<table>
<caption>Lista de pagadores desde el <?php print strftime("%d %b %Y", strtotime($fecha_inicio)); ?> hasta el <?php print strftime("%d %b %Y", strtotime($fecha_fin)); ?> en el rubro <?php print $rubro['descripcion']; ?></caption>
<thead>
<tr>
<th>Documento</th>
<th>Nombres</th>
<th>Fecha</th>
<th>Detalle</th>
</tr>
</thead>
<tbody>
<?php if ($data): ?>
<?php foreach($data as $da): ?>
<?php $alt = "even"; ?>
<tr class="<?php print $alt ?>">
<td><?php print $da['documento']; ?></td>
<td><?php print $da['nombres']; ?></td>
<td><?php print fecha_to_page($da['fecha']); ?></td>
<td><a href="ver-recibos.php?ID=<?php print $da['ID']; ?>">Ver detalles</a></td>
<?php $alt = ($alt == "even") ? "odd" : "even"; ?>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr class="<?php print $alt; ?>">
<td colspan="4">No existen datos</th>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>