<?php
header('Content-Type: application/json; charset=utf-8');
require_once __DIR__ . '/../includes/functions.php';
$rows = $db->select('qr_code', '*', '', 'id ASC');
$out = [];
foreach ($rows as $row) {
    $out[] = ['AdName' => (string)$row['name'], 'AdUrl' => (string)$row['url']];
}
echo json_encode($out, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
