@extends('layouts')

@section('content')
<br>
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-6">
                <div class="box box-danger">
                    <div class="box-header">
                    <center><h3 class="box-title">Staff registration form</h3></center>
                    </div>
                    <div class="box-body">
                        <form method="post" action="{{ route('register.save') }}">
                            @csrf
                        <div class="form-group ">
                            <label class="control-label" for="full_name" >Full name</label>
                               <div class="input-group">
                                    <div class="input-group-addon">
                                        <i class="fa fa-user"></i>
                                    </div>
                                    <input type="text" name="full_name" id="full_name" class="form-control" value="{{ old('full_name') }}">
                                </div>
                            @if ($errors->has('full_name'))
                                <span class="text-danger">
                                        <strong>{{ $errors->first('full_name') }}</strong>
                                    </span>
                            @endif
                        </div>
                        <div class="form-group ">
                        <label class="control-label" for="email" >E-mail</label>
                           <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-envelope"></i>
                                </div>
                                <input type="email" name="email" id="email" class="form-control" value="{{ old('email') }}">
                            </div>
                        @if ($errors->has('email'))
                            <span class="text-danger">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                        @endif
                        </div>
                        <div class="form-group ">
                            <label class="control-label" for="username" >Username</label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-lock"></i>
                                </div>
                                <input type="text" name="username" id="username" class="form-control {{ $errors->has('username') ? ' is-invalid' : '' }}" value="{{ old('username') }}">
                            </div>
                            @if ($errors->has('username'))
                                <span class="text-danger">
                                <strong>{{ $errors->first('username') }}</strong>
                            </span>
                            @endif
                        </div>
                        <div class="form-group ">
                            <label class="control-label" for="Gender" >Gender</label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-user"></i>
                                </div>
                                <select name="Gender" id="Gender" class="form-control">
                                    <option value="">Select Gender</option>
                                        <option value="m">Male</option>
                                        <option value="f">Female</option>
                                </select>
                            </div>
                            @if ($errors->has('Gender'))
                                <span class="text-danger">
                                <strong>{{ $errors->first('Gender') }}</strong>
                            </span>
                            @endif
                        </div>
                        <div class="form-group ">
                            <label class="control-label" for="role" >User role</label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-book"></i>
                                </div>
                                <select name="role" id="role" class="form-control">
                                    <option value="">Select User Role</option>
                                        <option>Staff</option>
                                        <option>Admin</option>
                                </select>
                            </div>
                            @if ($errors->has('role'))
                                <span class="text-danger">
                                <strong>{{ $errors->first('role') }}</strong>
                            </span>
                            @endif
                        </div>
                        <div class="form-group ">
                            <label class="control-label" for="password" >Password</label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-key"></i>
                                </div>
                                <input type="text" value="12345678" name="password" id="password" class="form-control">
                            </div>
                            @if ($errors->has('password'))
                                <span class="text-danger">
                                <strong>{{ $errors->first('password') }}</strong>
                            </span>
                            @endif
                        </div>

                        <button class="btn btn-flat btn-success btn-sm"> <span class="fa fa-floppy-o"></span> Register </button>
                        <a href="{{ url()->previous() }}" class="btn btn-danger btn-sm btn-flat"><span class="fa fa-times"></span> Cancel </a>

                        </form>

                    </div>
                </div>
            </div>
            <div class="col-lg-6">
            </div>
        </div>
    </div>
@endsection
