-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlisteenseignant.php
More file actions
131 lines (116 loc) · 3.09 KB
/
listeenseignant.php
File metadata and controls
131 lines (116 loc) · 3.09 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
<?php
include('config_db/config.php');
include 'dompdf/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
use Dompdf\Options;
// les choses a charger comme pdf dans la page
$html = '
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>liste des enseignants</title>
</head>
<style>
body{
font-family: Arial, Helvetica, sans-serif;
width:100%;
}
table{
border-collapse: collapse;
width:100%;
}
th, td{
border: 1px solid black;
padding: 2px;
}
p{
}
img{
width: 120px;
padding: 2px;
}
.entete{
text-align:center;
padding: 2px;
}
.republique{
font-weight: bold;
padding: 0,5px;
}
h2.dg{
font-weight: bold;
border-bottom: 3px solid black;
}
#footer { position: fixed; right: 0px; bottom: 10px; text-align: center;}
#footer .page:after { content: counter(page, decimal); }
@page { margin: 20px 30px 40px 50px; }
thead{
display: table-header-group;
page-break-inside: avoid;
}
</style>
<body>
<div class="entete ">
<h2 class="republique">REPUBLIQUE DEMOCRATIQUE DU CONGO <br>
PROVINCE DU NORD-KIVU <br>
MINISTERE DE L ENSEIGNEMENT SUPERIEUR ET UNIVERSITAIRE <br>
INSTITUT SUPERIEUR DE COMMERCE-GOMA <br>
<img src="assets/img/isc.jpg" alt="image"> <br>
ISC-GOMA
</h2>
<p style="font-family: Arial, Helvetica, sans-serif; text-align:center; border-style: double;
font-weight: bold;
font-size: 25px;">LISTE DES ENSEIGNANTS</p>
</div>
<table class="table-bordered">
<thead style="background-color: dimgrey;">
<th scope="col">NUMERO</th>
<th scope="col">NOM,POSTNOM,PRENOM</th>
<th scope="col">GENRE</th>
<th scope="col">ETAT-CIVIVIL </th>
<th scope="col">ADRESSE </th>
<th scope="col">TELEPHONE </th>
<th scope="col">MAIL </th>
</thead>
<tbody>';
$sql = "SELECT * FROM enseignant";
$result = mysqli_query($con,$sql);
$numero = 1;
while($agent = mysqli_fetch_assoc($result)){
$html .='
<tr>
<td>'.$numero.'</td>
<td>'.$agent['nom'].' '.$agent['postnom'].' '.$agent['prenom'].'</td>
<td>'.$agent['genre'].'</td>
<td>'.$agent['etat_civil'].'</td>
<td>'.$agent['adresse'].'</td>
<td>'.$agent['numero'].'</td>
<td>'.$agent['mail'].'</td>
</tr>
';
$numero ++;
}
$html .='</tbody>
</table>
<div id="footer">
<p>infoiscgoma@gmail.com</p>
<p class="page">Page </p>
</div>
</body>
</html>';
$dompdf = new Dompdf();
$option = new Options();
$option ->set('chroot', realpath(''));
$dompdf->set_option("isPhpEnabled", true);
$dompdf = new Dompdf($option);
$dompdf->loadHtml($html);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream('print.pdf',['Attachment'=>false]);
?>