Huge Bootstrap 4 Classes Fix (#2807)
[openemr.git] / interface / patient_file / label.php
blob2924ce86df692708450d547425f328a14352f298
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 * Used the program example supplied with the Avery Label Print Class to produce this program
11 * @package OpenEMR
12 * @link http://www.open-emr.org
13 * @author Terry Hill <terry@lillysystems.com>
14 * @copyright Copyright (c) 2014 Terry Hill <terry@lillysystems.com>
15 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
19 require_once("../globals.php");
21 //Get the data to place on labels
23 $patdata = sqlQuery("SELECT " .
24 "p.fname, p.mname, p.lname, p.pubpid, p.DOB, " .
25 "p.street, p.city, p.state, p.postal_code, p.pid " .
26 "FROM patient_data AS p " .
27 "WHERE p.pid = ? LIMIT 1", array($pid));
29 // re-order the dates
32 $today = oeFormatShortDate($date = 'today');
33 $dob = oeFormatShortDate($patdata['DOB']);
35 //get label type and number of labels on sheet
38 if ($GLOBALS['chart_label_type'] == '1') {
39 $pdf = new PDF_Label('5160');
40 $last = 30;
43 if ($GLOBALS['chart_label_type'] == '2') {
44 $pdf = new PDF_Label('5161');
45 $last = 20;
48 if ($GLOBALS['chart_label_type'] == '3') {
49 $pdf = new PDF_Label('5162');
50 $last = 14;
53 $pdf->AddPage();
55 // Added spaces to the sprintf for Fire Fox it was having a problem with alignment
56 $text = sprintf(" %s %s\n %s\n %s\n %s", $patdata['fname'], $patdata['lname'], $dob, $today, $patdata['pid']);
58 // For loop for printing the labels
61 for ($i=1; $i<=$last; $i++) {
62 $pdf->Add_Label($text);
65 $pdf->Output();