Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / interface / patient_file / addr_label.php
blob2c7d8c19c01157f899754da12b6a95730f0ae0fc
1 <?php
2 /**
3 * interface/patient_file/addr_label.php Displaying a PDF file of Labels for printing.
5 * Program for displaying Address Labels
6 * via the popups on the left nav screen
8 * Copyright (C) 2014 Terry Hill <terry@lillysystems.com>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 3
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Terry Hill <terry@lillysystems.com>
23 * @link http://www.open-emr.org
25 * this is from the barcode-coder and FPDF website I used the examples and code snippets listed on the sites
26 * to create this program
29 $fake_register_globals=false;
30 $sanitize_all_escapes=true;
32 require_once("../globals.php");
33 require_once("$srcdir/formatting.inc.php");
35 //Get the data to place on labels
38 $patdata = sqlQuery("SELECT " .
39 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
40 "p.street, p.city, p.state, p.postal_code, p.pid " .
41 "FROM patient_data AS p " .
42 "WHERE p.pid = ? LIMIT 1", array($pid));
44 // re-order the dates
46 $today = oeFormatShortDate($date='today');
47 $dob = oeFormatShortDate($patdata['DOB']);
49 $pdf = new PDF_Label('5160'); // used this to get the basic info to the class
50 $pdf = new eFPDF('P', 'mm',array(102,252)); // set the orentation, unit of measure and size of the page
51 $pdf->AddPage();
52 $pdf->SetFont('Arial','',50);
55 $fontSize = 40;
56 $marge = 5; // between barcode and hri in pixel
57 $x = 20; // barcode center
58 $y = 200; // barcode center
59 $height = 40; // barcode height in 1D ; module size in 2D
60 $width = 1; // barcode height in 1D ; not use in 2D
61 $angle = 90; // rotation in degrees
62 $black = '000000'; // color in hexa
66 $text1 = sprintf("%s %s\n", $patdata['fname'], $patdata['lname']);
67 $text2 = sprintf("%s \n", $patdata['street']);
68 $text3 = sprintf("%s , %s\n", $patdata['city'], $patdata['state']);
69 $text4 = sprintf("%s \n", $patdata['postal_code']);
72 $pdf->TextWithRotation($x + $xt, $y + $yt, $text1, $angle);
73 $xt=$xt + 15;
74 $pdf->TextWithRotation($x + $xt, $y + $yt, $text2, $angle);
75 $xt=$xt + 15;
76 $pdf->TextWithRotation($x + $xt, $y + $yt, $text3, $angle);
77 $xt=$xt + 15;
78 $y=$y - 100;
79 $pdf->TextWithRotation($x + $xt, $y + $yt, $text4, $angle);
82 $pdf->Output();