@extends('layouts.app')

@section('title')
Add Registration No 
@stop

@section('breadcrumb')
<ol class="breadcrumb pull-right">
        <li><a href="{{route('home')}}"><i class="fa fa-dashboard"></i> Home</a></li>
        @permission('view-reg-no')
        <li ><a href="{{route('registration_no.all')}}">Registration No </a></li>
        @endpermission
        <li class="active">Add Registration No</li>
      </ol>
@stop
@section('content')

<div class="container-fluid">
                <!--.row-->
                <div class="row">

                    <div class="col-md-12">
                        <div class="white-box">
                            <h3 class="box-title m-b-0">Add New Registration No</h3><hr>
                            <form class="form-horizontal" action="{{route('registration_no.insert')}}" method="post">
                               {{csrf_field()}}
                               <input type="hidden" name="project_id" value="{{env('PROJECT_ID')}}">
                                <div class="form-group">
                                    <label for="exampleInputuname" class="col-sm-2 control-label"> Number <span style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group" style="width:300px">

                                            <input  type="text" class="form-control" name="number" value="{{old('number')}}" id="exampleInputuname" placeholder="Number">
                                        @if ($errors->has('number'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('number') }}</strong>
                                    </span>
                                @endif
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group" >
                                    <label for="inputPassword3" class="col-sm-2 control-label">Status<span style="color: red">*</span></label>
                                    <div class="col-sm-10">
                                        <div class="input-group">
                                            <select class="form-control select2" style="width:300px" name="status">
                                                @if(old('status'))
                                                @if(old('status') == \App\RegistrationNo::open)
                                                <option value='{{\App\RegistrationNo::open}}' selected="">Open</option>
                                                <option value="{{\App\RegistrationNo::reserved}}">Reserved</option>
                                                <option value="{{\App\RegistrationNo::sold}}">Sold</option>
                                                <option value="{{\App\RegistrationNo::cancel}}">Cancel</option>

                                                @elseif(old('status') == \App\RegistrationNo::sold)
                                                <option value='{{\App\RegistrationNo::open}}'>Open</option>
                                                <option value="{{\App\RegistrationNo::reserved}}">Reserved</option>
                                                <option value="{{\App\RegistrationNo::sold}}" selected="">Sold</option>
                                                <option value="{{\App\RegistrationNo::cancel}}">Cancel</option>

                                                @elseif(old('status') == \App\RegistrationNo::reserved)
                                                <option value='{{\App\RegistrationNo::open}}'>Open</option>
                                                <option value="{{\App\RegistrationNo::reserved}}" selected="">Reserved</option>
                                                <option value="{{\App\RegistrationNo::sold}}">Sold</option>
                                                <option value="{{\App\RegistrationNo::cancel}}">Cancel</option>
                                                @elseif(old('status') == \App\RegistrationNo::cancel)
                                                <option value='{{\App\RegistrationNo::open}}'>Open</option>
                                                <option value="{{\App\RegistrationNo::reserved}}" >Reserved</option>
                                                <option value="{{\App\RegistrationNo::sold}}">Sold</option>
                                                <option selected="" value="{{\App\RegistrationNo::cancel}}">Cancel</option>

                                                @endif

                                                @else
                                                <option value='{{\App\RegistrationNo::open}}' >Open</option>
                                                <option value="{{\App\RegistrationNo::reserved}}">Reserved</option>
                                                <option value="{{\App\RegistrationNo::sold}}">Sold</option>
                                                <option value="{{\App\RegistrationNo::cancel}}">Cancel</option>

                                                @endif

                                            </select>

                                        @if ($errors->has('status'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('status') }}</strong>
                                    </span>
                                @endif
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group m-b-0">
                                    <div class="col-sm-offset-3 col-sm-9">
                                        <button type="submit" class="btn btn-info waves-effect waves-light m-t-10">Save</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!--./row-->
            </div>
            <!-- /.container-fluid -->

@stop