@extends('backend.layouts.app')
@section('content')
<div class="content-wrapper">
  <section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Edit Season</h1>
          <small>Series: <strong>{{ $series->title }}</strong></small>
        </div>
      </div>
    </div>
  </section>

  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div class="card">
            <form action="{{ route('admin.seasons.update', [$series->id, $season->id]) }}" method="post">
              @csrf
              <div class="card-body">
                @if($errors->any())
                  <div class="alert alert-danger">
                    <ul class="mb-0">@foreach($errors->all() as $e)<li>{{ $e }}</li>@endforeach</ul>
                  </div>
                @endif

                <div class="form-group">
                  <label>Season Number <span class="text-danger">*</span></label>
                  <input type="number" class="form-control" name="season_number" value="{{ old('season_number', $season->season_number) }}" min="1">
                </div>

                <div class="form-group">
                  <label>Title</label>
                  <input type="text" class="form-control" name="title" value="{{ old('title', $season->title) }}">
                </div>

                <div class="form-group">
                  <label>Description</label>
                  <textarea name="description" class="form-control" rows="4">{{ old('description', $season->description) }}</textarea>
                </div>

                <div class="form-group">
                  <label>Status</label>
                  <select name="status" class="form-control" style="width:100%">
                    <option value="0" {{ $season->status == 0 ? 'selected' : '' }}>Active</option>
                    <option value="1" {{ $season->status == 1 ? 'selected' : '' }}>Inactive</option>
                  </select>
                </div>
              </div>
              <div class="card-footer">
                <button type="submit" class="btn btn-primary">Update Season</button>
                <a href="{{ url('admin/series/'.$series->id.'/seasons') }}" class="btn btn-secondary ml-2">Cancel</a>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </section>
</div>
@endsection
