Verion DeepSeek corrigée v1.1

This commit is contained in:
KONE SOREL 2025-12-13 15:32:50 +00:00
parent c3dab11552
commit 4af19d6dde

View File

@ -72,7 +72,7 @@
<!-- Affichage mobile (cartes) --> <!-- Affichage mobile (cartes) -->
<div class="d-md-none"> <div class="d-md-none">
<!-- Copie exacte de la logique desktop, juste adaptée pour mobile --> <!-- Version mobile avec IDs UNIQUES -->
<span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin-top: 5px; margin-bottom:10px; display: block; font-size: 22px; text-align: center;"> <span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin-top: 5px; margin-bottom:10px; display: block; font-size: 22px; text-align: center;">
Portail Assuré Portail Assuré
</span> </span>
@ -86,16 +86,16 @@
</h4> </h4>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="text-center p-t-10" id="div_msgErreur" style="margin-bottom: 15px;"></div> <div class="text-center p-t-10" id="div_msgErreur_mobile" style="margin-bottom: 15px;"></div>
<?php endif; ?> <?php endif; ?>
<?php if($maintenance!='1'): ?> <?php if($maintenance!='1'): ?>
<!-- TOUTE LA STRUCTURE EST IDENTIQUE, SEULEMENT LES STYLES SONT AJUSTÉS POUR MOBILE --> <!-- TOUS LES IDs ONT UN SUFFIXE _mobile POUR LES RENDRE UNIQUES -->
<div class="wrap-input100" style="margin-bottom: 15px;"> <div class="wrap-input100" style="margin-bottom: 15px;">
<label for="langue">Langue</label> <label for="langue_mobile">Langue</label>
<select class="form-select" id="langue" name="langue" <select class="form-select" id="langue_mobile" name="langue_mobile"
style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; background: transparent; font-size: 13px; color: #7D4FFE; text-align: center; box-sizing: border-box;" style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; background: transparent; font-size: 13px; color: #7D4FFE; text-align: center; box-sizing: border-box;"
required autocomplete="off" onchange="javascript:changer_langue_connexion();"> required autocomplete="off" onchange="javascript:changer_langue_connexion_mobile(this.value);">
<?php liste_options($langues, $_SESSION['lang'], true); ?> <?php liste_options($langues, $_SESSION['lang'], true); ?>
</select> </select>
</div> </div>
@ -103,19 +103,19 @@
<div class="wrap-input100" style="margin-bottom: 15px;"> <div class="wrap-input100" style="margin-bottom: 15px;">
<div class="wrap-input100 validate-input"> <div class="wrap-input100 validate-input">
<label for="codeSociete">Entité</label> <label for="codeSociete_mobile">Entité</label>
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>" <input class="input100" type="text" name="codeSociete_mobile" id="codeSociete_mobile" value="<?= $codeSociete ?>"
placeholder="Entité" placeholder="Entité"
style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;" style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;"
required AUTOCOMPLETE="off" required AUTOCOMPLETE="off"
onChange="javascript:changer_entite_portail();" > onChange="javascript:changer_entite_portail_mobile(this.value);" >
</div> </div>
</div> </div>
<div id="div_login_portail" class="wrap-input100" style="margin-bottom: 15px;"> <div id="div_login_portail_mobile" class="wrap-input100" style="margin-bottom: 15px;">
<div class="wrap-input100 validate-input"> <div class="wrap-input100 validate-input">
<label for="login">Identifiant</label> <label for="login_mobile">Identifiant</label>
<input class="input100" type="text" name="login" id="login" value="<?= $codeUtilisateur ?>" <input class="input100" type="text" name="login_mobile" id="login_mobile" value="<?= $codeUtilisateur ?>"
placeholder="Identifiant" placeholder="Identifiant"
style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;" style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;"
required AUTOCOMPLETE="off"> required AUTOCOMPLETE="off">
@ -123,14 +123,14 @@
</div> </div>
<div class="wrap-input100 validate-input" style="margin-bottom: 20px;"> <div class="wrap-input100 validate-input" style="margin-bottom: 20px;">
<label for="mdp">Mot de passe</label> <label for="mdp_mobile">Mot de passe</label>
<input class="input100" type="password" name="mdp" id="mdp" placeholder="Mot de passe" <input class="input100" type="password" name="mdp_mobile" id="mdp_mobile" placeholder="Mot de passe"
style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;" style="width: 100%; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE; text-align: center; box-sizing: border-box;"
required AUTOCOMPLETE="off"> required AUTOCOMPLETE="off">
</div> </div>
<div class="container-login100-form-btn" style="margin-bottom: 20px;"> <div class="container-login100-form-btn" style="margin-bottom: 20px;">
<button name="btn_connexion" id="btn_connexion" class="btn login-btn" <button name="btn_connexion_mobile" id="btn_connexion_mobile" class="btn login-btn"
style="width: 100%; height: 45px; background: #7D4FFE; color: white; font-size: 18px; font-weight: 700; border-radius: 9px; border: none; box-sizing: border-box;"> style="width: 100%; height: 45px; background: #7D4FFE; color: white; font-size: 18px; font-weight: 700; border-radius: 9px; border: none; box-sizing: border-box;">
Connexion Connexion
</button> </button>
@ -142,130 +142,227 @@
<?php endif; ?> <?php endif; ?>
</div> </div>
<!-- STYLE CRITIQUE POUR ÉVITER TOUT DÉBORDEMENT --> <!-- STYLE POUR ÉVITER TOUT DÉBORDEMENT -->
<style> <style>
/* RESET COMPLET POUR MOBILE */ /* MASQUER LA VERSION MOBILE SUR DESKTOP */
.d-md-none { .d-md-none {
width: 100% !important; display: none !important;
max-width: 100vw !important;
overflow-x: hidden !important;
position: relative !important;
box-sizing: border-box !important;
} }
.d-md-none > * { /* AFFICHER SEULEMENT SUR MOBILE */
max-width: 100% !important; @media screen and (max-width: 767px) {
box-sizing: border-box !important; .d-md-none {
word-wrap: break-word !important; display: block !important;
} width: 100vw !important;
height: 100vh !important;
/* CONTENEUR PRINCIPAL SANS DÉBORDEMENT */ max-width: 100% !important;
.d-md-none { overflow-x: hidden !important;
display: flex !important; overflow-y: auto !important;
flex-direction: column !important; -webkit-overflow-scrolling: touch !important;
justify-content: center !important; position: fixed !important;
align-items: center !important; top: 0 !important;
padding: 10px 15px !important; left: 0 !important;
min-height: 100vh !important; background: white !important;
} padding: 20px 15px !important;
box-sizing: border-box !important;
/* GARANTIR QUE TOUT TIENT DANS L'ÉCRAN */ z-index: 9999 !important;
.wrap-input100 { }
width: 100% !important;
max-width: 100% !important; /* MASQUER LA VERSION DESKTOP SUR MOBILE */
text-align: center !important; .d-none.d-md-block {
} display: none !important;
}
/* LES LABELS ET INPUTS S'ADAPTENT */
.d-md-none label { /* GARANTIR QUE TOUT EST CONTENU */
display: block !important; .d-md-none * {
width: 100% !important; max-width: 100% !important;
text-align: center !important; box-sizing: border-box !important;
margin-bottom: 5px !important; }
font-size: 12pt !important;
} /* CENTRER LE CONTENU VERTICALEMENT */
.d-md-none {
.d-md-none input, display: flex !important;
.d-md-none select, flex-direction: column !important;
.d-md-none .login-btn { justify-content: center !important;
width: 100% !important; align-items: center !important;
max-width: 100% !important; }
margin: 0 auto !important;
display: block !important; /* STYLES DES CHAMPS */
} .wrap-input100 {
width: 100% !important;
/* EMPÊCHER LE ZOOM SUR MOBILE */ max-width: 300px !important;
.d-md-none input, margin: 0 auto 15px !important;
.d-md-none select { text-align: center !important;
font-size: 16px !important; }
}
label {
/* CORRECTION SPÉCIFIQUE POUR LE FOOTER */ display: block !important;
.d-md-none .footer { width: 100% !important;
position: static !important; text-align: center !important;
margin-top: 20px !important; margin-bottom: 5px !important;
width: 100% !important; font-size: 12pt !important;
text-align: center !important; }
input, select, .login-btn {
width: 100% !important;
max-width: 300px !important;
margin: 0 auto !important;
display: block !important;
}
/* EMPÊCHER LE ZOOM iOS */
input, select {
font-size: 16px !important;
}
/* BOUTON HOVER */
.login-btn:hover {
background: white !important;
color: #7D4FFE !important;
border: solid 2px #7D4FFE !important;
}
/* PLACEHOLDER */
input::placeholder {
font-weight: bold !important;
color: #7D4FFE !important;
opacity: 0.8 !important;
}
/* FOOTER */
.footer {
position: static !important;
margin-top: 20px !important;
width: 100% !important;
text-align: center !important;
}
} }
/* POUR LES TRÈS PETITS ÉCRANS */ /* POUR LES TRÈS PETITS ÉCRANS */
@media screen and (max-width: 320px) { @media screen and (max-width: 320px) {
.d-md-none { .d-md-none {
padding: 10px !important; padding: 15px 10px !important;
} }
.login100-form-title { .wrap-input100 {
font-size: 20px !important; max-width: 280px !important;
} }
.d-md-none input, input, select, .login-btn {
.d-md-none select { max-width: 280px !important;
height: 38px !important;
padding: 6px 10px !important;
}
.login-btn {
height: 42px !important;
font-size: 16px !important;
}
}
/* POUR LES TABLETTES EN MODE PORTRAIT */
@media screen and (min-width: 480px) and (max-width: 767px) {
.d-md-none {
max-width: 400px !important;
margin: 0 auto !important;
} }
} }
</style> </style>
<script> <script>
// IMPORTANT: MÊME LOGIQUE JAVASCRIPT QUE LE DESKTOP // FONCTIONS SPÉCIFIQUES POUR MOBILE
// Les IDs sont identiques, donc les fonctions JavaScript existantes function changer_langue_connexion_mobile(langue) {
// fonctionneront directement avec cette version mobile // Synchroniser avec la version desktop si nécessaire
const desktopLangue = document.getElementById('langue');
if (desktopLangue) {
desktopLangue.value = langue;
// Déclencher l'événement change
desktopLangue.dispatchEvent(new Event('change'));
}
// Appeler la fonction originale
changer_langue_connexion();
}
// Assurer que le bouton a le même comportement function changer_entite_portail_mobile(entite) {
document.getElementById('btn_connexion')?.addEventListener('click', function(e) { // Synchroniser avec la version desktop si nécessaire
// La logique existante dans votre application s'appliquera automatiquement const desktopEntite = document.getElementById('codeSociete');
// car les IDs des champs sont identiques à la version desktop if (desktopEntite) {
console.log('Connexion mobile - mêmes IDs que desktop'); desktopEntite.value = entite;
desktopEntite.dispatchEvent(new Event('change'));
}
// Appeler la fonction originale
changer_entite_portail();
}
// GESTION DE LA CONNEXION MOBILE
document.getElementById('btn_connexion_mobile')?.addEventListener('click', function(e) {
e.preventDefault();
// RÉCUPÉRER LES VALEURS DES CHAMPS MOBILES
const codeSociete = document.getElementById('codeSociete_mobile').value;
const login = document.getElementById('login_mobile').value;
const mdp = document.getElementById('mdp_mobile').value;
// VALIDATION
if (!codeSociete || !login || !mdp) {
alert('Veuillez remplir tous les champs obligatoires');
return;
}
// SYNCHRONISER AVEC LES CHAMPS DESKTOP (pour la soumission du formulaire)
const desktopForm = document.querySelector('form'); // Trouver le formulaire principal
if (desktopForm) {
// Mettre à jour les champs du formulaire desktop
const desktopCodeSociete = document.getElementById('codeSociete');
const desktopLogin = document.getElementById('login');
const desktopMdp = document.getElementById('mdp');
if (desktopCodeSociete) desktopCodeSociete.value = codeSociete;
if (desktopLogin) desktopLogin.value = login;
if (desktopMdp) desktopMdp.value = mdp;
// DÉCLENCHER LA SOUMISSION DU FORMULAIRE DESKTOP
desktopForm.submit();
} else {
// FALLBACK: Créer un formulaire temporaire
const form = document.createElement('form');
form.method = 'POST';
form.action = window.location.href;
// Ajouter les champs
const fields = [
{name: 'codeSociete', value: codeSociete},
{name: 'login', value: login},
{name: 'mdp', value: mdp},
{name: 'langue', value: document.getElementById('langue_mobile').value}
];
fields.forEach(field => {
const input = document.createElement('input');
input.type = 'hidden';
input.name = field.name;
input.value = field.value;
form.appendChild(input);
});
document.body.appendChild(form);
form.submit();
}
}); });
// Correction pour garantir que tout s'affiche correctement // GARANTIR QUE SEULE LA BONNE VERSION EST VISIBLE
window.addEventListener('load', function() { document.addEventListener('DOMContentLoaded', function() {
// Vérifier et corriger tout débordement const isMobile = window.innerWidth <= 767;
const mobileContainer = document.querySelector('.d-md-none');
if (mobileContainer) { if (isMobile) {
// Forcer le recalcul des dimensions // Masquer le desktop, montrer le mobile
mobileContainer.style.width = '100%'; const desktopVersion = document.querySelector('.d-none.d-md-block');
mobileContainer.style.overflowX = 'hidden'; const mobileVersion = document.querySelector('.d-md-none');
// Vérifier chaque élément pour éviter le débordement if (desktopVersion) desktopVersion.style.display = 'none';
const allElements = mobileContainer.querySelectorAll('*'); if (mobileVersion) mobileVersion.style.display = 'block';
allElements.forEach(el => { }
el.style.maxWidth = '100%'; });
el.style.boxSizing = 'border-box';
}); // REDIMENSIONNEMENT DE LA FENÊTRE
window.addEventListener('resize', function() {
const isMobile = window.innerWidth <= 767;
const desktopVersion = document.querySelector('.d-none.d-md-block');
const mobileVersion = document.querySelector('.d-md-none');
if (isMobile) {
if (desktopVersion) desktopVersion.style.display = 'none';
if (mobileVersion) mobileVersion.style.display = 'block';
} else {
if (desktopVersion) desktopVersion.style.display = 'block';
if (mobileVersion) mobileVersion.style.display = 'none';
} }
}); });
</script> </script>