<?php $__env->startSection('content'); ?>

<div class="container-fluid">
    <div class="row">
        <div class="w-100">
            <?php if($message = Session::get('success')): ?>
                <div class="alert alert-success alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert">×</button>  
                    <small><?php echo e($message); ?></small>
                </div>
            <?php endif; ?>
        </div>
    </div>
    <div class="row">
        <div class="col-md-8">
            
            <div class="row">
                <div class="card">
                    <div class="card-header">
                        <h4 class="card-title">Modifier le propriétaire</h4>
                    </div>
                    <div class="card-body">
                        <form method="POST" action="<?php echo e(route('proprietaire.update',$proprietaire->id)); ?>">
                            <?php echo csrf_field(); ?>
                            <div class="row">
                                <div class="col-md-2 pr-1 mt-auto">
                                    <div class="form-group">
                                        <label>Numéro du propriétaire</label>
                                        <input type="text" name="pro_num" class="form-control" value="<?php echo e(old('pro_num',$proprietaire->pro_num)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-4 px-1 mt-auto">
                                    <div class="form-group">
                                        <label>Civilité</label>
                                        <select name="civilite" class="form-control" >
                                            <option value="1" <?php echo e($proprietaire->civilite == 1 ? "selected" : ""); ?>>Monsieur</option>
                                            <option value="2" <?php echo e($proprietaire->civilite == 2 ? "selected" : ""); ?>>Madame</option>
                                            <option value="3" <?php echo e($proprietaire->civilite == 3 ? "selected" : ""); ?>>Mademoiselle</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-3 pl-1 mt-auto">
                                    <div class="form-group">
                                        <label>Nom</label>
                                        <input type="text" name="nom" class="form-control" value="<?php echo e(old('nom', $proprietaire->nom)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-3 pl-1 mt-auto">
                                    <div class="form-group">
                                        <label>Prénom</label>
                                        <input type="text" name="prenom" class="form-control" value="<?php echo e(old('prenom', $proprietaire->prenom)); ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6 pr-1 mt-auto">
                                    <div class="form-group">
                                        <label>Adresse</label>
                                        <input type="text" name="adresse" class="form-control" value="<?php echo e(old('adresse', $proprietaire->adresse)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-6 pl-1 mt-auto">
                                    <div class="form-group">
                                        <label>Code postal</label>
                                        <input type="number" class="form-control" name="cp" value="<?php echo e(old('cp', $proprietaire->cp)); ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12 mt-auto">
                                    <div class="form-group">
                                        <label>Ville</label>
                                        <input type="text" class="form-control" name="ville" value="<?php echo e(old('ville', $proprietaire->ville)); ?>">
                                        <input type="text" hidden="" name="pays" value="1" >
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-6 mt-auto">
                                    <div class="form-group">
                                        <label>IBAN</label>
                                        <input type="text" class="form-control" name="iban" value="<?php echo e(old('iban', $proprietaire->iban)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-6 mt-auto">
                                    <div class="form-group">
                                        <label>BIC</label>
                                        <input type="text" class="form-control" name="bic" value="<?php echo e(old('bic', $proprietaire->bic)); ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-4 pr-1 mt-auto">
                                    <div class="form-group">
                                        <label>Téléphone portable</label>
                                        <input type="text" class="form-control" name="telephone_portable" value="<?php echo e(old('telephone_portable', $proprietaire->telephone_portable)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-4 px-1 mt-auto">
                                    <div class="form-group">
                                        <label>Email</label>
                                        <input type="email" class="form-control" name="email" value="<?php echo e(old('email', $proprietaire->email)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-4 pl-1 mt-auto">
                                    <div class="form-group">
                                        <label>Statut matrimonial</label>
                                        <input type="text" class="form-control" name="statut_matrimonial" value="<?php echo e(old('statut_matrimonial', $proprietaire->statut_matrimonial)); ?>">
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-4 mt-auto">
                                    <div class="form-group">
                                        <label>Date de naissance</label>
                                        <input type="date" class="form-control" name="date_naissance" value="<?php echo e(old('date_naissance', $proprietaire->date_naissance)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-4 mt-auto">
                                    <div class="form-group">
                                        <label>Ville de naissance</label>
                                        <input type="text" class="form-control" name="ville_naissance" value="<?php echo e(old('ville_naissance', $proprietaire->ville_naissance)); ?>">
                                    </div>
                                </div>
                                <div class="col-md-4 mt-auto">
                                    <div class="form-group">
                                        <label>Département de naissance</label>
                                        <input type="text" class="form-control" name="departement_naissance" value="<?php echo e(old('departement_naissance', $proprietaire->departement_naissance)); ?>">
                                    </div>
                                </div>
                            </div>
    
                            <?php if(is_null($entreprise)): ?>
                            <?php else: ?>
                            <input hidden name="entreprise_id" value="<?php echo e($entreprise->id); ?>">
                            <?php endif; ?>
    
                            <button type="submit" class="btn btn-info btn-fill pull-right">Enregistrer</button>
                            <div class="clearfix"></div>
                        </form>
                    </div>
                </div>
            </div>

            
            <div class="row">
            </div>

        </div>

        
        <div class="col-md-4">
            <?php if($proprietaire->biens()->exists()): ?>
                <?php $__currentLoopData = $proprietaire->biens; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $bien): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="card card-user">
                        <div class="card-image mb-3">
                            <?php $__currentLoopData = $bien->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if($image->num == 1): ?>
                                    <img src="<?php echo e(asset('storage/'.$image->nom)); ?>">
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                        <div class="card-body" style="min-height: 0px;">
                            <p class="description text-center">
                                Référence : <?php echo e($bien->reference); ?>

                                <br>Numéro de lot : <?php echo e($bien->num_lot); ?>

                                <br>Régime juridique :<?php echo e($bien->regime_juridique); ?>

                                <br>Type de bien : <?php echo e($bien->type()); ?>

                            </p>
                        </div>
                        <hr>
                        <div class="button-container mr-auto ml-auto">
                            <button href="#" class="btn btn-simple btn-link btn-icon">
                                <a href="<?php echo e(route('bien.edit', $bien->id)); ?>" class="btn btn-primary btn-sm">Détails</a></td>
                            </button>
                        </div>
                    </div> 
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php else: ?>
            <h5 class="mt-4">Aucun bien n'est associé à ce propriétaire.</h5>
            <?php endif; ?>
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Lucie Kalam Conseil\KALAM CONSEIL\laravel\OBimmo\obimmo\resources\views/proprietaires/edit.blade.php ENDPATH**/ ?>