Commit 003b6024 authored by Andgel Brissaud's avatar Andgel Brissaud
Browse files

feat: add pop up and form for password changer

parent d7fa3c59
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -48,6 +48,15 @@ function update(Request $request) {
        return redirect()->route('manage_members');
    }

    function updatePassword(Request $request){
        $user = session('user');
        if ($request->OldPassword == $user->US_PASSWORD){
            $user->US_PASSWORD = $request->newPassword;
        }else{
            return redirect()->route('/error');
        }
        return redirect('/');
    }

}
+64 −0
Original line number Diff line number Diff line
  /* Fixer le bouton sur le côté gauche de la page */
  .open-btn {
    display: flex;
    justify-content: flex-start;
  }
  /* Positionnez la forme Popup */
  .login-popup {
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.22);
    width: 75vw;
    height: auto;
    border-radius: 30px;
    margin: auto;
    margin-top: 7em ;
    display: block;
    text-align: center;
    backdrop-filter: blur(5px);
}
  /* Masquez la forme Popup */
  .form-popup {
    display: none;
    position: fixed;
    left: 45%;
    top: 5%;
    transform: translate(-45%, 5%);
    border: 2px solid #666;
    z-index: 9;
    
  }
  /* Styles pour le conteneur de forme */
  .form-container {
    max-width: 600px;
    padding: 20px;
    background-color: #fff;
  }
  /* Largeur complète pour les champs de saisie */
  .form-container input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 5px 0 22px 0;
    border: none;
    background: #eee;
  }
  /*Quand les entrées sont concentrées, faites quelque chose */
  .form-container input[type="password"]:focus {
    background-color: #ddd;
    outline: none;
  }
  /* Stylez le bouton de connexion*/
  .form-container .btn {
    background-color: #fabb54;
    color: #fff;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    opacity: 0.8;
  }
  /* Planez les effets pour les boutons */
  .form-container .btn:hover,
  .open-button:hover {
    opacity: 1;
  }
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
function openForm() {
    document.getElementById("popupForm").style.display = "block";
}

function closeForm() {
    document.getElementById("popupForm").style.display = "none";
}
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class="block text-sm text-white">{{ session('user')->US_FIRST_NAME . " " . sessi
                        <li>
                             <a  href="{{route('divings')}}" class="block px-4 py-2 text-sm hover:bg-gray-600 text-gray-200 hover:text-white">Historique de mes plongées</a>
                        </li>
                            <a class="block px-4 py-2 text-sm hover:bg-gray-600 text-gray-200 hover:text-white cursor-pointer" onclick="openForm()">changer le mdp</a>
                        <li>
                            <a href="{{ route('logout') }}"
                               class="block px-4 py-2 text-sm hover:bg-gray-600 text-gray-200 hover:text-white">Se
@@ -74,3 +75,24 @@ class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-5
        </div>
    </div>
</nav>


<link rel="stylesheet" href="/css/pop-up-psw-changer.css">
    <div class="form-popup" id="popupForm">
      <form action="/modification/password-changer" class="form-container" method="post">
        <button onclick="closeForm()" type="button" class=" w-full flex items-center justify-center w-1/2 px-5 py-2 text-sm text-gray-700 transition-colors duration-200 border rounded-full gap-x-2 sm:w-auto dark:hover:bg-[#002550] dark:bg-[#002550] hover:bg-[#002550] dark:text-gray-200 dark:border-gray-700">
            <svg xmlns="http://www.w3.org/2000/svg" height="16" width="12" viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#ffffff" d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"/></svg>
        </button>
        <x-page-title >Changement de mot de passe</x-page-title>
        <label for="OldPassword">
           <h2>votre ancien mot de passe</h2>
        </label>
        <input type="password" value="" id="OldPassword" placeholder="Votre mot de passe" name="OldPassword" required />
        <label for="NewPassword">
            <h2>votre nouveau mot de passe</h2>
        </label>
        <input type="password" value="" id="NewPassword" placeholder="Votre Mot de passe" name="NewPassword" required />
        <button type="submit" class="btn">Changer votre mot de passe</button>
      </form>
    </div>
<script type="text/javascript" src="/js/pop-up-psw-changer.js"></script>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -284,3 +284,5 @@
});

Route::get('/modificationdives/members/{ds_code}/ajoutadherent/{level}', [AdherentController::class, 'searchByName']);

Route::post('/modification/password-changer', [ManageAdherentController::class, 'updatePassword']);
 No newline at end of file