|
2 | 2 |
|
3 | 3 | chdir(__DIR__ . '/../'); |
4 | 4 |
|
| 5 | +use JeroenDesloovere\VCard\VCard; |
5 | 6 | require('vendor/autoload.php'); |
6 | 7 | $config = require('config/local.php'); |
7 | 8 |
|
|
36 | 37 | $barcode = $barcodeObject->barcode->id; |
37 | 38 | } |
38 | 39 |
|
39 | | - $filename = __DIR__ . '/../qr/' . $attendee->id . '.png'; |
40 | | - echo 'Generating QR for ' . $attendee->id . ' ' . $barcode . PHP_EOL; |
41 | | - \PHPQRCode\QRcode::png($barcode, $filename, 'L', 30, 4); |
| 40 | + // define vcard |
| 41 | + $vcard = new VCard(); |
| 42 | + |
| 43 | + // add personal data |
| 44 | + $vcard->addName($attendee->last_name, $attendee->first_name); |
| 45 | + |
| 46 | + // add work data |
| 47 | + $vcard->addCompany($attendee->company); |
| 48 | + $vcard->addJobtitle($attendee->job_title); |
| 49 | + $vcard->addEmail($attendee->email); |
| 50 | + $vcard->addPhoneNumber($attendee->work_phone, 'PREF;WORK'); |
| 51 | + $vcard->addPhoneNumber($attendee->work_phone, 'WORK'); |
| 52 | + $vcard->addURL($attendee->website); |
| 53 | + |
| 54 | + $numberFilename = __DIR__ . '/../qr/' . $attendee->id . '_number.png'; |
| 55 | + echo 'Generating QR number for ' . $attendee->id . ' ' . $barcode . PHP_EOL; |
| 56 | + \PHPQRCode\QRcode::png($barcode, $numberFilename, 'L', 30, 4); |
| 57 | + |
| 58 | + $vcardFilename = __DIR__ . '/../qr/' . $attendee->id . '_vcard.png'; |
| 59 | + echo 'Generating QR vcard for ' . $attendee->id . ' ' . $barcode . PHP_EOL; |
| 60 | + \PHPQRCode\QRcode::png($vcard->buildVCard(), $vcardFilename, 'L', 30, 4); |
42 | 61 | } |
43 | 62 |
|
44 | 63 | ksort($data); |
|
0 commit comments