Inverse fix

This commit is contained in:
Ludovic CANDELLIER
2020-04-15 17:40:44 +02:00
parent 002967136e
commit 6d1993c037
106 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,269 @@
<div class="row">
<div class="col-md-6 col-lg-3">
{{ Form::label('ref', 'Numéro de lot') }}
@include('components.input', ['name' => 'ref', 'value' => (isset($ref)) ? $ref : null])
</div>
<div class="col-md-6 col-lg-3">
<div class="form-group {{ $errors->has('type_dispositifs') ? 'has-error' : '' }}">
{{ Form::label('type_dispositifs', 'Type de dispositifs') }}
@include('components.select', ['name' => 'type_dispositif_id', 'list' => $type_dispositifs, 'value' => (isset($type_dispositif_id)) ? $type_dispositif_id : null])
</div>
</div>
<div class="col-md-4 col-lg-2">
<div class="form-group {{ $errors->has('type_lots') ? 'has-error' : '' }}">
{{ Form::label('type_lots', 'Type de lot') }}
@include('components.select', ['name' => 'type_lot_id', 'list' => $type_lots, 'value' => (isset($type_lot_id)) ? $type_lot_id : null ])
</div>
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('nb_etages', 'Agencement') }}
@include('components.select', ['name' => 'nb_etages', 'list' => [1 => 'Aucun étage', 2 => 'Duplex', 3=> 'Triplex'], 'value' => (isset($nb_etages)) ? $nb_etages : 1])
</div>
<div class="col-md-4 col-lg-2">
<div class="form-group {{ $errors->has('statut') ? 'has-error' : '' }}">
{{ Form::label('statut_id', 'Statut') }}
@include('components.select', ['name' => 'statut_id', 'list' => $type_lot_statuts, 'value' => (isset($statut_id)) ? $statut_id : 3])
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 col-lg-6">
{{ Form::label('description', 'Description') }}
<textarea name="description" class="form-control editor">@if (isset($description)){{ $description }}@endif</textarea>
</div>
<div class="col-md-12 col-lg-6">
<div class="row">
<div class="col-md-12 col-lg-6">
<div class="form-group {{ $errors->has('residence_id') ? 'has-error' : '' }}">
{{ Form::label('residence_id', 'Résidence') }}
@include('components.select', ['name' => 'residence_id', 'id_name' => 'residence_id', 'list' => $residences, 'value' => (isset($residence_id)) ? $residence_id : null])
</div>
</div>
<div class="col-md-12 col-lg-4">
<div class="form-group {{ $errors->has('batiment_id') ? 'has-error' : '' }}">
{{ Form::label('residence_batiment_id', 'Batiment') }}
@include('components.select', ['name' => 'residence_batiment_id', 'id_name' => 'residence_batiment_id', 'list' => (isset($batiments)) ? $batiments : null, 'value' => (isset($residence_batiment_id)) ? $residence_batiment_id : null])
</div>
</div>
<div class="col-md-6 col-lg-2">
{{ Form::label('position_etage', 'Etage') }}
@include('components.select', ['name' => 'position_etage', 'id_name' => 'position_etage', 'list' => (isset($etages)) ? $etages : null, 'value' => (isset($position_etage)) ? $position_etage : null])
</div>
</div>
<div class="row">
<div class="col-lg-6">
{{ Form::label('adresse', 'Adresse') }}
@include('components.input', ['name' => 'adresse', 'value' => (isset($adresse)) ? $adresse : null])
</div>
<div class="col-lg-6">
{{ Form::label('complement_adresse', 'Complément d\'adresse') }}
@include('components.input', ['name' => 'complement_adresse', 'value' => (isset($complement_adresse)) ? $complement_adresse : null])
</div>
</div>
<div class="row m-top-8">
<div class="col-md-4">
{{ Form::label('code_postal', 'Code postal') }}
@include('components.input', ['name' => 'code_postal', 'value' => (isset($code_postal)) ? $code_postal : null])
</div>
<div class="col-md-8">
{{ Form::label('ville', 'Ville') }}
@include('components.city', ['name' => 'ville', 'list' => (isset($ville)) ? [$ville_id => $ville] : [], 'value' => (isset($ville_id)) ? $ville_id : null])
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-4 col-lg-2">
{{ Form::label('surface', 'Surface') }}
@include('components.input', ['name' => 'surface', 'value' => (isset($surface)) ? $surface : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('surface_terrain', 'Terrain') }}
@include('components.input', ['name' => 'surface_terrain', 'value' => (isset($surface_terrain)) ? $surface_terrain : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('surface_balcon', 'Balcon / Terrasse') }}
@include('components.input', ['name' => 'surface_balcon', 'value' => (isset($surface_balcon)) ? $surface_balcon : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('surface_cave', 'Cave') }}
@include('components.input', ['name' => 'surface_cave', 'value' => (isset($surface_cave)) ? $surface_cave : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('surface_soussol', 'Sous-sol') }}
@include('components.input', ['name' => 'surface_soussol', 'value' => (isset($surface_soussol)) ? $surface_soussol : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('surface_grenier', 'Grenier') }}
@include('components.input', ['name' => 'surface_grenier', 'value' => (isset($surface_grenier)) ? $surface_grenier : null])
</div>
</div>
</div>
</div>
<div class="row m-top-8">
<div class="col-md-4 col-lg-2">
{{ Form::label('prix_achat', 'Prix acquisition') }}
@include('components.money', ['name' => 'prix_achat', 'value' => (isset($prix_achat)) ? $prix_achat : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('prix_travaux', 'Montant travaux') }}
@include('components.money', ['name' => 'prix_travaux', 'value' => (isset($prix_travaux)) ? $prix_travaux : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('prix_total', 'Prix total') }}
@include('components.money', ['name' => 'prix_total', 'value' => (isset($prix_total)) ? $prix_total : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('prix_cave', 'Prix cave') }}
@include('components.money', ['name' => 'prix_cave', 'value' => (isset($prix_cave)) ? $prix_cave : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('prix_stationnement', 'Prix stationnement') }}
@include('components.money', ['name' => 'prix_stationnement', 'value' => (isset($prix_stationnement)) ? $prix_stationnement : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('package', 'Package') }}
@include('components.money', ['name' => 'package', 'value' => (isset($package)) ? $package : null])
</div>
</div>
<div class="row m-top-8">
<div class="col-md-4 col-lg-2">
{{ Form::label('honoraires_agence', 'Honoraires Agence') }}
@include('components.money', ['name' => 'honoraires_agence', 'value' => (isset($honoraires_agence)) ? $honoraires_agence : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('frais_notaire', 'Frais notaire') }}
@include('components.money', ['name' => 'frais_notaire', 'value' => (isset($frais_notaire)) ? $frais_notaire : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('frais_bancaire', 'Garantie bancaire') }}
@include('components.money', ['name' => 'frais_bancaire', 'value' => (isset($frais_bancaire)) ? $frais_bancaire : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('courtage_bancaire', 'Courtage bancaire') }}
@include('components.money', ['name' => 'courtage_bancaire', 'value' => (isset($courtage_bancaire)) ? $courtage_bancaire : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('interets_intercalaires', 'Interets intercalaires') }}
@include('components.money', ['name' => 'interets_intercalaires', 'value' => (isset($interets_intercalaires)) ? $interets_intercalaires : null])
</div>
</div>
<div class="row m-top-8">
<div class="col-md-4 col-lg-2">
{{ Form::label('garantie_revente', 'Garantie revente') }}
@include('components.money', ['name' => 'garantie_revente', 'value' => (isset($garantie_revente)) ? $garantie_revente : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('loyer_logement', 'Loyer logement') }}
@include('components.money', ['name' => 'loyer_logement', 'value' => (isset($loyer_logement)) ? $loyer_logement : null])
</div>
<div class="col-md-4 col-lg-2">
{{ Form::label('loyer_stationnement', 'Loyer stationnement') }}
@include('components.money', ['name' => 'loyer_stationnement', 'value' => (isset($loyer_stationnement)) ? $loyer_stationnement : null])
</div>
</div>
@push('js')
<script>
function setByResidence(id) {
$.ajax({
url : laroute.route("Hestimmo.ResidenceBatiments.getByResidence"),
data : {
"_token": "{{ csrf_token() }}",
"id": id
},
method : 'POST',
success : function(resp){
if (resp.success) {
setOptions('#residence_batiment_id',resp.batiments);
var batiment_id = $('#residence_batiment_id').val();
setNbEtages(batiment_id);
}
}
});
}
function setNbEtages(id) {
$.ajax({
url : id ? laroute.route("Hestimmo.ResidenceBatiments.getNbEtages") : laroute.route("Hestimmo.Lots.getNbEtages"),
data : {
"_token": "{{ csrf_token() }}",
"id": id
},
method : 'POST',
success : function(resp){
if (resp.success) {
setOptions('#position_etage',resp.etages);
}
}
});
}
function setAdresse(id) {
$.ajax({
url : laroute.route("Hestimmo.ResidenceBatiments.getAdresse"),
data : {
"_token": "{{ csrf_token() }}",
"id": id
},
method : 'POST',
success : function(resp){
if (resp.success) {
$('#adresse').val(resp.adresse);
$('#complement_adresse').val(resp.complement_adresse);
$('#code_postal').val(resp.code_postal);
$('#ville').val(resp.ville);
$('#ville_id').val(resp.ville_id);
}
}
});
}
$('#residence_id').change(function() {
var id = $('#residence_id').val();
setByResidence(id);
});
$('#residence_batiment_id').change(function() {
var id = $('#residence_batiment_id').val();
setNbEtages(id);
setAdresse(id);
});
var residence_id = $('#residence_id').val();
if (residence_id) {
setByResidence(residence_id);
}
</script>
@endpush