Changed wording of some Print buttons and links to survive MU2 testing.
[openemr.git] / interface / patient_file / addr_label.php
blob7161efccc6440e9f10a373d02e35d6a91174c260
1 <?php
2 /**
3 * interface/patient_file/addr_label.php Displaying a PDF file of Labels for printing.
4 *
5 * Program for displaying Address Labels
6 * via the popups on the left nav screen
7 *
8 * Copyright (C) 2014 Terry Hill <terry@lillysystems.com>
9 *
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/classes/PDF_Label.php");
34 require_once("$srcdir/formatting.inc.php");
35 require_once("$srcdir/classes/php-barcode.php");
37 //Get the data to place on labels
40 $patdata = sqlQuery("SELECT " .
41 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
42 "p.street, p.city, p.state, p.postal_code, p.pid " .
43 "FROM patient_data AS p " .
44 "WHERE p.pid = ? LIMIT 1", array($pid));
46 // re-order the dates
48 $today = oeFormatShortDate($date='today');
49 $dob = oeFormatShortDate($patdata['DOB']);
51 $pdf = new PDF_Label('5160'); // used this to get the basic info to the class
52 $pdf = new eFPDF('P', 'mm',array(102,252)); // set the orentation, unit of measure and size of the page
53 $pdf->AddPage();
54 $pdf->SetFont('Arial','',50);
57 $fontSize = 40;
58 $marge = 5; // between barcode and hri in pixel
59 $x = 20; // barcode center
60 $y = 200; // barcode center
61 $height = 40; // barcode height in 1D ; module size in 2D
62 $width = 1; // barcode height in 1D ; not use in 2D
63 $angle = 90; // rotation in degrees
64 $black = '000000'; // color in hexa
68 $text1 = sprintf("%s %s\n", $patdata['fname'], $patdata['lname']);
69 $text2 = sprintf("%s \n", $patdata['street']);
70 $text3 = sprintf("%s , %s\n", $patdata['city'], $patdata['state']);
71 $text4 = sprintf("%s \n", $patdata['postal_code']);
74 $pdf->TextWithRotation($x + $xt, $y + $yt, $text1, $angle);
75 $xt=$xt + 15;
76 $pdf->TextWithRotation($x + $xt, $y + $yt, $text2, $angle);
77 $xt=$xt + 15;
78 $pdf->TextWithRotation($x + $xt, $y + $yt, $text3, $angle);
79 $xt=$xt + 15;
80 $y=$y - 100;
81 $pdf->TextWithRotation($x + $xt, $y + $yt, $text4, $angle);
84 $pdf->Output();