prestation/Vue/Ajaxdetailprescription/index.php
2025-12-01 18:54:33 +00:00

295 lines
12 KiB
PHP

<div id="medicaments">
<?php
$numeroBonOrdonnance = $prescription['numeroBonOrdonnance'];
$nbMedicamentSaisie = $prescription['nbMedicamentSaisie'];
$hospitalisation = $_SESSION['p_hospitalisation_C'];
$actVisible = $_SESSION['p_actVisible'];
$facture = $prescription['facture'];
$bonCaduc = $this->nettoyer($prescription['bonCaduc']);
$fraisTotal = $this->nettoyer($prescription['fraisReel']);
$ententePrealable = $prescription['ententePrealable'];
$fraisTotal = $this->nettoyer($prescription['fraisReel']);
if ($numeroBonOrdonnance>"0") :
?>
<input class="sr-only" type="text" id="fraisTotal" name="fraisTotal" value="<?= $fraisTotal ?>" >
<input class="sr-only" type="text" id="nbMedicamentSaisie" name="nbMedicamentSaisie" value="<?= $nbMedicamentSaisie ?>" >
<input class="sr-only" id="ententePrealable" name="ententePrealable" type="text" value= "<?= $ententePrealable ?>">
<input class="sr-only" id="montantTotalMedicament" name="montantTotalMedicament" type="text" value= "<?= $montantTotalMedicament ?>">
<!--
<table class="table table-condensed table-responsive" >
<tbody >
<tr >
<td style="padding: 3px 6px;background-color: #337ab7;color: #fff; font-weight: bold;text-transform: uppercase;font-size:13pt;">
<?= _("Médicaments prescrits") ?>
</td>
</tr >
</tbody>
</table>
-->
<div >
<input class="form-control" style="text-align: center; font-size: 12pt;font-weight: bold;" type="text" value="<?= _("Liste des médicaments prescrits") ?>" readonly > </td>
</div>
<div class="tab-container">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:9pt; white-space: nowrap;">
<thead>
<tr>
<th width="24%" style="text-align:center"> <?= _("Nom") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Forme") ?> </th>
<th width="6%" style="text-align:center"> <?= _("Prix Unitaire") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Qté") ?> </th>
<th width="6%" style="text-align:center"> <?= _("Prix Total") ?> </th>
<th width="15%" style="text-align:center"> <?= _("Posologie") ?> </th>
<th width="7%" colspan="2" style="text-align:center"> <?= _("Durée (Jour)") ?> </th>
<th width="5%" style="text-align:center" > <?= _("Accord") ?> </th>
<th width="6%" style="text-align:center"> <?= _("Garanti") ?> </th>
<th width="7%" style="text-align:center"> <?= _("Renouvelable") ?> </th>
<th width="9%" style="text-align:center"> <?= _("Fréquence (Jour)") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Suppr") ?> </th>
</tr>
</thead>
<?php
$existeEntentePrealable = 0;
?>
<tfoot>
<tr>
<td colspan="4" style='text-align:center'> Total <?=" (".count($detailprescriptions).")"?> </td>
<td align='center'><?= format_N($this->nettoyer($prescription['fraisReelLivre']>"0" ? $prescription['fraisReelLivre'] : $prescription['fraisReel'])) ?></td>
<td colspan="8"> </td>
</tr>
</tfoot>
<tbody>
<?php
$nbreMedciament=0;
$existeEntentePrealable = '0';
$envoyeSms = '0';
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']);
$codeMedicament = $this->nettoyer($detailprescription['codeMedicament']);
$ajPharmacie = $this->nettoyer($detailprescription['ajPharmacie']);
$ententePrealable = $this->nettoyer($detailprescription['ententePrealable']);
$medicamentRemplace = $this->nettoyer($detailprescription['medicamentRemplace']);
$nbreMedciament = $nbreMedciament+1;
$prixTotal = $this->nettoyer($detailprescription['fraisReel']);
$envoyeSms = $this->nettoyer($detailprescription['envoyeSms']);
if($ententePrealable == "2"){
$existeEntentePrealable = $ententePrealable;
}
if($actVisible!="1")
{
$libelleMedicament = $codeMedicament;
}
$forme = $this->nettoyer($detailprescription['forme']);
$exclu = $this->nettoyer($detailprescription['exclu']);
if($exclu=="1"){
$garanti = "Non";
}else{
$garanti = "Oui";
}
$renouvelable = $this->nettoyer($detailprescription['renouvelable']);
$frequenceRenouvellement = $this->nettoyer($detailprescription['frequenceRenouvellement']);
if($renouvelable=="1"){
$ren = "Oui";
}else{
$ren = "Non";
}
if (est_anglophone()){
$forme = $this->nettoyer($detailprescription['formeEng']);
if($renouvelable=="1"){
$ren = "Yes";
}else{
$ren = "No";
}
if($exclu=="1"){
$garanti = "No";
}else{
$garanti = "Yes";
}
}
$envoyeSms++;
?>
<?php if($ajPharmacie=="1") : ?>
<tr valign="top" style="background-color: rgb(0, 142, 142);">
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<td align='center'> <?= $libelleMedicament ?> </td>
<td align='center' > <?= $forme ?> </td>
<td align='center' > <?= format_N($this->nettoyer($detailprescription['valeurActe'])) ?> </td>
<td align='center' >
<?php if ($livre!="1" && $bonCaduc!="1" && $ententePrealable!='1' && $ententePrealable!='9') : ?>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['quantite']) ?>"
onChange="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']) ?>"
disabled >
<?php endif; ?>
</td>
<td align='center'> <?= format_N($prixTotal) ?> </td>
<?php if ($livre=="1" || $facture=="1" || $bonCaduc=="1"): ?>
<td align='center' >
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['posologie']) ?>" disabled>
</td>
<td> </td>
<?php else: ?>
<?php if ($facture!="1" && $livre!="1" && $bonCaduc!="1" && $ententePrealable!='1' && $ententePrealable!='9') : ?>
<td align='center'>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['posologie']) ?>"
onChange="ajax_maj_posologie_medicament('<?=$idMedicament?>', this.value, this);">
</td>
<?php else: ?>
<td align='center' >
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['posologie']) ?>" disabled>
</td>
<?php endif; ?>
<?php endif; ?>
<?php if ($livre!="1" && $bonCaduc!="1" && $ententePrealable!='1' && $ententePrealable!='9') : ?>
<td align='center' colspan="2">
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['dureeTraitement']) ?>"
onChange="ajax_maj_duree_medicament('<?=$idMedicament?>', this.value, this);">
</td>
<?php else: ?>
<td align='center' >
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $this->nettoyer($detailprescription['dureeTraitement']) ?>"
disabled >
</td>
<?php endif; ?>
<?php if($ententePrealable<>"0"): ?>
<?php if($ententePrealable=='2' || $ententePrealable=='3'): ?>
<td align='center' style="background-color: yellow;"> <input type="checkbox" checked disabled> </td>
<?php elseif($ententePrealable=='1'): ?>
<td align='center' style="background-color: #00ff00;"> <input type="checkbox" checked disabled> </td>
<?php elseif($ententePrealable=='9' || $exclu=='1'): ?>
<td align='center' style="background-color: red;color:white;"> <input type="checkbox" checked disabled> </td>
<?php else: ?>
<td align='center'> <input type="checkbox" checked disabled> </td>
<?php endif; ?>
<?php else: ?>
<td align='center' > <input type="checkbox" disabled></td>
<?php endif; ?>
<td align='center' > <?=$garanti?></td>
<?php if ($livre!="1" && $bonCaduc!="1" && $ententePrealable!='1' && $ententePrealable!='9' && $exclu!="1") : ?>
<td align='center' >
<SELECT class="form-select" style='font-size:8pt; text-align:center; height: 27px !important; ' onChange="ajax_maj_renouvelable_medicament('<?=$idMedicament?>', this.value, this);">
<?php liste_options($ouinonrenouvelable, $renouvelable, true); ?>
</SELECT>
</td>
<td align='center' >
<?php if ($renouvelable=="1") : ?>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="<?= $frequenceRenouvellement ?>"
onChange="ajax_maj_frequence_medicament('<?=$idMedicament?>', this.value, this);" required>
<?php else: ?>
<INPUT style='text-align:center' class="form-control" TYPE="text" value="0" disabled>
<?php endif; ?>
</td>
<?php else: ?>
<td align='center' > <?=$ren?></td>
<td align='center' > <?=$frequenceRenouvellement?></td>
<?php endif; ?>
<?php if ($livre!="1" && $bonCaduc!="1" && $ententePrealable!='1' && $ententePrealable!='9'): ?>
<td>
<button type="button" class="form-control btn btn-danger" onClick="javascript:supprimer_medicament('<?= $idMedicament ?>');">
<i class="fa fa-times" aria-hidden="true"></i>
</button>
</td>
<?php else: ?>
<td></td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<tr style='background-color:white'>
<td colspan="15" height="8"></td>
</tr>
</tbody>
</table>
</div >
<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") ?> </button>
<h4 class="modal-title"><?= _("Rechercher un médicament...") ?></h4>
</div>
<div class="modal-body">
<div id="div_listemedicament" onkeypress="javascript:ctrlkeypress(event);">
<?php if ($nbMedicamentSaisie>=$_SESSION['p_nbMedicamentMax'] && $hospitalisation!="1"): ?>
<div class="alert alert-danger" style="height:38px; padding:5px;">
<H4> <?= _("Attention! Maximum de médicaments atteint!") ?></H4>
</div>
<?php else: ?>
<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...") ?> </th>
<th style="text-align:center" > <?= _("Prix") ?> </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><input type="button" class = "form-control btn btn-info" style='font-size:10pt;' value="<?= _("Rechercher...") ?>" onclick="javascript:afficher_pop_recherche_medicament();" /></td>
</tr>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>