payment gui remove fancybox
[openemr.git] / interface / patient_file / label.php
blobf881feab134685582ada2baa955d9e789e5a442c
1 <?php
2 /**
3 * interface/patient_file/label.php Displaying a PDF file of Labels for printing.
5 * Program for displaying Chart 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 // I used the program example supplied with the Avery Label Print Class to produce this program
30 require_once("../globals.php");
32 //Get the data to place on labels
34 $patdata = sqlQuery("SELECT " .
35 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
36 "p.street, p.city, p.state, p.postal_code, p.pid " .
37 "FROM patient_data AS p " .
38 "WHERE p.pid = ? LIMIT 1", array($pid));
40 // re-order the dates
43 $today = oeFormatShortDate($date = 'today');
44 $dob = oeFormatShortDate($patdata['DOB']);
46 //get label type and number of labels on sheet
49 if ($GLOBALS['chart_label_type'] == '1') {
50 $pdf = new PDF_Label('5160');
51 $last = 30;
54 if ($GLOBALS['chart_label_type'] == '2') {
55 $pdf = new PDF_Label('5161');
56 $last = 20;
59 if ($GLOBALS['chart_label_type'] == '3') {
60 $pdf = new PDF_Label('5162');
61 $last = 14;
64 $pdf->AddPage();
66 // Added spaces to the sprintf for Fire Fox it was having a problem with alignment
67 $text = sprintf(" %s %s\n %s\n %s\n %s", $patdata['fname'], $patdata['lname'], $dob, $today, $patdata['pid']);
69 // For loop for printing the labels
72 for ($i=1; $i<=$last; $i++) {
73 $pdf->Add_Label($text);
76 $pdf->Output();