@extends('layouts.manage')

@section('title', isset($title) ? $title : __('manage.add-user'))

@section('header')
  <a href="{{ route('manage.users.index') }}">
    <span class="menu-icon">
      <img src="{{ asset($storage_url.'img/manage-icons/user.jpg') }}" alt="">
    </span><span class="menu-text">
      @lang('manage.user-management')
    </span>
  </a>
@endsection

@section('content')
	<div class="container-fluid">
	  <div class="row">
    
      <div class="content-wrapper">        
        <form action="{{ $route or route('manage.users.store') }}" method="POST" enctype="multipart/form-data">
          {{ csrf_field() }} 
          {{ $method or method_field('POST') }}
          
          {{-- name --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            @include('flash::message')
            @include('manage.errors')
            <div class="form-group">
              <label for="name" class="control-label">@lang('manage.name')</label>
              <input type="text" class="form-control" name="name" value="{{ isset($user) ? $user->name : old('name') }}">
            </div>
          </div>
          {{-- /. name --}}

          {{-- email --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="email" class="control-label">@lang('manage.email')</label>
              <input type="email" class="form-control" name="email" value="{{ isset($user) ? $user->email : old('email') }}">
            </div>
          </div>
          {{-- /. email --}}
          
          {{-- password --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="password" class="control-label">@lang('manage.password')</label>
              <input type="password" class="form-control" name="password">
            </div>
           </div>
           {{-- /. password --}}

          {{-- password confirmation --}}
          <div class="col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <div class="form-group">
              <label for="passwordConfirmation" class="control-label">@lang('manage.password-confirmation')</label>
              <input type="password" class="form-control" name="passwordConfirmation">
            </div>
           </div>
           {{-- /. password confirmation --}}

          {{-- submit button --}}
          <div class="m-t-20 col-lg-6 col-md-6 col-sm-8 col-xs-12 col-lg-offset-3 col-md-offset-3 col-sm-offset-1 col-xs-offset-0">
            <button class="btn btn-primary btn-sm btn-block" type="submit">
              @lang('manage.save')
            </button>
          </div>
          {{-- /. submit button --}}

        </form>
        


      </div>

  	</div>
  </div>
@endsection