diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-30 05:03:23 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-30 05:03:23 +0300 |
| commit | 4f2d900af7636e6744ae14aeeefdf2d6080ac50a (patch) | |
| tree | 1f80775437510591656e6ef13375516226ed27f3 /html/app/views/user | |
| parent | a16d070c4f8301a8b68220aca6d3573705be9025 (diff) | |
| download | classroom-4f2d900af7636e6744ae14aeeefdf2d6080ac50a.tar.gz classroom-4f2d900af7636e6744ae14aeeefdf2d6080ac50a.tar.bz2 classroom-4f2d900af7636e6744ae14aeeefdf2d6080ac50a.zip | |
several mail options tested; mailhog (fake) mailer is working
Diffstat (limited to 'html/app/views/user')
| -rw-r--r-- | html/app/views/user/login.php | 8 | ||||
| -rw-r--r-- | html/app/views/user/new-password.php | 68 | ||||
| -rw-r--r-- | html/app/views/user/register.php | 175 |
3 files changed, 149 insertions, 102 deletions
diff --git a/html/app/views/user/login.php b/html/app/views/user/login.php index 2cf3290..4451d52 100644 --- a/html/app/views/user/login.php +++ b/html/app/views/user/login.php @@ -1,7 +1,7 @@ -<html> +<!DOCTYPE html> +<html lang="en"> <head> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta charset="utf-8"> <title><?=SITE_TITLE?> - Είσοδος Χρήστη</title> <link rel="preconnect" href="https://fonts.googleapis.com"> @@ -12,6 +12,8 @@ <link href="/assets/css/overides.css" rel="stylesheet"> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/js/bootstrap.bundle.min.js" integrity="sha384-qKXV1j0HvMUeCBQ+QVp7JcfGl760yU08IQ+GpUo5hlbpg51QRiuqHAJz8+BrxE/N" crossorigin="anonymous"></script> + <style> html,body{ padding:0; margin:0; diff --git a/html/app/views/user/new-password.php b/html/app/views/user/new-password.php index 955cffb..06e7fac 100644 --- a/html/app/views/user/new-password.php +++ b/html/app/views/user/new-password.php @@ -1,42 +1,42 @@ -<html> +<!DOCTYPE html> +<html lang="en"> <head> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title><?=SITE_TITLE?> - Επαναφορά κωδικού πρόσβασης</title> + <meta charset="utf-8"> + <title><?=SITE_TITLE?> - Επαναφορά κωδικού πρόσβασης</title> - <link rel="preconnect" href="https://fonts.googleapis.com"> - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> - <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400&display=swap" rel="stylesheet"> + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400&display=swap" rel="stylesheet"> - <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous"> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous"> - <link href="/assets/css/overides.css" rel="stylesheet"> + <link href="/assets/css/overides.css" rel="stylesheet"> - <style> - html,body{ - padding:0; margin:0; - font-size:1.25em; - color: #037; background: #eee; - line-height:1.2em; - } - h3 { - font-size: 2em; font-style: normal; - font-weight: 400; - color: #05a; - margin: 0; padding: 5px; - opacity: 0.27; - border-bottom: 1px solid #05a; - } - .container { display: flex; height: 100vh; align-items:center; } - .content { position: relative; - max-width:480px; width: 100%; - margin: auto auto; padding: 1.5em; - justify-center: center; - background: #ddd; - border-radius: 8px; - box-shadow: 1px 5px 7px #7777; - } - </style> + <style> + html,body{ + padding:0; margin:0; + font-size:1.25em; + color: #037; background: #eee; + line-height:1.2em; + } + h3 { + font-size: 2em; font-style: normal; + font-weight: 400; + color: #05a; + margin: 0; padding: 5px; + opacity: 0.27; + border-bottom: 1px solid #05a; + } + .container { display: flex; height: 100vh; align-items:center; } + .content { position: relative; + max-width:480px; width: 100%; + margin: auto auto; padding: 1.5em; + justify-center: center; + background: #ddd; + border-radius: 8px; + box-shadow: 1px 5px 7px #7777; + } + </style> </head> <body class="classroom"> <div class='container'> diff --git a/html/app/views/user/register.php b/html/app/views/user/register.php index 97724a6..591dcb7 100644 --- a/html/app/views/user/register.php +++ b/html/app/views/user/register.php @@ -1,75 +1,120 @@ -<html> +<!DOCTYPE html> +<html lang="en"> <head> - <meta name="viewport" content="width=device-width, initial-scale=1" /> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <title><?=SITE_TITLE?> - Εγγραφή</title> + <meta charset="utf-8"> + <title><?=SITE_TITLE?> - Εγγραφή</title> - <link rel="preconnect" href="https://fonts.googleapis.com"> - <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> - <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400&display=swap" rel="stylesheet"> + <?php // header includes + //////////////////////////////////////////////////////////////////////// + Render::view('components/header_includes'); + ?> - <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-aFq/bzH65dt+w6FI2ooMVUpc+21e0SRygnTpmBvdBgSdnuTN7QbdgL+OapgHtvPp" crossorigin="anonymous"> - - <link href="/assets/css/overides.css" rel="stylesheet"> - - <style> - html,body{ - padding:0; margin:0; - font-size:1.25em; - color: #037; background: #eee; - line-height:1.2em; - } - h3 { - font-size: 2em; font-style: normal; - font-weight: 400; - color: #05a; - margin: 0; padding: 5px; - opacity: 0.27; - border-bottom: 1px solid #05a; - } - .container { display: flex; height: 100vh; align-items:center; } - .content { position: relative; - max-width:480px; width: 100%; - margin: auto auto; padding: 1.5em; - justify-center: center; - background: #ddd; - border-radius: 8px; - box-shadow: 1px 5px 7px #7777; - } - </style> + <style> + html,body{ + padding:0; margin:0; + font-size:1.25em; + color: #037; background: #eee; + line-height:1.2em; + } + h3 { + font-size: 2em; font-style: normal; + font-weight: 400; + color: #05a; + margin: 0; padding: 5px; + opacity: 0.27; + border-bottom: 1px solid #05a; + } + .container { display: flex; height: 100vh; align-items:center; } + .content { position: relative; + max-width:480px; width: 100%; + margin: auto auto; padding: .5em; + justify-center: center; + font-size: .9em; + } + .content-form { + padding: 1.5em; + background: #ddd; + border-radius: 8px; + box-shadow: 1px 5px 7px #7777; + } + .content .info { padding: 1.5em; font-size: .92em; } + .content .info p { padding: .5em; } + .form-label { margin-bottom: .25rem; } + </style> </head> <body class="classroom"> <div class='container'> - <div class='content'> - <h4>Εγγραφή</h4> - <hr /> - <form method="post" action="/login-check"> - <div> - <div class="mb-3"> - <label for="name" class="form-label">Όνομα</label> - <input type="text" class="form-control form-control-sm" name="name" required> - </div> - <div class="mb-3"> - <label for="surname" class="form-label">Επίθετο</label> - <input type="text" class="form-control form-control-sm" name="surname" required> - </div> - <div class="mb-3"> - <label for="exampleInputEmail1" class="form-label">Email</label> - <input type="email" class="form-control form-control-sm" name="email" aria-describedby="emailHelp" rerquired> - </div> - <div class="mb-3"> - <label for="exampleInputPassword1" class="form-label">Κωδικός Πρόσβασης</label> - <input type="password" class="form-control form-control-sm" name="password" required> - </div> - <div class="mb-3"> - <label for="exampleInputPassword2" class="form-label">Επιβεβαίωση Κωδικού Πρόσβασης</label> - <input type="password" class="form-control form-control-sm" name="password2" required> - </div> - <br /> - <button type="submit" class="btn btn-primary btn-sm col-12">Εγγραφή</button> - </div> - </form> + <div class="content"> + <div class="info"> + <h4>Classroom: Εγγραφή</h4> + </div> + <div class='content-form'> + <form method="post"> + <div> + <div class="mb-3"> + <label for="name" class="form-label">Όνομα</label> + <input type="text" class="form-control form-control-sm" name="name" required> + </div> + <div class="mb-3"> + <label for="surname" class="form-label">Επίθετο</label> + <input type="text" class="form-control form-control-sm" name="surname" required> + </div> + <div class="mb-3"> + <label for="exampleInputEmail1" class="form-label">Email</label> + <input type="email" class="form-control form-control-sm" name="email" aria-describedby="emailHelp" rerquired> + </div> + <div class="mb-3"> + <label for="exampleInputPassword1" class="form-label">Κωδικός Πρόσβασης</label> + <input type="password" class="form-control form-control-sm" name="password" required> + </div> + <div class="mb-3"> + <label for="exampleInputPassword2" class="form-label">Επιβεβαίωση Κωδικού Πρόσβασης</label> + <input type="password" class="form-control form-control-sm" name="password2" required> + </div> + <br /> + <button type="submit" class="btn btn-primary btn-sm col-12">Εγγραφή</button> + </div> + </form> + </div> + <div class="info"> + <p>Αν έχετε ήδη λογαρισμό <a href="/login">συνδεθείτε</a>.</p> + <p>Σε κάθε περίπτωση μπορείτε να επιστρέψετε στην <a href="/">αρχική σελίδα</a>.</p> + </div> </div> </div> </body> + +<script> + // When form is submited + // ------------------------------------------------------------------------- + + $('.content-form form').submit( event => { + event.preventDefault(); + + if ($('input[name=password]').val() != $('input[name=password2]').val()) { + alert('Τα δυο passrods δεν ταιριάζουν!'); + + } else { + + // prepare data to POST + var data = { + name: $('input[name=name]').val(), + surname: $('input[name=surname]').val(), + email: $('input[name=email]').val(), + password: $('input[name=password]').val() + }; + + // select action url (add or update) + var request = '/xml/register'; + + // send POST request + $.post(request, data) + .done(function( data ) { + console.log(data); + }); + } + + }); +</script> + </html> |
