diff --git a/Controleur/ControleurFeuillemaladie.php b/Controleur/ControleurFeuillemaladie.php index a4ad7d6..c338dce 100755 --- a/Controleur/ControleurFeuillemaladie.php +++ b/Controleur/ControleurFeuillemaladie.php @@ -81,7 +81,6 @@ class ControleurFeuillemaladie extends Controleur { $feuillemaladie = $this->feuillemaladie->getfeuillemaladie($numeroFeuilleMaladie); - $prestations = $this->prestation->getprestationsfeuille($numeroFeuilleMaladie, $codePrestataire); $ententePrealableCons = ""; @@ -102,7 +101,6 @@ class ControleurFeuillemaladie extends Controleur { $codeTypeAffection = $feuillemaladie['codeTypeAffection']; - //$affections = $this->affection->getListe($codeTypeAffection) ; $affections = $this->affection->getListes(); $estGarantiePha = $this->garantieadherent->estDansGarantieDuBeneficiaire("PHA",$idBeneficiaire); @@ -148,4 +146,37 @@ class ControleurFeuillemaladie extends Controleur { 'nbreActeEntentePrealable' => $nbreActeEntentePrealable, 'autoriserBonHospitAvantDate' => $autoriserBonHospitAvantDate, 'tauxCouverture' => $tauxCouverture)); } + + public function confirmerotp() + { + if ($this->requete->existeParametre("otpValue")) + { + $login = $_SESSION['p_login']; + $otpValueSaisi = $this->requete->getParametre("otpValue"); + + $otpArray = $this->feuillemaladie->get_otp_value(); + + $otpValueRequis = $otpArray['otpValue']; + $idOtpFacturePrestation = $otpArray['idOtpFacturePrestation']; + + if ( (password_verify($otpValueSaisi, $otpValueRequis)) && (strlen($otpValueSaisi)=='6') ) + { + $this->feuillemaladie->maj_otp($idOtpFacturePrestation, '1'); // validé + } + else + { + $this->feuillemaladie->maj_otp($idOtpFacturePrestation, '9'); // incorrect + } + + $this->rediriger("Feuillemaladie"); + } + } + + public function envoyerotp() + { + $otpValue = mt_rand(100000, 999999); + $this->feuillemaladie->envoyer_otp($otpValue); + $this->rediriger("Feuillemaladie"); + } + } \ No newline at end of file diff --git a/Controleur/ControleurFichebeneficiaire.php b/Controleur/ControleurFichebeneficiaire.php index cd47a6e..93aa17c 100755 --- a/Controleur/ControleurFichebeneficiaire.php +++ b/Controleur/ControleurFichebeneficiaire.php @@ -35,24 +35,18 @@ class ControleurFichebeneficiaire extends Controleur { $this->familleacte = (new Familleacte())->getListe($codeTypePrestation); $this->detail = new Detailtarifacte(); - // $this->raison = (new Raisonconsultation())->getListe(); $this->raison = (new Raisonconsultation()); $this->bonpec = new Bonpec(); - - $this->medecin = new Medecin(); - $this->oui_non = new Ouinon(); } public function index() { - $codeSociete = $this->requete->getSession()->getAttribut('p_codeSociete'); $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; - $this->beneficiaire->getModeBiometrie(); $beneficiaire = $this->beneficiaire->getContexteBeneficiaireId($idBeneficiaire); @@ -89,10 +83,9 @@ class ControleurFichebeneficiaire extends Controleur { $bool = true; $codeGarantie = "CON"; - //09-01-2023 + $tmDerogation = $this->beneficiaire->getTmDerogation($codeGarantie); - //01-03-2022 $this->garantie->getsourcebaremegarantienew($idBeneficiaire, $codeGarantie, $date); if (!empty($dateRef)){ @@ -155,22 +148,17 @@ class ControleurFichebeneficiaire extends Controleur { $_SESSION['p_okReferencement_C'] =$okReferencement; - $codeTypePrestation = "CONS"; $codePrestataire = $_SESSION['p_codePrestataire_C']; $codeTypeBon = "CONS"; $acte = array(); - //$referencementpolice = $this->beneficiaire->getReferencementPolice($_SESSION['p_idPolice_C']); - $nbBonsCons = $this->bonpec->getNbBonPrestataireDisponible($codePrestataire, $codeTypeBon); $codeGestionBon = $this->bonpec->getCodeGestionBon($codeTypeBon); $typeGestionbon = $this->bonpec->getGestionBon($codeGestionBon); $dureeVieBon = $this->bonpec->getDureeVie($codeTypeBon); - //$situation = $this->acte->getSituationActeBeneficiaire($codeActe); - $_SESSION['p_okId'] = "1"; $this->detail->settmtypeprestation($codeTypePrestation); @@ -204,13 +192,11 @@ class ControleurFichebeneficiaire extends Controleur { $sexe = $beneficiaire['sexe']; $raison = $this->raison->getraisonconsultation($sexe); - // KANE => 24/02/205 => réponse demande reconnaissance faciale + // KANE => 24/02/2025 => réponse demande reconnaissance faciale $etatDemanderecFac = $this->beneficiaire->fn_etat_demandereconnaissancefaciale(); $libelleEtatDemanderecFac = $this->beneficiaire->fn_libelle_etat_demandereconnaissancefaciale(); $messagePrestataireRecFac = $this->beneficiaire->fn_message_demandereconnaissancefaciale(); - // if (in_array($etatDemanderecFac, ["-1", "3", "4", "5"] , true)){} - $prixActeModifiable = $this->detail->getPrixActeModifiableConsultation(); $_SESSION['p_prixActeModifiableConsultation'] = $prixActeModifiable; @@ -226,7 +212,6 @@ class ControleurFichebeneficiaire extends Controleur { 'typeGestionbon' => $typeGestionbon, 'familleacte' => $this->familleacte, 'acte' => $acte, - //'raison' => $this->raison, 'raison' => $raison, 'dernierCentre' => $dernierCentre, 'medecins' => $medecins, @@ -316,7 +301,6 @@ class ControleurFichebeneficiaire extends Controleur { 'Bytes' => file_get_contents($sourceImage) ], 'TargetImage' => [ - //'Bytes' => file_get_contents($targetImage) 'Bytes' => base64_decode($targetImage) ], ] @@ -354,8 +338,6 @@ class ControleurFichebeneficiaire extends Controleur { } catch (Exception $e) { - // echo 'Message: ' .$e->getMessage(); - // exit(); $msgErreur = $e->getMessage(); $_SESSION['p_messageFace'] = "Un problème lors du traitement! / A problem during treatment!"; @@ -413,7 +395,6 @@ class ControleurFichebeneficiaire extends Controleur { $this->beneficiaire->registerface($username); $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; - // $this->beneficiaire->changerPhoto($idBeneficiaire, $nomImage); $this->beneficiaire->changerPhoto($idBeneficiaire, $nomImageCrypte_0); $_SESSION['p_messageFace'] = "Enrôlement effectué avec succès! / Enrollment completed successfully!!"; @@ -437,7 +418,6 @@ class ControleurFichebeneficiaire extends Controleur { $otpValueRequis = $otpArray['otpValue']; $idOtpprestation = $otpArray['idOtpprestation']; - // if ( ($otpValueSaisi==$otpValueRequis) && (strlen($otpValueSaisi)=='6') ) if ( (password_verify($otpValueSaisi, $otpValueRequis)) && (strlen($otpValueSaisi)=='6') ) { $this->beneficiaire->maj_otp($idOtpprestation, '1'); // validé @@ -463,5 +443,4 @@ class ControleurFichebeneficiaire extends Controleur { $this->beneficiaire->demandereconnaissancefaciale($telephoneAutre); $this->rediriger("Fichebeneficiaire"); } - } \ No newline at end of file diff --git a/Modele/Feuillemaladie.php b/Modele/Feuillemaladie.php index 937e1f9..afabae0 100755 --- a/Modele/Feuillemaladie.php +++ b/Modele/Feuillemaladie.php @@ -635,12 +635,46 @@ class Feuillemaladie extends Modele { $sql = 'call sp_p_get_feuilles_maladie_contestees(?, ?, ?)'; - //var_dump(array($codePrestataire, $d1, $d2)); - $resultat = $this->executerRequete($sql, array($codePrestataire, $d1, $d2)); - return $resultat->fetchAll(PDO::FETCH_ASSOC); } + + public function envoyer_otp($otpValue) + { + $hash = password_hash($otpValue, PASSWORD_DEFAULT); + + $sql = 'CALL sp_p_envoyer_otp_facture_prestation(?, ?, ?, ?, ?, ?, ?, ?);'; + + $codeSociete = $_SESSION['p_codeSociete']; + $codePrestataire = $_SESSION['p_codePrestataire_C']; + $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; + $user = $_SESSION['p_login']; + $numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C']; + $codeTypeFacture = "CSO"; + + $this->executerRequete($sql, array($codeSociete, $codePrestataire, $idBeneficiaire, $numeroFeuilleMaladie, $codeTypeFacture, $otpValue, $user, $hash)); + } + public function get_otp_value() + { + $codePrestataire = $_SESSION['p_codePrestataire_C']; + $idBeneficiaire = $_SESSION['p_idBeneficiaire_C']; + $numeroFeuilleMaladie = $_SESSION['p_numeroFeuilleMaladie_C']; + $codeTypeFacture = "CSO"; + + $sql = 'CALL sp_p_get_otp_facture_prestation(?, ?, ?, ?);'; + $resultat = $this->executerRequete($sql, array($codePrestataire, $idBeneficiaire, $numeroFeuilleMaladie, $codeTypeFacture)); + $ligne = $resultat->fetch(PDO::FETCH_ASSOC); + return $ligne; + } + + public function maj_otp($idOtpFacturePrestation, $otpStatus) + { + $user = $_SESSION['p_login']; + + $sql = 'CALL sp_p_maj_otp_facture_prestation(?, ?, ?);'; + + $this->executerRequete($sql, array($idOtpFacturePrestation, $otpStatus, $user)); + } } \ No newline at end of file diff --git a/Vue/Feuillemaladie/index.php b/Vue/Feuillemaladie/index.php index e59edc9..4eed7f5 100755 --- a/Vue/Feuillemaladie/index.php +++ b/Vue/Feuillemaladie/index.php @@ -88,12 +88,6 @@ { $specialite = $this->nettoyer($feuillemaladie['specialiteEng']); } - - var_dump( - array( - "noPrescription" => $noPrescription, - ) - ); ?>