b912ff22bc
- SSO session auth gating on all protected pages - dashboard.php: account section (profile form + workspace panel), onboarding prompt modal, overview bar extracted to CSS classes, dashboard.css linked in page head - api/profile.php: save/dismiss endpoint for optional profile fields - assets/css/dashboard.css: account grid, dash-account-panel, dash-profile-form, profile-prompt-backdrop modal, overview bar classes, dash-section-kicker, dash-tier-badge base styles - includes/bootstrap.php: dbnToolsMainUserProfile, dbnToolsProfileNeedsPrompt, dbnToolsRequirePageAuth - scripts/sql/004_user_profile_fields.sql: nullable phone, address, and profile_prompt_dismissed_at columns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
509 lines
29 KiB
PHP
509 lines
29 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_once __DIR__ . '/includes/FreeTier.php';
|
|
require_once __DIR__ . '/includes/PricingCatalog.php';
|
|
|
|
$uiLang = dbnToolsCurrentLanguage();
|
|
$isAuthed = dbnToolsIsAuthenticated();
|
|
if (!$isAuthed) {
|
|
dbnToolsRequirePageAuth($_SERVER['REQUEST_URI'] ?? '/pricing.php');
|
|
}
|
|
$isAuthed = true;
|
|
$currentTier = $isAuthed ? dbnToolsCurrentTier() : 'free';
|
|
$surveyDone = false;
|
|
if ($isAuthed && dbnToolsIsFreeTier()) {
|
|
$surveyDone = FreeTier::hasCompletedSurvey((int)$_SESSION['dbn_tools_sso_uid']);
|
|
}
|
|
|
|
$status = (string)($_GET['status'] ?? '');
|
|
$loginUrl = 'https://dobetternorge.no/tools-login.php?return=' . urlencode('/pricing.php');
|
|
$surveyUrl = 'https://dobetternorge.no/survey.php';
|
|
$orgUrl = 'mailto:support@dobetternorge.no?subject=DBN%20Tools%20Organisasjon';
|
|
|
|
function h(mixed $value): string
|
|
{
|
|
return htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8');
|
|
}
|
|
|
|
function nok(int $amount): string
|
|
{
|
|
return PricingCatalog::formatNok($amount);
|
|
}
|
|
|
|
function credits(int $amount): string
|
|
{
|
|
return PricingCatalog::formatCredits($amount);
|
|
}
|
|
|
|
$copy = match ($uiLang) {
|
|
'no' => [
|
|
'title' => 'Priser - DBN Tools',
|
|
'description' => 'NOK-priser, kreditter og abonnement for tools.dobetternorge.no.',
|
|
'eyebrow' => 'NOK-priser for DBN Tools',
|
|
'headline' => 'Kreditter som gir mening',
|
|
'subhead' => 'Månedlige kreditter brukes først. Forhåndsbetalte kreditter legges på toppen og utløper ikke.',
|
|
'trial' => 'Pluss har 14 dagers prøveperiode. Kort kreves, og du kan kansellere når som helst.',
|
|
'survey_title' => 'Få 25 ekstra kreditter',
|
|
'survey_text' => 'Svar på fem korte spørsmål om hvordan du bruker verktøyene.',
|
|
'survey_cta' => 'Ta undersøkelsen',
|
|
'current' => 'Din plan',
|
|
'choose' => 'Velg',
|
|
'login' => 'Logg inn for å velge',
|
|
'available' => 'Tilgjengelig',
|
|
'topups_title' => 'Ekstra kreditter',
|
|
'topups_lead' => 'Top-ups er engangskjøp. De utløper ikke og brukes etter månedlige kreditter.',
|
|
'buy' => 'Kjøp',
|
|
'login_buy' => 'Logg inn for å kjøpe',
|
|
'tool_costs' => 'Verktøykostnader',
|
|
'tool_costs_lead' => 'Kreditter trekkes bare når verktøyet fullfører med et gyldig resultat.',
|
|
'organisation' => 'Organisasjon',
|
|
'organisation_price' => 'Kontakt',
|
|
'organisation_text' => 'For rådgivere, frivillige miljøer og større familieteam som trenger flere brukere, særskilte avtaler eller onboarding.',
|
|
'contact' => 'Snakk med oss',
|
|
'billing_note' => 'Stripe brukes for kortbetaling, abonnement og kvitteringer. Lokale DBN-kreditter er fasiten for tilgang.',
|
|
'status_success' => 'Betalingen er bekreftet. Kontoen oppdateres når Stripe-webhooken er behandlet.',
|
|
'status_canceled' => 'Betalingen ble avbrutt. Ingen endringer er gjort.',
|
|
'connecting' => 'Kobler til Stripe...',
|
|
'checkout_error' => 'Kunne ikke starte betaling. Prøv igjen.',
|
|
'per_month' => '/ mnd',
|
|
'starter_tier' => 'Startnivå',
|
|
'credit_unit' => 'kreditt',
|
|
'credits_unit' => 'kreditter',
|
|
'custom_terms' => 'Tilpasset avtale',
|
|
'more_users' => 'Flere brukere',
|
|
'custom_credits' => 'Tilpassede kreditter',
|
|
'onboarding_support' => 'Onboarding og støtte',
|
|
'agreed_directly' => 'Avtales direkte',
|
|
'paid_runs_per_hour' => 'betalte kjøringer per time',
|
|
'table_cost' => 'Kostnad',
|
|
'table_tools' => 'Verktøy',
|
|
'variable' => 'variabel',
|
|
'transcribe_cost' => 'transcribe: 1 kreditt per startet lydminutt, minst 5',
|
|
],
|
|
'uk' => [
|
|
'title' => 'Ціни - DBN Tools',
|
|
'description' => 'Ціни в NOK, кредити та підписки для tools.dobetternorge.no.',
|
|
'eyebrow' => 'Ціни в NOK для DBN Tools',
|
|
'headline' => 'Кредити, які мають сенс',
|
|
'subhead' => 'Щомісячні кредити витрачаються першими. Передоплачені кредити додаються зверху і не закінчуються.',
|
|
'trial' => 'Plus включає 14-денний пробний період. Картка обов\'язкова, скасування в будь-який час.',
|
|
'survey_title' => 'Отримайте 25 додаткових кредитів',
|
|
'survey_text' => 'Дайте відповідь на п\'ять коротких запитань про те, як ви використовуєте інструменти.',
|
|
'survey_cta' => 'Пройти опитування',
|
|
'current' => 'Ваш план',
|
|
'choose' => 'Вибрати',
|
|
'login' => 'Увійти для вибору',
|
|
'available' => 'Доступно',
|
|
'topups_title' => 'Додаткові кредити',
|
|
'topups_lead' => 'Поповнення — це одноразові покупки. Вони не закінчуються і витрачаються після щомісячних кредитів.',
|
|
'buy' => 'Купити',
|
|
'login_buy' => 'Увійти для покупки',
|
|
'tool_costs' => 'Вартість інструментів',
|
|
'tool_costs_lead' => 'Кредити знімаються лише тоді, коли інструмент завершує роботу з дійсним результатом.',
|
|
'organisation' => 'Організація',
|
|
'organisation_price' => 'Зв\'язатися',
|
|
'organisation_text' => 'Для консультантів, волонтерських організацій та великих сімейних команд, яким потрібно більше користувачів, особливі умови або підтримка.',
|
|
'contact' => 'Зв\'яжіться з нами',
|
|
'billing_note' => 'Stripe обробляє картки, підписки та квитанції. Місцеві кредити DBN залишаються авторитетними для доступу.',
|
|
'status_success' => 'Оплату підтверджено. Ваш обліковий запис оновиться після обробки вебхука Stripe.',
|
|
'status_canceled' => 'Оплату скасовано. Жодних змін не внесено.',
|
|
'connecting' => 'Підключення до Stripe...',
|
|
'checkout_error' => 'Не вдалося розпочати оплату. Спробуйте ще раз.',
|
|
'per_month' => '/ міс',
|
|
'starter_tier' => 'Стартовий рівень',
|
|
'credit_unit' => 'кредит',
|
|
'credits_unit' => 'кредитів',
|
|
'custom_terms' => 'Індивідуальні умови',
|
|
'more_users' => 'Більше користувачів',
|
|
'custom_credits' => 'Індивідуальні кредити',
|
|
'onboarding_support' => 'Підтримка та онбординг',
|
|
'agreed_directly' => 'Погоджується безпосередньо',
|
|
'paid_runs_per_hour' => 'платних запусків на годину',
|
|
'table_cost' => 'Вартість',
|
|
'table_tools' => 'Інструменти',
|
|
'variable' => 'змінна',
|
|
'transcribe_cost' => 'transcribe: 1 кредит за розпочату хвилину аудіо, мінімум 5',
|
|
],
|
|
'pl' => [
|
|
'title' => 'Cennik - DBN Tools',
|
|
'description' => 'Ceny w NOK, kredyty i subskrypcje dla tools.dobetternorge.no.',
|
|
'eyebrow' => 'Ceny w NOK dla DBN Tools',
|
|
'headline' => 'Kredyty, które mają sens',
|
|
'subhead' => 'Miesięczne kredyty są wydawane jako pierwsze. Opłacone z góry kredyty są dodawane na wierzchu i nigdy nie wygasają.',
|
|
'trial' => 'Plus zawiera 14-dniowy okres próbny. Wymagana karta, anulowanie w dowolnym momencie.',
|
|
'survey_title' => 'Zdobądź 25 dodatkowych kredytów',
|
|
'survey_text' => 'Odpowiedz na pięć krótkich pytań dotyczących korzystania z narzędzi.',
|
|
'survey_cta' => 'Wypełnij ankietę',
|
|
'current' => 'Twój plan',
|
|
'choose' => 'Wybierz',
|
|
'login' => 'Zaloguj się, aby wybrać',
|
|
'available' => 'Dostępny',
|
|
'topups_title' => 'Dodatkowe kredyty',
|
|
'topups_lead' => 'Doładowania to jednorazowe zakupy. Nigdy nie wygasają i są wydawane po miesięcznych kredytach.',
|
|
'buy' => 'Kup',
|
|
'login_buy' => 'Zaloguj się, aby kupić',
|
|
'tool_costs' => 'Koszty narzędzi',
|
|
'tool_costs_lead' => 'Kredyty są pobierane tylko wtedy, gdy narzędzie kończy pracę z prawidłowym wynikiem.',
|
|
'organisation' => 'Organizacja',
|
|
'organisation_price' => 'Kontakt',
|
|
'organisation_text' => 'Dla doradców, organizacji wolontariackich i większych zespołów rodzinnych potrzebujących więcej użytkowników, niestandardowych warunków lub wsparcia.',
|
|
'contact' => 'Skontaktuj się z nami',
|
|
'billing_note' => 'Stripe obsługuje karty, subskrypcje i paragony. Lokalne kredyty DBN pozostają miarodajne dla dostępu.',
|
|
'status_success' => 'Płatność potwierdzona. Twoje konto zostanie zaktualizowane po przetworzeniu webhooka Stripe.',
|
|
'status_canceled' => 'Płatność została anulowana. Nie wprowadzono żadnych zmian.',
|
|
'connecting' => 'Łączenie ze Stripe...',
|
|
'checkout_error' => 'Nie można rozpocząć płatności. Spróbuj ponownie.',
|
|
'per_month' => '/ mies',
|
|
'starter_tier' => 'Poziom startowy',
|
|
'credit_unit' => 'kredyt',
|
|
'credits_unit' => 'kredytów',
|
|
'custom_terms' => 'Warunki niestandardowe',
|
|
'more_users' => 'Więcej użytkowników',
|
|
'custom_credits' => 'Niestandardowe kredyty',
|
|
'onboarding_support' => 'Wsparcie i onboarding',
|
|
'agreed_directly' => 'Uzgadniane bezpośrednio',
|
|
'paid_runs_per_hour' => 'płatnych uruchomień na godzinę',
|
|
'table_cost' => 'Koszt',
|
|
'table_tools' => 'Narzędzia',
|
|
'variable' => 'zmienny',
|
|
'transcribe_cost' => 'transcribe: 1 kredyt za rozpoczętą minutę audio, minimum 5',
|
|
],
|
|
default => [
|
|
'title' => 'Pricing - DBN Tools',
|
|
'description' => 'NOK pricing, credits, and subscriptions for tools.dobetternorge.no.',
|
|
'eyebrow' => 'NOK pricing for DBN Tools',
|
|
'headline' => 'Credits that make sense',
|
|
'subhead' => 'Monthly credits are spent first. Prepaid credits sit on top and never expire.',
|
|
'trial' => 'Plus includes a 14-day trial. Card required, cancel anytime.',
|
|
'survey_title' => 'Get 25 extra credits',
|
|
'survey_text' => 'Answer five short questions about how you use the tools.',
|
|
'survey_cta' => 'Take the survey',
|
|
'current' => 'Current plan',
|
|
'choose' => 'Choose',
|
|
'login' => 'Log in to choose',
|
|
'available' => 'Available',
|
|
'topups_title' => 'Extra credits',
|
|
'topups_lead' => 'Top-ups are one-time purchases. They never expire and are spent after monthly credits.',
|
|
'buy' => 'Buy',
|
|
'login_buy' => 'Log in to buy',
|
|
'tool_costs' => 'Tool costs',
|
|
'tool_costs_lead' => 'Credits are charged only when a tool completes with a valid result.',
|
|
'organisation' => 'Organisation',
|
|
'organisation_price' => 'Contact',
|
|
'organisation_text' => 'For advisers, volunteer groups, and larger family teams that need more users, custom terms, or onboarding.',
|
|
'contact' => 'Talk to us',
|
|
'billing_note' => 'Stripe handles cards, subscriptions, and receipts. Local DBN credits remain authoritative for access.',
|
|
'status_success' => 'Payment confirmed. Your account updates when the Stripe webhook is processed.',
|
|
'status_canceled' => 'Payment was canceled. No changes were made.',
|
|
'connecting' => 'Connecting to Stripe...',
|
|
'checkout_error' => 'Could not start checkout. Please try again.',
|
|
'per_month' => '/ mo',
|
|
'starter_tier' => 'Starter tier',
|
|
'credit_unit' => 'credit',
|
|
'credits_unit' => 'credits',
|
|
'custom_terms' => 'Custom terms',
|
|
'more_users' => 'More users',
|
|
'custom_credits' => 'Custom credits',
|
|
'onboarding_support' => 'Onboarding and support',
|
|
'agreed_directly' => 'Agreed directly',
|
|
'paid_runs_per_hour' => 'paid runs per hour',
|
|
'table_cost' => 'Cost',
|
|
'table_tools' => 'Tools',
|
|
'variable' => 'variable',
|
|
'transcribe_cost' => 'transcribe: 1 credit per started audio minute, minimum 5',
|
|
],
|
|
};
|
|
|
|
$plans = PricingCatalog::plans();
|
|
$topups = PricingCatalog::topups();
|
|
|
|
$planFeatures = [
|
|
'no' => [
|
|
'free' => ['30 kreditter per måned', 'Verktøy på innlimt tekst', 'Juridisk korpussøk', 'Ingen Min Sak-lagring'],
|
|
'plus' => ['250 kreditter per måned', '500 MB Min Sak-lagring', '1 bruker', '14 dagers prøveperiode'],
|
|
'pro' => ['900 kreditter per måned', '5 GB Min Sak-lagring', '3 brukere', 'Full Azure-modellrute'],
|
|
],
|
|
'uk' => [
|
|
'free' => ['30 кредитів на місяць', 'Інструменти для вставленого тексту', 'Пошук юридичного корпусу', 'Без збереження «Моя справа»'],
|
|
'plus' => ['250 кредитів на місяць', '500 МБ сховища «Моя справа»', '1 користувач', '14-денний пробний період'],
|
|
'pro' => ['900 кредитів на місяць', '5 ГБ сховища «Моя справа»', '3 користувачі', 'Повний маршрут моделі Azure'],
|
|
],
|
|
'pl' => [
|
|
'free' => ['30 kredytów miesięcznie', 'Narzędzia na wklejonym tekście', 'Wyszukiwanie zasobów prawnych', 'Brak zapisu Mojej Sprawy'],
|
|
'plus' => ['250 kredytów miesięcznie', '500 MB pamięci Mojej Sprawy', '1 użytkownik', '14-dniowy okres próbny'],
|
|
'pro' => ['900 kredytów miesięcznie', '5 GB pamięci Mojej Sprawy', '3 użytkownicy', 'Pełna trasa modelu Azure'],
|
|
],
|
|
'en' => [
|
|
'free' => ['30 credits per month', 'Tools on pasted text', 'Legal corpus search', 'No My Case storage'],
|
|
'plus' => ['250 credits per month', '500 MB My Case storage', '1 user', '14-day trial'],
|
|
'pro' => ['900 credits per month', '5 GB My Case storage', '3 users', 'Full Azure model route'],
|
|
],
|
|
];
|
|
$planFeatureSet = $planFeatures[$uiLang] ?? $planFeatures['en'];
|
|
|
|
$toolCostRows = [
|
|
['0', 'search, corpus-search, clarify-only gates'],
|
|
['1', 'ask, extract, summarize, translate, korrespond_refine'],
|
|
['2', 'timeline, redact'],
|
|
['3', 'barnevernet, advocate, korrespond, legal-analysis'],
|
|
['4', 'discrepancy'],
|
|
['6', 'deep-research'],
|
|
[$copy['variable'], $copy['transcribe_cost']],
|
|
];
|
|
?>
|
|
<!doctype html>
|
|
<html lang="<?= h($uiLang) ?>">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><?= h($copy['title']) ?></title>
|
|
<meta name="description" content="<?= h($copy['description']) ?>">
|
|
<link rel="canonical" href="https://tools.dobetternorge.no/pricing.php">
|
|
<meta name="theme-color" content="#00205B">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap">
|
|
<link rel="stylesheet" href="assets/css/tools.css">
|
|
<link rel="stylesheet" href="assets/css/dbn-tools-redesign.css">
|
|
<style>
|
|
:root { --dbn-navy:#00205B; --dbn-red:#BA0C2F; --dbn-ink:#111827; --dbn-muted:#5b6472; --dbn-line:#d9dee8; --dbn-soft:#f7f9fc; --dbn-green:#0f766e; }
|
|
body { margin:0; background:#fbfcfe; color:var(--dbn-ink); font-family:'IBM Plex Sans', system-ui, sans-serif; }
|
|
.pricing-shell { max-width:1240px; margin:0 auto; padding:36px 24px 80px; }
|
|
.pricing-hero { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(280px, .8fr); gap:28px; align-items:end; padding:28px 0 34px; border-bottom:1px solid var(--dbn-line); }
|
|
.eyebrow { margin:0 0 8px; color:var(--dbn-red); font-size:.94rem; font-weight:700; text-transform:uppercase; letter-spacing:.1em; }
|
|
h1 { margin:0; font-family:'Crimson Pro', serif; font-size:clamp(2.2rem, 4vw, 4rem); line-height:1; letter-spacing:0; }
|
|
.hero-copy { margin:14px 0 0; color:var(--dbn-muted); font-size:1.15rem; max-width:720px; }
|
|
.hero-note { background:#fff; border:1px solid var(--dbn-line); border-left:5px solid var(--dbn-red); border-radius:8px; padding:22px 22px; color:#263244; font-size:1.02rem; }
|
|
.status-pill { display:inline-flex; margin:22px 0 0; padding:11px 16px; border-radius:8px; font-size:1rem; background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }
|
|
.status-pill.success { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
|
|
.survey-banner { margin:26px 0 0; display:flex; align-items:center; justify-content:space-between; gap:16px; background:var(--dbn-navy); color:#fff; border-radius:8px; padding:22px 24px; }
|
|
.survey-banner h2 { margin:0 0 4px; font-size:1.25rem; }
|
|
.survey-banner p { margin:0; color:rgba(255,255,255,.82); }
|
|
.btn, .pricing-cta { border:0; display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:0 18px; border-radius:8px; font-weight:700; font-size:.98rem; text-decoration:none; cursor:pointer; line-height:1.1; }
|
|
.btn-primary { background:var(--dbn-navy); color:#fff; }
|
|
.btn-primary:hover { background:#001740; }
|
|
.btn-light { background:#fff; color:var(--dbn-navy); }
|
|
.btn-muted { background:#edf1f7; color:#263244; }
|
|
.btn-current { background:#dcfce7; color:#166534; cursor:default; }
|
|
.plans-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; margin:28px 0; }
|
|
.plan-card, .topup-card, .cost-panel { background:#fff; border:1px solid var(--dbn-line); border-radius:10px; padding:26px; }
|
|
.plan-card { display:flex; flex-direction:column; min-height:440px; position:relative; }
|
|
.plan-card.highlight { border-color:var(--dbn-navy); box-shadow:0 10px 30px rgba(0,32,91,.10); }
|
|
.plan-badge { position:absolute; top:16px; right:16px; background:#e8eef8; color:var(--dbn-navy); border-radius:999px; padding:5px 11px; font-size:.85rem; font-weight:800; }
|
|
.plan-name { margin:0; font-size:1.55rem; font-family:'Crimson Pro', serif; }
|
|
.plan-price { margin:18px 0 6px; display:flex; align-items:baseline; gap:6px; }
|
|
.plan-price strong { font-size:2.3rem; color:var(--dbn-navy); }
|
|
.plan-meta { margin:0 0 18px; color:var(--dbn-muted); font-size:1.04rem; }
|
|
.plan-list { margin:0 0 22px; padding:0; list-style:none; flex:1; }
|
|
.plan-list li { padding:10px 0; border-bottom:1px dashed #eef1f6; font-size:1.05rem; }
|
|
.fine-print { margin:10px 0 0; color:var(--dbn-muted); font-size:.94rem; }
|
|
.section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin:42px 0 18px; }
|
|
.section-head h2 { margin:0; font-family:'Crimson Pro', serif; font-size:2.2rem; }
|
|
.section-head p { margin:0; color:var(--dbn-muted); max-width:640px; font-size:1.05rem; }
|
|
.topup-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; }
|
|
.topup-card { display:grid; gap:12px; }
|
|
.topup-price { color:var(--dbn-navy); font-size:2.1rem; font-weight:800; }
|
|
.topup-credits { font-weight:700; font-size:1.08rem; }
|
|
.topup-rate { color:var(--dbn-muted); font-size:1rem; }
|
|
.cost-panel { margin-top:16px; overflow:auto; }
|
|
.cost-table { width:100%; border-collapse:collapse; min-width:620px; }
|
|
.cost-table th, .cost-table td { text-align:left; padding:13px 12px; border-bottom:1px solid #edf1f7; }
|
|
.cost-table td { font-size:1rem; }
|
|
.cost-table th { color:var(--dbn-muted); font-size:.94rem; text-transform:uppercase; letter-spacing:.06em; }
|
|
.billing-note { margin-top:18px; color:var(--dbn-muted); font-size:1.02rem; }
|
|
@media (max-width:980px) { .pricing-hero { grid-template-columns:1fr; } .plans-grid { grid-template-columns:repeat(2, minmax(0,1fr)); } }
|
|
@media (max-width:680px) { .pricing-shell { padding-inline:14px; } .plans-grid, .topup-grid { grid-template-columns:1fr; } .survey-banner, .section-head { align-items:flex-start; flex-direction:column; } .plan-card { min-height:0; } }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<?php require_once __DIR__ . '/includes/nav.php'; ?>
|
|
<main class="pricing-shell">
|
|
|
|
<div class="dbn-context-bar" role="note">
|
|
<span class="dbn-context-bar__tag"><?= htmlspecialchars(dbnToolsT('context_bar_tag', $uiLang)) ?></span>
|
|
<nav class="dbn-context-bar__links" aria-label="About">
|
|
<a href="/why-ours.php<?= $uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : '' ?>"><?= htmlspecialchars(dbnToolsT('context_bar_why', $uiLang)) ?></a>
|
|
<a href="/mcp-tool.php<?= $uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : '' ?>"><?= htmlspecialchars(dbnToolsT('context_bar_mcp', $uiLang)) ?></a>
|
|
<a href="/privacy.php<?= $uiLang !== 'en' ? '?lang=' . urlencode($uiLang) : '' ?>"><?= htmlspecialchars(dbnToolsT('context_bar_privacy', $uiLang)) ?></a>
|
|
</nav>
|
|
</div>
|
|
|
|
<header class="pricing-hero">
|
|
<div>
|
|
<p class="eyebrow"><?= h($copy['eyebrow']) ?></p>
|
|
<h1><?= h($copy['headline']) ?></h1>
|
|
<p class="hero-copy"><?= h($copy['subhead']) ?></p>
|
|
</div>
|
|
<aside class="hero-note">
|
|
<?= h($copy['trial']) ?>
|
|
</aside>
|
|
</header>
|
|
|
|
<?php if ($status === 'success'): ?>
|
|
<p class="status-pill success"><?= h($copy['status_success']) ?></p>
|
|
<?php elseif ($status === 'canceled'): ?>
|
|
<p class="status-pill"><?= h($copy['status_canceled']) ?></p>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($isAuthed && !$surveyDone): ?>
|
|
<section class="survey-banner">
|
|
<div>
|
|
<h2><?= h($copy['survey_title']) ?></h2>
|
|
<p><?= h($copy['survey_text']) ?></p>
|
|
</div>
|
|
<a class="btn btn-light" href="<?= h($surveyUrl) ?>"><?= h($copy['survey_cta']) ?></a>
|
|
</section>
|
|
<?php endif; ?>
|
|
|
|
<section class="plans-grid" aria-label="Plans">
|
|
<?php foreach (['free', 'plus', 'pro'] as $sku): ?>
|
|
<?php $plan = $plans[$sku]; ?>
|
|
<article class="plan-card<?= $sku === 'pro' ? ' highlight' : '' ?>">
|
|
<?php if ($sku === 'pro'): ?><span class="plan-badge">Pro</span><?php endif; ?>
|
|
<h2 class="plan-name"><?= h($plan['name']) ?></h2>
|
|
<p class="plan-price">
|
|
<strong><?= h(nok((int)$plan['price_nok'])) ?></strong>
|
|
<span><?= $sku === 'free' ? '' : h($copy['per_month']) ?></span>
|
|
</p>
|
|
<p class="plan-meta">
|
|
<?php if ($sku === 'free'): ?>
|
|
<?= h($copy['starter_tier']) ?>
|
|
<?php else: ?>
|
|
<?= h(sprintf('%.2f', (float)$plan['effective_credit_cost'])) ?> kr / <?= h($copy['credit_unit']) ?>
|
|
<?php endif; ?>
|
|
</p>
|
|
<ul class="plan-list">
|
|
<?php foreach ($planFeatureSet[$sku] as $feature): ?>
|
|
<li><?= h($feature) ?></li>
|
|
<?php endforeach; ?>
|
|
<li><?= (int)$plan['hourly_cap'] ?> <?= h($copy['paid_runs_per_hour']) ?></li>
|
|
</ul>
|
|
<?php if ($sku === 'free'): ?>
|
|
<?php if (!$isAuthed): ?>
|
|
<a class="pricing-cta btn-primary" href="<?= h($loginUrl) ?>"><?= h($copy['login']) ?></a>
|
|
<?php elseif ($currentTier === 'free'): ?>
|
|
<span class="pricing-cta btn-current"><?= h($copy['current']) ?></span>
|
|
<?php else: ?>
|
|
<span class="pricing-cta btn-muted"><?= h($copy['available']) ?></span>
|
|
<?php endif; ?>
|
|
<?php else: ?>
|
|
<?php if (!$isAuthed): ?>
|
|
<a class="pricing-cta btn-primary" href="<?= h($loginUrl) ?>"><?= h($copy['login']) ?></a>
|
|
<?php elseif ($currentTier === $sku): ?>
|
|
<span class="pricing-cta btn-current"><?= h($copy['current']) ?></span>
|
|
<?php else: ?>
|
|
<button type="button" class="pricing-cta btn-primary" data-sku="<?= h($sku) ?>"><?= h($copy['choose'] . ' ' . $plan['name']) ?></button>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
|
|
<article class="plan-card">
|
|
<span class="plan-badge"><?= h($copy['organisation']) ?></span>
|
|
<h2 class="plan-name"><?= h($copy['organisation']) ?></h2>
|
|
<p class="plan-price"><strong><?= h($copy['organisation_price']) ?></strong></p>
|
|
<p class="plan-meta"><?= h($copy['custom_terms']) ?></p>
|
|
<ul class="plan-list">
|
|
<li><?= h($copy['more_users']) ?></li>
|
|
<li><?= h($copy['custom_credits']) ?></li>
|
|
<li><?= h($copy['onboarding_support']) ?></li>
|
|
<li><?= h($copy['agreed_directly']) ?></li>
|
|
</ul>
|
|
<a class="pricing-cta btn-muted" href="<?= h($orgUrl) ?>"><?= h($copy['contact']) ?></a>
|
|
<p class="fine-print"><?= h($copy['organisation_text']) ?></p>
|
|
</article>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="section-head">
|
|
<div>
|
|
<h2><?= h($copy['topups_title']) ?></h2>
|
|
<p><?= h($copy['topups_lead']) ?></p>
|
|
</div>
|
|
</div>
|
|
<div class="topup-grid">
|
|
<?php foreach ($topups as $topup): ?>
|
|
<article class="topup-card">
|
|
<h3 class="plan-name"><?= h($topup['name']) ?></h3>
|
|
<div class="topup-price"><?= h(nok((int)$topup['price_nok'])) ?></div>
|
|
<div class="topup-credits"><?= h(credits((int)$topup['credits'])) ?> <?= h($copy['credits_unit']) ?></div>
|
|
<div class="topup-rate"><?= h(sprintf('%.2f', (float)$topup['cost_per_credit'])) ?> kr / <?= h($copy['credit_unit']) ?></div>
|
|
<?php if ($isAuthed): ?>
|
|
<button type="button" class="pricing-cta btn-primary" data-sku="<?= h($topup['sku']) ?>"><?= h($copy['buy']) ?></button>
|
|
<?php else: ?>
|
|
<a class="pricing-cta btn-primary" href="<?= h($loginUrl) ?>"><?= h($copy['login_buy']) ?></a>
|
|
<?php endif; ?>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="section-head">
|
|
<div>
|
|
<h2><?= h($copy['tool_costs']) ?></h2>
|
|
<p><?= h($copy['tool_costs_lead']) ?></p>
|
|
</div>
|
|
</div>
|
|
<div class="cost-panel">
|
|
<table class="cost-table">
|
|
<thead>
|
|
<tr>
|
|
<th><?= h($copy['table_cost']) ?></th>
|
|
<th><?= h($copy['table_tools']) ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($toolCostRows as $row): ?>
|
|
<tr>
|
|
<td><?= h($row[0]) ?></td>
|
|
<td><?= h($row[1]) ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p class="billing-note"><?= h($copy['billing_note']) ?></p>
|
|
</section>
|
|
</main>
|
|
|
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|
|
|
|
<script>
|
|
(function() {
|
|
const connecting = <?= json_encode($copy['connecting'], JSON_UNESCAPED_UNICODE) ?>;
|
|
const checkoutError = <?= json_encode($copy['checkout_error'], JSON_UNESCAPED_UNICODE) ?>;
|
|
document.querySelectorAll('button[data-sku]').forEach((button) => {
|
|
button.addEventListener('click', async () => {
|
|
const sku = button.getAttribute('data-sku');
|
|
const original = button.textContent;
|
|
button.disabled = true;
|
|
button.textContent = connecting;
|
|
try {
|
|
const response = await fetch('/api/stripe-checkout.php', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
credentials: 'same-origin',
|
|
body: JSON.stringify({ sku })
|
|
});
|
|
const data = await response.json();
|
|
if (data.ok && data.url) {
|
|
window.location.href = data.url;
|
|
return;
|
|
}
|
|
alert(data.error?.message || checkoutError);
|
|
} catch (error) {
|
|
alert(error.message || checkoutError);
|
|
} finally {
|
|
button.disabled = false;
|
|
button.textContent = original;
|
|
}
|
|
});
|
|
});
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|