diff options
Diffstat (limited to 'public/app/views/user/invitation.php')
| -rw-r--r-- | public/app/views/user/invitation.php | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/public/app/views/user/invitation.php b/public/app/views/user/invitation.php new file mode 100644 index 0000000..eb34bc4 --- /dev/null +++ b/public/app/views/user/invitation.php @@ -0,0 +1,179 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title><?=SITE_TITLE?> - Εγγραφή</title> + + <?php // header includes + //////////////////////////////////////////////////////////////////////// + Render::view('components/header_includes'); + ?> + + <style> + html,body{ + padding:0; margin:0; + font-size:1.25em; + color: #037; background: #f6f6f6; + 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: 540px; width: 100%; + margin: auto auto; padding: .5em; + justify-center: center; + font-size: .78em; + } + .content-form { + padding: 1.5em; + background: #eee; + border-radius: 8px; + box-shadow: 1px 5px 7px #7777; + } + .content .info { padding: 1.5em; font-size: .92em; } + .content .info p { padding: .5em; color: #444; font-size: .82em } + .form-label { margin-bottom: .25rem; } + label { font-size: 14px; } + </style> +</head> +<body class="office"> + <div class='container'> + <div class="content"> + <div class="info"> + <!--<h4>1o Γυμνάσιο Ραφήνας</h4> + <p>1o Γυμνάσιο Ραφήνας: Πλατφόρμα ηλεκτρονικών αιτήσεων και δημιουργίας εγγράφων</p>--> + </div> + <div class='content-form'> + <form method="post"> + <div> + <p>1o Γυμνάσιο Ραφήνας /<br /> + Πλατφόρμα ηλεκτρονικών αιτήσεων και δημιουργίας διαδικαστικών εγγράφων</p> + + <h2>Πρόσκληση #</h2> + + <?=$form['html']?> + + <br /> + <button type="submit" class="btn btn-primary btn-sm col-12">Εγγραφή</button> + + </div> + </form> + </div> + + <div class="info"> + <p>Απαιτείται η συμπλήρωση όλων των στοιχείων προκειμένου να γίνεται γρήγορα η σύνταξη των εγγράφων. Τα στοιχεία σας δεν πρόκειται να δημοσιοποιηθούν και προστατεύονται κατά την εισαγωγή τους με κρυπτογράφιση AES. Παράλληλα η σύνδεση στο site γίνεται με χρήση πιστοποιητικού SSL (RSA 2048 bits).</p> + <p>Αν έχετε ενεργοποιήσει ήδη το λογαρισμό σας <a href="/login">μπορείτε να συνδεθείτε</a>.</p> + + </div> + </div> +</body> + +<script> +var values = {}; +var empty = ''; + +$(document).ready(function() { + + /** select2_set_text + * select an (select2-)option by text + * + * @param control = jquery selector, + * @param t (string) = text of option + */ + function select2_set_text(control, t) { /* define function */ + opts = control.select2()[0].options; + var id; + for(i=0; i<opts.length; i++) { if (opts[i].text == t) id = i; } + control.val(id).trigger('change'); + } + + /** get_id_of_text + * get id (=value) of an option with `t` text + * + * @param control = jquery selector, + * @param t (string) = text of option + */ + function get_id_of_text( control , t) { /* define id from text */ + opts = control.select2()[0].options; + var id = false; + for(i=0; i<opts.length; i++) { if (opts[i].text == t) id = i; } + return id; + } + + /** select2_set_multi_text + * select several (select2-)options by text + * + * @param control = jquery selector, + * #param t_list (string) = list of selected texts + */ + function select2_set_multi_text(control, t_list) { /* define function */ + var ids = []; + t_list.forEach (t => { let id = get_id_of_text(control, t); + if (id !== false) ids.push(id); + }) + control.val(ids).change(); + } + + + <?=$form['init_js']?> + + <?=$form['values_js']?> + + // When form is submited + // ------------------------------------------------------------------------- + + $('form').submit( event => { + event.preventDefault(); + + if ($('input[name=password]').val() != $('input[name=confirm_password]').val()) { + alert('Τα δυο κωδικοί πρόσβασης δεν ταιριάζουν!'); + + } else if ($('input[name=password]').val() == "") { + alert('Ο κωδικός πρόσβασης δεν μπορεί να είναι κενός') + + } else if ( ($('input[name=password]').val() == '0') + || ($('input[name=password]').val() =='') ) { + alert('Παρκαλώ συμπληρώστε ένα τηλέφωνο επικοινωνίας') + + } else { + // prepare data to POST + var data = { + // identification fields + id: $('input[name=id]').val(), + invitation: $('input[name=invitation]').val(), + // data fields + first_name: $('input[name=first_name]').val(), + last_name: $('input[name=last_name]').val(), + father_name: $('input[name=father_name]').val(), + email: $('input[name=email]').val(), + registration_number: $('input[name=registration_number]').val(), + sector: $('select[name=sector]').select2('data')[0].text, + belonging_school: $('input[name=belonging_school]').val(), + position: $('select[name=position]').select2('data')[0].text, + phone: $('input[name=phone]').val(), + // access verification + password: $('input[name=password]').val() + }; + // console.log('post:', data); + + var request = '/account/activate'; // set action url + + // send POST request + $.post(request, data) + .done(function( data ) { + $('.office .content-form').html(data.message) + }); + } + }); + + +}); +</script> +</html> |
