newdesigngestionnaire/Societes/envoyx/Tarifs/Vue/Ajaxprimescategorie.php
2026-03-04 00:45:44 +00:00

265 lines
12 KiB
PHP
Executable File

<INPUT class="sr-only" TYPE="text" id="plafondFamille" name="plafondFamille" value="<?=$plafondFamille?>">
<INPUT class="sr-only" TYPE="text" id="plafondIndividu" name="plafondIndividu" value="<?=$plafondIndividu?>">
<INPUT class="sr-only" TYPE="text" id="codeModecalculPrime" name="codeModecalculPrime" value="<?=$codeModecalculPrime?>">
<input class="form-control" style='text-align:center; font-size:11pt; background-color:#027BE3;color:white;' type="text" value="<?= _("PRIMES ET PLAFONDS PAR BENEFICAIRE"); ?>" disabled >
<?php if($codeModecalculPrime=="LP"): ?>
<table id="tab_plafond" class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
<thead>
<tr>
<th style='text-align:center '> <?= _("Lien Parenté") ?> </th>
<th style='text-align:center;'> <?= _("Prime de Base") ?> </th>
<th style='text-align:center '> <?= _("Effectif") ?> </th>
<th style='text-align:center'> <?= _("Plafond") ?> </th>
<th style='text-align:center'> <?= _("Maximum par Famille") ?> </th>
<th style='text-align:center'> <?= _("Autoriser Plus?") ?> </th>
<th style='text-align:center'> <?= _("Surprime") ?> </th>
<th style='text-align:center'> <?= _("Âge Min") ?> </th>
<th style='text-align:center'> <?= _("Âge Max") ?> </th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($prime_colleges as $prime_college):
$idPrime=$this->nettoyer($prime_college['id']);
$codeLienParente=$this->nettoyer($prime_college['codeLienParente']);
$pop = $this->nettoyer($prime_college['population']);
$lienparente = $this->nettoyer($prime_college['lienparente']);
if (est_anglophone()){
$lienparente = $this->nettoyer($prime_college['lienparenteEng']);
}
$ageMin = $this->nettoyer($prime_college['ageMinimum']);
$ageMax = $this->nettoyer($prime_college['ageMaximum']);
?>
<tr valign="top">
<td width="20%"><?= $lienparente ?></td>
<?php if(($codeBaseTarification == "FAM" && $codeLienParente=="A") || ($codeBaseTarification == "IND")):?>
<td align='center'>
<INPUT class="form-control text-center" id="tabPrime<?=++$i;?>" TYPE="text" value="<?= format_N($this->nettoyer($prime_college['prime'])); ?>"
onChange="ajax_maj_prime_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onkeyup="controle_numerique(this);"
onblur="formatMonetaire(this);" onfocus="formatNumerique(this);">
</td>
<td align='center' width="13%">
<INPUT class="form-control text-center" TYPE="text" id="tabPop<?=++$i;?>" value="<?= $pop ?>"
onChange="ajax_maj_population_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onkeyup="controle_numerique(this);"
onblur="formatMonetaire(this);">
</td>
<?php else:?>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<?php endif;?>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabPlafond<?=++$i;?>" value="<?= format_N($prime_college['forfaitPlafond']); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_plafond_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<?php if(($codeBaseTarification == "FAM" && $codeLienParente=="A") || ($codeBaseTarification == "IND" && $codeLienParente=="A")):?>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<td align='center'>
<SELECT class="form-control text-center" disabled>
<?php liste_options($ouinonautoriser, "", false); ?>
</SELECT>
</td>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<?php else:?>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabnbreParFamille<?=++$i;?>" value="<?= $prime_college['nbreParFamille']; ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_nbrefamille_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<td align='center'>
<SELECT class="form-control text-center" id="tabAutoriser<?=++$i;?>" onChange="ajax_maj_autoriser_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
<?php liste_options($ouinonautoriser, $this->nettoyer($prime_college['autoriserSupplement']), true); ?>
</SELECT>
</td>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabprimeSupplementaire<?=++$i;?>" value="<?= format_N($prime_college['primeSupplementaire']); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_supplementaire_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<?php endif;?>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabAgeMin<?=$i;?>" value="<?= $ageMin; ?>"
onkeyup="controle_numerique(this);" onChange="ajax_maj_agemin_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
</td>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabAgeMax<?=$i;?>" value="<?= $ageMax; ?>"
onkeyup="controle_numerique(this);" onChange="ajax_maj_agemax_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div id="div_prime" >
<div class="row">
<div id="div_plafond" class="col-6">
<table id="tab_plafond" class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt; margin-top:5px;">
<thead>
<tr>
<th style='text-align:center '> <?= _("Lien Parenté") ?> </th>
<th style='text-align:center'> <?= _("Plafond") ?> </th>
<th style='text-align:center'> <?= _("Maximum par Famille") ?> </th>
<th style='text-align:center'> <?= _("Autoriser Plus?") ?> </th>
<th style='text-align:center'> <?= _("Surprime") ?> </th>
<th style='text-align:center'> <?= _("Âge Min") ?> </th>
<th style='text-align:center'> <?= _("Âge Max") ?> </th>
</tr>
</thead>
<tbody>
<?php
$i = 0;
foreach ($prime_colleges as $prime_college):
$idPrime=$this->nettoyer($prime_college['id']);
$codeLienParente=$this->nettoyer($prime_college['codeLienParente']);
$lienparente = $this->nettoyer($prime_college['lienparente']);
if (est_anglophone()){
$lienparente = $this->nettoyer($prime_college['lienparenteEng']);
}
$ageMin = $this->nettoyer($prime_college['ageMinimum']);
$ageMax = $this->nettoyer($prime_college['ageMaximum']);
?>
<tr valign="top">
<td width="20%"><?= $lienparente ?></td>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabPlafond<?=++$i;?>" value="<?= format_N($prime_college['forfaitPlafond']); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_plafond_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<?php if($codeLienParente == "A"):?>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<td align='center'>
<SELECT class="form-control text-center" disabled>
<?php liste_options($ouinonautoriser, "", false); ?>
</SELECT>
</td>
<td>
<INPUT class="form-control" TYPE="text" disabled>
</td>
<?php else:?>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabnbreParFamille<?=++$i;?>" value="<?= $this->nettoyer($prime_college['nbreParFamille']); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_nbrefamille_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<td align='center'>
<SELECT class="form-control text-center" id="tabAutoriser<?=++$i;?>" onChange="ajax_maj_autoriser_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
<?php liste_options($ouinonautoriser, $this->nettoyer($prime_college['autoriserSupplement']), true); ?>
</SELECT>
</td>
<td align='center'>
<INPUT class="form-control text-center plafond" TYPE="text" id="tabprimeSupplementaire<?=++$i;?>" value="<?= format_N($prime_college['primeSupplementaire']); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);"
onChange="ajax_maj_supplementaire_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<?php endif;?>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabAgeMin<?=$i;?>" value="<?= $ageMin; ?>"
onkeyup="controle_numerique(this);" onChange="ajax_maj_agemin_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
</td>
<td align='center'>
<INPUT class="form-control text-center" TYPE="text" id="tabAgeMax<?=$i;?>" value="<?= $ageMax; ?>"
onkeyup="controle_numerique(this);" onChange="ajax_maj_agemax_college_temp('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');">
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div id="div_tranche_age" class="col-6">
<table id="tab_tranche_age" class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt; margin-top:5px;">
<thead>
<tr>
<th style="text-align:center" > <?= _("Tranche Âge") ?> </th>
<th style="text-align:center" > <?= _("Prime de Base") ?> </th>
<th style="text-align:center" > <?= _("Effectif") ?> </th>
<th style="text-align:center" > <?= _("Prime Total") ?> </th>
</tr>
</thead>
<tfoot>
<tr>
<td align="center" colspan="2"><?= _("Total") ?></td>
<td align="center"><?= $primesTotalTrancheAge['effectif_total']; ?></td>
<td align="center"><?= format_N($primesTotalTrancheAge['prime_total']); ?></td>
</tr>
</tfoot>
<tbody>
<?php
$i=0;
foreach ($primesTrancheAge as $v):
$idPrime = $this->nettoyer($v['id']);
$libelle = $this->nettoyer($v['libelleTrancheAge']);
if (est_anglophone()){
$libelle = $this->nettoyer($v['libelleTrancheAgeEng']);
}
$population = $this->nettoyer($v['population']);
$primeTotal = $this->nettoyer($v['primeTotal']);
$i++;
?>
<tr valign="top">
<td style="text-align:center"> <?= $libelle ?> </td>
<td style='text-align:center' width="25%">
<INPUT style='text-align:center; font-size:10pt;' class="form-control text-center" TYPE="text" id="prime<?=$i;?>" value="<?= format_N($this->nettoyer($v['prime'])); ?>"
onkeyup="controle_numerique(this);" onblur="formatMonetaire(this);" onChange="ajax_maj_prime_trancheage_college('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onfocus="formatNumerique(this);">
</td>
<td align='center' width="15%">
<INPUT class="form-control text-center" TYPE="text" id="tabPop<?=++$i;?>" value="<?= $population ?>"
onChange="maj_effectif_trancheage_college('<?=$idPrime?>', this.value, this, '<?=$_SESSION['modeDevis']?>');" onkeyup="controle_numerique(this);"
onblur="formatMonetaire(this);">
</td>
<td align='center' width="25%">
<INPUT class="form-control text-center" TYPE="text" id="tabPrimeTotal<?=++$i;?>" value="<?= format_N($primeTotal); ?>" disabled>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>