Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
0cf587a7 EM |
2 | |
3 | /** | |
4 | * Class CRM_Event_Badge_Logo5395 | |
5 | */ | |
6a488035 | 6 | class CRM_Event_Badge_Logo5395 extends CRM_Event_Badge { |
0cf587a7 EM |
7 | /** |
8 | * | |
9 | */ | |
00be9182 | 10 | public function __construct() { |
6a488035 TO |
11 | parent::__construct(); |
12 | // A4 | |
13 | $pw = 210; | |
14 | $ph = 297; | |
15 | $h = 59.2; | |
16 | $w = 85.7; | |
17 | $this->format = array( | |
18 | 'name' => 'Avery 5395', 'paper-size' => 'A4', 'metric' => 'mm', 'lMargin' => 13.5, | |
19 | 'tMargin' => 3, 'NX' => 2, 'NY' => 4, 'SpaceX' => 15, 'SpaceY' => 8.5, | |
20 | 'width' => $w, 'height' => $h, 'font-size' => 12, | |
21 | ); | |
22 | $this->lMarginLogo = 20; | |
23 | $this->tMarginName = 20; | |
24 | // $this->setDebug (); | |
25 | } | |
26 | ||
0cf587a7 EM |
27 | /** |
28 | * @param $participant | |
29 | */ | |
6a488035 TO |
30 | public function generateLabel($participant) { |
31 | $x = $this->pdf->GetAbsX(); | |
32 | $y = $this->pdf->GetY(); | |
33 | $this->printBackground(TRUE); | |
34 | $this->pdf->SetLineStyle(array('width' => 0.1, 'cap' => 'round', 'join' => 'round', 'dash' => '2,2', 'color' => array(0, 0, 200))); | |
35 | ||
36 | $this->pdf->SetFontSize(9); | |
37 | $this->pdf->MultiCell($this->pdf->width - $this->lMarginLogo, 0, $participant['event_title'], $this->border, "L", 0, 1, $x + $this->lMarginLogo, $y); | |
38 | ||
39 | $this->pdf->SetXY($x, $y + $this->pdf->height - 5); | |
40 | $date = CRM_Utils_Date::customFormat($participant['event_start_date'], "%e %b"); | |
41 | $this->pdf->Cell($this->pdf->width, 0, $date, $this->border, 2, "R"); | |
42 | ||
43 | $this->pdf->SetFontSize(20); | |
44 | $this->pdf->MultiCell($this->pdf->width, 10, $participant['display_name'], $this->border, "C", 0, 1, $x, $y + $this->tMarginName); | |
45 | $this->pdf->SetFontSize(15); | |
46 | $this->pdf->MultiCell($this->pdf->width, 0, $participant['current_employer'], $this->border, "C", 0, 1, $x, $this->pdf->getY()); | |
47 | } | |
48 | } |