assure/Vue/Prescription/index.php
2025-12-05 09:34:39 +00:00

315 lines
14 KiB
PHP
Executable File

<?php $this->titre = "Intersanté - Prescription";
$numeroBonOrdonnance = $prescription['numeroBonOrdonnance'];
$facture = $prescription['facture'];
$_SESSION['numeroBonOrdonnance_C'] = $numeroBonOrdonnance;
?>
<script type="text/javascript">
</script>
<input class="sr-only" id="facture" name="facture" type="text" value= "<?= $facture ?>" >
<input class="sr-only" id="numeroBonOrdonnance" name="numeroBonOrdonnance" type="text" value= "<?= $numeroBonOrdonnance ?>" >
<input class="sr-only" id="codeMedecin" name="codeMedecin" type="text" value= "<?= $prescription['codeMedecin'] ?>">
<input class="sr-only" type="text" id="numOrd" name="numOrd" value= "<?= $numeroBonOrdonnance ?>" >
<input class="sr-only" type="text" id="noPrescription" name="noPrescription" value="<?= $this->nettoyer($prescription['noPrescription']) ?>" >
<legend>Informations sur la prescription N° : <?= $_SESSION['numeroPrescription_C'] ?></legend>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > Date Prescription </td>
<td width="24%" > <INPUT class="form-control" TYPE="text" value="<?= dateFr($this->nettoyer($prescription['datePrescription'])) ?>" readonly style="text-align: center; font-size:10pt;" > </td>
<td width="10%" align="center"> Médecin </td>
<td>
<?php if ($numeroBonOrdonnance>"0" or $facture=="1") : ?>
<INPUT class="form-control" TYPE="text" value="<?= $this->nettoyer($prescription['medecinPrescription']) ?>" readonly style='font-size:10pt;'>
<?php else: ?>
<button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popRechercheMedecin" style='font-size:10pt;' ><span id="nomMedecin" name="nomMedecin"> <?= $this->nettoyer($prescription['medecinPrescription']) ?> </span></button>
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<div id="infosbon">
<input class="sr-only" type="text" id="codeEtatBon" name="codeEtatBon" value="">
<input class="sr-only" type="text" id="numeroBonSave" name="numeroBonSave" value="0">
<?php if ($numeroBonOrdonnance>"0") : ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > N° Ordonnance </td>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonOrdonnance ?>" readonly > </td>
<td width="10%" > </td>
<?php if ($facture=="1"): ?>
<td align='center' class="alert alert-danger"> Dejà facturée ! / Already charged ! </td>
<?php else: ?>
<td> <button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popRechercheMedicament" style='font-size:10pt;' >Ajouter Médicament... / Add Drug...</button> </td>
<?php endif; ?>
</tr>
</tbody>
</table>
<?php else: ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > N° Ordonnance </td>
<?php if ($facture=="1"): ?>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt; background-color:blue;color:white;" type="number" id="numeroBon" name="numeroBon" value="<?= $numeroBonOrdonnance ?>" readonly > </td>
<?php else: ?>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="numeroBon" name="numeroBon" required
onChange="javascript:ajaxinfosbonprescription();" onkeypress="javascript:ctrlkeypress_numeroBon(event);" autofocus ></td>
<?php endif; ?>
<td width="10%" > </td>
<td><input id="btn_enreg" name="btn_enreg" class = "form-control btn btn-primary" type="button" value="Enregistrer / Save" disabled style='font-size:10pt;' ></td>
</tr>
</tbody>
</table>
<?php endif; ?>
<?php if (isset($msgErreur)): ?>
<div id ="msgErreur" class="alert alert-danger">
<H3><?= $msgErreur ?></H3>
</div>
<?php endif; ?>
</div>
<?php if ($numeroBonOrdonnance>"0") : ?>
<div id="medicaments">
<legend> Médicaments prescrits / Prescribed </legend>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:8pt;">
<thead>
<tr>
<th width="40%"> Libellé </th>
<th width="5%" style="text-align:center"> Unité </th>
<th width="10%" style="text-align:center"> Valeur </th>
<th width="5%" style="text-align:center"> Qtité </th>
<th width="10%" style="text-align:center"> Frais </th>
<th width="5%" style="text-align:center"> TM </th>
<th width="10%" style="text-align:center"> A Rembours. </th>
<th width="5%" style="text-align:center"> Suppr </th>
<th width="5%" style="text-align:center"> Bon </th>
<th width="5%" style="text-align:center"> Rempl </th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4" style='text-align:center'> Total</td>
<td align='center'><?= format_N($this->nettoyer($prescription['fraisReel'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($prescription['montantTm'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($prescription['montantArembourser'])) ?></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tfoot>
<tbody>
<?php foreach ($detailprescriptions as $detailprescription):
$idMedicament=$this->nettoyer($detailprescription['id']);
$livre=$this->nettoyer($detailprescription['livre']);
$substituable = $this->nettoyer($detailprescription['substituable']);
$substitue = $this->nettoyer($detailprescription['substitue']);
$nomSubstitut = $this->nettoyer($detailprescription['nomSubstitut']);
$libelleMedicament = $this->nettoyer($detailprescription['libelleMedicament']);
$ajPharmacie = $this->nettoyer($detailprescription['ajPharmacie']);
?>
<?php if($ajPharmacie=="1") : ?>
<tr valign="top" style="background-color: rgb(0, 142, 142);">
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<?php if($substituable=="1") : ?>
<td style="background-color: yellow;"> <?= $libelleMedicament . " => " . $nomSubstitut ?> </td>
<?php else: ?>
<td> <?= $libelleMedicament ?> </td>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($detailprescription['unite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailprescription['valeurActe'])) ?> </td>
<?php if ($facture=="1"): ?>
<td align='center'>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['quantite']) ?>" readonly >
</td>
<?php else: ?>
<td align='center'>
<?php if ($livre!="1" && $ajPharmacie<>"1") : ?>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['quantite']) ?>"
onBlur="ajax_maj_qte_medicament('<?=$idMedicament?>', this.value, this);">
<?php else: ?>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['quantite']) ?>" readonly >
<?php endif; ?>
</td>
<?php endif; ?>
<td align='center'> <?= format_N($this->nettoyer($detailprescription['fraisReel'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailprescription['montantTm'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailprescription['montantArembourser'])) ?> </td>
<?php if ($facture=="1"): ?>
<td> </td>
<?php else: ?>
<?php if ($livre!="1" && $ajPharmacie<>"1") : ?>
<td> <input class = "form-control btn btn-danger" type="button" value="X" onClick="javascript:supprimer_medicament('<?= $idMedicament ?>');"> </td>
<?php else: ?>
<td> </td>
<?php endif; ?>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($detailprescription['numeroBonOrdonnance']) ?> </td>
<td align='center'> <?= $this->nettoyer($detailprescription['numeroRemplacement']) ?> </td>
</tr>
<?php endforeach; ?>
<tr style='background-color:white'>
<td colspan="10" height="8"></td>
</tr>
</tbody>
</table>
<div class="modal fade" id="popRechercheMedicament" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop" name="btn_close_pop" type="button" class="close" data-bs-dismiss="modal">Fermer/Close</button>
<h4 class="modal-title">Rechercher un médicament... / Search a drug...</h4>
</div>
<div class="modal-body">
<div id="div_listemedicament" onkeypress="javascript:ctrlkeypress(event);">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style='font-size:10pt;'>
<thead>
<tr>
<th style="text-align:center" width="10%" > Code </th>
<th style="text-align:center" >Nom contenant... / Name containing...</th>
<th style="text-align:center" > Instructions </th>
<th style="text-align:center" > Prix / Price</th>
<th style="text-align:center" > Unit </th>
<!-- <th style="text-align:center" > Ent. </th> -->
</tr>
</thead>
<tbody>
<tr>
<td colspan="2"> <input type="text" class="form-control" id="nomsearch" name="nomsearch" autofocus style='font-size:10pt;' ></td>
<td colspan="3"> <input type="button" class = "form-control btn btn-info" style='font-size:10pt;' value="Rechercher... / Search..." onclick="javascript:afficher_pop_recherche_medicament();" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal">Fermer / Close</button>
</div>
</div>
</div>
</div>
</div>
<div id="div_ged_0">
<form enctype="multipart/form-data" action="Prescription" method="post">
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td> Upload </td>
<td> <input style="font-size: 15px; height: 40px" class="form-control btn btn-info" name="fichier_upload" type="file" id="fichier_upload" /> </td>
<td> </td>
<td> <input style='font-size:10pt;' class="form-control btn btn-primary" type="submit" name="submit" value=" Envoyer / Send" /> </td>
<td> </td>
<td > <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:prescription_medicament();">Actualiser..</button> </td>
</tr>
</tbody>
</table>
</form>
<?php if((isset($msgErreurGed)) && ($msgErreurGed>" ")) : ?>
<INPUT style='font-size:12pt; color:red; text-align:center;' class="form-control" type="text" value="<?= $msgErreurGed ?>" readonly >
<?php endif; ?>
<table class="table table-striped table-hover table-condensed table-responsive" style="font-size:9pt;" >
<thead>
<th width="12%" style='text-align:center'> Date </th>
<th style='text-align:center'> Document GED / EDM </th>
<th width="11%" style='text-align:center'> Download </th>
</thead>
<tbody>
<?php foreach ($geds as $ged):
$idGed=$this->nettoyer($ged['idGed']);
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
?>
<tr valign="top">
<td align='center'><?= dateheureFr($this->nettoyer($ged['dateSysteme'])) ?></td>
<td align='center'><?= $this->nettoyer($ged['nomOrigine']) ?></td>
<td align="center">
<a style="font-size:10pt;" href="<?= $cheminFichier ?>" target="_blank" > Download</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
<div class="modal fade" id="popRechercheMedecin" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop" name="btn_close_pop" type="button" class="close" data-bs-dismiss="modal">Fermer / Close</button>
<h4 class="modal-title">Rechercher un Médecin... / Search a Doctor...</h4>
</div>
<div class="modal-body">
<div id="div_listemedecins" onkeypress="javascript:ctrlkeypress_medecin(event);">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style='font-size:10pt;'>
<thead>
<tr>
<th style="text-align:center" width="15%" > Code </th>
<th width="50%" style="text-align:center" >Nom contenant... / Name containing...</th>
<th style="text-align:center" > Spécialité / Speciality</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text" class="form-control" id="noOrdreMedecin" name="noOrdreMedecin" autofocus style='font-size:10pt;' ></td>
<td><input type="text" class="form-control" id="nomsearch" name="nomsearch" autofocus style='font-size:10pt;' ></td>
<td><input type="button" class = "form-control btn btn-info" style='font-size:10pt;' value="Rechercher... / Search..." onclick="javascript:afficher_pop_recherche_medecin();" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button id="close_pop" name="close_pop" type="button" class="btn btn-default" data-bs-dismiss="modal">Fermer / Close</button>
</div>
</div>
</div>
</div>
<div id="content">
<?php include 'flexcode/include/global.php'; ?>
</div>