<?php
header('Content-Type: application/manifest+json');
require 'RGShenn.php';

$cfg = $call->query("SELECT * FROM conf WHERE code = 'webcfg'")->fetch_assoc();
$name  = $cfg['c1'] ?? 'GCL Pay';
$desc  = $cfg['c2'] ?? 'Aplikasi top up dan transaksi digital';
$icon  = $cfg['c5'] ?? base_url('library/assets/images/icon/logo.png');
$base  = 'https://' . $_SERVER['SERVER_NAME'] . '/gcl/';

$manifest = [
    "name"             => $name,
    "short_name"       => $name,
    "description"      => $desc,
    "start_url"        => $base,
    "scope"            => $base,
    "display"          => "standalone",
    "orientation"      => "portrait",
    "background_color" => "#5A24A8",
    "theme_color"      => "#5A24A8",
    "lang"             => "id",
    "icons"            => [
        ["src" => $icon, "sizes" => "192x192", "type" => "image/png"],
        ["src" => $icon, "sizes" => "512x512", "type" => "image/png"],
        ["src" => $icon, "sizes" => "any",     "type" => "image/png", "purpose" => "maskable any"]
    ]
];

echo json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
