radiantprestation/Vue/Seances/index.php

324 lines
15 KiB
PHP

<?php
$this->titre = "INTER-SANTE - Séances";
$numeroBonKine = $prescription['numeroBonKine'];
$facture = $prescription['facture'];
$nbRestantOld = $this->nettoyer($prescription['nbRestantOld']);
$numeroBonSeance = $this->nettoyer($prescription['numeroBonSeance']);
$ententePrealable = $this->nettoyer($prescription['ententePrealable']);
$codeGestionBon = $this->nettoyer($prescription['codeGestionBon']);
$badcodeGestionBon = "1";
$tab_gestion_bon = array("0", "1", "2");
if (in_array($codeGestionBon, $tab_gestion_bon))
{
$badcodeGestionBon = "0";
}
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$libelleActePrescription = $this->nettoyer($prescription['libelleActePrescriptionEng']);
}
else
{
$libelleActePrescription = $this->nettoyer($prescription['libelleActePrescription']);
}
?>
<script type="text/javascript">
</script>
<input class="sr-only" id="facture" name="facture" type="text" value= "<?= $facture ?>" >
<input class="sr-only" type="text" id="badcodeGestionBon" name="badcodeGestionBon" value= "<?= $badcodeGestionBon ?>" >
<input class="sr-only" type="text" id="codeGestionBon" name="codeGestionBon" Value="<?= $codeGestionBon ?>" >
<input class="sr-only" type="text" id="nbBonsCons" name="nbBonsCons" Value="<?= $nbBonsCons ?>" >
<input class="sr-only" type="text" id="ententePrealableSea" name="ententePrealableSea" Value="<?= $ententePrealable ?>" >
<table class="table table-responsive table-condensed" style='font-size:9pt;' >
<tbody>
<tr>
<td width="10%" > <?= _("Prescript du") ?> </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="10%" align="center"> No du Bon </td>
<td width="10%"> <input class="form-control" style="text-align: center; font-size:10pt;background-color:blue;color:white; " type="number" id="numeroBonKine" name="numeroBonKine" value="<?= $numeroBonKine ?>" readonly > </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>
<?php if ($facture=="1"): ?>
<tr>
<td colspan="8" align='center' class="alert alert-danger" style='font-size:12pt;'> <?= _("Dejà facturée !") ?> </td>
</tr>
<?php endif; ?>
</tbody>
</table>
<div id="ordonnance">
<input class="sr-only" type="number" id="prixActe" name="prixActe" value="<?= $this->nettoyer($prescription['valeurActeSeance']) ?>" >
<input class="sr-only" type="number" id="valeurActe" name="valeurActe" value="<?= $this->nettoyer($prescription['valeurActeSeance']) ?>" >
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > <?= _("Acte") ?> </td>
<?php if($ententePrealable=='2'): ?>
<td colspan="5" style='background-color: yellow;'> <?= $libelleActePrescription ?> </td>
<?php elseif($ententePrealable=='1'): ?>
<td colspan="5" style='background-color: #00ff00;'> <?= $libelleActePrescription ?> </td>
<?php elseif($ententePrealable=='9'): ?>
<td colspan="5" style='background-color: red;color:white;'> <?= $libelleActePrescription ?> </td>
<?php else: ?>
<td colspan="5"> <?= $libelleActePrescription ?> </td>
<?php endif; ?>
</tr>
<tr>
<td> <?= _("Nb Prescrits") ?> </td>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="nbSeance" name="nbSeance" value="<?= $this->nettoyer($prescription['nbSeance']) ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Nb Effectués") ?> </td>
<td width="24%" > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="nbLivreOld" name="nbLivreOld" value="<?= $this->nettoyer($prescription['nbLivreOld']) ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Nb Restant") ?> </td>
<td > <input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="nbRestant" name="nbRestant" value="<?= $this->nettoyer($prescription['nbRestantOld']) ?>" readonly > </td>
</tr>
</tbody>
</table>
</div>
<?php if($ententePrealable<2): ?>
<legend> <?= _("Séances Effectuées") ?> </legend>
<?php $nbSeances = 0; ?>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
<thead>
<tr>
<th style="text-align:center"> <?= _("Acte") ?> </th>
<th style="text-align:center"> Date </th>
<th style="text-align:center"> <?= _("Qté") ?> </th>
<th style="text-align:center"> <?= _("Prestataire") ?> </th>
<th style="text-align:center"> <?= _("Bon Séance") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($detailseances as $detailseance):
$idSeance=$this->nettoyer($detailseance['id']);
$ententePrealable = $this->nettoyer($detailseance['ententePrealable']);
$nbSeances++;
if (isset($_SESSION['p_lang']) && $_SESSION['p_lang']=="en_US")
{
$libelleActeSeance = $this->nettoyer($detailseance['libelleActeSeanceEng']);
}
else
{
$libelleActeSeance = $this->nettoyer($detailseance['libelleActeSeance']);
}
?>
<?php if($ententePrealable=='2'): ?>
<tr style="background-color: yellow;" >
<?php elseif($ententePrealable=='1'): ?>
<tr style="background-color: #00ff00;" >
<?php elseif($ententePrealable=='9'): ?>
<tr style="background-color: red; color:white;" >
<?php else: ?>
<tr valign="top">
<?php endif; ?>
<td align="center"> <?= $libelleActeSeance ?> </td>
<td align="center"> <?= dateLang($this->nettoyer($detailseance['datePrestation'])) ?> </td>
<td align="center"> <?= $this->nettoyer($detailseance['quantite']) ?> </td>
<td align="center"> <?= $this->nettoyer($detailseance['prestataireSeance']) ?> </td>
<td align="center"> <?= $this->nettoyer($detailseance['numeroBonSeance']) ?> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div id="div_facturation_seance">
<?php if($numeroBonSeance=="0") : ?>
<?php if($nbRestantOld>"0") : ?>
<input class="sr-only" type="number" id="fraisRetenuSeance" name="fraisRetenuSeance" value="0" >
<button type="button" id="btn_InitSession" name="btn_InitSession" class="form-control btn btn-primary" data-toggle="modal" data-target="#popInitSession" style='font-size:10pt;' > <?= _("Initier séances...") ?></button>
<?php else: ?>
<div class="alert alert-danger" style="height:30px; padding:5px;" >
<H4><?= _("Séances terminées!") ?></H4>
</div>
<?php endif; ?>
<?php else: ?>
<?php if($codeGestionBon=="0") : ?>
<button type="button" class="form-control btn btn-primary" data-toggle="modal" data-target="#popInitSession" style='font-size:10pt;' > <?= _("Modifier le bon...") ?> </button>
<?php endif; ?>
<div id="infosacte" style='font-size:10pt;'>
<input class="sr-only" type="number" id="aRembourser" name="aRembourser" value="<?= $this->nettoyer($prescription['montantArembourserSeance']) ?>" >
<input class="sr-only" type="number" id="totalActe" name="totalActe" value="<?= $this->nettoyer($prescription['fraisReelSeance']) ?>" >
<input class="sr-only" type="number" id="fraisRetenuSeance" name="fraisRetenuSeance" value="<?= $this->nettoyer($prescription['fraisRetenuSeance']) ?>" >
<input class="sr-only" type="text" id="cout" name="cout" value="<?= $this->nettoyer($prescription['fraisReelSeance']) ?>" >
<input class="sr-only" type="number" id="montantTm" name="montantTm" value="<?= $this->nettoyer($prescription['montantTmSeance']) ?>" >
<input class="sr-only" type="text" id="cout_f" name="cout_f" value="<?= format_N($this->nettoyer($prescription['fraisReelSeance'])) ?>" >
<input class="sr-only" type="text" id="montantTm_f" name="montantTm_f" value="<?= format_N($this->nettoyer($prescription['montantTmSeance'])) ?>" >
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="15%" > <?= _("Valeur") ?> </td>
<td width="20%" > <input class="form-control" style="background-color: rgb(190,190,190);text-align: center; font-size:10pt;'" type="text" value="<?= format_N($this->nettoyer($prescription['valeurActeSeance'])) ?>" readonly> </td>
<td width="15%" align="center" > <?= _("Quantité") ?> </td>
<td width="15%" >
<input class="form-control" id="quantiteSeance" name="quantiteSeance" type="number" value="<?= $this->nettoyer($prescription['quantiteSeance']) ?>" style="text-align: center; font-size:10pt; '"
onBlur="javascript:ajaxmajquteseancecso();" >
</td>
<td width="15%" align="center"> Total </td>
<td width="20%" > <input class="form-control" style="background-color: rgb(190,190,190);text-align: center; font-size:10pt;'" type="text" value="<?= format_N($this->nettoyer($prescription['fraisReelSeance'])) ?>" readonly ></td>
</tr>
<tr>
<td> <?= _("T M") ?> </td>
<td> <input id="montantTm_info" name="montantTm_info" class="form-control" style="background-color: rgb(190,190,190);text-align: center; font-size:10pt;'" type="text" value="<?= format_N($this->nettoyer($prescription['montantTmSeance'])) ?>" readonly ></td>
<td align="center" > <?= _("A Remb") ?> </td>
<td > <input id="aRembourser_info" name="aRembourser_info" class="form-control" style="background-color: rgb(190,190,190);text-align: center; font-size:10pt;'" type="text" value="<?= format_N($this->nettoyer($prescription['montantArembourserSeance'])) ?>" readonly ></td>
<td align="center" > <?= _("Feuille de soins") ?> </td>
<td align="center" style='font-size:10pt; background-color:blue;color:white;'> <?= $prescription['numeroBonSeance'] ?> </td>
</tr>
<tr>
<td> </td>
<td colspan="5" >
<input id="btn_enreg_seance" name="btn_enreg_seance" class = "form-control btn btn-primary" type="button" value="<?= _("Valider") ?>" onClick="javascript:valider_seance_cso();" style='font-size:10pt;' >
</td>
</tr>
</tbody>
</table>
</div>
<?php endif; ?>
</div>
<div class="modal fade" id="popInitSession" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop_session" name="btn_close_pop_session" type="button" class="close" data-dismiss="modal"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"><?= _("Attribuer un bon...") ?> </h4>
</div>
<div class="modal-body">
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="20%" > <?= _("Bons Disponibles") ?> </td>
<td width="30%" > <input class="form-control" style="text-align: center; font-size:10pt;" Value="<?= $nbBonsCons ?>" readonly > </td>
<td width="15%" align="center" > <?= _("Gestion") ?> </td>
<td>
<?php if($badcodeGestionBon=="1") : ?>
<input class="form-control" style="text-align: center; font-size:10pt; background-color: red;color:white;" Value="<?= _("INCONNU") ?>" readonly >
<?php else: ?>
<input class="form-control" style="text-align: center; font-size:10pt;" Value="<?= $typeGestionbon ?>" readonly >
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
<div id="infosbon">
<?php if ($badcodeGestionBon=="1") : ?>
<div class="alert alert-danger" style="height:30px; padding:5px; text-align:center;" >
<H4> <?= _("REVOIR LE TYPE DE GESTION DES BONS") ?> </H4>
</div>
<?php else: ?>
<?php if($codeGestionBon!="0"): ?>
<input class="sr-only" type="text" id="codeEtatBon" name="codeEtatBon" value="1">
<input class="sr-only" type="text" id="numeroBonSave" name="numeroBonSave" value="1">
<input class="sr-only" type="text" id="numeroBon" name="numeroBon" value="1">
<?php if($codeGestionBon=="1" && $nbBonsCons<1): ?>
<div class="alert alert-danger" style="height:30px; padding:5px; text-align:center;" >
<H4> <?= _("STOCK DE BON EPUISE") ?> </H4>
</div>
<?php else: ?>
<input id="btn_enreg_bon_kine" name="btn_enreg_bon_kine" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer") ?>" onClick="javascript:enregistrerbonsseancekinecso();" style='font-size:10pt;' >
<?php endif; ?>
<?php else: ?>
<input class="sr-only" type="text" id="codeEtatBon" name="codeEtatBon" value="">
<input class="sr-only" type="text" id="numeroBonSave" name="numeroBonSave" value="0">
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<?php if($nbBonsCons<1): ?>
<tr>
<input class="sr-only" type="number" id="numeroBon" name="numeroBon" required >
<td>
<div class="alert alert-danger" style="height:30px; padding:5px; text-align:center;" >
<H4> <?= _("STOCK DE BON EPUISE") ?> </H4>
</div>
</td>
</tr>
<?php else: ?>
<tr>
<td width="20%" > <?= _("Numéro Bon") ?> </td>
<td width="30%" >
<input class="form-control" style="text-align: center; font-size:10pt;" type="number" id="numeroBon" name="numeroBon" required
onChange="javascript:ajaxinfosbonseancekinecso();" onkeypress="javascript:ctrlkeypress_numeroBon(event);" ></td>
<td width="15%" > </td>
<td><input id="btn_enreg_bon_kine" name="btn_enreg_bon_kine" class = "form-control btn btn-primary" type="button" value="<?= _("Enregistrer") ?>" disabled style='font-size:10pt;' ></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php endif; ?>
<?php if (isset($msgErreur)): ?>
<div id ="msgErreur" class="alert alert-danger" style="height:30px; padding:5px;" >
<H4><?= $msgErreur ?></H4>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<div class="modal-footer">
<button id="close_pop_acte" name="close_pop_acte" type="button" class="btn btn-default" data-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>
<div id="div_fraisExclu">
<input class="sr-only" type="text" id="fraisExclu" name="fraisExclu" value="0" >
</div>
<div id="div_test">
</div>
<?php endif; ?>