1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
<?php
include("config/parametres.php");
include("includes/sessions.php");
include("includes/functions.php");
// if user's ROLE is less then ADMIN : then go to Login | Panel
// -----------------------------------------------------------------------------
if (ROLE < ADMIN) {
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: /");
die();
}
?><!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB" dir="ltr">
<head>
<!-- Metas + Title -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>KALLASSA : Εκτύπωση'</title>
<!-- CSS needed -->
<link href="https://fonts.googleapis.com/css?family=Ubuntu:400,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/css/bootstrap.min.css" /><!-- v4.4.1 -->
<link rel="stylesheet" href="/css/select2.min.css" /><!-- v4.0.10 -->
<link rel="stylesheet" href="/css/pi.css" />
</head>
<body>
<?php // Menu ----------------------------------------------------------------
include("includes/menu.php");
?>
<div class="profile-container">
<div class="row">
<div class="col-md-12">
<h2>Τοπικό backup</h2>
<h4>Η διεργασία έχει απενεργοποιηθεί προσωρινά.</h4>
<hr />
</div>
</div>
</div>
<!-- scripts and libraries
load and register one by one, so you don't need to worry about if they are ready -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.4.1/jquery-migrate.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script>
var waitingResponse = false; // flag for an ajax request that was sent and still waiting response
// functions needed
// ---------------------------------------------------------------------------
// 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();
}
// menu management
// ---------------------------------------------------------------------------
$('.dropdown-item').on('click', function(e){
e.preventDefault();
// 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 = '/';
}
});
}
});
// 01. MENU MANAGEMENT
// ---------------------------------------------------------------------------
//////////////////////////////////////////////////////////////////////////////
// menu management
// ---------------------------------------------------------------------------
$('.dropdown-item').on('click', function(e){
e.preventDefault();
if (!waitingResponse) {
waitingResponse = true;
// var r = confirm("Δεν έχετε αποθηκεύσει το τρέχον αντικείμενο!\nΕίστε σίγουροι ότι θέλετε να εγκαταλείψετε τη σελίδα;");
r = true; // no need for confirmation
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;
}
});
</script>
</body>
</html>
|