a
This commit is contained in:
parent
b068c8470d
commit
7491c49a35
75
Contestation/Assure.php
Executable file
75
Contestation/Assure.php
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
require_once "Modelecontestation.php";
|
||||
|
||||
class Assure extends Modelecontestation {
|
||||
|
||||
public function existeligne($codeSociete)
|
||||
{
|
||||
$sql = 'select id FROM societeuser WHERE (codeSociete=? and actif="1")';
|
||||
|
||||
$resultat = $this->executerRequete($sql, array($codeSociete));
|
||||
|
||||
return ($resultat->rowCount() > 0);
|
||||
}
|
||||
|
||||
public function existeligneconnexion($codeSociete)
|
||||
{
|
||||
$sql = 'select count(0) as nb FROM societeuser WHERE (codeSociete=?);';
|
||||
|
||||
$resultat = $this->executerRequete($sql, array($codeSociete))->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
$nb = $resultat['nb'];
|
||||
|
||||
return ($nb > 0);
|
||||
}
|
||||
|
||||
public function getResultatRequete($requete)
|
||||
{
|
||||
$sql = 'call sp_executer_requete(?)';
|
||||
|
||||
$resultat = $this->executerRequeteAdin($sql, array($requete));
|
||||
|
||||
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function getTablesbd()
|
||||
{
|
||||
$sql = 'call sp_get_tables_bdd()';
|
||||
|
||||
$resultat = $this->executerRequeteAdin($sql);
|
||||
|
||||
$donnes = $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
return $donnes;
|
||||
}
|
||||
|
||||
public function describeTable($tableName)
|
||||
{
|
||||
$sql = 'call sp_describe_table(?)';
|
||||
|
||||
$resultat = $this->executerRequeteAdin($sql, array($tableName));
|
||||
|
||||
return $resultat->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function geUneBd($codeBdd)
|
||||
{
|
||||
$sql = 'CALL sp_une_bd_saas(?);';
|
||||
|
||||
$resultat = $this->executerRequete($sql, array($codeBdd));
|
||||
|
||||
return $resultat->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
public function contester($codeSociete, $idAdherent, $numeroFeuilleMaladie, $motifContestation)
|
||||
{
|
||||
$sql = 'call sp_a_contester_feuille(?, ?, ?, ?)';
|
||||
|
||||
$this->executerRequeteAdin($sql, array($codeSociete, $idAdherent, $numeroFeuilleMaladie, $motifContestation));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,3 +1,108 @@
|
|||
<?php
|
||||
session_start();
|
||||
session_unset();
|
||||
|
||||
if (!isset($_GET['lg'])) {
|
||||
afficherMessage("Paramètre langue absent de la requête!");
|
||||
}
|
||||
|
||||
$lg = $_GET['lg'];
|
||||
$codeLangue = base64_decode($lg);
|
||||
|
||||
$tab_code_langue = ["fr_FR", "en_US"];
|
||||
if (!in_array($codeLangue, $tab_code_langue)) {
|
||||
afficherMessage("Langue inconnue!");
|
||||
}
|
||||
|
||||
if (!isset($_GET['codeEntite'])) {
|
||||
$msg = $codeLangue == 'en_US' ? "Entity parameter missing from query!" : "Paramètre entité absent de la requête!";
|
||||
afficherMessage($msg);
|
||||
}
|
||||
|
||||
if (!isset($_GET['idBeneficiaire'])) {
|
||||
$msg = $codeLangue == 'en_US' ? "Family parameter missing from query!" : "Paramètre famille absent de la requête!";
|
||||
afficherMessage($msg);
|
||||
}
|
||||
|
||||
$_SESSION['codeLangue'] = $lg;
|
||||
$_SESSION['codeEntite'] = $_GET['codeEntite'];
|
||||
$_SESSION['idBeneficiaire'] = $_GET['idBeneficiaire'];
|
||||
|
||||
// Récupération des données
|
||||
$codeSociete = base64_decode($_SESSION['codeEntite']);
|
||||
$idBeneficiaire = base64_decode($_SESSION['idBeneficiaire']);
|
||||
$codeBdd = $codeSociete;
|
||||
|
||||
require_once "Assure.php";
|
||||
|
||||
$assure = new Assure();
|
||||
|
||||
$_SESSION['codeBdd'] = $codeBdd;
|
||||
$bdd = $assure->geUneBd($codeBdd);
|
||||
|
||||
var_dump(
|
||||
array(
|
||||
"bdd" => $bdd,
|
||||
"codeSociete" => $codeSociete,
|
||||
"idBeneficiaire" => $idBeneficiaire,
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
if(!$bdd) {
|
||||
$message = $codeLangue == 'en_US' ? "Entity not found!" : "Entité introuvable!";
|
||||
afficherMessage("<strong>$message</strong>");
|
||||
}
|
||||
|
||||
$_SESSION['BdName'] = $bdd['BdName'];
|
||||
$_SESSION['BdLogin'] = $bdd['BdLogin'];
|
||||
$_SESSION['BdMdp'] = $bdd['BdMdp'];
|
||||
|
||||
function afficherMessage($message) {
|
||||
echo "<!DOCTYPE html>
|
||||
<html lang='fr'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
<title>Erreur</title>
|
||||
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css' rel='stylesheet'>
|
||||
<link href='https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css' rel='stylesheet'>
|
||||
<style>
|
||||
.error-container {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
.error-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 30px rgba(0,0,0,0.12);
|
||||
padding: 2rem;
|
||||
max-width: 500px;
|
||||
width: 100%;
|
||||
border-left: 4px solid #dc3545;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class='bg-light'>
|
||||
<div class='error-container'>
|
||||
<div class='error-card'>
|
||||
<div class='text-center mb-3'>
|
||||
<i class='bi bi-exclamation-triangle-fill text-danger' style='font-size: 3rem;'></i>
|
||||
</div>
|
||||
<h4 class='text-center text-danger mb-3'>Erreur</h4>
|
||||
<p class='text-center text-muted'>{$message}</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
|
|
@ -325,8 +430,11 @@
|
|||
|
||||
// Récupérer le token depuis l'URL
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
alert(urlParams);
|
||||
verificationToken = urlParams.get('token');
|
||||
// alert(urlParams);
|
||||
// verificationToken = urlParams.get('token');
|
||||
codeEntite = urlParams.get('codeEntite');
|
||||
idBeneficiaire = urlParams.get('idBeneficiaire');
|
||||
alert("codeEntite="+codeEntite+" ; idBeneficiaire="+idBeneficiaire);
|
||||
|
||||
// Initialisation
|
||||
window.onload = function() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user