Corriger les dossiers animaux et le suivi médical
This commit is contained in:
parent
a55d27935f
commit
7b89fd5dfa
34 changed files with 440 additions and 39 deletions
|
|
@ -300,7 +300,11 @@ $currentTime = date('H:i');
|
|||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label"><?= h(t('animal.manufacturer')) ?></label>
|
||||
<input class="form-control" name="manufacturer" placeholder="Ex : Boehringer Ingelheim">
|
||||
<input class="form-control" name="manufacturer" list="vaccineManufacturerList"
|
||||
placeholder="Ex : Boehringer Ingelheim">
|
||||
<datalist id="vaccineManufacturerList">
|
||||
<?php foreach (($vaccineManufacturers ?? []) as $manufacturer): ?><option value="<?= h($manufacturer['name']) ?>"></option><?php endforeach; ?>
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
|
@ -619,13 +623,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
</div>
|
||||
<div class="col-md-4">
|
||||
<label class="form-label"><?= h(t('animal.test_date')) ?></label>
|
||||
<input class="form-control" type="date" name="test_date" value="<?= date('Y-m-d') ?>">
|
||||
<input class="form-control" type="date" name="test_date"
|
||||
value="<?= h($animal['fiv_felv_test_date'] ?: date('Y-m-d')) ?>">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<label class="form-label"><?= h(t('animal.test_note')) ?></label>
|
||||
<input class="form-control" name="test_notes"
|
||||
placeholder="<?= h(t('animal.test_notes_placeholder')) ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label"><?= h(t('animal.veterinary_clinic')) ?></label>
|
||||
<select class="form-select" name="clinic_contact_id">
|
||||
<option value="">— <?= h(t('common.choose')) ?> —</option>
|
||||
<?php foreach (($directoryClinics ?? []) as $clinic): ?><option value="<?= (int)$clinic['id'] ?>"><?= h($clinic['name']) ?></option><?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label"><?= h(t('animal.tariff_record')) ?> <span class="text-muted">(<?= h(mb_strtolower(t('common.optional'))) ?>)</span></label>
|
||||
<select class="form-select" name="test_tariff_id">
|
||||
<option value=""><?= h(t('animal.no_expense')) ?></option>
|
||||
<?php foreach (($expenseTariffs ?? []) as $tariff): if (($tariff['category'] ?? '') !== 'test') continue; ?><option
|
||||
value="<?= (int)$tariff['id'] ?>" data-clinic="<?= (int)$tariff['clinic_contact_id'] ?>"><?= h($tariff['clinic_name'] . ' · ' . $tariff['label']) ?> · <?= number_format((int)$tariff['effective_cents']/100, 2, ',', ' ') ?> €</option><?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-4">
|
||||
|
|
@ -694,6 +714,22 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const modal = document.getElementById('modalMedicalStatus');
|
||||
const clinic = modal?.querySelector('select[name="clinic_contact_id"]');
|
||||
const tariff = modal?.querySelector('select[name="test_tariff_id"]');
|
||||
const sync = () => {
|
||||
[...(tariff?.options || [])].forEach(option => {
|
||||
if (!option.dataset.clinic) return;
|
||||
option.hidden = !clinic?.value || option.dataset.clinic !== clinic.value;
|
||||
option.disabled = option.hidden;
|
||||
});
|
||||
if (tariff?.selectedOptions[0]?.hidden) tariff.value = '';
|
||||
};
|
||||
clinic?.addEventListener('change', sync); sync();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="modal modal-blur fade" id="modalMedical" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
|
|
|
|||
Loading…
Reference in a new issue