<?php 
require_once "../../packages/phpqrcode/qrlib.php";
// Get the data and item ID from the request
$data = isset($_GET['data']) ? $_GET['data'] : $_POST['data'];
$itemId = isset($_GET['item']) ? $_GET['item'] : $_POST['item'];
$tenant = isset($_GET['tenant']) ? $_GET['tenant'] : $_POST['tenant'];

// Generate the QR code
$filePath = '../../..' . $tenant . '/images/' . $itemId . '.png';
QRcode::png($data, $filePath, 'L', 4, 2);