-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpt_directorio_grupo.php
128 lines (122 loc) · 2.59 KB
/
rpt_directorio_grupo.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
<?php
if(!isset($_GET['ID'])||$_GET['ID']==""){exit();}
// include autoloader
require_once 'dompdf/autoload.inc.php';
require_once("includes/conexion.php");
$SQL=Seleccionar('uvw_tbl_Publicadores','*');
$Datos="";
$i=1;
while($row=sqlsrv_fetch_array($SQL)){
$Datos.="<tr>
<td>".$i."</td>
<td>".$row['NombrePublicador']."</td>
<td>".$row['Direccion']."</td>
<td>".$row['Telefono']."</td>
<td>".$row['Celular']."</td>
<td>".$row['TipoPublicadorAbr']."</td>
<td>".$row['PrivilegioServicioAbr']."</td>
</tr>";
$i++;
}
// reference the Dompdf namespace
use Dompdf\Dompdf;
$dompdf = new Dompdf();
define("DOMPDF_ENABLE_PHP", true);
$HTML1='<html>
<head>
<title>Directorio de grupo</title>
<style>
@page { margin: 120px 50px; }
body{
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:12px;
}
#header{
position: fixed;
left: 0px;
top: -110px;
right: 0px;
height: 150px;
}
#footer{
position: fixed;
left: 0px;
bottom: -2px;
float: right;
height: 2px;
}
#footer .page:after{
content: counter(page);
}
.table-title{
width: 100%;
font-size:14px;
text-align: center;
font-weight: bold;
max-width: 100%;
margin-bottom: 1rem;
background-color: transparent;
}
.table{
border-collapse: collapse;
border: 1px solid #EBEBEB;
width: 100%;
max-width: 100%;
margin-bottom: 1rem;
background-color: transparent;
}
.table > thead > tr > th {
border: 1px solid #e7e7e7;
background-color: #F5F5F6;
padding: 4px;
line-height: 1.42857;
}
.table > tbody > tr > td {
border: 1px solid #e7e7e7;
padding: 4px;
line-height: 1.42857;
}
</style>
</head>
<body>
<div id="footer">
<p class="page">Página </p>
</div>
<table id="header" class="table-title">
<tr>
<td>DIRECTORIO DE GRUPO</td>
</tr>
<tr>
<td>CONGREGACIÓN EL CARMEN, BARRANQUILLA (ATL)</td>
</tr>
</table>
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Nombre del publicador</th>
<th>Dirección</th>
<th>Teléfono</th>
<th>Celular</th>
<th>Tipo publicador</th>
<th>Priv. Servicio</th>
</tr>
</thead>
<tbody>';
$HTML2='</tbody>
</table>
</body>
</html>';
//InsertarLog("Descarga de entrada");
//sqlsrv_close($conexion);
//echo $HTML1.$Datos.$HTML2;/*
// instantiate and use the dompdf class
$dompdf->loadHtml($HTML1.$Datos.$HTML2);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('letter', 'portrait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream("Directorio_grupo.pdf",array("Attachment" => false));
exit(0);
?>