From 3a28356193fdcbec0a29783efc7797dc7175ec82 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Mon, 16 Feb 2026 21:31:48 +0000
Subject: [PATCH] Add QR Code renderer

---
 public.php    |   11 +++++++++++
 composer.json |    3 ++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/composer.json b/composer.json
index eefbeab..4218a3b 100644
--- a/composer.json
+++ b/composer.json
@@ -13,6 +13,7 @@
 		"php": ">=8.1",
 		"ext-json": "*",
 		"ubnt/ucrm-plugin-sdk": "^0.9.0",
-		"webit/w-firma-api": "^2.6.0"
+		"webit/w-firma-api": "^2.6.0",
+		"chillerlan/php-qrcode": "^5.0"
 	}
 }
diff --git a/public.php b/public.php
index f56883c..06eb6c9 100644
--- a/public.php
+++ b/public.php
@@ -2,6 +2,17 @@
 require_once(__DIR__ . '/vendor/autoload.php');
 
 try {
+	if (isset($_GET['barcode'])) {
+		header('Content-Type: image/svg+xml');
+		echo (new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
+			'outputBase64' => false,
+			'addQuietzone' => false,
+			'drawLightModules' => false,
+			'connectPaths' => true,
+		])))->render($_GET['barcode']);
+		die();
+	}
+
 	$helper = new \SIPL\UCRM\wFirma\UcrmHelper();
 	$event = $helper->getCurrentEvent();
 

--
Gitblit v1.10.0