prestation/Vue/Ajaxchangerordonnance/index.php
2025-12-05 10:42:46 +00:00

248 lines
11 KiB
PHP
Executable File

<?php
$numeroBonOrdonnance = $this->nettoyer($prescription['numeroBonOrdonnance']);
$numeroPrescription = $_SESSION['p_numeroPrescription_C'] ;
$actVisible = $_SESSION['p_actVisible'];
echo $numeroBonOrdonnance;
?>
<?php if ($numeroPrescription>" ") : ?>
<div id="pharmacien">
<div id="prestation" onkeypress="javascript:ctrlkeypressord(event);">
<input class="sr-only" type="text" id="idPrestationactes" name="idPrestationactes" value="<?= $this->nettoyer($prescription['idPrestationactes']) ?>" >
<table class="table table-responsive table-condensed" style='font-size:9pt;' >
<tbody>
<tr>
<td width="7%" > <?= _("No Ordonn") ?> </td>
<td width="10%">
<INPUT style='text-align:center' class="form-control" TYPE="text" id="numeroBonOrdonnance" name="numeroBonOrdonnance"
value="<?= $numeroBonOrdonnance ?>" onChange="chercher_ordonnance(this.value);" required AUTOCOMPLETE="OFF" >
</td>
<td width="7%" align="center" > <?= _("Date Prescript") ?> </td>
<td width="10%" > <INPUT class="form-control" TYPE="text" value="<?= dateLang($this->nettoyer($prescription['datePrescription'])) ?>" readonly style="text-align: center; font-size:9pt;" > </td>
<td width="7%" align="center"> <?= _("Médecin") ?> </td>
<td> <INPUT class="form-control" TYPE="text" value="<?= $this->nettoyer($prescription['medecinPrescription']) ?>" readonly style='font-size:9pt;'> </td>
<td width="7%" align="center"> <?= _("Tél Méd") ?> </td>
<td width="15%"> <INPUT class="form-control" TYPE="text" value="<?= $this->nettoyer($prescription['telephoneMedecin']) ?>" readonly style='font-size:9pt;'> </td>
</tr>
</tbody>
</table>
</div>
<div id="ordonnance">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style='font-size:9pt;'>
<thead>
<tr>
<th width="50%" style="text-align:center"> <?= _("Médicaments prescrits") ?> </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"> <?= _("Qté") ?> </th>
<th width="10%" style="text-align:center"> <?= _("Frais") ?> </th>
<th width="10%" style="text-align:center"> <?= _("T M") ?> </th>
<th width="10%" style="text-align:center"> <?= _("A Remb") ?> </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>
</tr>
</tfoot>
<tbody>
<?php foreach ($detailprescriptions as $detailprescription):
$libelleMedicament=$this->nettoyer($detailprescription['libelleMedicament']);
$codeMedicament=$this->nettoyer($detailprescription['codeMedicament']);
?>
<tr valign="top">
<td align='center'>
<?php if($actVisible=="1"): ?>
<?= $libelleMedicament ?>
<?php else: ?>
<?= $codeMedicament ?>
<?php endif; ?>
</td>
<td align='center'> <?= $this->nettoyer($detailprescription['unite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailprescription['valeurActe'])) ?> </td>
<td align='center'> <?= $this->nettoyer($detailprescription['quantite']) ?> </td>
<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>
</tr>
<?php endforeach; ?>
<tr style='background-color:white'>
<td colspan="7" height="5"></td>
</tr>
</tbody>
</table>
</div>
<div id="livraison">
<legend> <?= _("Non livrés") ?> </legend>
<div id="non_livre">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style='font-size:9pt;'>
<thead>
<tr>
<th width="5%" style="text-align:center" > <input class="form-control btn btn-primary" type="button" value=" + + " onClick="javascript:ajoutermedicament_tous();" style='font-size:10pt;' > </th>
<th width="45%" > <?= _("Non livrés") ?> </th>
<th width="5%" > <?= _("Unité") ?> </th>
<th width="10%" style="text-align:center"> <?= _("Valeur") ?> </th>
<th width="5%" style="text-align:center"> <?= _("Qté") ?> </th>
<th width="10%" style="text-align:center"> <?= _("Frais") ?> </th>
<th width="10%" style="text-align:center"> <?= _("T M") ?> </th>
<th width="10%" style="text-align:center"> <?= _("A Remb") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($detailnonlivres as $detailnonlivre):
$idNonLivre=$this->nettoyer($detailnonlivre['id']);
$libelleMedicament=$this->nettoyer($detailnonlivre['libelleMedicament']);
$codeMedicament=$this->nettoyer($detailnonlivre['codeMedicament']);
?>
<tr valign="top">
<?php if($actVisible=="1"): ?>
<td width="5%" align='center'> <input type="button" value=" + " onClick="javascript:ajoutermedicament('<?= $idNonLivre ?>');"></td>
<td> <?= $libelleMedicament ?> </td>
<?php else: ?>
<td width="5%" align='center'> <input type="button" value=" + " disabled ></td>
<td> <?= $libelleMedicament ?> </td>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($detailnonlivre['unite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailnonlivre['valeurActe'])) ?> </td>
<td align='center'> <?= $this->nettoyer($detailnonlivre['quantite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailnonlivre['fraisReel'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailnonlivre['montantTm'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detailnonlivre['montantArembourser'])) ?> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<legend> <?= _("A Livrer") ?> </legend>
<div id="livre">
<?php $nbLivre = 0; ?>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style='font-size:9pt;'>
<thead>
<tr>
<th width="5%" style="text-align:center" > <input class="form-control btn btn-primary" type="button" value=" - - " onClick="javascript:retirermedicament_tous();" style='font-size:10pt;' > </th>
<th width="45%" > <?= _("Médicaments à livrer") ?> </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"> <?= _("Qté") ?> </th>
<th width="10%" style="text-align:center"> <?= _("Frais") ?> </th>
<th width="10%" style="text-align:center"> <?= _("T M") ?> </th>
<th width="10%" style="text-align:center"> <?= _("A Remb") ?> </th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5" style='text-align:center'> Total </td>
<td align='center'><?= format_N($this->nettoyer($prescription['fraisReelLivre'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($prescription['montantTmLivre'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($prescription['montantArembourserLivre'])) ?></td>
</tr>
</tfoot>
<tbody>
<?php foreach ($detaillivres as $detaillivre):
$idLivre=$this->nettoyer($detaillivre['id']);
$substituable = $this->nettoyer($detaillivre['substituable']);
$substitue = $this->nettoyer($detaillivre['substitue']);
$libelleMedicament=$this->nettoyer($detaillivre['libelleMedicament']);
$codeMedicament=$this->nettoyer($detaillivre['codeMedicament']);
$nomSubstitut=$this->nettoyer($detaillivre['nomSubstitut']);
if($actVisible=="1")
{
$libelleMedicament=$codeMedicament;
$nomSubstitut=$codeMedicament;
}
$nbLivre++;
?>
<tr valign="top">
<td align='center'> <input type="button" value=" - " onClick="javascript:retirermedicament('<?= $idLivre ?>');"></td>
<?php if($substituable=="1") : ?>
<?php if($substitue=="1") : ?>
<td> <input style="text-align:left; font-size:9pt;" class="form-control btn btn-warning" type="button" value="<?= $nomSubstitut ?>" onClick="javascript:annuler_substitution_medicament('<?= $idLivre ?>');"></td>
<?php else: ?>
<td> <input style="text-align:left; font-size:9pt;" class="form-control btn btn-primary" type="button" value="<?= $libelleMedicament ?>" onClick="javascript:substituer_medicament('<?= $idLivre ?>');"></td>
<?php endif; ?>
<?php else: ?>
<td> <?= $libelleMedicament ?> </td>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($detaillivre['unite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detaillivre['valeurActe'])) ?> </td>
<td align='center'> <?= $this->nettoyer($detaillivre['quantite']) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detaillivre['fraisReel'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detaillivre['montantTm'])) ?> </td>
<td align='center'> <?= format_N($this->nettoyer($detaillivre['montantArembourser'])) ?> </td>
</tr>
<?php endforeach; ?>
<tr style='background-color:white'>
<td colspan="8" height="5"></td>
</tr>
</tbody>
</table>
<input class="sr-only" type="text" id="nbLivre" name="nbLivre" value="<?= $nbLivre ?>" >
</div>
</div>
</div>
<?php else: ?>
<div id="pharmacien" onkeypress="javascript:ctrlkeypressord(event);">
<div id="prestation" onkeypress="javascript:ctrlkeypressord(event);">
<input class="sr-only" type="text" id="idPrestationactes" name="idPrestationactes" >
<table class="table table-responsive table-condensed" style='font-size:9pt;' >
<tbody>
<tr>
<td width="7%" align="center"> <?= _("No Ordonn") ?> </td>
<td width="10%">
<INPUT style='text-align:center' class="form-control" TYPE="text" id="numeroBonOrdonnance" name="numeroBonOrdonnance"
onChange="chercher_ordonnance(this.value);" required AUTOCOMPLETE="OFF" >
</td>
<td > </td>
</tr>
</tbody>
</table>
</div>
<div id="ordonnance">
</div>
<div id="livraison">
<div id="non_livre">
</div>
<div id="livre">
</div>
</div>
</div>
<div id ="msgErreur" class="alert alert-danger" style="height:38px; padding:5px;" >
<H4><?= _("Ordonnance introuvable!") ?></H4>
</div>
<?php endif; ?>