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

125 lines
7.8 KiB
PHP
Executable File

<?php
$idDemandeSubstitution = $subsEnCours['id'];
//var_dump($idDemandeSubstitution);
$codeReponseEntentePrealable = $subsEnCours['codeReponseEntentePrealable'];
?>
<div id="div_substitution">
<form id="frmmedicament" name="frmmedicament" method="post" >
<input class="sr-only" type="text" id="prixTarif" name="prixTarif" type="number" value="<?= $this->nettoyer($medicament['prixTarif']) ?>" >
<input class="sr-only" type="text" id="idMedicament" name="idMedicament" value="<?= $this->nettoyer($medicament['id']) ?>">
<input class="sr-only" type="text" id="codeMedicament" name="codeMedicament" value="<?= $this->nettoyer($medicament['codeMedicament']) ?>">
<input class="sr-only" type="text" id="numeroFeuilleMaladie" name="numeroFeuilleMaladie" value="<?= $_SESSION['p_numeroFeuilleMaladie_C'] ?>">
<input class="sr-only" type="text" id="codePrestataire" name="codePrestataire" value="<?= $_SESSION['p_codePrestataire_C'] ?>">
<input class="sr-only" type="text" id="idSubstitut" name="idSubstitut" value="<?= $subsEnCours['id'] ?>">
<input class="sr-only" type="text" id="codeSubstitut" name="codeSubstitut" value="<?= $this->nettoyer($subsEnCours['codeMedicamentSubstitution']) ?>">
<input class="sr-only" type="text" id="libelleSubstitut" name="libelleSubstitut" value="<?= $subsEnCours['libelleSubstitut'] ?>">
<input class="sr-only" type="text" id="appliquerMargePrixSubstitutMedicament" name="appliquerMargePrixSubstitutMedicament" value="<?= $this->nettoyer($marges['appliquerMargePrixSubstitutMedicament']) ?>">
<input class="sr-only" type="text" id="margePrixSubstitutMedicament" name="margePrixSubstitutMedicament" value="<?= $this->nettoyer($marges['margePrixSubstitutMedicament']) ?>">
<input class="sr-only" type="text" id="devise" name="devise" value="<?= $_SESSION['p_devise_C'] ?>">
<input class="sr-only" type="text" id="ententePrealableSubstitut" name="ententePrealableSubstitut" value="<?= $this->nettoyer($medicament['ententePrealable']) ?>">
<div class="alert alert-danger" style="height:40px; padding:5px; text-align:center; margin-bottom:5px;" >
<H4 style="background-color:red; color:white;"> <?= _("NB: Le prix de substitution doit être inférieur ou égal au prix de prescription.") ?> </H4>
</div>
<table class="table table-responsive table-condensed table-bordered" style='font-size:11pt;'>
<thead>
<tr>
<th style="text-align:center" width="5%" > </th>
<th style="text-align:center" colspan="2"> <?= _("Médicament") ?> </th>
<th style="text-align:center" > <?= _("Qté") ?> </th>
<th style="text-align:center" > <?= _("Prix Unitaire") ?> </th>
</tr>
</thead>
<tbody>
<tr>
<td width="10%" ><?= _("Prescrit") ?> </td>
<td colspan="2" width="65%"> <input class="form-control" style="font-size:10pt;" id="nomPrescrit" name="nomPrescrit" value="<?= $this->nettoyer($medicament['libelleMedicament']) ?>" readonly > </td>
<td width="5%"> <input class="form-control" style="text-align: center; font-size:10pt;" value="<?= $_SESSION['quantite']; ?>" readonly > </td>
<td width="20%"> <input class="form-control" style="text-align: center; font-size:10pt;" value="<?= format_N($this->nettoyer($medicament['prixTarif'])) ?>" readonly > </td>
</tr>
<tr>
<td width="10%" ><?= _("Posologie") ?> </td>
<td colspan="2"> <input class="form-control" style="font-size:10pt;" id="posologie" name="posologie" value="<?= $_SESSION['posologie']; ?>" readonly > </td>
<td></td>
<td></td>
</tr>
<tr>
<td width="10%" class="required"> <?= _("Substitut") ?> </td>
<td colspan="2">
<div class="frmSearch" style="position: relative;">
<input id="searchInput" name="searchInput" style="font-size:11pt; padding-left: 35px;" class="form-control" type="text" placeholder="<?= _("Effectuer une recherche de médicament...") ?>" autofocus required AUTOCOMPLETE="OFF" value="<?= $subsEnCours['libelleSubstitut'] ?>"
onkeyup="javascript:affichelistemedicament();" onblur="javascript:affiche_info_mediacment_substitution(this.value)">
<i class="fas fa-search" style="position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #999;"></i>
<div id="div_selection"></div>
</div>
</td>
<td width="5%"> <input class="form-control" type="number" id="qteMedicamentSubstitut" name="qteMedicamentSubstitut" style="text-align: center; font-size:10pt;" value="<?= $_SESSION['quantite']; ?>" min="1" max="<?= $_SESSION['quantite']; ?>" readonly> </td>
<td >
<input type="text" class="form-control" id="prixPublicSubstitut" name="prixPublicSubstitut" value="<?= format_N($subsEnCours['prixSubstitution']) ?>" style='text-align: center; font-size:10pt;' onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);" readonly>
</td>
</tr>
<tr>
<td width="10%" ><?= _("Nouvelle Posologie") ?> </td>
<td colspan="2"> <input class="form-control" style="font-size:10pt;" id="nvellePosologie" name="nvellePosologie" value="<?= $this->nettoyer($subsEnCours['nvellePosologie']) ?>" > </td>
<td width="13%" class="required" align='right'> <?= _("Prix Pharmacie") ?> </td>
<td >
<INPUT style='text-align:center; font-size:10pt;' class="form-control" type="text" id="prixSubstitut" NAME="prixSubstitut" value="<?= format_N($subsEnCours['prixSubstitution']) ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);" onChange="verifierPrixSubstitut(this);" required AUTOCOMPLETE="OFF" >
</td>
</tr>
<!--
<tr >
<td colspan="3">
<input type="button" class = "form-control btn btn-primary" style='font-size:10pt;' value="<?= _("Rechercher un médicament de substitution") ?>" onclick="javascript:afficher_liste_recherche_medicament();" />
</td>
-->
</tr>
<?php if($idDemandeSubstitution > "0"): ?>
<tr >
<?php if($codeReponseEntentePrealable=='2'): ?>
<td colspan="5">
<input class="form-control" style="font-size:12pt;background-color: yellow;text-align:center;" id="codeReponseEntentePrealable" name="codeReponseEntentePrealable" value="<?= $libelleReponse ?>" readonly > </td>
</td>
<?php elseif($codeReponseEntentePrealable=='9'): ?>
<td colspan="5">
<input class="form-control" style="font-size:12pt;background-color: red;color:white;text-align:center;" id="codeReponseEntentePrealable" name="codeReponseEntentePrealable" value="<?= $libelleReponse ?>" readonly > </td>
</td>
<?php elseif($codeReponseEntentePrealable=='1'): ?>
<td colspan="5">
<!-- <input class="form-control" style="font-size:12pt;background-color: #00ff00;text-align:center;" id="codeReponseEntentePrealable" name="codeReponseEntentePrealable" value="<?= $libelleReponse ?>" readonly > </td> -->
<input class="form-control" style="font-size:12pt;background-color: #00ff00;text-align:center;" id="codeReponseEntentePrealable" name="codeReponseEntentePrealable" value="<?= $libelleReponse ?>" readonly > </td>
</td>
<?php endif; ?>
</tr >
<?php else: ?>
<div id="div_patienter" style='font-size:10pt;'>
</div>
<?php endif; ?>
<tr>
<!--<td colspan="2" > <input id="btn_actu" name="btn_actu" class = "form-control btn btn-warning" type="button" value="<?= _("Actualiser") ?>" onClick="etatreponsesubstitution();" style='font-size:10pt;' disabled> </td>-->
<td colspan="5"><input id="btn_enreg" name="btn_enreg" class = "form-control btn btn-primary" type="button" value="<?= _("Substituer") ?>" onClick="enregistrersubstituion_medicament();" style='font-size:10pt;' disabled> </td>
</tr>
</tbody>
</table>
<div id="div_liste_medicament">
</div>
</form>
</div>