This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopzioni.php
209 lines (195 loc) · 10.4 KB
/
opzioni.php
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
include "include/top.php";
// $axios = new axios;
// $axios->postREFamilyData = $_SESSION["getPostREFamily"];
// $axios->QuadrimestreFT = $_COOKIE["QuadrimestreFT"];
// $axios->QuadrimestreFTAll = $_SESSION["QuadrimestreFTAll"];
// $axios->student = $_SESSION["getStudentId"][$_COOKIE['studentNumber']];
// $axios->cookies = $_SESSION["cookies"];
// $result = $axios->getAbsences();
?>
<!DOCTYPE html>
<html>
<head>
<!-- Test code notifiche -->
<link rel="manifest" href="/manifest.json" />
<title>Opzioni | REDignus</title>
<?php include "include/head.php";?>
</head>
<body>
<div class="wrapper">
<!-- Apertura Wrapper -->
<!-- Sidebar -->
<?php include "include/sidebar.php";?>
<!-- Page Content -->
<div id="content">
<?php include "include/navbar.php";?>
<div class="container">
<br>
<h1 class="text-center">Opzioni</h1>
<br>
<div class="jumbotron">
<h2>Grafica</h2>
<p>Qui puoi cambiare tutte le opzioni relative all' aspetto grafico dell' interfaccia.</p>
<p>*<small>Se viene selezionata l'opzione Default allora verrà sempre visualizzata la versione più recente</small></p>
<hr>
<div class="row">
<div class="col-md-10 col-sm-8">
<p class="mx-auto">Tasto menù</p>
</div>
<div class="col-md-2 col-sm-4">
<span class="switch">
<input type="checkbox" name="tastomenu" class="switch" id="Tastomenu">
<label for="Tastomenu"></label>
</span>
</div>
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Grafica registro </p>
</div>
<div class="col-md-3 col-sm-4">
<select name="grafica-registro" id="grafica-registro">
<option value="default">Default (Scheda [v3.0])</option>
<option value="3">Scheda [v3.0]</option>
<option value="2">Scheda [v2.1]</option>
<option value="1">Tabella [v1.0]</option>
</select>
</div>
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Grafica voti </p>
</div>
<div class="col-md-3 col-sm-4">
<select name="grafica-voti" id="grafica-voti">
<option value="default">Default (Scheda [v2.2])</option>
<option value="2">Scheda [v2.2]</option>
<option value="1">Tabella [v1.3]</option>
</select>
</div>
</div>
<hr>
<div class="row justify-content-end">
<div class="col text-center">
<button type="button" class="btn btn-primary" onclick="saveGrafica();">Salva</button>
<button type="button" class="btn btn-danger" onclick="resetGrafica();">Cancella</button>
</div>
</div>
</div>
<div class="jumbotron">
<h2>Varie</h2>
<p>Qui puoi cambiare tutte le opzioni.</p>
<hr>
<div class="row">
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Alunno </p>
</div>
<div class="col-md-3 col-sm-4">
<select name="studentNumber" id="studentNumber">
<?php
foreach ($_SESSION['getStudentId'] as $key => $value) {
echo '<option value="' . $value['num'] . '">' . $value["name"] . '</option>';
}
?>
</select>
</div>
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Periodo dell'anno </p>
</div>
<div class="col-md-3 col-sm-4">
<select name="studentNumber" id="QuadrimestreFT">
<?php
foreach ($_SESSION['QuadrimestreFTAll'] as $key => $value) {
echo '<option value="' . $value . '">' . $value . '</option>';
}
?>
</select>
</div>
</div>
<hr>
<div class="row justify-content-end">
<div class="col text-center">
<button type="button" class="btn btn-primary" onclick="saveVarie();">Salva</button>
<button type="button" class="btn btn-danger" onclick="resetVarie();">Cancella</button>
</div>
</div>
</div>
<div class="jumbotron">
<h2>Info</h2>
<p>Qui puoi vedere i dettagli del tuo account e del tuo dispositivo.</p>
<hr>
<div class="row">
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Alunno: </p>
</div>
<div class="col-md-3 col-sm-4">
<p id="alunnodebug"></p>
</div>
<div class="col-md-9 col-sm-8">
<p class="mx-auto">Password: </p>
</div>
<div class="col-md-3 col-sm-4">
<p class="btn btn-primary" id="passowrddebug" onclick="showPass();">Clicca<br> per mostrare</p>
</div>
</div>
</div>
</div>
<?php include "include/footer.php";?>
<script>
if (typeof $.cookie('tastomenu') === 'undefined'){
$.cookie("tastomenu", true, { expires: 365 })
}
if (typeof $.cookie('graficaregistro') === 'undefined'){
$.cookie("graficaregistro", "default", { expires: 365 })
}
if (typeof $.cookie('graficavoti') === 'undefined'){
$.cookie("graficavoti", "default", { expires: 365 })
}
if (typeof $.cookie('studentNumber') === 'undefined'){
$.cookie("studentNumber", "0", { expires: 365 })
}
// ---- Opzioni Grafica ----
function resetGrafica() {
$('#Tastomenu').prop('checked', $.parseJSON($.cookie("tastomenu")));
$("#grafica-registro").val($.cookie("graficaregistro"));
$("#grafica-voti").val($.cookie("graficavoti"));
}
resetGrafica();
function saveGrafica() {
$.cookie("tastomenu", $('#Tastomenu').is(':checked'), { expires: 365 })
$.cookie("graficaregistro", $('#grafica-registro').find(":selected").val(), { expires: 365 })
$.cookie("graficavoti", $('#grafica-voti').find(":selected").val(), { expires: 365 })
alert("Ottimo! \nLe modifiche sono state salvate...");
}
// ---- Opzioni Varie ----
function resetVarie() {
$("#studentNumber").val($.cookie("studentNumber"));
$("#QuadrimestreFT").val($.cookie("QuadrimestreFT"));
}
resetVarie();
function saveVarie() {
$.cookie("studentNumber", $('#studentNumber').find(":selected").val(), { expires: 365 })
$.cookie("QuadrimestreFT", $('#QuadrimestreFT').find(":selected").val(), { expires: 7 })
window.location.href = "login";
alert("Ottimo! \nLe modifiche sono state salvate...\nAspetta un attimo");
}
// ---- Debug Info ----
function showPass() {
if ($.cookie("axiospassword") === undefined) {
$("#passowrddebug").text("Non è presente nessuna password");
$("#passowrddebug").removeClass();
} else {
$("#passowrddebug").text($.cookie("axiospassword"));
$("#passowrddebug").removeClass();
}
}
function infoDebug() {
if ($.cookie("axiosuser") === undefined) {
$("#alunnodebug").text("Non è presente nessun username");
} else {
$("#alunnodebug").text($.cookie("axiosuser"));
}
}
infoDebug();
</script>
</div><!-- Page Content -->
</div><!-- Chiusura Wrapper -->
</body>
</html>