assure/Vue/Ajaxconnexioncookie/french.php

349 lines
14 KiB
PHP
Executable File

<?php
$maintenance = $societeusersaas['maintenance'];
if($maintenance=='1')
{
$msgErreur = 'Site en maintenance, veuillez vous reconnecter plus tard!';
}
?>
<!-- Tableau desktop (affiché sur les écrans moyens et grands) -->
<div class="d-md-none">
<!-- VERSION MOBILE COMPACTE SANS DÉBORDEMENT -->
<div style="width: 100%; max-width: 100vw; overflow-x: hidden; box-sizing: border-box; padding: 10px;">
<!-- Titre ajusté pour mobile -->
<span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin: 5px 0 15px 0; display: block; font-size: 20px; text-align: center;">
Portail Assuré
</span>
<?php if (isset($msgErreur) and $msgErreur>" "): ?>
<div class="text-center" style="margin-bottom: 15px;">
<div style="background-color: #f8d7da; color: #721c24; padding: 10px; border-radius: 8px; font-size: 13px; border: 1px solid #f5c6cb;">
<?= $msgErreur ?>
</div>
</div>
<?php else: ?>
<div class="text-center" id="div_msgErreur_mobile" style="margin-bottom: 15px;"></div>
<?php endif; ?>
<?php if($maintenance!='1'): ?>
<!-- Champs de formulaire compacts pour mobile -->
<div style="width: 100%; max-width: 100%;">
<!-- Langue -->
<div style="margin-bottom: 15px; text-align: center;">
<label for="langue_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Langue</label>
<select id="langue_mobile" name="langue_mobile"
style="width: 100%; max-width: 280px; margin: 0 auto; height: 40px; padding: 0 12px; border: 2px solid #7D4FFE; border-radius: 9px; background: transparent; font-size: 14px; color: #7D4FFE; text-align: center; box-sizing: border-box; display: block;"
required onchange="changerLangueMobile(this.value);">
<?php liste_options($langues, $_SESSION['lang'], true); ?>
</select>
</div>
<!-- Entité -->
<div style="margin-bottom: 15px; text-align: center;">
<label for="codeSociete_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Entité</label>
<input type="text" id="codeSociete_mobile" name="codeSociete_mobile" value="<?= $codeSociete ?>"
placeholder="Entité"
style="width: 100%; max-width: 280px; margin: 0 auto; height: 40px; padding: 0 12px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box; display: block;"
required autocomplete="off"
onchange="changerEntiteMobile(this.value);">
</div>
<!-- Identifiant -->
<div style="margin-bottom: 15px; text-align: center;">
<label for="login_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Identifiant</label>
<input type="text" id="login_mobile" name="login_mobile" value="<?= $codeUtilisateur ?>"
placeholder="Identifiant"
style="width: 100%; max-width: 280px; margin: 0 auto; height: 40px; padding: 0 12px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box; display: block;"
required autocomplete="off">
</div>
<!-- Mot de passe -->
<div style="margin-bottom: 20px; text-align: center;">
<label for="mdp_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Mot de passe</label>
<input type="password" id="mdp_mobile" name="mdp_mobile" placeholder="Mot de passe"
style="width: 100%; max-width: 280px; margin: 0 auto; height: 40px; padding: 0 12px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box; display: block;"
required autocomplete="off">
</div>
<!-- Bouton Connexion -->
<div style="margin-bottom: 15px; text-align: center;">
<button type="button" id="btn_connexion_mobile"
style="width: 100%; max-width: 280px; margin: 0 auto; height: 45px; background: #7D4FFE; color: white; font-size: 16px; font-weight: 700; border-radius: 9px; border: none; box-sizing: border-box; display: block;">
Connexion
</button>
</div>
</div>
<!-- Footer mobile -->
<div style="font-size: 11px; text-align: center; padding: 10px 0; color: #666; width: 100%;">
Tous droits réservés <a href="https://www.ebene.info/" style="color: #7D4FFE; text-decoration: none;">&copy; EBENE SOLUTIONS INFORMATIQUES</a>
</div>
<?php endif; ?>
</div>
</div>
<!-- STYLES POUR ÉVITER TOUT DÉBORDEMENT -->
<style>
/* STYLES MOBILE CRITIQUES - À AJOUTER DANS PORTAL.PHP OU ICI */
/* 1. FORCER LE VIEWPORT MOBILE */
@media screen and (max-width: 767px) {
html, body {
width: 100vw !important;
max-width: 100vw !important;
overflow-x: hidden !important;
position: relative !important;
}
/* 2. CACHER LA VERSION DESKTOP */
.d-none.d-md-block {
display: none !important;
}
/* 3. AFFICHER LA VERSION MOBILE */
.d-md-none {
display: block !important;
width: 100vw !important;
max-width: 100vw !important;
overflow: hidden !important;
}
/* 4. CORRECTION DU CONTENEUR PRINCIPAL DANS PORTAL.PHP */
.container-fluid {
flex-direction: column !important;
width: 100vw !important;
max-width: 100vw !important;
margin: 0 !important;
padding: 0 !important;
}
/* 5. CORRECTION DU LOGO DANS PORTAL.PHP */
.logo img {
width: 100px !important;
height: 100px !important;
position: relative !important;
left: 0 !important;
top: 0 !important;
margin: 10px auto !important;
display: block !important;
}
/* 6. CORRECTION DE LA ZONE DE CONTENU DANS PORTAL.PHP */
.content {
width: 100vw !important;
max-width: 100vw !important;
padding: 5px !important;
margin: 0 !important;
}
.form-side {
padding-top: 10px !important;
min-height: auto !important;
height: auto !important;
}
/* 7. STYLES DES CHAMPS MOBILES */
.d-md-none > div {
width: 100vw !important;
max-width: 100vw !important;
padding: 0 10px !important;
box-sizing: border-box !important;
}
/* 8. FORCER LE CONTENU À RESTER DANS LES LIMITES */
.d-md-none * {
max-width: 100% !important;
box-sizing: border-box !important;
}
/* 9. ADAPTER LES INPUTS */
.d-md-none input,
.d-md-none select,
.d-md-none button {
width: 100% !important;
max-width: 280px !important;
margin-left: auto !important;
margin-right: auto !important;
}
/* 10. CORRECTION DU CARROUSEL */
.slide-container {
display: none !important;
}
/* 11. BOUTON HOVER */
#btn_connexion_mobile:hover {
background: white !important;
color: #7D4FFE !important;
border: 2px solid #7D4FFE !important;
}
/* 12. PLACEHOLDER */
.d-md-none input::placeholder {
font-weight: bold !important;
color: #7D4FFE !important;
opacity: 0.7 !important;
}
}
/* CACHER MOBILE SUR DESKTOP */
@media screen and (min-width: 768px) {
.d-md-none {
display: none !important;
}
}
/* POUR TRÈS PETITS ÉCRANS */
@media screen and (max-width: 320px) {
.d-md-none > div {
padding: 0 5px !important;
}
.d-md-none input,
.d-md-none select,
.d-md-none button {
max-width: 260px !important;
font-size: 13px !important;
}
.login100-form-title {
font-size: 18px !important;
}
}
</style>
<script>
// FONCTIONS MOBILE SIMPLIFIÉES
function changerLangueMobile(langue) {
// Synchroniser avec le desktop
const desktopLangue = document.getElementById('langue');
if (desktopLangue) {
desktopLangue.value = langue;
const event = new Event('change');
desktopLangue.dispatchEvent(event);
}
}
function changerEntiteMobile(entite) {
// Synchroniser avec le desktop
const desktopEntite = document.getElementById('codeSociete');
if (desktopEntite) {
desktopEntite.value = entite;
const event = new Event('change');
desktopEntite.dispatchEvent(event);
}
}
// GESTION DE LA CONNEXION MOBILE
document.addEventListener('DOMContentLoaded', function() {
const btnMobile = document.getElementById('btn_connexion_mobile');
if (btnMobile) {
btnMobile.addEventListener('click', function() {
// Récupérer les valeurs
const codeSociete = document.getElementById('codeSociete_mobile').value.trim();
const login = document.getElementById('login_mobile').value.trim();
const mdp = document.getElementById('mdp_mobile').value.trim();
// Validation simple
if (!codeSociete || !login || !mdp) {
alert('Veuillez remplir tous les champs');
return false;
}
// Option 1: Utiliser le formulaire desktop existant
const desktopForm = document.querySelector('form');
if (desktopForm) {
// Copier les valeurs dans les champs desktop
const fields = [
{id: 'codeSociete', value: codeSociete},
{id: 'login', value: login},
{id: 'mdp', value: mdp}
];
fields.forEach(field => {
const el = document.getElementById(field.id);
if (el) el.value = field.value;
});
// Soumettre
desktopForm.submit();
return true;
}
// Option 2: Redirection avec paramètres
const params = new URLSearchParams();
params.append('action', 'connexion');
params.append('codeSociete', codeSociete);
params.append('login', login);
params.append('mdp', mdp);
params.append('langue', document.getElementById('langue_mobile').value);
window.location.href = '?' + params.toString();
});
}
// GESTION RESPONSIVE AUTOMATIQUE
function gererAffichageResponsive() {
const isMobile = window.innerWidth <= 767;
const mobileDiv = document.querySelector('.d-md-none');
const desktopDiv = document.querySelector('.d-none.d-md-block');
if (isMobile) {
// Mode mobile
if (mobileDiv) mobileDiv.style.display = 'block';
if (desktopDiv) desktopDiv.style.display = 'none';
// Forcer le viewport mobile
document.documentElement.style.overflowX = 'hidden';
document.body.style.overflowX = 'hidden';
} else {
// Mode desktop
if (mobileDiv) mobileDiv.style.display = 'none';
if (desktopDiv) desktopDiv.style.display = 'block';
}
}
// Initialisation
gererAffichageResponsive();
window.addEventListener('resize', gererAffichageResponsive);
// CORRECTION URGENTE POUR DÉBORDEMENT
setTimeout(function() {
const mobileElements = document.querySelectorAll('.d-md-none, .d-md-none *');
mobileElements.forEach(el => {
el.style.maxWidth = '100vw';
el.style.boxSizing = 'border-box';
el.style.overflowX = 'hidden';
});
}, 100);
});
// FONCTION POUR FORCER L'AFFICHAGE CORRECT SUR MOBILE
function corrigerDebordementMobile() {
if (window.innerWidth <= 767) {
// Forcer les dimensions
document.querySelectorAll('input, select, button, div').forEach(el => {
el.style.maxWidth = '100%';
el.style.boxSizing = 'border-box';
});
// Corriger le conteneur principal
const container = document.querySelector('.container-fluid');
if (container) {
container.style.width = '100vw';
container.style.maxWidth = '100vw';
container.style.overflowX = 'hidden';
}
}
}
// Exécuter plusieurs fois pour être sûr
window.addEventListener('load', corrigerDebordementMobile);
window.addEventListener('resize', corrigerDebordementMobile);
setTimeout(corrigerDebordementMobile, 500);
</script>