@extends('adminlte::page')
@section('title', 'Crea Contratti')
@section('content_header')
    <h1>Crea Contratto di Locazione</h1>
@stop
@section('content')
<div class="container">
    @if ($errors->any())
        <div class="alert alert-danger" dismissible>
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif
   <form method="POST" action="{{ route('contratti_affitti.store') }}">
    @csrf
    <div class="form-group">
        <label for="immobile_id">Immobile</label>
        <select name="immobile_id" id="immobile_id" class="form-control">
        @foreach($immobili as $immobile)
            <option value="{{ $immobile->id }}">{{ $immobile->indirizzo }}</option>
        @endforeach
        </select>
    </div>
    <div class="form-group">
        <label for="tipo_contratto_id">Tipo Contratto</label>
        <input type="number" name="tipo_contratto_id" id="tipo_contratto_id" class="form-control">
    </div>
    <div class="form-group">
        <label for="data_inizio">Data Inizio</label>
        <input type="date" name="data_inizio" id="data_inizio" class="form-control">
    </div>
    <div class="form-group">
        <label for="data_fine">Data Fine</label>
        <input type="date" name="data_fine" id="data_fine" class="form-control">
    </div>
    <div class="form-group">
        <label for="tacito_rinnovo">Tacito Rinnovo</label>
        <input type="number" name="tacito_rinnovo" id="tacito_rinnovo" class="form-control" min="0" max="1">
    </div>
    <div class="form-group">
        <label for="canone_mensile">Canone Mensile</label>
        <input type="text" name="canone_mensile" id="canone_mensile" class="form-control">
    </div>
    <div class="form-group">
        <label for="deposito_cauzionale">Deposito Cauzionale</label>
        <input type="text" name="deposito_cauzionale" id="deposito_cauzionale" class="form-control">
    </div>
    <div class="form-group">
        <label for="spese_condominiali">Spese Condominiali</label>
        <input type="text" name="spese_condominiali" id="spese_condominiali" class="form-control">
    </div>
    <div class="form-group">
        <label for="iva">IVA</label>
        <input type="text" name="iva" id="iva" class="form-control">
    </div>
    <div class="form-group">
        <label for="registrazione">Registrazione</label>
        <input type="text" name="registrazione" id="registrazione" class="form-control">
    </div>
    <div class="form-group">
        <label for="note">Note</label>
        <input type="text" name="note" id="note" class="form-control">
    </div>
    <button type="submit" class="btn btn-primary">Salva</button>
</form>
</div>
@stop
