summaryrefslogtreecommitdiff
path: root/public/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'public/app/views')
-rw-r--r--public/app/views/components/header_includes.php6
-rw-r--r--public/app/views/error/404.php1
-rw-r--r--public/app/views/error/general.php1
-rw-r--r--public/app/views/group.php13
-rw-r--r--public/app/views/item.php4
-rw-r--r--public/app/views/templates/admin_petitions.php3
-rw-r--r--public/app/views/templates/admin_users.php3
-rw-r--r--public/app/views/templates/application.php1
-rw-r--r--public/app/views/templates/create_pdf.php1
-rw-r--r--public/app/views/templates/invite.php5
-rw-r--r--public/app/views/templates/penalty.php1
-rw-r--r--public/app/views/user/control.php1
-rw-r--r--public/app/views/user/invitation.php1
-rw-r--r--public/app/views/user/login.php5
-rw-r--r--public/app/views/user/panel.php3
-rw-r--r--public/app/views/user/update_password.php5
-rw-r--r--public/app/views/user/update_properties.php5
-rw-r--r--public/app/views/welcome.php280
18 files changed, 33 insertions, 306 deletions
diff --git a/public/app/views/components/header_includes.php b/public/app/views/components/header_includes.php
index 9e1d239..ab16da1 100644
--- a/public/app/views/components/header_includes.php
+++ b/public/app/views/components/header_includes.php
@@ -58,9 +58,11 @@
<!-- basic cookie handling (vanilla js) -->
<script src="/assets/js/cookie.js"></script>
+<?php if (!$no_pdfmake) : ?>
<!-- pdfmake -->
-<script src="<?=SITE_URL?>/assets/js/pdfmake/pdfmake.min.js"></script>
-<script src="<?=SITE_URL?>/assets/js/pdfmake/vfs_fonts.js"></script>
+ <script src="<?=SITE_URL?>/assets/js/pdfmake/pdfmake.min.js"></script>
+ <script src="<?=SITE_URL?>/assets/js/pdfmake/vfs_fonts.js"></script>
+<?php endif; ?>
<?php if (!$no_dataTables) : ?>
<!-- DataTables js -->
diff --git a/public/app/views/error/404.php b/public/app/views/error/404.php
index 41f17da..95ec039 100644
--- a/public/app/views/error/404.php
+++ b/public/app/views/error/404.php
@@ -21,6 +21,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=$error_code?> : <?= $moto ?? 'Not found' ?></title>
<style>
diff --git a/public/app/views/error/general.php b/public/app/views/error/general.php
index 6ed984b..28a1531 100644
--- a/public/app/views/error/general.php
+++ b/public/app/views/error/general.php
@@ -18,6 +18,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title>
<?= isset($title)
? (SITE_TITLE .": ". $title)
diff --git a/public/app/views/group.php b/public/app/views/group.php
deleted file mode 100644
index 5d5dea0..0000000
--- a/public/app/views/group.php
+++ /dev/null
@@ -1,13 +0,0 @@
-<section>
- <div style="padding: 1em">
-
- <?php foreach ($group as $item) : ?>
-
- <div style="padding: 1em">
- <?php render_view('item', ['item' => $item]) ?>
- </div>
-
- <?php endforeach; ?>
-
- </div>
-</section>
diff --git a/public/app/views/item.php b/public/app/views/item.php
deleted file mode 100644
index 2354c81..0000000
--- a/public/app/views/item.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<h3><?=$item['title']?></h3>
-<p>
- <i><?=$item['info']?></i>
-</p> \ No newline at end of file
diff --git a/public/app/views/templates/admin_petitions.php b/public/app/views/templates/admin_petitions.php
index 59c85f6..2a8479d 100644
--- a/public/app/views/templates/admin_petitions.php
+++ b/public/app/views/templates/admin_petitions.php
@@ -2,11 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Control Panel</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_pdfmake' => true ]);
?>
<style>
:root { /* login-form overides */
diff --git a/public/app/views/templates/admin_users.php b/public/app/views/templates/admin_users.php
index baa2e58..1fc7cc7 100644
--- a/public/app/views/templates/admin_users.php
+++ b/public/app/views/templates/admin_users.php
@@ -2,11 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Control Panel</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_pdfmake' => true ]);
?>
<style>
:root { /* login-form overides */
diff --git a/public/app/views/templates/application.php b/public/app/views/templates/application.php
index 72c9251..533a0bf 100644
--- a/public/app/views/templates/application.php
+++ b/public/app/views/templates/application.php
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Αίτηση</title>
<?php // header includes
diff --git a/public/app/views/templates/create_pdf.php b/public/app/views/templates/create_pdf.php
index 6b5c164..2549cda 100644
--- a/public/app/views/templates/create_pdf.php
+++ b/public/app/views/templates/create_pdf.php
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?></title>
<style>
diff --git a/public/app/views/templates/invite.php b/public/app/views/templates/invite.php
index ab0f12c..25826ec 100644
--- a/public/app/views/templates/invite.php
+++ b/public/app/views/templates/invite.php
@@ -2,11 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Είσοδος Χρήστη</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes',
+ [ 'no_dataTables' => true, 'no_pdfmake' => true ]
+ );
?>
<style>
:root { /* login-form overides */
diff --git a/public/app/views/templates/penalty.php b/public/app/views/templates/penalty.php
index 232e8a8..a033925 100644
--- a/public/app/views/templates/penalty.php
+++ b/public/app/views/templates/penalty.php
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Πρακτικό Πειθαρχικής Υπόθεσης</title>
<?php // header includes
diff --git a/public/app/views/user/control.php b/public/app/views/user/control.php
index b429dc6..233e278 100644
--- a/public/app/views/user/control.php
+++ b/public/app/views/user/control.php
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Control Panel</title>
<?php // header includes
diff --git a/public/app/views/user/invitation.php b/public/app/views/user/invitation.php
index 64e5bcb..3544b90 100644
--- a/public/app/views/user/invitation.php
+++ b/public/app/views/user/invitation.php
@@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Εγγραφή</title>
<?php // header includes
diff --git a/public/app/views/user/login.php b/public/app/views/user/login.php
index 169a72b..54972df 100644
--- a/public/app/views/user/login.php
+++ b/public/app/views/user/login.php
@@ -2,11 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Είσοδος Χρήστη</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes', [ 'no_dataTables' => true ]);
+ Render::view('components/header_includes',
+ [ 'no_dataTables' => true, 'no_pdfmake' => true ]
+ );
?>
<style>
:root { /* login-form overides */
diff --git a/public/app/views/user/panel.php b/public/app/views/user/panel.php
index 304237b..a371852 100644
--- a/public/app/views/user/panel.php
+++ b/public/app/views/user/panel.php
@@ -2,11 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Control Panel</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes', [ 'no_pdfmake' => true ]);
?>
<style>
:root { /* login-form overides */
diff --git a/public/app/views/user/update_password.php b/public/app/views/user/update_password.php
index b415f7c..ee91390 100644
--- a/public/app/views/user/update_password.php
+++ b/public/app/views/user/update_password.php
@@ -2,11 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Αλλαγή Password</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes', [ 'no_dataTables' => true ]);
+ Render::view('components/header_includes',
+ [ 'no_dataTables' => true, 'no_pdfmake' => true ]
+ );
?>
</head>
<body class="office central-form">
diff --git a/public/app/views/user/update_properties.php b/public/app/views/user/update_properties.php
index 363016a..4af5bfe 100644
--- a/public/app/views/user/update_properties.php
+++ b/public/app/views/user/update_properties.php
@@ -2,11 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8">
+ <meta name="viewport" content="width=device-width initial-scale=1">
<title><?=SITE_TITLE?> - Ενημέρωση στοιχείων</title>
<?php // header includes
////////////////////////////////////////////////////////////////////////
- Render::view('components/header_includes');
+ Render::view('components/header_includes',
+ [ 'no_dataTables' => true, 'no_pdfmake' => true ]
+ );
?>
</head>
<body class="office central-form">
diff --git a/public/app/views/welcome.php b/public/app/views/welcome.php
deleted file mode 100644
index fd3f703..0000000
--- a/public/app/views/welcome.php
+++ /dev/null
@@ -1,280 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Welcome!</title>
-
- <!-- Latest compiled and minified CSS -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
-
- <!-- jQuery library -->
- <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.4/dist/jquery.slim.min.js"></script>
-
- <!-- select2 -->
- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
- <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
-
- <style>
-label { font-size:12px; }
-.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { padding-left: 0; }
-.form-group { margin-bottom: .667rem; }
-select { height: 31px; padding-left: 8px; padding-right: 24px; }
-select, input,
-select option { font-size: .87rem; }
- </style>
-
-</head>
-<body class='classroom'>
- <div class="container" style="max-width: 640px;">
- <div class="row">
-
-<?php
- $form = JsonToForm::make_a_form(REGISTRATION_FORM);
-?>
-<?=$form['html']?>
-
- </div>
- </div>
-
-
-
-<script>
-// NOW RUN EVERYTHING AFTER JQUERY (AND DOM ready)
-// -----------------------------------------------------------------------------
-////////////////////////////////////////////////////////////////////////////////
-
-// 00. FLAGS and NEEDED FUNCTIONS
-// ---------------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-var waitingResponse = false; // flag for an ajax request that was sent and still waiting response
-
-// pure JS ajax GET request
-// return data as JSON
-// no fancy things like UTF8; if needed use base64 ---------------------------
-function ajax_get(url, callback) {
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
-
- try {
- var data = JSON.parse(xmlhttp.responseText);
- } catch(err) {
- console.log(err.message + ' in ' + xmlhttp.responseText);
- return;
- }
- callback(data);
- }
- };
-
- xmlhttp.open("GET", url, true);
- xmlhttp.send();
-}
-
-
-// 01. MENU MANAGEMENT
-// ---------------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-// menu management
-// ---------------------------------------------------------------------------
-$('.dropdown-item').on('click', function(e){
- e.preventDefault();
-
- if (!waitingResponse) {
- waitingResponse = true;
-
- var r = confirm('Δεν έχετε αποθηκεύσει το τρέχον αντικείμενο!\nΕίστε σίγουροι ότι θέλετε να εγκαταλείψετε τη σελίδα;');
- if (r == true) {
-
- // all data-goto have the format: 'method,uri_address'
- // uri_address is the url to call
- // method options:
- // * url : means goto url (redirect)
- // * ajax : means call url via ajax; if 'success = true' then goto '/' after that
- // -----------------------------------------------------------------------
- var opt = $(this).data('goto').split(','); // split data-goto
-
- if (opt[0] == 'url') { // if method = url
- window.location.href = opt[1];
- }
- else { // else, method = ajax
- ajax_get(opt[1], function(response) {
- if (response.success) {
- window.location.href = '/';
- }
- });
- }
-
- }
- else {
- // user did not confirmed the selection; do nothing
- }
-
- waitingResponse = false;
- }
-
-});
-
-// 02. USER INTERFACE
-// ---------------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-// tabs to accorderon --------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-// FUNCTION: Set tabsContainer height
-// acording to which tab is visible
-// and tab mode (tabs|acordeon)
-// ---------------------------------------------------------------------------
-function set_tabsContainer_height() {
- var ch_; // content height
- var tc_base; // tabs-container base height
- tc_base = ($(window).width() > 650) ? 100 : 400;
- if ($('#content1').is(':visible')) ch_ = $('#content1').height();
- if ($('#content2').is(':visible')) ch_ = $('#content2').height();
- if ($('#content3').is(':visible')) ch_ = $('#content3').height();
- if ($('#content4').is(':visible')) ch_ = $('#content4').height();
- if ($('#content5').is(':visible')) ch_ = $('#content5').height();
- if ($('#content6').is(':visible')) ch_ = $('#content6').height();
-
- $('#tabsContainer').height(ch_ + tc_base);
-
-}
-set_tabsContainer_height(); // init (run for 1st time)
-
-// on tab selection
-// calculate tabsContainer height
-$('input:radio[name="tabs"]').change( function(){
- set_tabsContainer_height()
-});
-
-// on window change
-// set tabsContainer height
-$( window ).resize(function() {
- set_tabsContainer_height();
-});
-
-
-
-// 03. FORM-CONTROLS
-// ---------------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-// Select2 controls
-//////////////////////////////////////////////////////////////////////////////
-
-// FUNCTION: Get selected value(s) of Select2 control
-// pass arg: source-element
-// return: value(s) comma-separated
-// ---------------------------------------------------------------------------
-function getValues(srcElm) {
- var res;
- var obj = srcElm.select2('data'); // get delected data array
-
- if (obj.length === 0) return ''; // if empty list then nothig is selected
- else {
- var i = 0;
- obj.forEach(function(elm){ // loop through object elements array
-
- if (i) res += ',' + elm.id; // if not first item, prepend ',' befor value(id)
- else res = elm.id; // else set (first) checked value
-
- i++;
- });
- }
- return res;
-}
-
-// patch select2-multiple widths
-// ---------------------------------------------------------------------------
-$('.select-field').select2({ width: '100%' });
-
-// init select2 fields
-// (embed from php)
-// ---------------------------------------------------------------------------
-<?=$form['init_js']?>
-
-<?=$form['values_js']?>
-
-
-// 04. FORM-LOGIC
-// ---------------------------------------------------------------------------
-//////////////////////////////////////////////////////////////////////////////
-
-// FUNCTION: Report empty fields
-// ---------------------------------------------------------------------------
-function reportEmpty() {
- var empty = '';
- var needit = [];
- var values = {};
-
- // embed if-conditions from php
- <?=$form['values_js']?>
-
- $("#empty-fields").html(empty); // render empty fields
-
- // console.log(JSON.stringify(values));
-
- return { need : needit, data: values }; // return all fields
-}
-reportEmpty();
-
-$('form').on('keyup change paste', 'input, select, textarea', function(){
- console.log('Form changed!');
- reportEmpty();
-});
-
-// validation?
-// check: https://www.sitepoint.com/instant-validation/
-
-
-$('#post-form').on('submit', function(e){
- e.preventDefault();
- if (!waitingResponse) {
- waitingResponse = true;
- var resp = reportEmpty();
-
- if (resp.need.length > 0) alert("Tα πεδία:\n\n" + resp.need.join(',\n') + "\n\nείναι υποχρεωτικά!");
- else {
- // alert('sending: '+JSON.stringify(resp.data));
- var postUrl = "/ajax.php?do=additem"; // url to post form
- var data2send = resp.data; // parse data to send
-
- $.ajax({
- type: 'POST',
- url: postUrl, // make sure you respect the same origin policy with this url
- data: data2send,
- dataType: "text",
-
- success: function(data) { // server replies
- var json = $.parseJSON(data);
- if (json.success == true) { // good! post accepted
- // alert(json.id)
- window.location.href = '/ui-show-item.php?id='+ json.id;
- }
- else {
- alert("Post not accepted.\nPlease check the data you submit.");
- // $('#oc-company-form')[0].reset();
- }
- },
-
- error: function() {
- alert('Some ajax error! :(');
- }
- });
- }
-
- waitingResponse = false;
- }
-
-});
-
-</script>
-
-
-
- </body>
-</html>
-
-