<?php $__env->startSection('content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
  <div class="card">
    <div class="card-header d-flex justify-content-between align-items-center">
      <h5 class="mb-0">Edit Joined Subscription</h5>
      <a href="<?php echo e(route('dashboard.my-subscriptions')); ?>" class="btn btn-sm btn-outline-secondary">Back</a>
    </div>

    <div class="card-body">
      <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($errors->any()): ?>
        <div class="alert alert-danger">
          <ul class="mb-0">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
              <li><?php echo e($error); ?></li>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
          </ul>
        </div>
      <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

      <div class="row mb-4">
        <div class="col-md-4">
          <small class="text-muted d-block">Member</small>
          <strong><?php echo e($member->user?->name ?? 'N/A'); ?></strong>
        </div>
        <div class="col-md-4">
          <small class="text-muted d-block">Service</small>
          <strong><?php echo e($member->sharedSubscription?->service?->name ?? 'N/A'); ?></strong>
        </div>
        <div class="col-md-4">
          <small class="text-muted d-block">Plan</small>
          <strong><?php echo e($member->sharedSubscription?->servicePlan?->name ?? 'N/A'); ?></strong>
        </div>
      </div>

      <form method="POST" action="<?php echo e(route('dashboard.subscription-members.update', $member)); ?>">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <div class="row g-3">
          <div class="col-md-4">
            <label class="form-label">Status</label>
            <select name="status" class="form-select" required>
              <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <option value="<?php echo e($status); ?>" <?php if(old('status', $member->status) === $status): echo 'selected'; endif; ?>>
                  <?php echo e(ucfirst(str_replace('_', ' ', $status))); ?>

                </option>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </select>
          </div>

          <div class="col-md-4">
            <label class="form-label">Slots Taken</label>
            <input type="number" min="1" name="slots_taken" class="form-control" value="<?php echo e(old('slots_taken', $member->slots_taken)); ?>" required>
          </div>

          <div class="col-md-4">
            <label class="form-label">Subscription Amount</label>
            <input type="number" min="0" step="0.01" name="subscription_amount" class="form-control" value="<?php echo e(old('subscription_amount', $member->subscription_amount)); ?>" required>
          </div>

          <div class="col-md-4">
            <label class="form-label">Payment Verified</label>
            <select name="payment_verified" class="form-select" required>
              <option value="1" <?php if((string) old('payment_verified', (int) $member->payment_verified) === '1'): echo 'selected'; endif; ?>>Yes</option>
              <option value="0" <?php if((string) old('payment_verified', (int) $member->payment_verified) === '0'): echo 'selected'; endif; ?>>No</option>
            </select>
          </div>

          <div class="col-md-4">
            <label class="form-label">Joined At</label>
            <input type="datetime-local" name="joined_at" class="form-control" value="<?php echo e(old('joined_at', $member->joined_at?->format('Y-m-d\TH:i'))); ?>">
          </div>

          <div class="col-md-4">
            <label class="form-label">Expires At</label>
            <input type="datetime-local" name="expires_at" class="form-control" value="<?php echo e(old('expires_at', $member->expires_at?->format('Y-m-d\TH:i'))); ?>">
          </div>

          <div class="col-md-4">
            <label class="form-label">Cancel Requested At</label>
            <input type="datetime-local" name="cancel_requested_at" class="form-control" value="<?php echo e(old('cancel_requested_at', $member->cancel_requested_at?->format('Y-m-d\TH:i'))); ?>">
          </div>
        </div>

        <div class="mt-4 d-flex gap-2">
          <button type="submit" class="btn btn-primary">Save Changes</button>
          <a href="<?php echo e(route('dashboard.my-subscriptions')); ?>" class="btn btn-outline-secondary">Cancel</a>
        </div>
      </form>
    </div>
  </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\xampp\htdocs\G_desizn\marketplace\resources\views/dashboard/subscription-members/edit.blade.php ENDPATH**/ ?>