130 lines
6.0 KiB
PHP
130 lines
6.0 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
if (isset($_GET['simulate'])) {
|
|
$_SESSION['has_subscription'] = $_GET['simulate'] === 'true';
|
|
header('Location: pricing.php');
|
|
exit;
|
|
}
|
|
|
|
require_once 'db/config.php';
|
|
$project_name = getenv('PROJECT_NAME') ?: 'Ritual';
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Pricing - <?php echo htmlspecialchars($project_name); ?></title>
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="assets/css/custom.css">
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
<a class="navbar-brand" href="index.php"><?php echo htmlspecialchars($project_name); ?></a>
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav ml-auto">
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#">Welcome, <?php echo htmlspecialchars($_SESSION['username']); ?></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="progress.php">Progress</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="logout.php">Logout</a>
|
|
</li>
|
|
<?php else: ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="login.php">Login</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="register.php">Register</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container mt-5">
|
|
<div class="text-center">
|
|
<h1>Choose Your Plan</h1>
|
|
<p class="lead">Unlock premium features and support the development of this platform.</p>
|
|
</div>
|
|
|
|
<div class="row mt-5">
|
|
<div class="col-md-4">
|
|
<div class="card mb-4 shadow-sm">
|
|
<div class="card-header">
|
|
<h4 class="my-0 font-weight-normal">Basic</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<h1 class="card-title pricing-card-title">$5 <small class="text-muted">/ mo</small></h1>
|
|
<ul class="list-unstyled mt-3 mb-4">
|
|
<li>Access to all themes</li>
|
|
<li>Track your progress</li>
|
|
<li>Email support</li>
|
|
</ul>
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<a href="checkout.php?plan=basic" class="btn btn-lg btn-block btn-outline-primary">Sign up for Basic</a>
|
|
<?php else: ?>
|
|
<a href="login.php" class="btn btn-lg btn-block btn-primary">Login to Subscribe</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="card mb-4 shadow-sm">
|
|
<div class="card-header">
|
|
<h4 class="my-0 font-weight-normal">Pro</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<h1 class="card-title pricing-card-title">$15 <small class="text-muted">/ mo</small></h1>
|
|
<ul class="list-unstyled mt-3 mb-4">
|
|
<li>All Basic features</li>
|
|
<li>Access to premium themes</li>
|
|
<li>Priority email support</li>
|
|
</ul>
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<a href="checkout.php?plan=pro" class="btn btn-lg btn-block btn-primary">Get started</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="card mb-4 shadow-sm">
|
|
<div class="card-header">
|
|
<h4 class="my-0 font-weight-normal">Enterprise</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<h1 class="card-title pricing-card-title">$29 <small class="text-muted">/ mo</small></h1>
|
|
<ul class="list-unstyled mt-3 mb-4">
|
|
<li>All Pro features</li>
|
|
<li>24/7 phone support</li>
|
|
<li>Dedicated account manager</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<div class="mt-5 p-4 bg-light rounded">
|
|
<h3>Subscription Simulation (for testing)</h3>
|
|
<p>You can simulate having a subscription to test the premium features.</p>
|
|
<a href="pricing.php?simulate=true" class="btn btn-success">Simulate Subscription</a>
|
|
<a href="pricing.php?simulate=false" class="btn btn-danger">Cancel Simulation</a>
|
|
<p class="mt-2">Current status: <strong><?php echo isset($_SESSION['has_subscription']) && $_SESSION['has_subscription'] ? 'Active' : 'Inactive'; ?></strong></p>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
|
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
|
</body>
|
|
</html>
|