-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
85 lines (84 loc) · 2.75 KB
/
index.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
<HTML>
<HEAD>
<TITLE>Label maker</TITLE>
<script src="jquery-1.11.3.min.js"></script>
<script>
function bla() {
var size=$('#size').val();
var big1=$('#big1').is(':checked') ? "yes" : "no" ;
var big2=$('#big2').is(':checked') ? "yes" : "no" ;
var qrcode=$('#qrcode').is(':checked') ? "yes" : "no" ;
var font1=$('#font1').val();
var font2=$('#font2').val();
var line1=$('#line1').val();
var line2=$('#line2').val();
$('#preview').attr("src", "output.php?img=true"+
"&text1="+encodeURIComponent(line1)+
"&text2="+encodeURIComponent(line2)+
"&font1="+font1+
"&font2="+font2+
"&big1="+big1+
"&big2="+big2+
"&qrcode="+qrcode+
"&size="+size );
}
function print() {
var size=$('#size').val();
var big1=$('#big1').is(':checked') ? "yes" : "no" ;
var big2=$('#big2').is(':checked') ? "yes" : "no" ;
var qrcode=$('#qrcode').is(':checked') ? "yes" : "no" ;
var font1=$('#font1').val();
var font2=$('#font2').val();
var line1=$('#line1').val();
var line2=$('#line2').val();
$('#printimg').attr("src", "output.php?img=false"+
"&text1="+encodeURIComponent(line1)+
"&text2="+encodeURIComponent(line2)+
"&font1="+font1+
"&font2="+font2+
"&big1="+big1+
"&big2="+big2+
"&qrcode="+qrcode+
"&size="+size );
}
$( document ).ready(function() {
bla();
});
</script>
</HEAD>
<BODY>
<select name="size" id="size" onchange="bla();">
<option value="6">6mm</option>
<option value="9" selected>9mm</option>
<option value="12">12mm</option>
<option value="22">24mm</option>
</select>
<input id="big1" type="checkbox" name="big1" value="yes" onclick="bla();"> Line 1 large
<input id="big2" type="checkbox" name="big2" value="yes" onclick="bla();"> Line 2 large
<select name="font1" id="font1" onchange="bla();">
<?php
$files=glob("*.ttf");
include 'ttfInfo.class.php';
foreach($files as $font) {
$fontinfo = getFontInfo($font);
echo "<option value=\"$font\">".$fontinfo[1]." - ".$fontinfo[2]."</option>";
}
?>
</select>
<select name="font2" id="font2" onchange="bla();">
<?php
foreach($files as $font) {
$fontinfo = getFontInfo($font);
echo "<option value=\"$font\">".$fontinfo[1]." - ".$fontinfo[2]."</option>";
}
?>
</select><input type="submit" id="print" name="print" value="Print" onclick="print();">
<br/>
<span class="line1">Line 1 <input id="line1" type="text" name="text1" size=48 onkeyup="bla();"></span><br/>
<span class="line2">Line 2 <input id="line2" type="text" name="text2" size=48 onkeyup="bla();"></span>
<input id="qrcode" type="checkbox" name="qrcode" value="yes" onclick="bla();">QRcode<br/>
Preview:<br/>
<span ><img style="border-style: solid; border-width: 5px;" id="preview" src=""></span><br>
<img id="printimg" src="">
</BODY>
</HTML>