-
Notifications
You must be signed in to change notification settings - Fork 1
/
print.php
278 lines (256 loc) · 9.47 KB
/
print.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!DOCTYPE html>
<?php
//get input:
if (is_numeric($id = $_GET["id"])) {
require_once 'config.php';
require_once 'functions.php';
$dbh = db_connect();
$domain = "print";
require_once 'locale.php';
///*
$sql = "SELECT data.name, lastname, dob, activities.name as activity, rooms.name as room,
grade, phone, \"mobileCarrier\", paging, parent1, parent2,
\"parentEmail\", medical, \"joinDate\", \"lastSeen\",
\"lastModified\", count, visitor, expiry, \"noParentTag\",
barcode, picture, notes
FROM data
LEFT JOIN activities ON data.activity=activities.id
LEFT JOIN rooms ON data.room = rooms.id
WHERE data.id = :id;";
$sth = $dbh->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$sth->execute(array(":id" => $id));
$edata = $sth->fetch(PDO::FETCH_ASSOC);
if (!$edata) {
header("HTTP/1.1 400 Bad Request");
die("ID " . $id . " does not exist.");
}
$page_title = "{$edata["name"]} {$edata["lastname"]}";
} else {
header("HTTP/1.1 400 Bad Request");
die("Missing or malformed ID parameter");
}
?>
<html>
<head>
<title><?php echo $edata["name"] . " " . $edata["lastname"]; ?></title>
<script>
function Print(){document.body.offsetHeight;window.print()};
</script>
<style type="text/css">
p.date {
text-align: right;
font-family: sans;
font-size: 12px;
}
p {
font-family: sans;
font-size: 16px;
}
p.info {
margin-left: 10px;
}
p.float {
text-align: right;
display: inline-table;
}
p.head {
text-align: center;
}
.circle {
border-radius: 50%;
display: inline-block;
margin-right: 5px;
margin-left: 10px;
margin-top: 5px;
margin-bottom: 0px;
float: middle;
}
#circle1 {
width: 20px;
height: 20px;
background: #EAEAEA;
border: 4px solid #000000;
}
#circle2 {
width: 5px;
height: 5px;
background: #000000;
border: 4px solid #000000;
}
#checkbox {
vertical-align: top;
margin-top: 4px;
margin-left: 5px;
margin-right: 2px;
}
table.field {
border-width: 1px;
border-spacing: 0px;
border-style: solid;
border-color: white;
border-collapse: separate;
background-color: white;
}
table.field th {
border-width: 1px;
padding: 0px;
border-style: solid;
border-color: grey;
background-color: white;
}
table.field td {
border-width: 2px;
padding: 0px;
border-style: solid;
border-color: black;
background-color: white;
}
hr {
color: #000000;
background-color: #000000;
height: 2px;
}
</style>
</head>
<body onload="Print()">
<table width=800px><tr>
<td width=200>
<img src="photo.php?id=<?php echo $edata["picture"] ?>" width=200>
</td>
<td>
<p class="info" style="font-size: 24px"><b><?php echo $edata["lastname"] ?>,<br/>
<?php echo $edata["name"]?></b><br/></p><p class="info">
<?php echo _("Activity") . ": " . $edata["activity"]; ?><br/>
<?php echo _("Room") . ": " . $edata["room"]; ?><br/>
</p>
<p class="info" style="font-size: 12px">
<?php echo sprintf(_("Created: %s"), strftime(_("%e %B %Y"), strtotime($edata["joinDate"]))) ?><br>
<?php echo sprintf(_("Last Seen: %s"), strftime(_("%e %B %Y"), strtotime($edata["lastSeen"]))) ?><br>
<?php echo sprintf(_("Modified: %s"), strftime(_("%e %b %Y %H:%M:%S"), strtotime($edata["lastModified"]))) ?><br>
<?php echo sprintf(_("Check-in Count: %s"), $edata["count"]) ?>
</p>
</td>
<td valign="top">
<!-- keeping RFC date format for interoperability purposes-->
<p class="date"><?php echo date("r") ?></p>
<img src="resources/logo.png" width=300 style="float:right; vertical-align:top">
</td>
</tr></table>
<table class="field" width=800px><tr>
<td width=90px>
<p class="head"><b><?php echo _("Name"); ?></b></p>
</td>
<td width=287px><p class="info"><?php echo $edata["name"]?></p></td>
<td width=120px><p class="head"><b><?php echo _("Last name"); ?></b></p></td>
<td width=287px><p class="info"><?php echo $edata["lastname"]?></p></td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=90px>
<p class="head"><b><?php echo _("Phone"); ?></b></p>
</td>
<td width=286px><p class="info"><?php echo $edata["phone"]?></p></td>
<td>
<img src="resources/check-<?php echo $edata["mobileCarrier"] ? "on" : "off"?>.png" id="checkbox">
<p class="float"><?php echo _("Mobile?"); ?> </p>
</td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=90px>
<p class="head"><b><?php echo _("Grade"); ?></b></p>
</td>
<td width=40px><p class="head"><?php echo $edata["grade"]?></p></td>
<td width=140px>
<p class="head"><b><?php echo _("DOB"); ?></b> <?php echo _("D/M/Y"); ?></p>
</td>
<td width=140px><p class="info"><?php echo strftime(_("%d/%m/%Y"), strtotime($edata["dob"]))?></p></td>
<td width=80px>
<p class="head"><b><?php echo _("Email"); ?></b></p>
</td>
<td><p class="info"><?php echo $edata["parentEmail"]?></p></td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=100px>
<p class="head"><b><?php echo _("Parent 1"); ?></b></p>
</td>
<td width=286px><p class="info"><?php echo $edata["parent1"]?></p></td>
<td width=100px>
<p class="head"><b><?php echo _("Parent 2"); ?></b></p>
</td>
<td><p class="info"><?php echo $edata["parent2"]?></p></td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=110px>
<p class="head"><b><?php echo _("Medical & Allergies"); ?></b></p>
</td>
<td width=276px><p class="info"><?php echo $edata["medical"]?></p></td>
<td width=110px>
<p style="text-align: center"><b><?php echo _("Special Instructions"); ?></b></p>
</td>
<td><p class="info"><?php echo $edata["notes"]?></p></td>
</tr></table>
<img src="resources/black.gif" width=800 height=3 style="margin-top: 10px">
<p><?php echo _("Additional information and emergency contact (optional):"); ?></p>
<table class="field" width=800px height=50px><tr>
<td width=100px>
<p class="head"><b><?php echo _("Address"); ?></b></p>
</td>
<td width=676px><p class="info"> </p></td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=100px>
<p class="head"><b><?php echo _("City"); ?></b></p>
</td>
<td width=190px>
<p class="info"> </p>
</td>
<td width=100px>
<p class="head"><b><?php echo _("State"); ?></b></p>
</td>
<td width=100px>
<p class="info"> </p>
</td>
<td width=100px>
<p class="head"><b><?php echo _("ZIP"); ?></b></p>
</td>
<td width=170px>
<p class="info"> </p>
</td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=100px>
<p class="head"><b><?php echo _("Parent 1 Phone"); ?></b></p>
</td>
<td width=286px><p class="info"> </p></td>
<td>
<p class="info"><?php echo _("Mobile"); ?>: </p>
</td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=100px>
<p class="head"><b><?php echo _("Parent 2 Phone"); ?></b></p>
</td>
<td width=286px><p class="info"> </p></td>
<td>
<p class="info"><?php echo _("Mobile"); ?>: </p>
</td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=120px>
<p class="head"><b><?php echo _("Emergency Contact 1"); ?></b></p>
</td>
<td width=286px><p class="info"> </p></td>
<td>
<p class="info"><?php echo _("Relationship"); ?>: </p>
</td>
</tr></table>
<table class="field" width=800px height=50px><tr>
<td width=120px>
<p class="head"><b><?php echo _("Emergency Contact 2"); ?></b></p>
</td>
<td width=286px><p class="info"> </p></td>
<td>
<p class="info"><?php echo _("Relationship"); ?>: </p>
</td>
</tr></table>
</body>
</html>