83 lines
3.5 KiB
PHP
83 lines
3.5 KiB
PHP
<?php
|
|
require_once 'includes/header.php';
|
|
|
|
// Default to monthly
|
|
$billing_cycle = isset($_GET['billing_cycle']) && $_GET['billing_cycle'] === 'annually' ? 'annually' : 'monthly';
|
|
|
|
$plans = [
|
|
'basic' => [
|
|
'name' => t('basic_plan_name'),
|
|
'price_monthly' => 10,
|
|
'price_annually' => 10 * 12 * 0.85,
|
|
'limit' => t('basic_plan_limit'),
|
|
'features' => [
|
|
t('feature_150_generations'),
|
|
t('feature_standard_support'),
|
|
t('feature_history_access')
|
|
]
|
|
],
|
|
'premium' => [
|
|
'name' => t('premium_plan_name'),
|
|
'price_monthly' => 20,
|
|
'price_annually' => 20 * 12 * 0.85,
|
|
'limit' => t('premium_plan_limit'),
|
|
'features' => [
|
|
t('feature_unlimited_generations'),
|
|
t('feature_priority_support'),
|
|
t('feature_history_access')
|
|
]
|
|
]
|
|
];
|
|
|
|
?>
|
|
|
|
<main class="container my-5">
|
|
<div class="text-center mb-5">
|
|
<h1><?php echo t('pricing_title'); ?></h1>
|
|
<p class="lead"><?php echo t('pricing_subtitle'); ?></p>
|
|
<div class="btn-group" role="group" aria-label="Billing cycle toggle">
|
|
<a href="?billing_cycle=monthly" class="btn <?php echo $billing_cycle === 'monthly' ? 'btn-primary' : 'btn-outline-primary'; ?>"><?php echo t('monthly'); ?></a>
|
|
<a href="?billing_cycle=annually" class="btn <?php echo $billing_cycle === 'annually' ? 'btn-primary' : 'btn-outline-primary'; ?>">
|
|
<?php echo t('annually'); ?>
|
|
<span class="badge bg-success ms-2"><?php echo t('save_15_percent'); ?></span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<?php foreach ($plans as $plan_key => $plan): ?>
|
|
<div class="col-lg-6 mb-4">
|
|
<div class="card h-100 shadow-sm">
|
|
<div class="card-header text-center">
|
|
<h4 class="my-0 fw-normal"><?php echo $plan['name']; ?></h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<h1 class="card-title pricing-card-title text-center">
|
|
$<?php echo $billing_cycle === 'monthly' ? number_format($plan['price_monthly'], 2) : number_format($plan['price_annually'] / 12, 2); ?>
|
|
<small class="text-muted fw-light">/<?php echo t('month_short'); ?></small>
|
|
</h1>
|
|
<?php if ($billing_cycle === 'annually'): ?>
|
|
<p class="text-center text-muted"><?php echo t('billed_annually_at'); ?> $<?php echo number_format($plan['price_annually'], 2); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<ul class="list-unstyled mt-3 mb-4">
|
|
<?php foreach ($plan['features'] as $feature): ?>
|
|
<li class="mb-2"><i class="fas fa-check text-success me-2"></i><?php echo $feature; ?></li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<div class="d-grid">
|
|
<a href="subscription.php?plan=<?php echo $plan_key; ?>&billing_cycle=<?php echo $billing_cycle; ?>" class="btn btn-lg btn-primary"><?php echo t('choose_plan'); ?></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
|
|
<div class="mt-5 text-center">
|
|
<p><?php echo t('pricing_footer_text'); ?></p>
|
|
</div>
|
|
</main>
|
|
|
|
<?php require_once 'includes/footer.php'; ?>
|