@extends('layouts.app')

@section('title','Add Job')

@section('content')
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">Post a new Job</div>
            <div class="panel-body">
                @include('errors.form')
                <form method="POST" action="{{ url('/admin/job/add') }}">
                    {{ csrf_field() }}
                    <input type="hidden" name="_method" value="PUT">
                    <div class="form-group">
                        <label>Job Title</label>
                        <input type="text" name="job_title" class="form-control">
                    </div>
                    <div class="form-group">
                        <label>Company</label>
                        <select name="company" class="form-control">
                            @foreach($companies as $company)
                            <option value="{{ $company->id }}">{{ $company->name }}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Number of vacancy</label>
                                <input type="number" name="vacancy" class="form-control" min="1" value="10">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Salary</label>
                                <input type="text" name="salary" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Job Category</label>
                                <select name="category" class="form-control">
                                    @foreach($categories as $category)
                                    <option value="{{ $category->id }}">{{ $category->name }}</option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label>Final Date</label>
                                <input type="date" name="expires_at" class="form-control" min="{{ date('Y-m-d') }}" value="{{ date('Y-m-d') }}" required>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>Job Description</label>
                        <textarea rows="10" class="form-control" name="description"></textarea>
                    </div>
                    <input type="submit" name="submit" value="Post Job" class="btn btn-block btn-lg btn-success">
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
