Version DeepSeek corrigée v1.3
This commit is contained in:
parent
72cb57a062
commit
7f79933c45
|
|
@ -7,141 +7,78 @@
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- Tableau desktop (affiché sur les écrans moyens et grands) -->
|
<!-- Tableau desktop (affiché sur les écrans moyens et grands) -->
|
||||||
<div class="d-none d-md-block">
|
<div class="d-md-none">
|
||||||
<span class="login100-form-title" style="font-family: Play-Bold; color:#e5e5e5; margin-top: 5px; margin-bottom:10px;">
|
<!-- VERSION MOBILE COMPACTE SANS DÉBORDEMENT -->
|
||||||
Portail Assuré
|
<div style="width: 100%; max-width: 100vw; overflow-x: hidden; box-sizing: border-box; padding: 10px;">
|
||||||
</span>
|
|
||||||
|
|
||||||
<?php if (isset($msgErreur) and $msgErreur>" "): ?>
|
|
||||||
<div class="text-center p-t-10">
|
|
||||||
<h4 class="txt3">
|
|
||||||
<div class="col-12 alert alert-danger">
|
|
||||||
<?= $msgErreur ?>
|
|
||||||
</div>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
|
||||||
<div class="text-center p-t-10" id="div_msgErreur">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php if($maintenance!='1'): ?>
|
|
||||||
<div class="wrap-input100">
|
|
||||||
<label for="langue">Langue</label>
|
|
||||||
<select class="form-select" id="langue" name="langue"
|
|
||||||
|
|
||||||
required autocomplete="off" onchange="javascript:changer_langue_connexion();">
|
|
||||||
<?php liste_options($langues, $_SESSION['lang'], true); ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="wrap-input100">
|
|
||||||
<div class="wrap-input100 validate-input" data-validate="Enter Entity">
|
|
||||||
<label for="codeSociete">Entité</label>
|
|
||||||
<input class="input100" type="text" name="codeSociete" id="codeSociete" value="<?= $codeSociete ?>"
|
|
||||||
placeholder="Entité" style="text-align:center;" required AUTOCOMPLETE="off"
|
|
||||||
onChange="javascript:changer_entite_portail();" >
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="div_login_portail" class="wrap-input100">
|
|
||||||
<div class="wrap-input100 validate-input" data-validate="Enter username">
|
|
||||||
<label for="login">Identifiant</label>
|
|
||||||
<input class="input100" type="text" name="login" id="login" value="<?= $codeUtilisateur ?>" placeholder="Identifiant" style="text-align:center;" required AUTOCOMPLETE="off">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wrap-input100 validate-input" data-validate="Enter password">
|
|
||||||
<label for="mdp">Mot de passe</label>
|
|
||||||
<input class="input100" type="password" name="mdp" id="mdp" placeholder="Mot de passe" style="text-align:center;" required AUTOCOMPLETE="off">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container-login100-form-btn">
|
|
||||||
<button name="btn_connexion" id="btn_connexion" class="btn login-btn">
|
|
||||||
Connexion
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="footer">
|
|
||||||
Tous droits réservés <a href="https://www.ebene.info/">© EBENE SOLUTIONS INFORMATIQUES</a>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Affichage mobile (cartes) -->
|
|
||||||
<div class="d-md-none" style="display: none;">
|
|
||||||
<!-- VERSION MOBILE COMPLÈTE - SANS LE LOGO (car déjà dans portail.php) -->
|
|
||||||
|
|
||||||
<div style="width: 100%; max-width: 100%; overflow-x: hidden; padding: 10px 15px; box-sizing: border-box;">
|
|
||||||
|
|
||||||
<!-- Titre (sans le logo car déjà affiché par portail.php) -->
|
<!-- Titre ajusté pour mobile -->
|
||||||
<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; padding-top: 20px;">
|
<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é
|
Portail Assuré
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<?php if (isset($msgErreur) and $msgErreur>" "): ?>
|
<?php if (isset($msgErreur) and $msgErreur>" "): ?>
|
||||||
<div class="text-center p-t-10" style="margin-bottom: 15px;">
|
<div class="text-center" style="margin-bottom: 15px;">
|
||||||
<h4 class="txt3">
|
<div style="background-color: #f8d7da; color: #721c24; padding: 10px; border-radius: 8px; font-size: 13px; border: 1px solid #f5c6cb;">
|
||||||
<div class="col-12 alert alert-danger" style="padding: 10px; font-size: 14px; border-radius: 8px;">
|
<?= $msgErreur ?>
|
||||||
<?= $msgErreur ?>
|
</div>
|
||||||
</div>
|
|
||||||
</h4>
|
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="text-center p-t-10" id="div_msgErreur_mobile" style="margin-bottom: 15px;"></div>
|
<div class="text-center" id="div_msgErreur_mobile" style="margin-bottom: 15px;"></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($maintenance!='1'): ?>
|
<?php if($maintenance!='1'): ?>
|
||||||
|
|
||||||
<!-- Champs de formulaire avec IDs uniques -->
|
<!-- Champs de formulaire compacts pour mobile -->
|
||||||
<div class="wrap-input100" style="margin-bottom: 15px;">
|
<div style="width: 100%; max-width: 100%;">
|
||||||
<label for="langue_mobile" style="font-size: 12pt;">Langue</label>
|
<!-- Langue -->
|
||||||
<select class="form-select" id="langue_mobile" name="langue_mobile"
|
<div style="margin-bottom: 15px; text-align: center;">
|
||||||
style="width: 100%; max-width: 300px; margin: 0 auto; 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; display: block;"
|
<label for="langue_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Langue</label>
|
||||||
required autocomplete="off" onchange="changer_langue_connexion_mobile(this.value);">
|
<select id="langue_mobile" name="langue_mobile"
|
||||||
<?php liste_options($langues, $_SESSION['lang'], true); ?>
|
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;"
|
||||||
</select>
|
required onchange="changerLangueMobile(this.value);">
|
||||||
</div>
|
<?php liste_options($langues, $_SESSION['lang'], true); ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wrap-input100" style="margin-bottom: 15px;">
|
<!-- Entité -->
|
||||||
<div class="wrap-input100 validate-input">
|
<div style="margin-bottom: 15px; text-align: center;">
|
||||||
<label for="codeSociete_mobile" style="font-size: 12pt;">Entité</label>
|
<label for="codeSociete_mobile" style="font-size: 12pt; display: block; margin-bottom: 5px;">Entité</label>
|
||||||
<input class="input100" type="text" name="codeSociete_mobile" id="codeSociete_mobile" value="<?= $codeSociete ?>"
|
<input type="text" id="codeSociete_mobile" name="codeSociete_mobile" value="<?= $codeSociete ?>"
|
||||||
placeholder="Entité"
|
placeholder="Entité"
|
||||||
style="width: 100%; max-width: 300px; margin: 0 auto; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE !important; text-align: center; box-sizing: border-box; display: block;"
|
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"
|
required autocomplete="off"
|
||||||
onChange="changer_entite_portail_mobile(this.value);">
|
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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="div_login_portail_mobile" class="wrap-input100" style="margin-bottom: 15px;">
|
<!-- Footer mobile -->
|
||||||
<div class="wrap-input100 validate-input">
|
<div style="font-size: 11px; text-align: center; padding: 10px 0; color: #666; width: 100%;">
|
||||||
<label for="login_mobile" style="font-size: 12pt;">Identifiant</label>
|
Tous droits réservés <a href="https://www.ebene.info/" style="color: #7D4FFE; text-decoration: none;">© EBENE SOLUTIONS INFORMATIQUES</a>
|
||||||
<input class="input100" type="text" name="login_mobile" id="login_mobile" value="<?= $codeUtilisateur ?>"
|
|
||||||
placeholder="Identifiant"
|
|
||||||
style="width: 100%; max-width: 300px; margin: 0 auto; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE !important; text-align: center; box-sizing: border-box; display: block;"
|
|
||||||
required AUTOCOMPLETE="off">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wrap-input100 validate-input" style="margin-bottom: 20px;">
|
|
||||||
<label for="mdp_mobile" style="font-size: 12pt;">Mot de passe</label>
|
|
||||||
<input class="input100" type="password" name="mdp_mobile" id="mdp_mobile" placeholder="Mot de passe"
|
|
||||||
style="width: 100%; max-width: 300px; margin: 0 auto; height: 40px; padding: 8px 12px; border: 2px solid #7D4FFE !important; border-radius: 9px; color: #7D4FFE !important; text-align: center; box-sizing: border-box; display: block;"
|
|
||||||
required AUTOCOMPLETE="off">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container-login100-form-btn" style="margin-bottom: 20px; text-align: center;">
|
|
||||||
<button name="btn_connexion_mobile" id="btn_connexion_mobile" class="btn login-btn"
|
|
||||||
style="width: 100%; max-width: 300px; margin: 0 auto; height: 45px; background: #7D4FFE; color: white; font-size: 18px; font-weight: 700; border-radius: 9px; border: none; box-sizing: border-box; display: block;">
|
|
||||||
Connexion
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="footer" style="position: relative; font-size: 11px; text-align: center; padding: 10px; width: 100%; box-sizing: border-box;">
|
|
||||||
Tous droits réservés <a href="https://www.ebene.info/" style="color: #7D4FFE;">© EBENE SOLUTIONS INFORMATIQUES</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
@ -149,73 +86,107 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- STYLES ET SCRIPT POUR MOBILE -->
|
<!-- STYLES POUR ÉVITER TOUT DÉBORDEMENT -->
|
||||||
<style>
|
<style>
|
||||||
/* STYLES SPÉCIFIQUES POUR MOBILE */
|
/* STYLES MOBILE CRITIQUES - À AJOUTER DANS PORTAL.PHP OU ICI */
|
||||||
|
|
||||||
|
/* 1. FORCER LE VIEWPORT MOBILE */
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
/* AFFICHER LA VERSION MOBILE */
|
html, body {
|
||||||
.d-md-none {
|
width: 100vw !important;
|
||||||
display: block !important;
|
max-width: 100vw !important;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
position: relative !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MASQUER LA VERSION DESKTOP */
|
/* 2. CACHER LA VERSION DESKTOP */
|
||||||
.d-none.d-md-block {
|
.d-none.d-md-block {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CORRECTION POUR LE LOGO DANS PORTAL.PHP */
|
/* 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 {
|
.logo img {
|
||||||
width: 100px !important;
|
width: 100px !important;
|
||||||
height: 100px !important;
|
height: 100px !important;
|
||||||
position: relative !important;
|
position: relative !important;
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
margin: 0 auto 20px auto !important;
|
top: 0 !important;
|
||||||
|
margin: 10px auto !important;
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ADAPTER LE CONTENEUR PRINCIPAL */
|
/* 6. CORRECTION DE LA ZONE DE CONTENU DANS PORTAL.PHP */
|
||||||
.content .form-side {
|
.content {
|
||||||
|
width: 100vw !important;
|
||||||
|
max-width: 100vw !important;
|
||||||
|
padding: 5px !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-side {
|
||||||
padding-top: 10px !important;
|
padding-top: 10px !important;
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
|
height: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* STYLES DES CHAMPS MOBILES */
|
/* 7. STYLES DES CHAMPS MOBILES */
|
||||||
.d-md-none {
|
|
||||||
width: 100% !important;
|
|
||||||
max-width: 100% !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.d-md-none > div {
|
.d-md-none > div {
|
||||||
width: 100% !important;
|
width: 100vw !important;
|
||||||
max-width: 100% !important;
|
max-width: 100vw !important;
|
||||||
margin: 0 !important;
|
|
||||||
padding: 0 10px !important;
|
padding: 0 10px !important;
|
||||||
|
box-sizing: border-box !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CENTRER TOUT */
|
/* 8. FORCER LE CONTENU À RESTER DANS LES LIMITES */
|
||||||
.wrap-input100 {
|
.d-md-none * {
|
||||||
text-align: center !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
input, select, button {
|
|
||||||
max-width: 100% !important;
|
max-width: 100% !important;
|
||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EMPÊCHER LE ZOOM iOS */
|
/* 9. ADAPTER LES INPUTS */
|
||||||
input[type="text"],
|
.d-md-none input,
|
||||||
input[type="password"],
|
.d-md-none select,
|
||||||
select {
|
.d-md-none button {
|
||||||
font-size: 16px !important;
|
width: 100% !important;
|
||||||
|
max-width: 280px !important;
|
||||||
|
margin-left: auto !important;
|
||||||
|
margin-right: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* BOUTON HOVER */
|
/* 10. CORRECTION DU CARROUSEL */
|
||||||
.login-btn:hover {
|
.slide-container {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 11. BOUTON HOVER */
|
||||||
|
#btn_connexion_mobile:hover {
|
||||||
background: white !important;
|
background: white !important;
|
||||||
color: #7D4FFE !important;
|
color: #7D4FFE !important;
|
||||||
border: solid 2px #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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,149 +196,154 @@
|
||||||
display: none !important;
|
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>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// FONCTIONS POUR LA VERSION MOBILE
|
// FONCTIONS MOBILE SIMPLIFIÉES
|
||||||
|
function changerLangueMobile(langue) {
|
||||||
function changer_langue_connexion_mobile(langue) {
|
// Synchroniser avec le desktop
|
||||||
// Mettre à jour le sélecteur desktop si présent
|
|
||||||
const desktopLangue = document.getElementById('langue');
|
const desktopLangue = document.getElementById('langue');
|
||||||
if (desktopLangue) {
|
if (desktopLangue) {
|
||||||
desktopLangue.value = langue;
|
desktopLangue.value = langue;
|
||||||
// Déclencher l'événement
|
|
||||||
const event = new Event('change');
|
const event = new Event('change');
|
||||||
desktopLangue.dispatchEvent(event);
|
desktopLangue.dispatchEvent(event);
|
||||||
}
|
}
|
||||||
console.log('Langue mobile changée:', langue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changer_entite_portail_mobile(entite) {
|
function changerEntiteMobile(entite) {
|
||||||
// Mettre à jour le champ desktop si présent
|
// Synchroniser avec le desktop
|
||||||
const desktopEntite = document.getElementById('codeSociete');
|
const desktopEntite = document.getElementById('codeSociete');
|
||||||
if (desktopEntite) {
|
if (desktopEntite) {
|
||||||
desktopEntite.value = entite;
|
desktopEntite.value = entite;
|
||||||
const event = new Event('change');
|
const event = new Event('change');
|
||||||
desktopEntite.dispatchEvent(event);
|
desktopEntite.dispatchEvent(event);
|
||||||
}
|
}
|
||||||
console.log('Entité mobile changée:', entite);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GESTION DE LA CONNEXION MOBILE
|
// GESTION DE LA CONNEXION MOBILE
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const btnMobile = document.getElementById('btn_connexion_mobile');
|
const btnMobile = document.getElementById('btn_connexion_mobile');
|
||||||
|
|
||||||
if (btnMobile) {
|
if (btnMobile) {
|
||||||
btnMobile.addEventListener('click', function(e) {
|
btnMobile.addEventListener('click', function() {
|
||||||
e.preventDefault();
|
// Récupérer les valeurs
|
||||||
|
|
||||||
// RÉCUPÉRER LES VALEURS MOBILES
|
|
||||||
const codeSociete = document.getElementById('codeSociete_mobile').value.trim();
|
const codeSociete = document.getElementById('codeSociete_mobile').value.trim();
|
||||||
const login = document.getElementById('login_mobile').value.trim();
|
const login = document.getElementById('login_mobile').value.trim();
|
||||||
const mdp = document.getElementById('mdp_mobile').value.trim();
|
const mdp = document.getElementById('mdp_mobile').value.trim();
|
||||||
const langue = document.getElementById('langue_mobile').value;
|
|
||||||
|
|
||||||
// VALIDATION
|
// Validation simple
|
||||||
if (!codeSociete || !login || !mdp) {
|
if (!codeSociete || !login || !mdp) {
|
||||||
alert('Veuillez remplir tous les champs obligatoires');
|
alert('Veuillez remplir tous les champs');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OPTION 1: Synchroniser avec le formulaire desktop existant
|
// Option 1: Utiliser le formulaire desktop existant
|
||||||
const desktopForm = document.querySelector('form');
|
const desktopForm = document.querySelector('form');
|
||||||
if (desktopForm) {
|
if (desktopForm) {
|
||||||
// Mettre à jour les champs du formulaire desktop
|
// Copier les valeurs dans les champs desktop
|
||||||
const desktopFields = {
|
const fields = [
|
||||||
'codeSociete': codeSociete,
|
{id: 'codeSociete', value: codeSociete},
|
||||||
'login': login,
|
{id: 'login', value: login},
|
||||||
'mdp': mdp,
|
{id: 'mdp', value: mdp}
|
||||||
'langue': langue
|
];
|
||||||
};
|
|
||||||
|
|
||||||
for (const [name, value] of Object.entries(desktopFields)) {
|
fields.forEach(field => {
|
||||||
const field = document.getElementById(name);
|
const el = document.getElementById(field.id);
|
||||||
if (field) {
|
if (el) el.value = field.value;
|
||||||
field.value = value;
|
});
|
||||||
} else {
|
|
||||||
// Créer un champ caché si nécessaire
|
|
||||||
const hiddenInput = document.createElement('input');
|
|
||||||
hiddenInput.type = 'hidden';
|
|
||||||
hiddenInput.name = name;
|
|
||||||
hiddenInput.value = value;
|
|
||||||
desktopForm.appendChild(hiddenInput);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Soumettre le formulaire
|
// Soumettre
|
||||||
desktopForm.submit();
|
desktopForm.submit();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OPTION 2: Créer un nouveau formulaire
|
// Option 2: Redirection avec paramètres
|
||||||
console.log('Soumission formulaire mobile:', {codeSociete, login, mdp, langue});
|
|
||||||
|
|
||||||
// Ici, vous devriez appeler votre fonction de connexion existante
|
|
||||||
// Par exemple: connexionUtilisateur(codeSociete, login, mdp, langue);
|
|
||||||
|
|
||||||
// Pour l'instant, on redirige vers la même page avec les paramètres
|
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
params.append('action', 'connexion');
|
||||||
params.append('codeSociete', codeSociete);
|
params.append('codeSociete', codeSociete);
|
||||||
params.append('login', login);
|
params.append('login', login);
|
||||||
params.append('mdp', mdp);
|
params.append('mdp', mdp);
|
||||||
params.append('langue', langue);
|
params.append('langue', document.getElementById('langue_mobile').value);
|
||||||
|
|
||||||
window.location.href = window.location.pathname + '?' + params.toString();
|
window.location.href = '?' + params.toString();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// GESTION RESPONSIVE
|
// GESTION RESPONSIVE AUTOMATIQUE
|
||||||
function checkScreenSize() {
|
function gererAffichageResponsive() {
|
||||||
const isMobile = window.innerWidth <= 767;
|
const isMobile = window.innerWidth <= 767;
|
||||||
const mobileContainer = document.querySelector('.d-md-none');
|
const mobileDiv = document.querySelector('.d-md-none');
|
||||||
const desktopContainer = document.querySelector('.d-none.d-md-block');
|
const desktopDiv = document.querySelector('.d-none.d-md-block');
|
||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
// Mode mobile
|
// Mode mobile
|
||||||
if (mobileContainer) mobileContainer.style.display = 'block';
|
if (mobileDiv) mobileDiv.style.display = 'block';
|
||||||
if (desktopContainer) desktopContainer.style.display = 'none';
|
if (desktopDiv) desktopDiv.style.display = 'none';
|
||||||
|
|
||||||
|
// Forcer le viewport mobile
|
||||||
|
document.documentElement.style.overflowX = 'hidden';
|
||||||
|
document.body.style.overflowX = 'hidden';
|
||||||
} else {
|
} else {
|
||||||
// Mode desktop
|
// Mode desktop
|
||||||
if (mobileContainer) mobileContainer.style.display = 'none';
|
if (mobileDiv) mobileDiv.style.display = 'none';
|
||||||
if (desktopContainer) desktopContainer.style.display = 'block';
|
if (desktopDiv) desktopDiv.style.display = 'block';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vérifier au chargement et au redimensionnement
|
// Initialisation
|
||||||
checkScreenSize();
|
gererAffichageResponsive();
|
||||||
window.addEventListener('resize', checkScreenSize);
|
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);
|
||||||
});
|
});
|
||||||
|
|
||||||
// SYNCHRONISATION DES CHAMPS (optionnel)
|
// FONCTION POUR FORCER L'AFFICHAGE CORRECT SUR MOBILE
|
||||||
function synchronizeFields() {
|
function corrigerDebordementMobile() {
|
||||||
// Synchroniser les valeurs entre mobile et desktop
|
if (window.innerWidth <= 767) {
|
||||||
const fieldsToSync = [
|
// Forcer les dimensions
|
||||||
{mobile: 'codeSociete_mobile', desktop: 'codeSociete'},
|
document.querySelectorAll('input, select, button, div').forEach(el => {
|
||||||
{mobile: 'login_mobile', desktop: 'login'},
|
el.style.maxWidth = '100%';
|
||||||
{mobile: 'langue_mobile', desktop: 'langue'}
|
el.style.boxSizing = 'border-box';
|
||||||
];
|
});
|
||||||
|
|
||||||
fieldsToSync.forEach(field => {
|
|
||||||
const mobileField = document.getElementById(field.mobile);
|
|
||||||
const desktopField = document.getElementById(field.desktop);
|
|
||||||
|
|
||||||
if (mobileField && desktopField) {
|
// Corriger le conteneur principal
|
||||||
// Mobile → Desktop
|
const container = document.querySelector('.container-fluid');
|
||||||
mobileField.addEventListener('input', function() {
|
if (container) {
|
||||||
desktopField.value = this.value;
|
container.style.width = '100vw';
|
||||||
});
|
container.style.maxWidth = '100vw';
|
||||||
|
container.style.overflowX = 'hidden';
|
||||||
// Desktop → Mobile (si on change de vue)
|
|
||||||
desktopField.addEventListener('input', function() {
|
|
||||||
mobileField.value = this.value;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lancer la synchronisation
|
// Exécuter plusieurs fois pour être sûr
|
||||||
setTimeout(synchronizeFields, 500);
|
window.addEventListener('load', corrigerDebordementMobile);
|
||||||
|
window.addEventListener('resize', corrigerDebordementMobile);
|
||||||
|
setTimeout(corrigerDebordementMobile, 500);
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user