Portal credential enhancements
[openemr.git] / interface / patient_file / addr_appt_label.php
blob411c5786885fd3ac484f8eb51a444ac6f26267a1
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 * The program example supplied with the Avery Label Print
10 * Class was used to produce this program
13 * @package OpenEMR
14 * @link http://www.open-emr.org
15 * @author Terry Hill <terry@lillysystems.com>
16 * @copyright 2016 Terry Hill <terry@lillysystems.com>
17 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
21 require_once("../globals.php");
24 # This is based on session array.
25 $pid_list = array();
26 $pid_list = $_SESSION['pidList'];
28 #get label type and number of labels on sheet
31 if ($GLOBALS['chart_label_type'] == '1') {
32 $pdf = new PDF_Label('5160');
33 $last = 30;
34 } elseif ($GLOBALS['chart_label_type'] == '2') {
35 $pdf = new PDF_Label('5161');
36 $last = 20;
37 } elseif ($GLOBALS['chart_label_type'] == '3') {
38 $pdf = new PDF_Label('5162');
39 $last = 14;
40 } elseif ($GLOBALS['chart_label_type'] == '4') {
41 $pdf = new PDF_Label('5163');
42 $last = 14; //not sure about $last from here on down
43 } elseif ($GLOBALS['chart_label_type'] == '5') {
44 $pdf = new PDF_Label('5164');
45 $last = 14;
46 } elseif ($GLOBALS['chart_label_type'] == '6') {
47 $pdf = new PDF_Label('8600');
48 $last = 14;
49 } elseif ($GLOBALS['chart_label_type'] == '7') {
50 $pdf = new PDF_Label('L7163');
51 $last = 14;
52 } elseif ($GLOBALS['chart_label_type'] == '8') {
53 $pdf = new PDF_Label('3422');
54 $last = 14;
55 } else {
56 $pdf = new PDF_Label('5160');
57 $last = 30;
59 $pdf->AddPage();
61 #Get the data to place on labels
62 #and output each label
63 foreach ($pid_list as $pid) {
64 $patdata = sqlQuery("SELECT " .
65 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
66 "p.street, p.city, p.state, p.postal_code, p.pid " .
67 "FROM patient_data AS p " .
68 "WHERE p.pid = ? LIMIT 1", array($pid));
70 # sprintf to print data
71 $text = sprintf(" %s %s\n %s\n %s %s %s\n ", $patdata['fname'], $patdata['lname'], $patdata['street'], $patdata['city'], $patdata['state'], $patdata['postal_code']);
72 $pdf->Add_Label($text);
75 $pdf->Output();