109 lines
4.4 KiB
PHP
Executable File
109 lines
4.4 KiB
PHP
Executable File
<?php
|
|
require_once 'Framework/Controleur.php';
|
|
require_once 'Modele/Seance_temp.php';
|
|
require_once 'Modele/Prestationactes.php';
|
|
require_once 'Modele/Garantiesbaremepriseencharge.php';
|
|
require_once 'Modele/Feuillemaladie.php';
|
|
|
|
class ControleurAjaxprixseancesea extends Controleur {
|
|
private $feuille;
|
|
|
|
public function __construct() {
|
|
$this->prescription = new Seance_temp();
|
|
$this->prestation = new Prestationactes();
|
|
$this->garantie = new Garantiesbaremepriseencharge();
|
|
$this->feuille = new Feuillemaladie();
|
|
}
|
|
|
|
public function index() {
|
|
$codeActe = $this->requete->getParametreFormulaire("codeActe");
|
|
$quantite = $this->requete->getParametreFormulaire("quantite", "numerique");
|
|
// 10/03/2026 => prix modifiable
|
|
$prixSaisi = $this->requete->getParametreFormulaire("prixSaisi", "numerique");
|
|
|
|
$codePrestataire = $_SESSION['p_codePrestataire_C'];
|
|
$numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C'];
|
|
$numeroBonKine = $_SESSION['p_numeroBonKine_C'];
|
|
|
|
$prixActeModifiable = $_SESSION['p_prixActeModifiable'];
|
|
|
|
if($prixActeModifiable=="0"){
|
|
$this->prescription->modifierseancesea($codeActe, $quantite, $numeroBonKine);
|
|
}else{
|
|
$this->prescription->modifierprixseancesea($codeActe, $quantite, $numeroBonKine, $prixSaisi);
|
|
}
|
|
|
|
$prescription = $this->prescription->getprescription_sea($numeroBonKine);
|
|
|
|
$numeroFeuilleMaladie = $prescription['numeroFeuilleMaladie'];
|
|
$idBeneficiaire = $prescription['idBeneficiaire'];
|
|
|
|
$datePrestation = $this->prescription->getDateSurvenance($numeroFeuilleMaladie);
|
|
$codeGarantie = $this->prestation->getGarantieActe($codeActe);
|
|
|
|
$this->garantie->getsourcebaremegarantienew($idBeneficiaire, $codeGarantie, $datePrestation);
|
|
$statut = $this->garantie->getstatutacte($idBeneficiaire,$codeActe,$codeGarantie);
|
|
$motifStatut = $this->garantie->getlibellemotifdepassement($statut);
|
|
$this->garantie->baremesolde($idBeneficiaire,$codeActe,$codeGarantie,$numeroFeuilleMaladie);
|
|
$baremesolde = $this->garantie->getbaremesolde($idBeneficiaire,$codeActe,$codeGarantie,$numeroFeuilleMaladie);
|
|
|
|
|
|
$garantieadherent_temp = null;//$this->prestation->afficher_garantieadherent_temp();
|
|
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'garantieadherent_temp' => $garantieadherent_temp,
|
|
'statut' => $statut, 'baremesolde' => $baremesolde, 'motifStatut' => $motifStatut));
|
|
}
|
|
|
|
public function raffraichir() {
|
|
$numeroBonKine = $_SESSION['p_numeroBonKine_C'];
|
|
$prescription = $this->prescription->getprescription_sea($numeroBonKine);
|
|
$numeroFeuilleMaladie = $prescription['numeroFeuilleMaladie'];
|
|
$idBeneficiaire = $prescription['idBeneficiaire'];
|
|
$codeActe = $prescription['codeActeSeance'];
|
|
$datePrestation = $this->prescription->getDateSurvenance($numeroFeuilleMaladie);
|
|
$codeGarantie = $this->prestation->getGarantieActe($codeActe);
|
|
$baremesolde = $this->garantie->getbaremesolde($idBeneficiaire,$codeActe,$codeGarantie,$numeroFeuilleMaladie);
|
|
// $motifStatut = $this->garantie->getlibellemotifdepassement($statut);
|
|
$statut = $_SESSION['statut'];
|
|
|
|
// $this->genererVueAjax(array('prescription' => $prescription, 'statut' => $statut, 'baremesolde' => $baremesolde, 'motifStatut' => $motifStatut));
|
|
$this->genererVueAjax(array('prescription' => $prescription, 'statut' => $statut, 'baremesolde' => $baremesolde));
|
|
}
|
|
|
|
public function confirmerotp()
|
|
{
|
|
if ($this->requete->existeParametre("otpValue"))
|
|
{
|
|
$login = $_SESSION['p_login'];
|
|
$otpValueSaisi = $this->requete->getParametre("otpValue");
|
|
$codeTypeFacture = "SEA";
|
|
|
|
$otpArray = $this->feuille->get_otp_value($codeTypeFacture);
|
|
|
|
$otpValueRequis = $otpArray['otpValue'];
|
|
$idOtpFacturePrestation = $otpArray['idOtpFacturePrestation'];
|
|
|
|
if ( (password_verify($otpValueSaisi, $otpValueRequis)) && (strlen($otpValueSaisi)=='6') )
|
|
{
|
|
$this->feuille->maj_otp($idOtpFacturePrestation, '1'); // validé
|
|
}
|
|
else
|
|
{
|
|
$this->feuille->maj_otp($idOtpFacturePrestation, '9'); // incorrect
|
|
}
|
|
|
|
$this->executerAction("raffraichir");
|
|
}
|
|
}
|
|
|
|
public function envoyerotp()
|
|
{
|
|
$codeTypeFacture = "SEA";
|
|
$otpValue = mt_rand(100000, 999999);
|
|
$this->feuille->envoyer_otp($codeTypeFacture, $otpValue);
|
|
|
|
$this->executerAction("raffraichir");
|
|
}
|
|
|
|
|
|
} |