Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
0cf587a7 EM |
2 | |
3 | /** | |
4 | * Class CRM_Event_Badge_Logo | |
5 | */ | |
6a488035 | 6 | class CRM_Event_Badge_Logo extends CRM_Event_Badge { |
0cf587a7 EM |
7 | /** |
8 | * | |
9 | */ | |
6a488035 TO |
10 | function __construct() { |
11 | parent::__construct(); | |
12 | // A4 | |
13 | $pw = 210; | |
14 | $ph = 297; | |
15 | $h = 50; | |
16 | $w = 75; | |
17 | $this->format = array( | |
18 | 'name' => 'Sigel 3C', 'paper-size' => 'A4', 'metric' => 'mm', 'lMargin' => ($pw - $w * 2) / 2, | |
19 | 'tMargin' => ($ph - $h * 5) / 2, 'NX' => 2, 'NY' => 5, 'SpaceX' => 0, 'SpaceY' => 0, | |
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(8); | |
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(15); | |
44 | $this->pdf->MultiCell($this->pdf->width, 10, $participant['display_name'], $this->border, "C", 0, 1, $x, $y + $this->tMarginName); | |
45 | $this->pdf->SetFontSize(10); | |
46 | $this->pdf->MultiCell($this->pdf->width, 0, $participant['current_employer'], $this->border, "C", 0, 1, $x, $this->pdf->getY()); | |
47 | } | |
48 | } | |
49 |