subscriptionModel = new SubscriptionModel();\n }\n \n public function index() {\n // Only tenant admins can access\n if (!isset($_SESSION['tenant_id']) || $_SESSION['user_role'] !== 'tenant_admin') {\n header('Location: index.php?route=dashboard');\n exit;\n }\n \n $tenantId = $_SESSION['tenant_id'];\n \n // Get current subscription\n $subscription = $this->subscriptionModel->getByTenantId($tenantId);\n $subscriptionStatus = $this->subscriptionModel->getSubscriptionStatus($tenantId);\n $availablePlans = $this->subscriptionModel->getPlans();\n \n // Get billing history\n $billingHistory = $this->subscriptionModel->getBillingHistory($tenantId, 10);\n \n $pageTitle = 'Subscription Management';\n $contentView = $this->renderSubscriptionView([\n 'subscription' => $subscription,\n 'subscriptionStatus' => $subscriptionStatus,\n 'availablePlans' => $availablePlans,\n 'billingHistory' => $billingHistory,\n 'tenantId' => $tenantId\n ]);\n \n include 'src/Views/layout.php';\n }\n \n public function changePlan() {\n if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['new_plan'])) {\n $tenantId = $_SESSION['tenant_id'];\n $newPlan = $_POST['new_plan'];\n $billingCycle = $_POST['billing_cycle'] ?? 'monthly';\n \n try {\n $result = $this->subscriptionModel->changeSubscription($tenantId, $newPlan, $billingCycle);\n \n if ($result) {\n $_SESSION['success_message'] = 'Subscription plan changed successfully!';\n } else {\n $_SESSION['error_message'] = 'Failed to change subscription plan.';\n }\n } catch (Exception $e) {\n $_SESSION['error_message'] = 'Error: ' . $e->getMessage();\n }\n }\n \n header('Location: index.php?route=subscriptions');\n exit;\n }\n \n public function cancel() {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $tenantId = $_SESSION['tenant_id'];\n $reason = $_POST['cancellation_reason'] ?? '';\n \n try {\n $result = $this->subscriptionModel->cancelSubscription($tenantId, $reason);\n \n if ($result) {\n $_SESSION['success_message'] = 'Subscription cancelled successfully.';\n } else {\n $_SESSION['error_message'] = 'Failed to cancel subscription.';\n }\n } catch (Exception $e) {\n $_SESSION['error_message'] = 'Error: ' . $e->getMessage();\n }\n }\n \n header('Location: index.php?route=subscriptions');\n exit;\n }\n \n private function renderSubscriptionView($data) {\n ob_start();\n extract($data);\n ?>\n
\n
\n
\n

Subscription Management

\n \n \n \n \n \n \n
\n
\n
\n
\n
Current Subscription
\n
\n
\n \n
\n \n
No Active Subscription
\n

You don't have an active subscription. Choose a plan to get started.

\n \n View Packages\n \n
\n \n
\n
\n
\n \n
\n
\n
\n
Quick Actions
\n
\n
\n
\n \n View All Packages\n \n \n \n Contact Support\n \n
\n
\n
\n
\n
\n \n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
Change Subscription Plan
\n \n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
Cancel Subscription
\n \n
\n
\n
\n \n Warning: Cancelling your subscription will disable your account at the end of the current billing period.\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n GarageSync - Modern Garage Management
GarageSync - Garage Management Software

Modern Garage Management Solution

Streamline your operations, manage customers, inventory, and orders efficiently with GarageSync. Designed specifically for auto parts retailers and repair shops.

Garage Management Software

Powerful Features

Everything you need to manage your auto parts business efficiently

Customer Management

Easily manage customer information, including multiple vehicles per customer. Track customer history and preferences for better service.

Inventory Control

Keep track of all parts in your inventory with detailed information including part numbers, brands, and compatibility with different vehicle models.

Order Management

Create and manage orders with ease. Track status, generate invoices, and keep a complete order history for each customer.

Ready to Transform Your Garage Business?

Join thousands of satisfied users who have streamlined their operations with GarageSync.

Start Your Free Trial Today