

<?php $__env->startSection('title', 'Edit Subscription Plan'); ?>

<?php $__env->startSection('admin-content'); ?>
<div class="container-fluid px-0">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1>Edit Subscription Plan: <?php echo e($plan->name); ?></h1>
        <a href="<?php echo e(route('admin.plans.index')); ?>" class="btn btn-outline-secondary">Back to Plans</a>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body">
            <form action="<?php echo e(route('admin.plans.update', $plan->id)); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>
                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label">Plan Name</label>
                        <input type="text" name="name" class="form-control" value="<?php echo e($plan->name); ?>" required>
                    </div>
                    <div class="col-md-3">
                        <label class="form-label">Price (INR)</label>
                        <input type="number" step="0.01" name="price_inr" class="form-control" value="<?php echo e($plan->price_inr); ?>" required>
                    </div>
                    <div class="col-md-3">
                        <label class="form-label">Price (USD)</label>
                        <input type="number" step="0.01" name="price_usd" class="form-control" value="<?php echo e($plan->price_usd); ?>" required>
                    </div>
                    
                    <div class="col-md-4">
                        <label class="form-label">Duration (Days)</label>
                        <input type="number" name="duration_days" class="form-control" value="<?php echo e($plan->duration_days); ?>" required>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label">Product Limit</label>
                        <input type="number" name="product_limit" class="form-control" value="<?php echo e($plan->product_limit); ?>" required>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label">Inquiry Limit</label>
                        <input type="number" name="inquiry_limit" class="form-control" value="<?php echo e($plan->inquiry_limit); ?>" required>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label">Max Images per Product</label>
                        <input type="number" name="product_image_limit" class="form-control" value="<?php echo e($plan->product_image_limit); ?>" required>
                    </div>

                        <div class="row g-3">
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="is_active" name="is_active" value="1" <?php echo e($plan->is_active ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="is_active">Plan Active Status</label>
                                    <div class="form-text text-muted small">If disabled, this plan will not be visible to sellers.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="show_contact_details" name="show_contact_details" value="1" <?php echo e($plan->show_contact_details ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="show_contact_details">Show Contact Details to Buyers?</label>
                                    <div class="form-text text-muted small">If enabled, buyers can see mobile/email on profile.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="view_buyer_contact" name="view_buyer_contact" value="1" <?php echo e($plan->view_buyer_contact ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="view_buyer_contact">Can View Buyer Contact?</label>
                                    <div class="form-text text-muted small">If enabled, seller can see buyer details on RFQs.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="is_featured" name="is_featured" value="1" <?php echo e($plan->is_featured ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="is_featured">Featured Listing?</label>
                                    <div class="form-text text-muted small">Products will appear at the top of search results.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="has_verified_badge" name="has_verified_badge" value="1" <?php echo e($plan->has_verified_badge ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="has_verified_badge">KYC Verified?</label>
                                    <div class="form-text text-muted small">Seller gets a blue tick on their profile.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-check form-switch">
                                    <input class="form-check-input" type="checkbox" id="allow_microsite" name="allow_microsite" value="1" <?php echo e($plan->allow_microsite ? 'checked' : ''); ?>>
                                    <label class="form-check-label fw-bold" for="allow_microsite">Allow Microsite?</label>
                                    <div class="form-text text-muted small">Seller can customize their own mini-website.</div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <label class="form-label fw-bold">Commission Rate (%)</label>
                                <div class="input-group">
                                    <input type="number" step="0.01" min="0" max="100" name="commission_rate" class="form-control" value="<?php echo e($plan->commission_rate); ?>">
                                    <span class="input-group-text">%</span>
                                </div>
                                <div class="form-text text-muted small">Commission charged on orders (if applicable).</div>
                            </div>
                            <div class="col-12">
                                <label class="form-label fw-bold">Plan Features (One per line)</label>
                                <textarea name="features_text" class="form-control" rows="6" placeholder="Example:
Priority Support
Verified Badge
Featured Listings"><?php echo e(is_array($plan->features) ? implode("\n", $plan->features) : (is_string($plan->features) ? implode("\n", json_decode($plan->features, true) ?? []) : '')); ?></textarea>
                                <div class="form-text text-muted small">Enter each feature on a new line. Don't include "Buyer Notifications" or "Product Listings" here as they are managed via the numeric fields above.</div>
                            </div>

                        </div>

                    <div class="col-12 mt-4">
                        <button type="submit" class="btn btn-primary">Update Plan</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u281583269/domains/theminiport.com/public_html/resources/views/admin/plans/edit.blade.php ENDPATH**/ ?>