Init Git Prod Mars 2026
This commit is contained in:
commit
d81efe93b1
362 files changed
+86627
No files matched your search
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../includes/init_praticien.php';
|
||||
|
||||
require_once __DIR__ . '/../../includes/header.php';
|
||||
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
|
||||
|
||||
$praticien_id = (int)($_SESSION['reference_id'] ?? 0);
|
||||
$dossier_id = (int)($_GET['dossier_id'] ?? 0);
|
||||
if ($dossier_id<=0) { header('Location: index.php'); exit; }
|
||||
|
||||
// Vérif propriétaire
|
||||
$ok = $pdo->prepare("SELECT d.id, d.praticien_id, c.nom, c.prenom
|
||||
FROM client_dossiers d JOIN client c ON c.id=d.client_id
|
||||
WHERE d.id=:d AND d.praticien_id=:p AND d.archived_at IS NULL");
|
||||
$ok->execute([':d'=>$dossier_id, ':p'=>$praticien_id]);
|
||||
$dos = $ok->fetch(PDO::FETCH_ASSOC);
|
||||
if(!$dos){ header('Location: index.php'); exit; }
|
||||
|
||||
// CSRF
|
||||
if (empty($_SESSION['cl_csrf'])) $_SESSION['cl_csrf'] = bin2hex(random_bytes(32));
|
||||
$CSRF = $_SESSION['cl_csrf'];
|
||||
|
||||
?>
|
||||
<div class="main1">
|
||||
<div class="container py-5">
|
||||
<div class="shadow p-4 rounded bg-light">
|
||||
<main class="container my-4">
|
||||
<div class="card p-3 shadow-sm">
|
||||
<h4 class="mb-3"><?= h($translations['cl_ajouter_note_titre'] ?? 'Ajouter une note') ?></h4>
|
||||
|
||||
<form id="note-form" enctype="multipart/form-data" autocomplete="off">
|
||||
<input type="hidden" name="csrf" value="<?= h($CSRF) ?>">
|
||||
<input type="hidden" name="dossier_id" value="<?= (int)$dossier_id ?>">
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label"><?= h($translations['cl_date_rdv'] ?? 'Date') ?></label>
|
||||
<input type="datetime-local" name="date_rdv" class="form-control" value="<?= h((new DateTime())->format('Y-m-d\TH:i')) ?>">
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label"><?= h($translations['cl_type_rdv'] ?? 'Type') ?></label>
|
||||
<select class="form-select" name="type_rdv">
|
||||
<option value="online"><?= h($translations['cl_type_online'] ?? 'En ligne') ?></option>
|
||||
<option value="cabinet"><?= h($translations['cl_type_cabinet'] ?? 'Au cabinet') ?></option>
|
||||
<option value="tel"><?= h($translations['cl_type_tel'] ?? 'Téléphone') ?></option>
|
||||
<option value="autre"><?= h($translations['cl_type_autre'] ?? 'Autre') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<label class="form-label"><?= h($translations['cl_duree'] ?? 'Durée (min)') ?></label>
|
||||
<input type="number" name="duree_minutes" class="form-control" min="1" max="600" value="60">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label"><?= h($translations['cl_titre'] ?? 'Titre') ?></label>
|
||||
<input type="text" name="titre" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label"><?= h($translations['cl_notes'] ?? 'Notes') ?></label>
|
||||
<textarea name="notes" class="form-control" rows="6" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
<label class="form-label"><?= h($translations['cl_prochaine_action'] ?? 'Prochaine action') ?></label>
|
||||
<input type="text" name="prochaine_action" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label"><?= h($translations['cl_pieces_jointes'] ?? 'Pièces jointes') ?></label>
|
||||
<input type="file" name="files[]" class="form-control" multiple
|
||||
accept=".pdf,.jpg,.jpeg,.png,.doc,.docx,.txt">
|
||||
<div class="form-text">Max 8 Mo par fichier.</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 d-flex justify-content-end gap-2">
|
||||
<a href="fiche.php?dossier_id=<?= (int)$dossier_id ?>" class="btn btn-outline-secondary"><?= h($translations['cl_pagination_prec'] ?? 'Annuler') ?></a>
|
||||
<button class="btn btn-primary" type="submit"><?= h($translations['cl_enregistrer'] ?? 'Enregistrer') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<p><?= $translations['copyr'] ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
<script>
|
||||
document.getElementById('note-form').addEventListener('submit', async (e)=>{
|
||||
e.preventDefault();
|
||||
const fd = new FormData(e.currentTarget);
|
||||
const r = await fetch('ajax_ajouter_note.php', {method:'POST', body:fd, credentials:'same-origin'});
|
||||
const j = await r.json();
|
||||
if(j.ok){
|
||||
window.location = 'fiche.php?dossier_id=' + encodeURIComponent(<?= (int)$dossier_id ?>);
|
||||
} else {
|
||||
alert(j.message || 'Erreur');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user