Version DeepSeek corrigée v1.9

This commit is contained in:
KONE SOREL 2025-12-13 16:38:58 +00:00
parent 2ac8f83bcb
commit 2326d29102

View File

@ -72,138 +72,167 @@
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<!-- VERSION MOBILE FONCTIONNELLE -->
<!-- VERSION MOBILE IDENTIQUE AU DESKTOP MAIS STYLÉE POUR MOBILE -->
<span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin-top: 5px; margin-bottom:15px; display: block; text-align: center; font-size: 20px;">
<span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin: 10px 0 15px 0; display: block; text-align: center; font-size: 20px; width: 100%;">
Portail Assuré
</span>
<?php if (isset($msgErreur) and $msgErreur>" "): ?>
<div class="text-center p-t-10" style="margin-bottom: 15px;">
<div class="text-center p-t-10" style="margin-bottom: 15px; width: 100%;">
<h4 class="txt3">
<div class="col-12 alert alert-danger" style="padding: 10px; font-size: 13px; border-radius: 8px;">
<div class="col-12 alert alert-danger" style="padding: 10px; font-size: 13px; border-radius: 8px; max-width: 300px; margin: 0 auto;">
<?= $msgErreur ?>
</div>
</h4>
</div>
<?php else: ?>
<div class="text-center p-t-10" id="div_msgErreur_mobile" style="margin-bottom: 15px;"></div>
<div class="text-center p-t-10" id="div_msgErreur" style="margin-bottom: 15px;"></div>
<?php endif; ?>
<?php if($maintenance!='1'): ?>
<!-- FORMULAIRE MOBILE AVEC ACTION EXPLICITE -->
<form id="form_mobile" method="POST" action="" style="width: 100%; max-width: 300px; margin: 0 auto;">
<!-- MÊME STRUCTURE QUE DESKTOP MAIS EN COLONNE -->
<div style="width: 100%; max-width: 100%; overflow: hidden; padding: 0 10px; box-sizing: border-box;">
<!-- Langue -->
<div class="wrap-input100" style="margin-bottom: 15px; text-align: center;">
<label for="langue_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Langue</label>
<select class="form-select" id="langue_mobile" name="langue"
style="width: 100%; height: 40px; border: 2px solid #7D4FFE; border-radius: 9px; background: transparent; font-size: 14px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box;"
required autocomplete="off">
<div class="wrap-input100" style="margin-bottom: 15px; text-align: center; width: 100%;">
<label for="langue" style="font-size: 12pt; display: block; margin-bottom: 5px; width: 100%; text-align: center;">Langue</label>
<select class="form-select" id="langue" name="langue"
style="width: 100%; max-width: 300px; height: 40px; margin: 0 auto; border: 2px solid #7D4FFE; border-radius: 9px; background: transparent; font-size: 14px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box; display: block;"
required autocomplete="off" onchange="javascript:changer_langue_connexion();">
<?php liste_options($langues, $_SESSION['lang'], true); ?>
</select>
</div>
<!-- Entité -->
<div class="wrap-input100" style="margin-bottom: 15px; text-align: center;">
<div class="wrap-input100" style="margin-bottom: 15px; text-align: center; width: 100%;">
<div class="wrap-input100 validate-input">
<label for="codeSociete_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Entité</label>
<input class="input100" type="text" name="codeSociete" id="codeSociete_mobile" value="<?= $codeSociete ?>"
<label for="codeSociete" style="font-size: 12pt; display: block; margin-bottom: 5px; width: 100%; text-align: center;">Entité</label>
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>"
placeholder="Entité"
style="width: 100%; height: 40px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box;"
required AUTOCOMPLETE="off">
style="width: 100%; max-width: 300px; height: 40px; margin: 0 auto; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box; display: block;"
required AUTOCOMPLETE="off"
onChange="javascript:changer_entite_portail();">
</div>
</div>
<!-- Identifiant -->
<div id="div_login_portail_mobile" class="wrap-input100" style="margin-bottom: 15px; text-align: center;">
<div id="div_login_portail" class="wrap-input100" style="margin-bottom: 15px; text-align: center; width: 100%;">
<div class="wrap-input100 validate-input">
<label for="login_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Identifiant</label>
<input class="input100" type="text" name="login" id="login_mobile" value="<?= $codeUtilisateur ?>"
<label for="login" style="font-size: 12pt; display: block; margin-bottom: 5px; width: 100%; text-align: center;">Identifiant</label>
<input class="input100" type="text" name="login" id="login" value="<?= $codeUtilisateur ?>"
placeholder="Identifiant"
style="width: 100%; height: 40px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box;"
style="width: 100%; max-width: 300px; height: 40px; margin: 0 auto; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box; display: block;"
required AUTOCOMPLETE="off">
</div>
</div>
<!-- Mot de passe -->
<div class="wrap-input100 validate-input" 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 class="input100" type="password" name="mdp" id="mdp_mobile" placeholder="Mot de passe"
style="width: 100%; height: 40px; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box;"
<div class="wrap-input100 validate-input" style="margin-bottom: 20px; text-align: center; width: 100%;">
<label for="mdp" style="font-size: 12pt; display: block; margin-bottom: 5px; width: 100%; text-align: center;">Mot de passe</label>
<input class="input100" type="password" name="mdp" id="mdp" placeholder="Mot de passe"
style="width: 100%; max-width: 300px; height: 40px; margin: 0 auto; border: 2px solid #7D4FFE; border-radius: 9px; color: #7D4FFE; text-align: center; padding: 0 10px; box-sizing: border-box; display: block;"
required AUTOCOMPLETE="off">
</div>
<!-- Champ caché pour l'action -->
<input type="hidden" name="action" value="connexion">
<!-- Bouton Connexion - TYPE SUBMIT -->
<div class="container-login100-form-btn" style="margin-bottom: 20px; text-align: center;">
<button type="submit" name="btn_connexion" id="btn_connexion_mobile" class="btn login-btn"
style="width: 100%; height: 45px; background: #7D4FFE; color: white; font-size: 16px; font-weight: 700; border-radius: 9px; border: none;">
<!-- Bouton Connexion - MÊME ID ET MÊME COMPORTEMENT -->
<div class="container-login100-form-btn" style="margin-bottom: 20px; text-align: center; width: 100%;">
<button name="btn_connexion" id="btn_connexion" class="btn login-btn"
style="width: 100%; max-width: 300px; height: 45px; margin: 0 auto; background: #7D4FFE; color: white; font-size: 16px; font-weight: 700; border-radius: 9px; border: none; box-sizing: border-box; display: block;">
Connexion
</button>
</div>
</form>
</div>
<!-- Footer mobile -->
<div class="footer" style="position: relative; bottom: auto; left: auto; font-size: 11px; text-align: center; padding: 10px; width: 100%; margin-top: 10px;">
<!-- Footer -->
<div class="footer" style="position: relative; font-size: 11px; text-align: center; padding: 10px 0; width: 100%; max-width: 300px; margin: 10px auto 0; box-sizing: border-box;">
Tous droits réservés <a href="https://www.ebene.info/">&copy; EBENE SOLUTIONS INFORMATIQUES</a>
</div>
<?php endif; ?>
</div>
<!-- STYLES ET SCRIPT SIMPLIFIÉS -->
<!-- STYLES CRITIQUES POUR ÉLIMINER LE DÉBORDEMENT -->
<style>
/* RÈGLES STRICTES POUR ÉVITER TOUT DÉBORDEMENT */
.d-md-none {
width: 100vw !important;
max-width: 100vw !important;
overflow-x: hidden !important;
box-sizing: border-box !important;
display: none; /* Caché par défaut */
}
/* SUR MOBILE SEULEMENT */
@media screen and (max-width: 767px) {
/* FORCE LE VIEWPORT */
body, html {
width: 100vw !important;
max-width: 100vw !important;
overflow-x: hidden !important;
position: relative !important;
}
/* AFFICHER MOBILE, CACHER DESKTOP */
.d-md-none {
display: block !important;
width: 100% !important;
padding: 15px !important;
box-sizing: border-box !important;
}
.d-none.d-md-block {
display: none !important;
}
#form_mobile {
/* CORRECTION DU CONTENEUR PRINCIPAL */
.container-fluid {
width: 100vw !important;
max-width: 100vw !important;
overflow-x: hidden !important;
margin: 0 !important;
padding: 0 !important;
}
.content {
width: 100vw !important;
max-width: 100vw !important;
padding: 10px !important;
margin: 0 !important;
overflow-x: hidden !important;
}
/* STYLES SPÉCIFIQUES POUR LES CHAMPS MOBILES */
.d-md-none > div:last-child {
width: 100% !important;
max-width: 300px !important;
margin: 0 auto !important;
max-width: 100% !important;
overflow: hidden !important;
}
#form_mobile input,
#form_mobile select,
#btn_connexion_mobile {
/* TOUS LES ÉLÉMENTS ONT UNE LARGEUR MAX */
.d-md-none input,
.d-md-none select,
.d-md-none .login-btn,
.d-md-none .footer {
max-width: 300px !important;
width: 100% !important;
max-width: 300px !important;
margin: 0 auto !important;
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
}
#form_mobile input,
#form_mobile select {
height: 40px !important;
border: 2px solid #7D4FFE !important;
border-radius: 9px !important;
padding: 0 15px !important;
box-sizing: border-box !important;
}
#btn_connexion_mobile {
height: 45px !important;
}
#form_mobile label {
/* FORCE LE CENTRAGE */
.wrap-input100 {
text-align: center !important;
display: block !important;
width: 100% !important;
margin-bottom: 5px !important;
}
/* POUR LES TRÈS PETITS ÉCRANS */
@media screen and (max-width: 320px) {
.d-md-none input,
.d-md-none select,
.d-md-none .login-btn,
.d-md-none .footer {
max-width: 280px !important;
}
}
}
@ -212,152 +241,178 @@
.d-md-none {
display: none !important;
}
.d-none.d-md-block {
display: block !important;
}
}
</style>
<script>
// SCRIPT SIMPLE ET FONCTIONNEL POUR MOBILE
// ============================================
// SOLUTION SIMPLE POUR LES IDs EN DOUBLE
// ============================================
// 1. Initialisation au chargement
// 1. AU CHARGEMENT, CACHER LA VERSION INACTIVE
document.addEventListener('DOMContentLoaded', function() {
console.log('Initialisation mobile...');
console.log('Initialisation...');
// Récupérer le formulaire desktop pour copier son action
const formDesktop = document.querySelector('form');
const formMobile = document.getElementById('form_mobile');
if (formDesktop && formMobile) {
// Copier l'action du formulaire desktop
formMobile.action = formDesktop.action || window.location.href;
console.log('Action copiée:', formMobile.action);
// Copier la méthode
formMobile.method = formDesktop.method || 'POST';
}
// 2. Gestion des événements de changement
document.getElementById('langue_mobile')?.addEventListener('change', function() {
const desktopLangue = document.getElementById('langue');
if (desktopLangue) {
desktopLangue.value = this.value;
if (typeof changer_langue_connexion === 'function') {
changer_langue_connexion();
}
}
});
document.getElementById('codeSociete_mobile')?.addEventListener('change', function() {
const desktopEntite = document.getElementById('codeSociete');
if (desktopEntite) {
desktopEntite.value = this.value;
if (typeof changer_entite_portail === 'function') {
changer_entite_portail();
}
}
});
// 3. Validation avant soumission
formMobile?.addEventListener('submit', function(e) {
console.log('Soumission du formulaire mobile...');
// 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
if (!codeSociete || !login || !mdp) {
e.preventDefault();
alert('Veuillez remplir tous les champs obligatoires');
return false;
}
console.log('Données mobiles:', {codeSociete, login, mdp});
// OPTION A: Synchroniser avec le desktop avant soumission
const desktopForm = document.querySelector('form');
if (desktopForm) {
// Copier les valeurs dans le formulaire desktop
document.getElementById('codeSociete').value = codeSociete;
document.getElementById('login').value = login;
document.getElementById('mdp').value = mdp;
document.getElementById('langue').value = document.getElementById('langue_mobile').value;
// Soumettre le formulaire desktop
e.preventDefault();
desktopForm.submit();
return false;
}
// OPTION B: Soumettre le formulaire mobile normalement
return true;
});
// 4. Gestion responsive
function gererAffichageResponsive() {
function gererAffichage() {
const isMobile = window.innerWidth <= 767;
if (isMobile) {
// Mode mobile
document.querySelectorAll('.d-md-none').forEach(el => el.style.display = 'block');
document.querySelectorAll('.d-none.d-md-block').forEach(el => el.style.display = 'none');
// SUR MOBILE: cacher desktop, montrer mobile
const desktopElements = document.querySelectorAll('.d-none.d-md-block, .d-none.d-md-block *');
const mobileElements = document.querySelectorAll('.d-md-none, .d-md-none *');
desktopElements.forEach(el => {
if (el.id) el.id = el.id + '_desktop_hidden';
el.style.display = 'none';
});
mobileElements.forEach(el => {
el.style.display = '';
});
console.log('Mode mobile activé');
} else {
// Mode desktop
document.querySelectorAll('.d-md-none').forEach(el => el.style.display = 'none');
document.querySelectorAll('.d-none.d-md-block').forEach(el => el.style.display = 'block');
// SUR DESKTOP: cacher mobile, montrer desktop
const mobileElements = document.querySelectorAll('.d-md-none, .d-md-none *');
const desktopElements = document.querySelectorAll('.d-none.d-md-block, .d-none.d-md-block *');
mobileElements.forEach(el => {
if (el.id) el.id = el.id + '_mobile_hidden';
el.style.display = 'none';
});
desktopElements.forEach(el => {
el.style.display = '';
// Restaurer les IDs originaux
if (el.id && el.id.endsWith('_desktop_hidden')) {
el.id = el.id.replace('_desktop_hidden', '');
}
});
console.log('Mode desktop activé');
}
// FORCER LA SUPPRESSION DU DÉBORDEMENT
document.body.style.overflowX = 'hidden';
document.documentElement.style.overflowX = 'hidden';
}
// 2. SOLUTION DE CONNEXION POUR MOBILE
// Le bouton a le même ID, donc il devrait fonctionner comme le desktop
// Mais au cas où, ajoutons un fallback
function setupConnexionMobile() {
const btnConnexion = document.getElementById('btn_connexion');
if (btnConnexion) {
// Sauvegarder l'original
const originalOnClick = btnConnexion.onclick;
btnConnexion.addEventListener('click', function(e) {
console.log('Bouton connexion cliqué');
if (window.innerWidth <= 767) {
console.log('Mode mobile - validation...');
// Validation des champs
const codeSociete = document.getElementById('codeSociete')?.value.trim();
const login = document.getElementById('login')?.value.trim();
const mdp = document.getElementById('mdp')?.value.trim();
if (!codeSociete || !login || !mdp) {
e.preventDefault();
alert('Veuillez remplir tous les champs');
return false;
}
console.log('Validation OK, soumission...');
// Trouver le formulaire parent
let form = btnConnexion.closest('form');
if (!form) {
// Chercher un formulaire dans la page
form = document.querySelector('form');
}
if (form) {
console.log('Formulaire trouvé, soumission...');
// Laisser le navigateur soumettre normalement
return true;
} else {
console.error('Aucun formulaire trouvé!');
// Fallback: redirection
const params = new URLSearchParams();
params.append('codeSociete', codeSociete);
params.append('login', login);
params.append('mdp', mdp);
params.append('langue', document.getElementById('langue').value);
window.location.href = window.location.pathname + '?' + params.toString();
return false;
}
}
// Sur desktop, laisser le comportement original
if (originalOnClick) {
return originalOnClick.call(this, e);
}
return true;
});
}
}
gererAffichageResponsive();
window.addEventListener('resize', gererAffichageResponsive);
// Initialiser
gererAffichage();
setupConnexionMobile();
// 5. Debug: Log quand on clique sur le bouton
document.getElementById('btn_connexion_mobile')?.addEventListener('click', function() {
console.log('Bouton connexion mobile cliqué!');
// Ré-initialiser au redimensionnement
window.addEventListener('resize', function() {
setTimeout(gererAffichage, 100);
setTimeout(setupConnexionMobile, 150);
});
// 3. CORRECTION URGENTE DU DÉBORDEMENT
setTimeout(function() {
const allElements = document.querySelectorAll('*');
allElements.forEach(el => {
el.style.maxWidth = '100vw';
el.style.boxSizing = 'border-box';
});
}, 500);
});
// 6. Fallback ultra simple - déclencher la connexion desktop
function soumettreConnexionMobile() {
console.log('Fonction soumettreConnexionMobile appelée');
// Trouver le formulaire desktop
const form = document.querySelector('form');
if (form) {
// Copier les valeurs mobiles vers desktop
const valeurs = {
'codeSociete': document.getElementById('codeSociete_mobile')?.value,
'login': document.getElementById('login_mobile')?.value,
'mdp': document.getElementById('mdp_mobile')?.value,
'langue': document.getElementById('langue_mobile')?.value
};
Object.keys(valeurs).forEach(name => {
const input = document.querySelector(`[name="${name}"]`);
if (input && valeurs[name]) {
input.value = valeurs[name];
}
});
console.log('Soumission du formulaire desktop avec valeurs mobiles');
form.submit();
} else {
console.error('Aucun formulaire trouvé!');
alert('Erreur: Impossible de trouver le formulaire de connexion');
}
}
// ============================================
// SOLUTION ALTERNATIVE: ATTENDRE QUE LE DESKTOP SOIT CHARGÉ
// ============================================
// 7. Liaison directe au bouton (fallback)
// Attendre que le JavaScript desktop soit chargé
setTimeout(function() {
const btnMobile = document.getElementById('btn_connexion_mobile');
if (btnMobile) {
btnMobile.addEventListener('click', function(e) {
console.log('Clic sur bouton mobile détecté');
// Essayer la méthode simple
soumettreConnexionMobile();
e.preventDefault();
return false;
});
console.log('Vérification des fonctions desktop...');
// Si les fonctions desktop existent, les utiliser
if (typeof changer_langue_connexion === 'function') {
console.log('Fonction changer_langue_connexion trouvée');
}
if (typeof changer_entite_portail === 'function') {
console.log('Fonction changer_entite_portail trouvée');
}
// Le bouton devrait déjà fonctionner via le JS desktop
// Mais ajoutons un écouteur de débogage
document.getElementById('btn_connexion')?.addEventListener('click', function() {
console.log('DEBUG - Bouton cliqué, width:', window.innerWidth);
console.log('Champs:', {
codeSociete: document.getElementById('codeSociete')?.value,
login: document.getElementById('login')?.value,
mdp: document.getElementById('mdp')?.value
});
});
}, 1000);
</script>