/var/www/hkosl.com/oneMotorChunHing_delete20240201/html/html/html/bchtml/header.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
<?php
if(!defined('IN_CB')) die('You are not allowed to access to this page.');

define('VERSION''2.2.0');

if(
version_compare(phpversion(), '5.0.0''>=') !== true)
    exit(
'Sorry, but you have to run this script with PHP5... You currently have the version <b>' phpversion() . '</b>.');

if(!
function_exists('imagecreate'))
    exit(
'Sorry, make sure you have the GD extension installed before running this script.');

include(
'config.php');

require(
'function.php');

include(
'LSTable.php');

echo 
'<?xml version="1.0" encoding="iso-8859-1"?>' "\n";
?>
<!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>Drawing Barcode</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link type="text/CSS" rel="stylesheet" href="./style.css" />
<script language="JavaScript" type="text/javascript">
function newkey(form,variable){
    form.text2display.value += variable;
}
function newkeyCode(form,variable){
    form.text2display.value += String.fromCharCode(variable);
}
</script>
</head>
<body bgcolor="#ffffff">

<?php
// FileName & Extension
$system_temp_array explode('/'$_SERVER['PHP_SELF']);
$system_temp_array2 explode('.'$system_temp_array[count($system_temp_array) - 1]);
$filename $system_temp_array2[0];

$default_value = array();
$default_value['output'] = 1;
$default_value['dpi'] = 72;
$default_value['thickness'] = 30;
$default_value['res'] = 1;
$default_value['rotation'] = 0.0;
$default_value['font_family'] = '0';
$default_value['font_size'] = 8;
$default_value['text2display'] = '';
$default_value['a1'] = '';
$default_value['a2'] = '';
$default_value['a3'] = '';

$output intval(isset($_POST['output']) ? $_POST['output'] : $default_value['output']);
$dpi = isset($_POST['dpi']) ? $_POST['dpi'] : $default_value['dpi'];
$thickness intval(isset($_POST['thickness']) ? $_POST['thickness'] : $default_value['thickness']);
$res intval(isset($_POST['res']) ? $_POST['res'] : $default_value['res']);
$rotation = isset($_POST['rotation']) ? $_POST['rotation'] : $default_value['rotation'];
$font_family = isset($_POST['font_family']) ? $_POST['font_family'] : $default_value['font_family'];
$font_size intval(isset($_POST['font_size']) ? $_POST['font_size'] : $default_value['font_size']);
$text2display = isset($_POST['text2display']) ? $_POST['text2display'] : $default_value['text2display'];
$a1 = isset($_POST['a1']) ? $_POST['a1'] : $default_value['a1'];
$a2 = isset($_POST['a2']) ? $_POST['a2'] : $default_value['a2'];
$a3 = isset($_POST['a3']) ? $_POST['a3'] : $default_value['a3'];
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" name="barcode_drawer" method="post">
<?php
$table 
= new LSTable(102'500'$null);
$table->setTitle('Configs for ' $filename);
$table->addRowAttribute(0'class''table_title');
$table->addCellAttribute(00'colspan''2');
$table->addCellAttribute(00'align''center');
$table->setText(00'<font color="#ffffff"><b>General Configs</b></font>');
$table->addCellAttribute(10'width''100');
$table->setText(10'Type');
$table->setText(11display_select($filename));
$table->setText(20'Output');
$table->setText(21display_output($output$dpi));
$table->setText(30'DPI');
$table->setText(31display_dpi($output$dpi));
$table->setText(40'Thickness');
$table->setText(41display_thickness($thickness));
$table->setText(50'Resolution');
$table->setText(51display_res($res));
$table->setText(60'Rotation');
$table->setText(61display_rotation($rotation));
$table->setText(70'Font');
$table->setText(71display_font($font_family$font_size));
$table->setText(80'Text');
$table->setText(81display_text($text2display));
$table->addCellAttribute(90'align''center');
$table->addCellAttribute(90'colspan''2');
$table->setText(90'<input type="submit" value="Generate" />');

if(!empty(
$text2display)) {
    
$table->insertRows(101);
    
$table->addCellAttribute(100'align''center');
    
$table->addCellAttribute(100'colspan''2');
    
$table->addRowAttribute(10'style','background-color: #ffffff');
    
$table->setText(100'<img src="image.php?code=' $filename '&amp;o=' $output '&amp;dpi=' $dpi '&amp;t=' $thickness '&amp;r=' $res '&amp;rot=' $rotation '&amp;text=' urlencode($text2display) . '&amp;f1=' $font_family '&amp;f2=' $font_size '&amp;a1=' $a1 '&amp;a2=' $a2 '&amp;a3=' $a3 '" alt="Barcode Image" />');
}
?>