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) -->
<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;">
Portail Assuré
</span>
@ -86,16 +86,16 @@
</h4>
</div>
<?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 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;">
<label for="langue">Langue</label>
<select class="form-select" id="langue" name="langue"
<label for="langue_mobile">Langue</label>
<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;"
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); ?>
</select>
</div>
@ -103,19 +103,19 @@
<div class="wrap-input100" style="margin-bottom: 15px;">
<div class="wrap-input100 validate-input">
<label for="codeSociete">Entité</label>
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>"
<label for="codeSociete_mobile">Entité</label>
<input class="input100" type="text" name="codeSociete_mobile" id="codeSociete_mobile" value="<?= $codeSociete ?>"
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;"
required AUTOCOMPLETE="off"
onChange="javascript:changer_entite_portail();" >
onChange="javascript:changer_entite_portail_mobile(this.value);" >
</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">
<label for="login">Identifiant</label>
<input class="input100" type="text" name="login" id="login" value="<?= $codeUtilisateur ?>"
<label for="login_mobile">Identifiant</label>
<input class="input100" type="text" name="login_mobile" id="login_mobile" value="<?= $codeUtilisateur ?>"
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;"
required AUTOCOMPLETE="off">
@ -123,14 +123,14 @@
</div>
<div class="wrap-input100 validate-input" style="margin-bottom: 20px;">
<label for="mdp">Mot de passe</label>
<input class="input100" type="password" name="mdp" id="mdp" placeholder="Mot de passe"
<label for="mdp_mobile">Mot de passe</label>
<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;"
required AUTOCOMPLETE="off">
</div>
<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;">
Connexion
</button>
@ -142,42 +142,60 @@
<?php endif; ?>
</div>
<!-- STYLE CRITIQUE POUR ÉVITER TOUT DÉBORDEMENT -->
<!-- STYLE POUR ÉVITER TOUT DÉBORDEMENT -->
<style>
/* RESET COMPLET POUR MOBILE */
/* MASQUER LA VERSION MOBILE SUR DESKTOP */
.d-md-none {
width: 100% !important;
max-width: 100vw !important;
overflow-x: hidden !important;
position: relative !important;
box-sizing: border-box !important;
display: none !important;
}
.d-md-none > * {
/* AFFICHER SEULEMENT SUR MOBILE */
@media screen and (max-width: 767px) {
.d-md-none {
display: block !important;
width: 100vw !important;
height: 100vh !important;
max-width: 100% !important;
overflow-x: hidden !important;
overflow-y: auto !important;
-webkit-overflow-scrolling: touch !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
background: white !important;
padding: 20px 15px !important;
box-sizing: border-box !important;
z-index: 9999 !important;
}
/* MASQUER LA VERSION DESKTOP SUR MOBILE */
.d-none.d-md-block {
display: none !important;
}
/* GARANTIR QUE TOUT EST CONTENU */
.d-md-none * {
max-width: 100% !important;
box-sizing: border-box !important;
word-wrap: break-word !important;
}
/* CONTENEUR PRINCIPAL SANS DÉBORDEMENT */
/* CENTRER LE CONTENU VERTICALEMENT */
.d-md-none {
display: flex !important;
flex-direction: column !important;
justify-content: center !important;
align-items: center !important;
padding: 10px 15px !important;
min-height: 100vh !important;
}
/* GARANTIR QUE TOUT TIENT DANS L'ÉCRAN */
/* STYLES DES CHAMPS */
.wrap-input100 {
width: 100% !important;
max-width: 100% !important;
max-width: 300px !important;
margin: 0 auto 15px !important;
text-align: center !important;
}
/* LES LABELS ET INPUTS S'ADAPTENT */
.d-md-none label {
label {
display: block !important;
width: 100% !important;
text-align: center !important;
@ -185,87 +203,166 @@
font-size: 12pt !important;
}
.d-md-none input,
.d-md-none select,
.d-md-none .login-btn {
input, select, .login-btn {
width: 100% !important;
max-width: 100% !important;
max-width: 300px !important;
margin: 0 auto !important;
display: block !important;
}
/* EMPÊCHER LE ZOOM SUR MOBILE */
.d-md-none input,
.d-md-none select {
/* EMPÊCHER LE ZOOM iOS */
input, select {
font-size: 16px !important;
}
/* CORRECTION SPÉCIFIQUE POUR LE FOOTER */
.d-md-none .footer {
/* 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 */
@media screen and (max-width: 320px) {
.d-md-none {
padding: 10px !important;
padding: 15px 10px !important;
}
.login100-form-title {
font-size: 20px !important;
.wrap-input100 {
max-width: 280px !important;
}
.d-md-none input,
.d-md-none select {
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;
input, select, .login-btn {
max-width: 280px !important;
}
}
</style>
<script>
// IMPORTANT: MÊME LOGIQUE JAVASCRIPT QUE LE DESKTOP
// Les IDs sont identiques, donc les fonctions JavaScript existantes
// fonctionneront directement avec cette version mobile
// FONCTIONS SPÉCIFIQUES POUR MOBILE
function changer_langue_connexion_mobile(langue) {
// 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'));
}
// Assurer que le bouton a le même comportement
document.getElementById('btn_connexion')?.addEventListener('click', function(e) {
// La logique existante dans votre application s'appliquera automatiquement
// car les IDs des champs sont identiques à la version desktop
console.log('Connexion mobile - mêmes IDs que desktop');
// Appeler la fonction originale
changer_langue_connexion();
}
function changer_entite_portail_mobile(entite) {
// Synchroniser avec la version desktop si nécessaire
const desktopEntite = document.getElementById('codeSociete');
if (desktopEntite) {
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);
});
// Correction pour garantir que tout s'affiche correctement
window.addEventListener('load', function() {
// Vérifier et corriger tout débordement
const mobileContainer = document.querySelector('.d-md-none');
if (mobileContainer) {
// Forcer le recalcul des dimensions
mobileContainer.style.width = '100%';
mobileContainer.style.overflowX = 'hidden';
// Vérifier chaque élément pour éviter le débordement
const allElements = mobileContainer.querySelectorAll('*');
allElements.forEach(el => {
el.style.maxWidth = '100%';
el.style.boxSizing = 'border-box';
document.body.appendChild(form);
form.submit();
}
});
// GARANTIR QUE SEULE LA BONNE VERSION EST VISIBLE
document.addEventListener('DOMContentLoaded', function() {
const isMobile = window.innerWidth <= 767;
if (isMobile) {
// Masquer le desktop, montrer le mobile
const desktopVersion = document.querySelector('.d-none.d-md-block');
const mobileVersion = document.querySelector('.d-md-none');
if (desktopVersion) desktopVersion.style.display = 'none';
if (mobileVersion) mobileVersion.style.display = 'block';
}
});
// 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>