@extends('layouts.app')

@section('content')
<div class="container app-content">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title m-0">Edit Split</h3>
                </div>

                <div class="card-body">
                    <form method="post" action="{{ route('admin.split.update', $split) }}">
                        @csrf
                        @method('PUT')
                        <div class="form-group">
                            <label>Name</label>
                            <input class="form-control @error('name') is-invalid @enderror" type="text" name="name" value="{{ $split->name }}" required>
                        </div>
                        <div class="form-group">
                            <label>Country</label>
                            <input class="form-control @error('country') is-invalid @enderror" type="text" name="country" value="{{ implode(', ', $split->country) }}" placeholder="en, fr, de">
                            <small>Enter the language code that will display the offer url. Or leave blank for all languages.</small>
                        </div>
                        <div class="form-group">
                            <label>Link Register</label>
                            <input class="form-control @error('link_reg') is-invalid @enderror" type="text" name="link_reg" value="{{ $split->link_reg }}" placeholder="look.djfiln.com/offer?prod=924&ref=1122334" required>
                            <small>Enter the cpa offer url to display the register page.</small>
                        </div>
                        <div class="form-group">
                            <label>Link Play</label>
                            <input class="form-control @error('link_play') is-invalid @enderror" type="text" name="link_play" value="{{ $split->link_play }}" placeholder="look.djfiln.com/offer?prod=924&ref=1122334" required>
                            <small>Enter the cpa offer url to display the player page.</small>
                        </div>
                        <button class="btn btn-success" type="submit">Save</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection
