-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhoraire.php
More file actions
129 lines (114 loc) · 2.93 KB
/
horaire.php
File metadata and controls
129 lines (114 loc) · 2.93 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
<?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>horaire</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;">HORAIRE D"EXAMEN</p>
</div>
<table class="table-bordered">
<thead style="background-color: dimgrey;">
<th scope="col">#</th>
<th scope="col">COURS</th>
<th scope="col">PROMOTION</th>
<th scope="col">DATE</th>
<th scope="col">HEURE</th>
<th scope="col">SESSION</th>
</thead>
<tbody>';
$sql = "SELECT * FROM `vhoraire`";
$result = mysqli_query($con,$sql);
$numero = 1;
while($agent = mysqli_fetch_assoc($result)){
$html .='
<tr>
<td>'.$numero.'</td>
<td>'.$agent['cours'].'</td>
<td>'.$agent['promotion'].'</td>
<td>'.$agent['date_examen'].'</td>
<td>'.$agent['heure'].'</td>
<td>'.$agent['session'].'</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]);
?>