-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_cup_barcode.php
72 lines (52 loc) · 2.19 KB
/
print_cup_barcode.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
<?php
$GLOBALS['nojunk']='';
require_once 'project_common.php';
require_once 'base/verify_login.php';
////////User code below/////////////////////
//$sample_id_array=array(1000000,10000010);
//print_r($sample_id_array);
//exit();
$pdf=get_pdf_link_for_barcode();
for($i=$_POST['from']; $i<=$_POST['to'];$i=$i+6)
{
prepare_cup_barcode($i,$pdf);
}
print_pdf($pdf,'barcode.pdf');
//echo '<pre>';print_r($_POST);echo '</pre>';
//echo '<pre>';print_r($_FILES);echo '</pre>';
function prepare_cup_barcode($sample_id,$pdf)
{
$style=array(
'fitwidth' => false,
'text' => true,
'font' => 'helvetica',
'fontsize' => 6
);
$stylee=array('module_width'=>1,'module_height'=>1);
$w=18;
$h=7;
$rx=26.5;
$ry=23.5;
$delta=6;
$code='C128';
//$code='EAN8';
//$code='EAN13';
//$code='C39';
//$code='S25';
$pdf->AddPage();
//$pdf->write2DBarcode($sample_id, 'QRCODE,L', 10, 10 , 10 , 10,$stylee,'N');
$pdf->SetFont('helveticaB', '', 9);
$pdf->SetXY(3,3);
$pdf->Cell($w,$h,$sample_id,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
$pdf->SetXY(28,3);
$pdf->Cell($w,$h,$sample_id+1,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
$pdf->SetXY(3,9);
$pdf->Cell($w,$h,$sample_id+2,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
$pdf->SetXY(28,9);
$pdf->Cell($w,$h,$sample_id+3,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
$pdf->SetXY(3,15);
$pdf->Cell($w,$h,$sample_id+4,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
$pdf->SetXY(28,15);
$pdf->Cell($w,$h,$sample_id+5,$border=0, $ln=0, $align='', $fill=false, $link='', $stretch=2, $ignore_min_height=false);
}
?>