diff options
Diffstat (limited to 'public/app/views/js/submit/application-form.php')
| -rw-r--r-- | public/app/views/js/submit/application-form.php | 60 |
1 files changed, 39 insertions, 21 deletions
diff --git a/public/app/views/js/submit/application-form.php b/public/app/views/js/submit/application-form.php index 2480d67..168ca0d 100644 --- a/public/app/views/js/submit/application-form.php +++ b/public/app/views/js/submit/application-form.php @@ -1,27 +1,31 @@ <script> - function postObject() { - return { // select content data - subject: $('input[name=subject]').val(), - date: $('input[name=date]').val(), - type_id: 1, // 1 = application document - first_name: $('input[name=first_name]').val(), - last_name: $('input[name=last_name]').val(), - father_name: $('input[name=father_name]').val(), - phone: $('input[name=phone]').val(), - email: $('input[name=email]').val(), - registration_number: $('input[name=registration_number]').val(), - belonging_school: $('input[name=belonging_school]').val(), - date: $('input[name=date]').val(), - sector: selected_text($('select[name=sector]')), - position: selected_text($('select[name=position]')), - request: $('textarea[name=request]').val(), - now: Math.floor(Date.now() / 1000), // client timestamp - ticket: ref.ticket - }; - } + $(document).ready(function() { + + // application details + //////////////////////////////////////////////////////////////////////// + + function postObject() { + return { // select content data + subject: $('input[name=subject]').val(), + date: $('input[name=date]').val(), + type_id: 1, // 1 = application document + first_name: $('input[name=first_name]').val(), + last_name: $('input[name=last_name]').val(), + father_name: $('input[name=father_name]').val(), + phone: $('input[name=phone]').val(), + email: $('input[name=email]').val(), + registration_number: $('input[name=registration_number]').val(), + belonging_school: $('input[name=belonging_school]').val(), + date: $('input[name=date]').val(), + sector: selected_text($('select[name=sector]')), + position: selected_text($('select[name=position]')), + request: $('textarea[name=request]').val(), + now: Math.floor(Date.now() / 1000), // client timestamp + ticket: ref.ticket + }; + } - $(document).ready(function() { // When form is submited //////////////////////////////////////////////////////////////////////// @@ -73,5 +77,19 @@ }); + + // go-back event + //////////////////////////////////////////////////////////////////////// + + $('.btn-back2panel').click( event => { + event.preventDefault(); + + let confirm_exit = confirm('<?=CONFIRM_EXIT?>'); + if (confirm_exit) { + window.location.href = '/panel'; + } + }); + + }); </script> |
