Compact css tweak
[openemr.git] / interface / patient_file / addr_appt_label.php
blob05510ee74121929ff30a3af57135393d39ed26b5
1 <?php
2 /**
3 * interface/patient_file/addr_appt_label.php
4 * Displaying a PDF file of Appointment Labels for printing.
6 * Program for displaying Address Labels
7 * from the appointment report or the Recall Board
9 * Copyright (C) 2016 Terry Hill <terry@lillysystems.com>
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Terry Hill <terry@lillysystems.com>
24 * @link http://www.open-emr.org
26 # I used the program example supplied with the Avery Label Print Class to produce this program
29 require_once("../globals.php");
32 # This is based on session array.
33 $pid_list = array();
34 $pid_list = $_SESSION['pidList'];
36 #get label type and number of labels on sheet
39 if ($GLOBALS['chart_label_type'] == '1') {
40 $pdf = new PDF_Label('5160');
41 $last = 30;
42 } elseif ($GLOBALS['chart_label_type'] == '2') {
43 $pdf = new PDF_Label('5161');
44 $last = 20;
45 } elseif ($GLOBALS['chart_label_type'] == '3') {
46 $pdf = new PDF_Label('5162');
47 $last = 14;
48 } elseif ($GLOBALS['chart_label_type'] == '4') {
49 $pdf = new PDF_Label('5163');
50 $last = 14; //not sure about $last from here on down
51 } elseif ($GLOBALS['chart_label_type'] == '5') {
52 $pdf = new PDF_Label('5164');
53 $last = 14;
54 } elseif ($GLOBALS['chart_label_type'] == '6') {
55 $pdf = new PDF_Label('8600');
56 $last = 14;
57 } elseif ($GLOBALS['chart_label_type'] == '7') {
58 $pdf = new PDF_Label('L7163');
59 $last = 14;
60 } elseif ($GLOBALS['chart_label_type'] == '8') {
61 $pdf = new PDF_Label('3422');
62 $last = 14;
63 } else {
64 $pdf = new PDF_Label('5160');
65 $last = 30;
67 $pdf->AddPage();
69 #Get the data to place on labels
70 #and output each label
71 foreach ($pid_list as $pid) {
72 $patdata = sqlQuery("SELECT " .
73 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
74 "p.street, p.city, p.state, p.postal_code, p.pid " .
75 "FROM patient_data AS p " .
76 "WHERE p.pid = ? LIMIT 1", array($pid));
78 # sprintf to print data
79 $text = sprintf(" %s %s\n %s\n %s %s %s\n ", $patdata['fname'], $patdata['lname'], $patdata['street'], $patdata['city'], $patdata['state'], $patdata['postal_code']);
80 $pdf->Add_Label($text);
83 $pdf->Output();