<?php $__env->startSection('content'); ?>
  <?php
    $contestType = $contest_type ?? 'paid';
    $pageTitle = $create_title ?? 'Add Competition';
    $heroTitle = $hero_create_title ?? 'Create New Competition';
    $heroDescription = $hero_create_description ?? 'Set up a fresh competition with prize pool, seat limit, join amount and rank-based rewards.';
    $formAction = isset($save_route_name) ? route($save_route_name) : route('admin.savecontest');
    $submitLabel = $submitLabel ?? 'Save Competition';
    $manageRouteName = $manage_route_name ?? 'admin.managecontest';
    $oldPrizeAmounts = old('prizedetail', ['']);
    $oldPrizeStarts = old('prizestratseat', ['']);
    $oldPrizeEnds = old('prizeendseat', ['']);
    $rowCount = max(count($oldPrizeAmounts), count($oldPrizeStarts), count($oldPrizeEnds), 1);
    $prizeRows = [];

    for ($index = 0; $index < $rowCount; $index++) {
        $prizeRows[] = [
            'amount' => $oldPrizeAmounts[$index] ?? '',
            'start' => $oldPrizeStarts[$index] ?? '',
            'end' => $oldPrizeEnds[$index] ?? '',
        ];
    }

    if ($contestType === 'free' && ! old('prizedetail')) {
        $prizeRows = [['amount' => 0, 'start' => 1, 'end' => 1]];
    }
  ?>

  <div class="card-header">
    <h4><?php echo e($pageTitle); ?></h4>
  </div>
  <div class="card-body">
    <?php echo $__env->make('admin.partials.flash-messages', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php echo $__env->make('admin.contest.partials.contest-form', [
        'pageTitle' => $pageTitle,
        'heroTitle' => $heroTitle,
        'heroDescription' => $heroDescription,
        'formAction' => $formAction,
        'submitLabel' => $submitLabel,
        'prizeRows' => $prizeRows,
        'contestType' => $contestType,
        'contestTypeLabel' => $contest_type_label ?? 'Paid Competition',
        'manageRouteName' => $manageRouteName,
    ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
  </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\examproject\examproject_new\resources\views/admin/contest/addcontest.blade.php ENDPATH**/ ?>