@extends('layout.base')

@section('content')
<div class="page-heading">
  <h3>Editar <a href="{{nUrl('inmobiliarias', 'show', ['rut' => $inmobiliaria->rut])}}">{{$inmobiliaria->abreviacion}}</a></h3>
</div>
<br />
<form class="form-horizontal" method="post" action="{{nUrl('inmobiliarias', 'do_edit', ['rut' => $inmobiliaria->rut])}}">
  <div class="form-group">
    <div class="col-md-2">RUT</div>
    <div class="col-md-3"><input type="text" name="rut" class="form-control" value="{{$inmobiliaria->rut}}" /></div>
    <div class="col-md-1"><input type="text" name="dv" class="form-control" value="{{$inmobiliaria->dv}}" /></div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Abreviaci&oacute;n</div>
    <div class="col-md-3"><input type="text" name="abreviacion" class="form-control" value="{{$inmobiliaria->abreviacion}}" /></div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Raz&oacute;n Social</div>
    <div class="col-md-4"><input type="text" name="razon" value="{{$inmobiliaria->razon}}" class="form-control" /></div>
    <div class="col-md-2">
  		<select name="sociedad" class="form-control">
  			@foreach ($sociedades as $sociedad)
  				<option value="{{$sociedad->id}}"
            @if ($sociedad->id == $inmobiliaria->sociedad)
              selected="selected"
            @endif
            >{{$sociedad->abreviacion}}</option>
  			@endforeach
  		</select>
  	</div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Banco</div>
    <div class="col-md-3"><select name="banco" class="form-control">
      <option value="0">---</option>
      @foreach ($bancos as $banco)
      <option value="{{$banco->id}}"
        @if ($banco->id == $inmobiliaria->id)
        selected="selected"
        @endif
      >{{$banco->nombre}}</option>
      @endforeach
    </select></div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Cuenta</div>
    <div class="col-md-3"><input type="text" name="cuenta" class="form-control" value="{{$inmobiliaria->cuenta}}" /></div>
  </div>
  <div class="form-group">
    <div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Edit</button></div>
  </div>
</form>
@endsection
