@extends('layouts.app')

@section('extra_css')
<link rel="stylesheet" href="{{ asset('assets/css/bootstrap-datepicker.min.css') }}">
@endsection

@section("breadcrumb")
<li class="breadcrumb-item"><a href="{{ route('organization.index') }}">Organizations</a></li>
<li class="breadcrumb-item active">Edit Organization</li>
@endsection

@section('content')
<div class="row">
  <div class="col-md-12">
    <div class="card card-success">
      <div class="card-header">
        <h3 class="card-title">Edit Organization</h3>
      </div>
      <div class="card-body">
        @if ($errors->any())
        <div class="alert alert-danger">
          <ul>
            @foreach ($errors->all() as $error)
              <li>{{ $error }}</li>
            @endforeach
          </ul>
        </div>
        @endif

        {!! Form::open(['route' => ['organization.update', $data->id],'method'=>'put','class' => 'form-reset']) !!}
        
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>@lang('fleet.org_name')</label>
              <input type="text" name="organization_name" class="form-control" value="{{ old('organization_name', $data->organization_name) }}">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>@lang('fleet.email')</label>
              <input type="email" name="email" class="form-control" value="{{ old('email', $data->email) }}">
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>@lang('fleet.phone')</label>
              <input type="number" name="phone" class="form-control" value="{{ old('phone', $data->phone) }}">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>@lang('fleet.address')</label>
              <input type="text" name="address" class="form-control" value="{{ old('address', $data->address) }}">
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-4">
            <div class="form-group">
              <label>@lang('fleet.city')</label>
              <input type="text" name="city" class="form-control" value="{{ old('city', $data->city) }}">
            </div>
          </div>

          <div class="col-md-4">
            <div class="form-group">
              <label>@lang('fleet.state')</label>
              <input type="text" name="state" class="form-control" value="{{ old('state', $data->state) }}">
            </div>
          </div>

          <div class="col-md-4">
            <div class="form-group">
              <label>@lang('fleet.country')</label>
              <input type="text" name="country" class="form-control" value="{{ old('country', $data->country) }}">
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-4">
            <div class="form-group">
              <label>@lang('fleet.z_code')</label>
              <input type="number" name="zipcode" class="form-control" value="{{ old('zipcode', $data->zipcode) }}">
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-12">
            {!! Form::submit('Update', ['class' => 'btn btn-success']) !!}
          </div>
        </div>

        {!! Form::close() !!}
      </div>
    </div>
  </div>
</div>
@endsection

