@extends('super_admin.layouts.master') @section('title', 'Manage ' . $school->name) @section('page_title', 'Subscription & Status Management') @section('content')
{{-- School Info Card --}}
@if($school->logo && \Illuminate\Support\Facades\Storage::disk('public')->exists($school->logo)) @else {{ substr($school->name, 0, 1) }} @endif

{{ $school->name }}

{{ $school->slug }}.schoolerp.com

{{-- Status & Plan Badges --}}
{{ ucfirst($school->status) }} @php $planColors = [ 'basic' => 'bg-gray-100 text-gray-700', 'standard' => 'bg-blue-100 text-blue-700', 'premium' => 'bg-purple-100 text-purple-700' ]; $planColor = $planColors[$school->plan] ?? 'bg-gray-100 text-gray-700'; @endphp {{ ucfirst($school->plan) }} Plan
{{-- Expiry Info Bar --}}

@if($school->subscription_end->isPast()) Subscription expired {{ $school->subscription_end->diffForHumans() }} @else Current expiry: {{ $school->subscription_end->format('M d, Y') }} ({{ $school->daysUntilExpiry() }} days remaining) @endif

{{-- Status Management Section --}}

Quick Status Change

@foreach(['active' => ['icon' => 'fa-check-circle', 'color' => 'green'], 'inactive' => ['icon' => 'fa-pause-circle', 'color' => 'gray'], 'suspended' => ['icon' => 'fa-ban', 'color' => 'red']] as $status => $config) @endforeach
{{-- Plan Management Section --}} @if($school->status === 'active') {{-- Mode Toggle --}}

Change Plan

Extend subscription with selected plan and duration.

@if($school->subscription_end->isPast())

Plan has expired. You can only Extend. "Plan Only" option is disabled.

@endif {{-- Plan Selection --}} @if($planPricings && $planPricings->count() > 0)
@foreach($planPricings as $planPricing) @php $isCurrent = $school->plan === $planPricing->plan_key; // Define complete class maps for each plan $planClasses = [ 'basic' => [ 'icon' => 'fa-seedling', 'bg' => 'gray', 'border' => 'peer-checked:border-gray-600 peer-checked:bg-gray-50 hover:border-gray-300', 'iconColor' => 'text-gray-600', 'bgColor' => 'bg-gray-100', 'priceColor' => 'text-gray-600', 'currentBg' => 'bg-gray-200', 'currentText' => 'text-gray-800' ], 'standard' => [ 'icon' => 'fa-rocket', 'bg' => 'blue', 'border' => 'peer-checked:border-blue-600 peer-checked:bg-blue-50 hover:border-blue-300', 'iconColor' => 'text-blue-600', 'bgColor' => 'bg-blue-100', 'priceColor' => 'text-blue-600', 'currentBg' => 'bg-blue-200', 'currentText' => 'text-blue-800' ], 'premium' => [ 'icon' => 'fa-crown', 'bg' => 'purple', 'border' => 'peer-checked:border-purple-600 peer-checked:bg-purple-50 hover:border-purple-300', 'iconColor' => 'text-purple-600', 'bgColor' => 'bg-purple-100', 'priceColor' => 'text-purple-600', 'currentBg' => 'bg-purple-200', 'currentText' => 'text-purple-800' ] ][$planPricing->plan_key] ?? $planClasses['standard']; @endphp @endforeach
@endif
{{-- EXTEND MODE FORM --}}
@csrf {{-- Duration Selection --}}

Select Duration *

@foreach([1 => ['label' => '1 Month', 'badge' => ''], 3 => ['label' => '3 Months', 'badge' => '5% off'], 6 => ['label' => '6 Months', 'badge' => '10% off'], 12 => ['label' => '1 Year', 'badge' => '15% off']] as $months => $info) @endforeach
{{-- Extension Summary --}}

Extension Summary

Plan Price: ₹0/month
Duration: 0 months
Discount: -₹0
Total Amount: ₹0
Cancel
{{-- PLAN ONLY FORM (Plan Change with Proration) --}} @else

Plan Modifications Locked

School is {{ ucfirst($school->status) }}. Activate to modify plan.

@endif
{{-- Status Change Form --}} {{-- Status Modal --}} @endsection @push('scripts') @endpush