<?php require dirname(__DIR__) . '/layouts/app.php'; ?>
<?php $isEdit = !empty($tenant['id']); ?>
<section class="page-heading"><div><p class="eyebrow">Location longue duree</p><h1><?= $isEdit ? 'Modifier locataire' : 'Ajouter locataire' ?></h1></div><a class="button-link secondary" href="<?= url('/long-rentals/tenants') ?>">Retour</a></section>
<?php require __DIR__ . '/nav.php'; ?>
<?php if (!empty($errors)): ?><div class="alert alert-error"><?php foreach ($errors as $error): ?><div><?= e($error) ?></div><?php endforeach; ?></div><?php endif; ?>
<form class="form-panel" method="post" action="<?= url($isEdit ? '/long-rentals/tenants/update' : '/long-rentals/tenants/store') ?>"><input type="hidden" name="_token" value="<?= csrf_token() ?>"><?php if ($isEdit): ?><input type="hidden" name="id" value="<?= (int) $tenant['id'] ?>"><?php endif; ?><div class="form-grid"><label>Nom complet <input name="full_name" value="<?= e($tenant['full_name']) ?>" required></label><label>Telephone <input name="phone" value="<?= e($tenant['phone']) ?>"></label><label>Email <input type="email" name="email" value="<?= e($tenant['email']) ?>"></label><label>CIN / Passeport <input name="identity_number" value="<?= e($tenant['identity_number']) ?>"></label></div><label class="full-field">Adresse <textarea name="address" rows="4"><?= e($tenant['address']) ?></textarea></label><div class="form-actions"><button><?= $isEdit ? 'Enregistrer' : 'Ajouter' ?></button></div></form>
<?php require dirname(__DIR__) . '/layouts/app_footer.php'; ?>
