<div class="modal fade" id="dialog-deatils_rdv" tabindex="-1" aria-labelledby="detailsRDV" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <form class="" action="" method="post" onsubmit="javascript:traitDetailsRDV();return false;">
        <input type="hidden" name="rdv_id" id="rdv_id" value="<?=$rdv['id'];?>">
        <div class="modal-header">
          <h5 class="modal-title" id="detailsRDV">RDV n&deg;<?=$rdv['id'];?></h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">

          <div class="container-fluid">
            <div class="row">
              <div class="col-12">
                <div class="mb-2"> Patient : <b><?=$patient['prenom']." ".$patient['nom'];?></b> </div>

                <div class="d-flex flex-row flex-wrap justify-content-start align-items-center mb-2">
                  <div class="me-2"><label for="rdv_date">Date</label></div>
                  <div><input type="text" class="form-control form-control-sm" name="rdv_date" id="rdv_date" value="<?=$rdv['aff_date'];?>"></div>
                </div>

                <div class="d-flex flex-row flex-wrap justify-content-start align-items-center mb-2">
                  <div class="me-2"><label for="rdv_id_acte">Acte</label></div>
                  <div>
                    <select class="form-select form-select-sm" name="rdv_id_acte" id="rdv_id_acte">
                      <?php foreach ($actes as $key => $acte): ?>
                        <option value="<?=$acte['id'];?>"<?=(($acte['id']==$rdv['id_acte'])?" selected":"");?>><?=$acte['libel'];?></option>
                      <?php endforeach; ?>
                    </select>
                  </div>
                </div>

                <b>Type</b>
                <div class="mb-1">
                  <div class="form-check form-check-inline m-1">
                    <input class="form-check-input" type="radio" name="type_rdv" id="type_rdv_petit_matin" value="petit_matin"<?=(($rdv['petit_matin']>0)?" checked":"");?>>
                    <label class="form-check-label" for="type_rdv_petit_matin">Petit matin</label>
                  </div>
                  <div class="form-check form-check-inline m-1">
                    <input class="form-check-input" type="radio" name="type_rdv" id="type_rdv_matin" value="matin"<?=(($rdv['matin']>0)?" checked":"");?>>
                    <label class="form-check-label" for="type_rdv_matin">Matin</label>
                  </div>
                  <div class="form-check form-check-inline m-1">
                    <input class="form-check-input" type="radio" name="type_rdv" id="type_rdv_midi" value="midi"<?=(($rdv['midi']>0)?" checked":"");?>>
                    <label class="form-check-label" for="type_rdv_midi">Midi</label>
                  </div>
                  <div class="form-check form-check-inline m-1">
                    <input class="form-check-input" type="radio" name="type_rdv" id="type_rdv_soir" value="soir"<?=(($rdv['soir']>0)?" checked":"");?>>
                    <label class="form-check-label" for="type_rdv_soir">Soir</label>
                  </div>
                </div>

                <b>Horaire souhaité</b>
                <div class="mb-1">
                  <div class="form-text text-warning">
                    <?=nl2br($rdv['horaire_souhaite']);?>
                  </div>
                </div>

                <b>Fréquence des soins</b>
                <div class="mb-1">
                  <div class="form-check form-check-inline m-1">
                    <input class="form-check-input" type="radio" name="frequence" id="frequence_<?=$fre['id'];?>" value="0"<?=(($rdv['id_frequence']==0)?" checked":"");?>>
                    <label class="form-check-label" for="frequence_<?=$fre['id'];?>">Aucune</label>
                  </div>
                  <?php foreach ($frequences as $key_fre => $fre): ?>
                    <div class="form-check form-check-inline m-1">
                      <input class="form-check-input" type="radio" name="frequence" id="frequence_<?=$fre['id'];?>" value="<?=$fre['id'];?>"<?=(($rdv['id_frequence']==$fre['id'])?" checked":"");?>>
                      <label class="form-check-label" for="frequence_<?=$fre['id'];?>"><?=$fre['libel'];?></label>
                    </div>
                  <?php endforeach; ?>
                </div>


                <?php /* ?>

                <div class="form-check form-switch">
                  <input class="form-check-input" type="checkbox" role="switch" value="1" id="rdv_petit_matin" name="rdv_petit_matin"<?=(($rdv['petit_matin']>0)?" checked":"");?>>
                  <label class="form-check-label" for="rdv_petit_matin">Petit matin</label>
                </div>

                <div class="form-check form-switch">
                  <input class="form-check-input" type="checkbox" role="switch" value="1" id="rdv_matin" name="rdv_matin"<?=(($rdv['matin']>0)?" checked":"");?>>
                  <label class="form-check-label" for="rdv_matin">Matin</label>
                </div>

                <div class="form-check form-switch">
                  <input class="form-check-input" type="checkbox" role="switch" value="1" id="rdv_midi" name="rdv_midi"<?=(($rdv['midi']>0)?" checked":"");?>>
                  <label class="form-check-label" for="rdv_midi">Midi</label>
                </div>

                <div class="form-check form-switch">
                  <input class="form-check-input" type="checkbox" role="switch" value="1" id="rdv_soir" name="rdv_soir"<?=(($rdv['soir']>0)?" checked":"");?>>
                  <label class="form-check-label" for="rdv_soir">Soir</label>
                </div>

                <?php */ ?>

                <?php /* ?>
                <div class="form-check form-switch">
                  <input class="form-check-input" type="checkbox" role="switch" value="1" id="rdv_mms" name="rdv_mms"<?=(($rdv['mms']>0)?" checked":"");?>>
                  <label class="form-check-label" for="rdv_mms">Matin/midi/soir</label>
                </div>
                <?php */ ?>

              </div>
              <div class="col text-end">
                <div class="m-2">
                  <input type="hidden" name="id_rdv_scan" id="id_rdv_scan" value="<?=$rdv['id'];?>">
                  <input type="hidden" name="id_patient_scan" id="id_patient_scan" value="<?=$patient['id'];?>">
                  <button type="button" class="btn btn-primary icon-camera" onclick="javascript:scanDoc();"></button>
                </div>
              </div>
            </div>
          </div>

        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fermer</button>
          <button type="button" class="btn btn-danger" onclick="javascript:supRDV(<?=$rdv['id'];?>);">Supprimer</button>
          <button type="submit" class="btn btn-primary">Enregistrer</button>
        </div>
      </form>
    </div>
  </div>
</div>
