Merge pull request #21572 from colemanw/afformEvents
[civicrm-core.git] / CRM / Event / Badge / Simple.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12
13 /*
14 * Copyright (C) 2010 Tech To The People
15 * Licensed to CiviCRM under the Academic Free License version 3.0.
16 *
17 */
18
19 /**
20 *
21 * @package CRM
22 *
23 */
24 class CRM_Event_Badge_Simple extends CRM_Event_Badge {
25
26 /**
27 * @param $participant
28 */
29 public function generateLabel($participant) {
30 $date = CRM_Utils_Date::customFormat($participant['event_start_date'], "%e %b");
31 $this->pdf->SetFontSize(8);
32 $y = $this->pdf->GetY();
33 $x = $this->pdf->GetAbsX();
34 $this->pdf->Cell($this->pdf->width, $this->pdf->lineHeight, $participant['event_title'], 0, 1, "L");
35 $this->pdf->SetXY($x, $y + 4);
36 $this->pdf->Cell($this->pdf->width, $this->pdf->lineHeight, $date, 0, 2, "R");
37 $this->pdf->SetFontSize(12);
38 $this->pdf->SetXY($x, $this->pdf->GetY() + 5);
39 $this->pdf->Cell($this->pdf->width, $this->pdf->lineHeight, $participant['display_name'], 0, 2, "C");
40 $this->pdf->SetFontSize(10);
41 $this->pdf->SetXY($x, $this->pdf->GetY() + 2);
42 $this->pdf->Cell($this->pdf->width, $this->pdf->lineHeight, $participant['current_employer'], 0, 2, "C");
43 //$this->pdf->MultiCell ($this->pdf->width, $this->pdf->lineHeight, $txt,1,"L");
44 }
45
46 }