-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupc.php
374 lines (359 loc) · 31.3 KB
/
upc.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the Revised BSD License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Revised BSD License for more details.
Copyright 2011-2012 Cool Dude 2k - http://idb.berlios.de/
Copyright 2011-2012 Game Maker 2k - http://intdb.sourceforge.net/
Copyright 2011-2012 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
$FileInfo: upc.php - Last Update: 02/13/2012 Ver. 2.2.5 RC 1 - Author: cooldude2k $
*/
@ob_start("ob_gzhandler");
$website_url = "http://localhost/upc/";
$url_style = 0;
$url_file = "upc.php";
$appname = htmlspecialchars("UPC/EAN Barcode Generator");
$appmakerurl = "https://github.com/GameMaker2k/UPC-A-EAN-13-Maker";
$appmaker = htmlspecialchars("Game Maker 2k");
$appver = array(2,2,5,"RC 1");
$upcdatabase = "http://www.upcdatabase.com/item/%s";
@header("Content-Type: text/html; charset=UTF-8");
@header("Content-Language: en");
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
$_SERVER['HTTP_USER_AGENT'] = "";
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "msie") &&
!strpos($_SERVER['HTTP_USER_AGENT'], "opera")) {
header("X-UA-Compatible: IE=Edge");
}
if (strpos($_SERVER['HTTP_USER_AGENT'], "chromeframe")) {
header("X-UA-Compatible: IE=Edge,chrome=1");
}
header("Date: ".gmdate("D, d M Y H:i:s")." GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
header("Pragma: private, no-cache, no-store, must-revalidate, pre-check=0, post-check=0, max-age=0");
function version_info($proname, $subver, $ver, $supver, $reltype, $svnver, $showsvn)
{
$return_var = $proname." ".$reltype." ".$subver.".".$ver.".".$supver;
if ($showsvn == false) {
$showsvn = null;
}
if ($showsvn == true) {
$return_var .= " SVN ".$svnver;
}
if ($showsvn != true && $showsvn != null) {
$return_var .= " ".$showsvn." ".$svnver;
}
return $return_var;
}
$appversion = version_info($appname, $appver[0], $appver[1], $appver[2], $appver[3]." Ver.", null, false);
require("./functions.php");
if (!isset($_GET['act'])) {
$_GET['act'] = "view";
}
if (!isset($_GET['upc'])) {
$_GET['upc'] = null;
}
if ($_GET['act'] != "upca" && $_GET['act'] != "upce" &&
$_GET['act'] != "ean13" && $_GET['act'] != "ean8" &&
$_GET['act'] != "itf" && $_GET['act'] != "itf14" &&
$_GET['act'] != "code39" && $_GET['act'] != "code93" &&
$_GET['act'] != "view" && $_GET['act'] != "barcode") {
$_GET['act'] = "view";
}
if ($_GET['act'] == "upca" || $_GET['act'] == "upce" ||
$_GET['act'] == "ean13" || $_GET['act'] == "barcode") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_barcode($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if ($_GET['act'] == "itf") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_itf($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if ($_GET['act'] == "itf14") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_itf14($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if ($_GET['act'] == "code39") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_code39($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if ($_GET['act'] == "code93") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_code93($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if ($_GET['act'] == "ean8") {
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
create_ean8($_GET['upc'], $_GET['imgtype'], true, $_GET['resize']);
}
if (validate_ean8($_GET['upc']) === false && validate_upce($_GET['upc']) === false &&
strlen($_GET['upc']) == 8) {
preg_match("/^(\d{7})/", $_GET['upc'], $pre_matches);
$_GET['upc'] = $pre_matches[1].validate_upce($pre_matches[1], true);
}
if (validate_upca($_GET['upc']) === false &&
strlen($_GET['upc']) == 12) {
preg_match("/^(\d{11})/", $_GET['upc'], $pre_matches);
$_GET['upc'] = $pre_matches[1].validate_upca($pre_matches[1], true);
}
if (validate_ean13($_GET['upc']) === false &&
strlen($_GET['upc']) == 13) {
preg_match("/^(\d{12})/", $_GET['upc'], $pre_matches);
$_GET['upc'] = $pre_matches[1].validate_ean13($pre_matches[1], true);
}
if (validate_itf14($_GET['upc']) === false &&
strlen($_GET['upc']) == 14) {
preg_match("/^(\d{13})/", $_GET['upc'], $pre_matches);
$_GET['upc'] = $pre_matches[1].validate_itf14($pre_matches[1], true);
}
if ($_GET['act'] == "view") {
if (isset($_GET['upc']) && !is_numeric($_GET['upc'])) {
$_GET['upc'] = cuecat_decode($_GET['upc']);
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 7) {
$_GET['upc'] = $_GET['upc'].validate_upce($_GET['upc'], true);
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 11) {
$_GET['upc'] = $_GET['upc'].validate_upca($_GET['upc'], true);
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 12 && validate_upca($_GET['upc']) === false) {
$_GET['upc'] = $_GET['upc'].validate_ean13($_GET['upc'], true);
}
$addontitle = null;
if (isset($_GET['upc']) && $_GET['upc'] !== null && $_GET['upc'] !== "") {
if (validate_barcode($_GET['upc']) &&
(strlen($_GET['upc']) == 8 || strlen($_GET['upc']) == 12 || strlen($_GET['upc']) == 13 || strlen($_GET['upc']) == 14)) {
$addontitle = " - ".htmlspecialchars($_GET['upc'], ENT_QUOTES);
}
if (validate_ean8($_GET['upc']) && strlen($_GET['upc']) == 8) {
$addontitle = " - ".htmlspecialchars($_GET['upc'], ENT_QUOTES);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> <?php echo $appname.$addontitle; ?> </title>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Pragma" content="private, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0" />
<meta http-equiv="Expires" content="<?php echo gmdate("D, d M Y H:i:s")." GMT"; ?>" />
<meta name="generator" content="<?php echo $appname; ?>" />
<meta name="author" content="<?php echo $appmaker; ?>" />
<meta name="keywords" content="<?php echo $appname; ?>" />
<meta name="description" content="<?php echo $appname; ?>" />
<base href="<?php echo $website_url; ?>" />
<link rel="icon" href="<?php echo $website_url; ?>favicon.ico" />
<link rel="shortcut icon" href="<?php echo $website_url; ?>favicon.ico" />
<script type="text/javascript">
<!--
// Copyright (c) 2000 Dustin Sallings <[email protected]>
// $Id: kittycode.js,v 1.2 2000/09/20 03:42:24 dustin Exp $
// Any work derived from this code must retain the above copyright.
// Please send all modifications of this script to me.
function kittyCode() {
// Make sure there's something in there before we do this.
if(document.upcform.upc.value.length > 0) {
var parts=document.upcform.upc.value.split('.');
// Valid data will have five parts (the first and last are empty)
// Parts are as follows:
// 0 = empty
// 1 = id
// 2 = type
// 3 = code
// 4 = empty
if(parts.length == 5) {
// We just care about the actual scanned code right now
document.upcform.upc.value=decodePart(parts[3]);
}
}
}
function decodePart(str) {
var m = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-";
var result = "";
var packer = 0;
var count = 0;
var i = 0;
for (i=0; i < str.length; i++) {
// Get the offset to the current character in our map
var x = m.indexOf(str.charAt(i));
// For invalid characters, point them out really well!
if(x<0) {
result += " > " + str.charAt(i) + " < ";
continue;
}
// only count valid characters...why not?
count++;
// Pack them bits.
packer = packer << 6 | x
// every four bytes, we have three valid characters.
if (count == 4) {
result += String.fromCharCode((packer >> 16) ^ 67);
result += String.fromCharCode((packer >> 8 & 255) ^ 67);
result += String.fromCharCode((packer & 255) ^ 67);
count=0; packer=0;
}
}
// Now, deal with the remainders
if(count==2) {
result += String.fromCharCode((( (packer << 12) >> 16) ^ 67));
} else if(count == 3) {
result += String.fromCharCode(( (packer << 6) >> 16) ^ 67);
result += String.fromCharCode(( (packer << 6) >> 8 & 255) ^ 67);
}
return result;
}
function validate_str_size(str) {
if(str==null||str=='') {
alert("You need to enter a UPC/EAN!");
return false; }
if(str.length==0) {
alert("You need to enter a UPC/EAN!");
return false; }
kittyCode();
<?php if ($url_style == 1) { ?>
location.href='<?php echo $website_url; ?>view/'+document.upcform.upc.value+'.htm';
<?php } if ($url_style == 0) { ?>
location.href='<?php echo $website_url.$url_file; ?>?act=view&upc='+document.upcform.upc.value;
<?php } ?>
return true; }
//-->
</script>
</head>
<body>
<form method="get" id="upcform" name="upcform" action="<?php echo $website_url.$url_file; ?>?act=view" onsubmit="validate_str_size(document.upcform.upc.value); return false;">
<label for="upc">Enter UPC:</label><br />
<?php if (isset($_GET['upc'])) { ?>
<input type="text" id="upc" name="upc" value="<?php echo htmlspecialchars($_GET['upc'], ENT_QUOTES); ?>" /><br />
<?php } if (!isset($_GET['upc'])) { ?>
<input type="text" id="upc" name="upc" /><br />
<?php } ?>
<input type="submit" value="Get UPC" onclick="validate_str_size(document.upcform.upc.value); return false;" /> <button type="submit" onclick="validate_str_size(document.upcform.upc.value); return false;">CueCat Decode</button>
<?php if (isset($_GET['upc'])) { ?>
<br /><br />
<?php } ?>
</form>
<?php
if (!isset($_GET['resize']) || !is_numeric($_GET['resize']) || $_GET['resize'] < 1) {
$_GET['resize'] = 1;
}
$addresizeimg = null;
if ($url_style == 1 && $_GET['resize'] > 1) {
$addresizeimg = ".".urlencode($_GET['resize']);
}
if ($url_style == 0 && $_GET['resize'] > 1) {
$addresizeimg = "&resize=".urlencode($_GET['resize']);
}
$upca_code = null;
$upce_code = null;
$ean8_code = null;
$ean13_code = null;
$itf14_code = null;
if (isset($_GET['upc']) && strlen($_GET['upc']) == 14 && validate_itf14($_GET['upc']) === true) {
$itf14_code = $_GET['upc'];
if (preg_match("/^(\d{1})(\d{12})(\d{1})$/", $itf14_code, $upc_matches)) {
$ean13_code = convert_itf14_to_ean13($_GET['upc']);
$upca_code = convert_itf14_to_upca($_GET['upc']);
$upce_code = convert_itf14_to_upce($_GET['upc']);
}
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 8 && validate_upce($_GET['upc']) === true) {
$upce_code = $_GET['upc'];
$upca_code = convert_upce_to_upca($_GET['upc']);
$ean13_code = convert_upce_to_ean13($_GET['upc']);
$itf14_code = convert_ean13_to_itf14($ean13_code);
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 12 && validate_upca($_GET['upc']) === true) {
$upca_code = $_GET['upc'];
$upce_code = convert_upca_to_upce($_GET['upc']);
$ean13_code = convert_upca_to_ean13($_GET['upc']);
$itf14_code = convert_ean13_to_itf14($ean13_code);
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 13 && validate_ean13($_GET['upc']) === true) {
$ean13_code = $_GET['upc'];
if (preg_match("/^0(\d{12})/", $ean13_code, $upc_matches) && $upca_code == null) {
$upca_code = convert_ean13_to_upca($_GET['upc']);
$upce_code = convert_ean13_to_upce($_GET['upc']);
}
$itf14_code = convert_ean13_to_itf14($ean13_code);
}
$ean8_code = $_GET['upc'];
if (isset($_GET['upc']) && strlen($_GET['upc']) == 8 && validate_ean8($upce_code) === true) {
$ean8_code = $upce_code;
}
if (isset($_GET['upc']) && strlen($_GET['upc']) == 8 &&
validate_upce($_GET['upc']) === false && validate_ean8($_GET['upc']) === true) {
$upca_code = convert_ean8_to_upca($_GET['upc']);
$ean13_code = convert_ean8_to_ean13($_GET['upc']);
$itf14_code = convert_ean8_to_itf14($_GET['upc']);
}
//if(isset($upce_code)&&strlen($upce_code)==8&&validate_ean8($upce_code)===true) {
//$ean8_code = $upce_code; }
if (isset($_GET['upc']) && strlen($_GET['upc']) == 14) {
$itf14_code = $_GET['upc'];
}
if (isset($ean8_code) && $ean8_code != "") {
$ean8location = get_gs1_prefix($ean8_code);
}
if (isset($ean13_code) && $ean13_code != "") {
$ean13location = get_gs1_prefix($ean13_code);
}
if (isset($_GET['upc'])) { ?>
<table style="vertical-align: middle; width: 50%;">
<?php if ($upce_code != null && validate_upce($upce_code) === true) { ?>
<tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;">UPC-E: <?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=view&upc=<?php echo urlencode($upce_code); ?>"><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>view/<?php echo urlencode($upce_code); ?>.htm"><?php } ?><?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?></a></td></tr><?php if ($ean13location != false) {
echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\">Issuing Country: ".$ean13location."</td></tr>";
} echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\"><a href=\"".sprintf($upcdatabase, $upce_code)."\" title=\"Lookup ".$upce_code." at UPC Database\">Lookup ".$upce_code." at UPC Database</a></td></tr>";
echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td style="text-align: center; vertical-align: middle; width: 25%;"><?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=upce&upc=<?php echo urlencode($upce_code); ?>&imgtype=png<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=upce&upc=<?php echo urlencode($upce_code); ?>&imgtype=png<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url.$url_file; ?>?act=upce&upc=<?php echo urlencode($upce_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=upce&upc=<?php echo urlencode($upce_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>viewupce/<?php echo urlencode($upce_code); ?><?php echo $addresizeimg; ?>.png"><img style="border: 0px;" src="<?php echo $website_url; ?>viewupce/<?php echo urlencode($upce_code); ?><?php echo $addresizeimg; ?>.png" alt="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url; ?>viewupce/<?php echo urlencode($upce_code); ?><?php echo $addresizeimg; ?>.gif"><img style="border: 0px;" src="<?php echo $website_url; ?>viewupce/<?php echo urlencode($upce_code); ?><?php echo $addresizeimg; ?>.gif" alt="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($upce_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php } ?>
<?php echo "\n";
} if ($upca_code != null && validate_upca($upca_code) === true) { ?>
<tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;">UPC-A: <?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=view&upc=<?php echo urlencode($upca_code); ?>"><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>view/<?php echo urlencode($upca_code); ?>.htm"><?php } ?><?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?></a></td></tr><?php if ($ean13location != false) {
echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\">Issuing Country: ".$ean13location."</td></tr>";
} echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\"><a href=\"".sprintf($upcdatabase, $upca_code)."\" title=\"Lookup ".$upca_code." at UPC Database\">Lookup ".$upca_code." at UPC Database</a></td></tr>";
echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td style="text-align: center; vertical-align: middle; width: 25%;"><?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=upca&upc=<?php echo urlencode($upca_code); ?>&imgtype=png<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=upca&upc=<?php echo urlencode($upca_code); ?>&imgtype=png<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url.$url_file; ?>?act=upca&upc=<?php echo urlencode($upca_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=upca&upc=<?php echo urlencode($upca_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>viewupca/<?php echo urlencode($upca_code); ?><?php echo $addresizeimg; ?>.png"><img style="border: 0px;" src="<?php echo $website_url; ?>viewupca/<?php echo urlencode($upca_code); ?><?php echo $addresizeimg; ?>.png" alt="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url; ?>viewupca/<?php echo urlencode($upca_code); ?><?php echo $addresizeimg; ?>.gif"><img style="border: 0px;" src="<?php echo $website_url; ?>viewupca/<?php echo urlencode($upca_code); ?><?php echo $addresizeimg; ?>.gif" alt="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($upca_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php } ?>
<?php echo "\n";
} if ($ean13_code != null && validate_ean13($ean13_code) === true) { ?>
<tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;">EAN-13: <?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=view&upc=<?php echo urlencode($ean13_code); ?>"><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>view/<?php echo urlencode($ean13_code); ?>.htm"><?php } ?><?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?></a></td></tr><?php if ($ean13location != false) {
echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\">Issuing Country: ".$ean13location."</td></tr>";
} echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\"><a href=\"".sprintf($upcdatabase, $ean13_code)."\" title=\"Lookup ".$ean13_code." at UPC Database\">Lookup ".$ean13_code." at UPC Database</a></td></tr>";
echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td style="text-align: center; vertical-align: middle; width: 25%;"><?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=ean13&upc=<?php echo urlencode($ean13_code); ?>&imgtype=png<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=ean13&upc=<?php echo urlencode($ean13_code); ?>&imgtype=png<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url.$url_file; ?>?act=ean13&upc=<?php echo urlencode($ean13_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=ean13&upc=<?php echo urlencode($ean13_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>viewean13/<?php echo urlencode($ean13_code); ?><?php echo $addresizeimg; ?>.png"><img style="border: 0px;" src="<?php echo $website_url; ?>viewean13/<?php echo urlencode($ean13_code); ?><?php echo $addresizeimg; ?>.png" alt="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url; ?>viewean13/<?php echo urlencode($ean13_code); ?><?php echo $addresizeimg; ?>.gif"><img style="border: 0px;" src="<?php echo $website_url; ?>viewean13/<?php echo urlencode($ean13_code); ?><?php echo $addresizeimg; ?>.gif" alt="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($ean13_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php } ?>
<?php echo "\n";
} if ($ean8_code != null && validate_ean8($ean8_code) === true) { ?>
<tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;">EAN-8: <?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=view&upc=<?php echo urlencode($ean8_code); ?>"><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>view/<?php echo urlencode($ean8_code); ?>.htm"><?php } ?><?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?></a></td></tr><?php if ($ean8location != false) {
echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\">Issuing Country: ".$ean8location."</td></tr>";
} echo "\n <!--<tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\"><a href=\"".sprintf($upcdatabase, $ean8_code)."\" title=\"Lookup ".$ean8_code." at UPC Database\">Lookup ".$ean8_code." at UPC Database</a></td></tr>-->";
echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td style="text-align: center; vertical-align: middle; width: 25%;"><?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=ean8&upc=<?php echo urlencode($ean8_code); ?>&imgtype=png<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=ean8&upc=<?php echo urlencode($ean8_code); ?>&imgtype=png<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url.$url_file; ?>?act=ean8&upc=<?php echo urlencode($ean8_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=ean8&upc=<?php echo urlencode($ean8_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>viewean8/<?php echo urlencode($ean8_code); ?><?php echo $addresizeimg; ?>.png"><img style="border: 0px;" src="<?php echo $website_url; ?>viewean8/<?php echo urlencode($ean8_code); ?><?php echo $addresizeimg; ?>.png" alt="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url; ?>viewean8/<?php echo urlencode($ean8_code); ?><?php echo $addresizeimg; ?>.gif"><img style="border: 0px;" src="<?php echo $website_url; ?>viewean8/<?php echo urlencode($ean8_code); ?><?php echo $addresizeimg; ?>.gif" alt="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($ean8_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php } ?>
<?php echo "\n";
} if ($itf14_code != null && validate_itf14($itf14_code) === true) { ?>
<tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;">ITF-14: <?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=view&upc=<?php echo urlencode($itf14_code); ?>"><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>view/<?php echo urlencode($itf14_code); ?>.htm"><?php } ?><?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?></a></td></tr><?php if ($ean13location != false) {
echo "\n <tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\">Issuing Country: ".$ean13location."</td></tr>";
} echo "\n <!--<tr style=\"text-align: center; vertical-align: middle; width: 50%;\"><td colspan=\"2\" style=\"text-align: left; vertical-align: middle; width: 50%;\"><a href=\"".sprintf($upcdatabase, $itf14_code)."\" title=\"Lookup ".$itf14_code." at UPC Database\">Lookup ".$itf14_code." at UPC Database</a></td></tr>-->";
echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td style="text-align: center; vertical-align: middle; width: 25%;"><?php if ($url_style == 0) { ?><a href="<?php echo $website_url.$url_file; ?>?act=itf14&upc=<?php echo urlencode($itf14_code); ?>&imgtype=png<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=itf14&upc=<?php echo urlencode($itf14_code); ?>&imgtype=png<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url.$url_file; ?>?act=itf14&upc=<?php echo urlencode($itf14_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>"><img style="border: 0px;" src="<?php echo $website_url.$url_file; ?>?act=itf14&upc=<?php echo urlencode($itf14_code); ?>&imgtype=gif<?php echo $addresizeimg; ?>" alt="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php } if ($url_style == 1) { ?><a href="<?php echo $website_url; ?>viewitf14/<?php echo urlencode($itf14_code); ?><?php echo $addresizeimg; ?>.png"><img style="border: 0px;" src="<?php echo $website_url; ?>viewitf14/<?php echo urlencode($itf14_code); ?><?php echo $addresizeimg; ?>.png" alt="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> PNG" title="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> PNG" /></a></td><td style="text-align: center; vertical-align: middle; width: 25%;"><a href="<?php echo $website_url; ?>viewitf14/<?php echo urlencode($itf14_code); ?><?php echo $addresizeimg; ?>.gif"><img style="border: 0px;" src="<?php echo $website_url; ?>viewitf14/<?php echo urlencode($itf14_code); ?><?php echo $addresizeimg; ?>.gif" alt="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> GIF" title="<?php echo htmlspecialchars($itf14_code, ENT_QUOTES); ?> GIF" /></a></td></tr><?php echo "\n "; ?><tr style="text-align: center; vertical-align: middle; width: 50%;"><td colspan="2" style="text-align: left; vertical-align: middle; width: 50%;"> </td></tr><?php } ?>
<?php echo "\n";
} ?>
</table>
<?php } ?>
<div> <br /> </div>
<address><?php echo "<a href=\"".$appmakerurl."\" title=\"".$appname." by ".$appmaker."\">".$appname."</a> ver. ".$appver[0].".".$appver[1].".".$appver[2]." ".$appver[3]; ?></address>
</body>
</html>
<?php } ?>