css file and refactoring

This commit is contained in:
Matteo Gheza 2020-11-14 23:00:36 +01:00
parent 51df554065
commit 868825f0d1
17 changed files with 829 additions and 1201 deletions

View File

@ -34,7 +34,7 @@ foreach($risultato as $row){
if($user->requireRole(Role::FULL_VIEWER)){
$name = $user->nameById($row["id"]);
$name_encoded = urlencode($name);
$functionName = $row["available"] ? "Deactivate" : "Activate";
$functionName = $row["available"] ? "deactivate" : "activate";
$firstCell = $row["chief"] ? "<a onclick='$functionName(".$row["id"].");'><img alt='chief' src='./resources/images/red_helmet.png' width='20px'>$name</a>" : "<a onclick='$functionName(".$row["id"].");'><img alt='normal user' src='./resources/images/black_helmet.png' width='20px'>$name</a>";
$secondCell = $row["available"] ? "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-check' style='color:green'></i></a>" : "<a onclick='$functionName(".$row["id"].");'><i class='fa fa-times' style='color:red'></i></a>";
$response[] = [

View File

@ -0,0 +1,211 @@
body:not(table) {
max-width: 100%;
overflow-x: hidden;
}
center {
text-align: center;
}
#modulogin {
margin-top: 60px;
padding: 30px 0 30px 0;
width: 90%;
height: auto;
background: #fafafa;
border-radius: 15px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}
input::placeholder {
color: lightgray;
}
.modal-text {
margin-top: 15px;
line-height: 25px;
font-size: 1.0em;
font-family: calibri;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: red;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.active {
background-color: #4CAF50;
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
@media screen and (max-width: 600px) {
.topnav a:not(:first-child) {
display: none;
}
.topnav a.icon {
float: right;
display: block;
}
}
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
@media screen and (max-width: 600px) {
.topnav.responsive {
position: relative;
}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
}
#bottom {
background-color: grey;
color: white;
}
div.img {
border: 2px solid white;
float: left;
margin: 10px;
width: 100px;
height: 100px;
}
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
form {
border: 3px solid #f1f1f1;
}
input[type=text],
input[type=password],
input[type=email] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
textarea {
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
resize: none;
}
#href {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
th,td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table {
box-shadow: 2px 2px 25px rgba(0, 0, 0, 0.5);
border-radius: 15px;
margin: auto;
}
.fa{
vertical-align: middle;
font-size: 20px;
}

View File

@ -2,6 +2,7 @@ jQuery = $;
window.$ = window.jQuery = $;
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
import './main.css';
import './font-awesome.scss';
import '../node_modules/bootstrap-cookie-alert/cookiealert.css'; // TODO: migrate to Bootstrap Italia
import 'bootstrap-datepicker';
@ -161,8 +162,30 @@ function loadTable(table_page, set_interval=true, interval=10000, onlineReload=f
}
}
function chat() {
setCookie("chat", "true", 1);
location.reload();
}
window.addEventListener('securitypolicyviolation',console.error.bind(console));
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function menu() {
var x = document.getElementById("myTopnav");
//var z = document.getElementById("logout");
if (x.className === "topnav") {
x.className += " responsive";
//z.className = " logout_sx";
} else {
x.className = "topnav";
//z.className = " logout_dx";
}
}
window.loadTable_interval = loadTable_interval;
window.fillTable = fillTable;
window.loadTable = loadTable;
window.setCookie = setCookie;
window.getCookie = getCookie;
window.getCookie = getCookie;
window.chat = chat;
window.menu = menu;

View File

@ -23,11 +23,6 @@ div#results {
font-size: 75%;
}
.fa{
vertical-align: middle;
font-size: 25px;
}
.fa.fa-map-marker-alt,.fa.fa-spinner.fa-spin {
line-height: inherit;
}

View File

@ -1,22 +1,24 @@
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.3/howler.min.js" integrity="sha256-/Q4ZPy6sMbk627wHxuaWSIXS1y7D2KnMhsm/+od7ptE=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.3/howler.min.js"
integrity="sha256-/Q4ZPy6sMbk627wHxuaWSIXS1y7D2KnMhsm/+od7ptE=" crossorigin="anonymous"></script>
</head>
<body>
<div class='text-center' id="err">
<script>
var sound = new Howl({
src: ['{{ urlsoftware }}/resources/sounds/{{ error_sound }}'],
autoplay: true,
volume: 0.9,
onend: function() {
console.log('Finito');
}
});
sound.play();
</script>
Possibile attività di hacking del software rilevata
<img src='{{ urlsoftware }}/resources/images/{{ error_image }}'></img>
</div>
<h1>Abbiamo rilevato un' attività sospetta provenire dal tuo dispositivo o dalla tua rete.<br>Se non stavi facendo niente di brutto, e ritieni che questo sia un error, la<br>preghiamo di contattare l'assistenza.</h1>
<div class='text-center' id="err">
<script>
var sound = new Howl({
src: ['{{ urlsoftware }}/resources/sounds/{{ error_sound }}'],
autoplay: true,
volume: 0.9,
onend: function () {
console.log('Finito');
}
});
sound.play();
</script>
Possibile attività di hacking del software rilevata
<img src='{{ urlsoftware }}/resources/images/{{ error_image }}'></img>
</div>
<h1>Abbiamo rilevato un' attività sospetta provenire dal tuo dispositivo o dalla tua rete.<br>Se non stavi facendo
niente di brutto, e ritieni che questo sia un error, la<br>preghiamo di contattare l'assistenza.</h1>
</body>

View File

@ -1,349 +1,91 @@
<!DOCTYPE html>
<html lang="it">
<head>
{% block head %}
<title>{{ title }} - ALLERTA sistema gestionale {{ owner }}</title>
<link href="{{ urlsoftware }}/resources/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<meta name="viewport" content="user-scalable=no, initial-scale=1">
<link rel="manifest" href="manifest.webmanifest">
<style>
body:not(table){
max-width: 100%;
overflow-x: hidden;
}
</style>
<script src="resources/dist/main.js"></script>
{% if enable_technical_support and technical_support_open %}
<!-- Smartsupp Live Chat script -->
<script type='text/javascript'>
var _smartsupp = _smartsupp || {};
_smartsupp.key = '{{ technical_support_key }}';
_smartsupp.ratingEnabled = true; // default value : false
_smartsupp.ratingComment = true; // default value : false
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='https://www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
</script>
<script>
// basic info
smartsupp('email', '');
smartsupp('name', '{{ user.name }}');
smartsupp('recording:disable', false);
// extra info
smartsupp('variables', {
name: { label: 'name user ', value: '{{ user.name }}' },
Admin: { label: 'Admin', value: '{{ user.full_viewer }}' }
});
</script>
{% endif %}
<script>
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
<head>
{% block head %}
<title>{{ title }} - ALLERTA sistema gestionale {{ owner }}</title>
<link href="{{ urlsoftware }}/resources/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<meta name="viewport" content="user-scalable=no, initial-scale=1">
<link rel="manifest" href="manifest.webmanifest">
<script src="resources/dist/main.js"></script>
{% if enable_technical_support and technical_support_open %}
<!-- Smartsupp Live Chat script -->
<script type='text/javascript'>
var _smartsupp = _smartsupp || {};
_smartsupp.key = '{{ technical_support_key }}';
_smartsupp.ratingEnabled = true; // default value : false
_smartsupp.ratingComment = true; // default value : false
window.smartsupp || (function (d) {
var s, c, o = smartsupp = function () {
o._.push(arguments)
};
o._ = [];
s = d.getElementsByTagName('script')[0];
c = d.createElement('script');
c.type = 'text/javascript';
c.charset = 'utf-8';
c.async = true;
c.src = 'https://www.smartsuppchat.com/loader.js?';
s.parentNode.insertBefore(c, s);
})(document);
</script>
<script>
// basic info
smartsupp('email', '');
smartsupp('name', '{{ user.name }}');
smartsupp('recording:disable', false);
// extra info
smartsupp('variables', {
name: {
label: 'name user ',
value: '{{ user.name }}'
},
Admin: {
label: 'Admin',
value: '{{ user.full_viewer }}'
}
});
</script>
{% endif %}
{% endblock %}
</head>
<body>
<div class="alert text-center cookiealert" role="alert">
<b>Do you like cookies?</b> &#x1F36A; We use cookies to ensure you get the best experience on our website. <a
href="https://cookiesandyou.com/" target="_blank">Learn more</a>
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function chat() {
setCookie("chat", "true", 1);
location.reload();
}
window.addEventListener('securitypolicyviolation',console.error.bind(console));
</script>
<script>
function loadScript(directory, files) {
var head = document.getElementsByTagName("head")[0]
var done = false
var extension = '.js'
for (var file of files) {
var path = directory + file + extension
var script = document.createElement("script")
script.src = path
script.type = "text/javascript"
script.onload = script.onreadystatechange = function() {
if (!done && (!this.readyState ||
this.readyState == "loaded" || this.readyState == "complete")) {
done = true
script.onload = script.onreadystatechange = null // cleans up a little memory:
head.removeChild(script) // to avoid douple loading
}
};
head.appendChild(script)
done = false
}
}
function loadStyle(directory, files) {
var head = document.getElementsByTagName("head")[0]
var extension = '.css'
for (var file of files) {
var path = directory + file + extension
var link = document.createElement("link")
link.href = path
link.type = "text/css"
link.rel = "stylesheet"
head.appendChild(link)
}
}
</script>
<style>
center {
text-align: center;
}
#modulogin {
margin-top: 60px;
padding: 30px 0 30px 0;
width: 90%;
height: auto;
background: #fafafa;
border-radius: 15px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}
input::placeholder {
color: lightgray;
}
#watermark {
position: fixed;
bottom: 5px;
right: 5px;
opacity: 0.5;
z-index: 99;
color: blue;
font-size: 25px;
}
#demo-modal {
text-align: center;
padding: 20px;
}
#demo-modal-target {
font-family: calibri;
max-width: 550px;
text-align: center;
color: #FFF;
padding: 70px 0px;
}
.demo-title {
font-size: 2em;
padding: 40px;
}
.btn-modal-target {
padding: 10px 20px;
color: #F0F0F0;
margin: 5px;
border-radius: 15px;
cursor: pointer;
width: 70px;
display: inline-block;
}
#btn-jquery {
background: #e85545;
}
#btn-bootstrap {
background: #43cb83;
}
#btn-responsive {
background: #ff9e8f;
}
.modal-text {
margin-top: 15px;
line-height: 25px;
font-size: 1.0em;
font-family: calibri;
}
/* Add a black background color to the top navigation */
.topnav {
background-color: red;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.active {
background-color: #4CAF50;
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
@media screen and (max-width: 600px) {
.topnav a:not(:first-child) {
display: none;
}
.topnav a.icon {
float: right;
display: block;
}
}
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
@media screen and (max-width: 600px) {
.topnav.responsive {
position: relative;
}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
}
.logout_dx {
float: right;
}
.logout_sx {
float: left;
}
</style>
<script>
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function menu() {
var x = document.getElementById("myTopnav");
//var z = document.getElementById("logout");
if (x.className === "topnav") {
x.className += " responsive";
//z.className = " logout_sx";
} else {
x.className = "topnav";
//z.className = " logout_dx";
}
}
</script>
<script>
function Activate(id){
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 1,
token_list: "{{ token_list }}"
},
success: function(data) {
alert("{{ 'Thanks, %s, you have given your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
function Deactivate(id){
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 0,
token_list: "{{ token_list }}"
},
success: function(data) {
alert("{{ 'Thanks, %s, you have removed your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
</script>
{% endblock %}
</head>
<body>
<div class="alert text-center cookiealert" role="alert">
<b>Do you like cookies?</b> &#x1F36A; We use cookies to ensure you get the best experience on our website. <a href="https://cookiesandyou.com/" target="_blank">Learn more</a>
<button type="button" class="btn btn-primary btn-sm acceptcookies">
I agree
</button>
<button type="button" class="btn btn-primary btn-sm acceptcookies">
I agree
</button>
</div>
{% block menu %}
<!-- Menu -->
<div class="topnav" id="myTopnav">
<a href="{{ urlsoftware }}list.php" class="active">{{ 'Availability List'|t }}</a>
<a href="{{ urlsoftware }}services.php">{{ 'Services'|t }}</a>
<a href="{{ urlsoftware }}trainings.php">{{ 'Trainings'|t }}</a>
<a href="{{ urlsoftware }}log.php">{{ 'Logs'|t }}</a>
<a {# href="{{ urlsoftware }}graphics.php" #}>{{ 'Graphics'|t }}</a>
{% if enable_technical_support %}<a href="javascript:void(0);"
onclick="chat()">{{ 'Technical Support' }}</a>{% endif %}
<a style="float: right;" id="logout">{{ 'Hi, %s.'|t|format(user.name) }} <b
onclick="location.href='{{ urlsoftware }}logout.php';">{{ 'Logout'|t }}</b></a>
<a href="javascript:void(0);" class="icon" onclick="menu()"></a>
</div>
<!-- /Menu -->
{% endblock %}
<div class="alert alert-danger m-3" id="offline_alert" style="display: none" role="alert">
<b>{{ 'You are offline'|t }}.</b> {{ 'Last update'|t }}: <p style="display: inline" id="offline_update"></p>
</div>
<!-- Content -->
<div id="content">{% block content %}{% endblock %}</div>
<!-- /Content -->
<!-- Footer -->
<footer hidden id="bottom" class="row text-left p-4">
<div class="col-12 col-md-4">
<h5>Copyright &copy; Matteo</h5>
<h4>Applicativo realizzato per {{ owner }}</h4>
</div>
{% block menu %}
<!-- Menu -->
<div class="topnav" id="myTopnav">
<a href="{{ urlsoftware }}list.php" class="active">{{ 'Availability List'|t }}</a>
<a href="{{ urlsoftware }}services.php">{{ 'Services'|t }}</a>
<a href="{{ urlsoftware }}trainings.php">{{ 'Trainings'|t }}</a>
<a href="{{ urlsoftware }}log.php">{{ 'Logs'|t }}</a>
<a {# href="{{ urlsoftware }}graphics.php" #}>{{ 'Graphics'|t }}</a>
{% if enable_technical_support %}<a href="javascript:void(0);" onclick="chat()">{{ 'Technical Support' }}</a>{% endif %}
<a style="float: right;" id="logout">{{ 'Hi, %s.'|t|format(user.name) }} <b onclick="location.href='{{ urlsoftware }}logout.php';">{{ 'Logout'|t }}</b></a>
<a href="javascript:void(0);" class="icon" onclick="menu()"></a>
</div>
<!-- /Menu -->
{% endblock %}
<div class="alert alert-danger m-3" id="offline_alert" style="display: none" role="alert">
<b>{{ 'You are offline'|t }}.</b> {{ 'Last update'|t }}: <p style="display: inline" id="offline_update"></p>
</div>
<!-- Content -->
<div id="content">{% block content %}{% endblock %}</div>
<!-- /Content -->
<!-- Footer -->
<style>
#bottom {background-color: grey; color: white;}
div.img {border: 2px solid white; float: left; margin: 10px; width: 100px; height: 100px;}
</style>
<footer hidden id="bottom" class="row text-left p-4">
<div class="col-12 col-md-4">
<h5>Copyright &copy; Matteo</h5>
<h4>Applicativo realizzato per {{ owner }}</h4>
</div>
</footer>
<!-- /Footer -->
</body>
</footer>
<!-- /Footer -->
</body>
</html>

View File

@ -1,222 +1,159 @@
<!DOCTYPE html>
<html>
<head>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
</head>
<style>
form {
border: 3px solid #f1f1f1;
}
input[type=text], input[type=password], input[type=email] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
textarea {
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
resize: none;
}
</style>
<body>
{% if service.modalità == "edit" or service.modalità == "add" %}
<form method="post">
<div class="container">
<label><b>{{ 'Service day'|t }}</b></label>
<div class="input-group">
<input aria-label="Date picker" placeholder="DD/MM/YYY" autocomplete="off" name="data" data-provide="datepicker" value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
{% if service.modalità == "edit" or service.modalità == "add" %}
<form method="post">
<div class="container">
<label><b>{{ 'Service day'|t }}</b></label>
<div class="input-group">
<input aria-label="Date picker" placeholder="DD/MM/YYY" autocomplete="off" name="data" data-provide="datepicker"
value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
<br>
<br>
<label><b>{{ 'Code'|t }}</b></label>
<input id="progressivo" type="text" name="codice" placeholder="1234/5" required value="{{ values.codice }}">
<br>
<br>
<label for="timePicker1"><b>{{ 'Start time'|t }}</b></label>
<input id="timePicker1" type="time" name="uscita" required value="{{ values.uscita }}">
<br>
<br>
<label for="timePicker2"><b>{{ 'End time'|t }}</b></label>
<input id="timePicker2" type="time" name="rientro" required value="{{ values.rientro }}">
<br>
<br>
<label><b>{{ 'Chief'|t }}</b></label>
<br>
{% for user in service.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input capo capo-{{ user.id }}"
style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='capo[]'
value='{{ user.id }}'>
<label class="form-check-label" for="capo-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<script>
$('.capo').on('change', function () {
$('input[name="' + this.name + '"]').not(this).prop('checked', false);
});
</script>
<br>
<label><b>{{ 'Drivers'|t }}</b></label>
<br>
{% for user in service.personale %}
{% if user.autista == 1 %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input autisti autisti-{{ user.id }}"
style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='autisti[]'
value='{{ user.id }}'>
<label class="form-check-label" for="autisti-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endif %}
{% endfor %}
<br>
<label><b>{{ 'Others people'|t }}</b></label>
<br>
{% for user in service.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input personale personale-{{ user.id }}"
style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='personale[]'
value='{{ user.id }}'>
<label class="form-check-label" for="personale-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<br>
{% if option('use_location_picker') %}
<label><b>{{ 'Service place'|t }}</b></label>
<div id="map"></div>
<div id="search">
<input type="text" name="addr" value="" id="addr" size="10" />
<button type="button" onclick="addr_search('{{ 'Search results'|t }}', '{{ 'No results found'|t }}');"
class="btn btn-primary">{{ 'Search'|t }}</button>
<div id="results"></div>
</div>
<input type="hidden" name="luogo" value="" />
<script src="resources/dist/maps.js" onload="load_map();"></script>
{% else %}
<label><b>{{ 'Service place'|t }}</b></label>
<input type="text" name="luogo" required value="{{ values.luogo }}">
{% endif %}
<br>
<br>
<label><b>{{ 'Others notes (ex. others infos)'|t }}</b></label><br>
<textarea name='note' id='note'></textarea>
<br>
<br>
<label><b>{{ 'Service type'|t }}</b></label>
<br>
<select name='tipo' class="tipi">
{% for tipo in service.tipologie %}
<option value='{{ tipo.name }}'>{{ tipo.name }}</option>
{% endfor %}
</select>
<br>
<input id="modalità" type="hidden" value="{{ service.modalità }}" name="mod"></input>
<input id="token" type="hidden" value="{{ service.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ service.id }}" name="id"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
<br>
<br>
<label><b>{{ 'Code'|t }}</b></label>
<input id="progressivo" type="text" name="codice" placeholder="1234/5" required value="{{ values.codice }}">
<br>
<br>
<label for="timePicker1"><b>{{ 'Start time'|t }}</b></label>
<input id="timePicker1" type="time" name="uscita" required value="{{ values.uscita }}">
<br>
<br>
<label for="timePicker2"><b>{{ 'End time'|t }}</b></label>
<input id="timePicker2" type="time" name="rientro" required value="{{ values.rientro }}">
<br>
<br>
<label><b>{{ 'Chief'|t }}</b></label>
<br>
{% for user in service.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input capo capo-{{ user.id }}" style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='capo[]' value='{{ user.id }}'>
<label class="form-check-label" for="capo-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<script>
$('.capo').on('change', function() {
$('input[name="' + this.name + '"]').not(this).prop('checked', false);
</form>
<script>
{% if service.modalità == "edit" %}
$.each('{{ values.capo }}'.split(','), function (index, value) {
$('.capo-' + value).prop('checked', true);
});
$.each('{{ values.autisti }}'.split(','), function (index, value) {
$('.autisti-' + value).prop('checked', true);
});
$.each('{{ values.personale }}'.split(','), function (index, value) {
$('.personale-' + value).prop('checked', true);
});
$(".tipi").val('{{ values.tipo }}');
$('#note').val('{{ values.note }}');
{% endif %}
$('form').submit(function () {
var progressivo_valido = /^[0-9/]{3,6}$/
var progressivo = $('#progressivo').val();
if (!progressivo_valido.test(progressivo)) {
var invia_progressivo = confirm(
"{{ 'The code has been detected as incorrect, do you want to add the service anyway?'|t }}");
} else {
var invia_progressivo = true;
}
return invia_progressivo;
});
</script>
{% endif %}
{% if service.modalità == "delete" %}
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the service?'|t }}</p>
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ service.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ service.id }}" name="id"></input>
<input id="increment" type="hidden" value="{{ increment }}" name="increment"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
<br>
<label><b>{{ 'Drivers'|t }}</b></label>
<br>
{% for user in service.personale %}
{% if user.autista == 1 %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input autisti autisti-{{ user.id }}" style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='autisti[]' value='{{ user.id }}'>
<label class="form-check-label" for="autisti-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endif %}
{% endfor %}
<br>
<label><b>{{ 'Others people'|t }}</b></label>
<br>
{% for user in service.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input personale personale-{{ user.id }}" style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='personale[]' value='{{ user.id }}'>
<label class="form-check-label" for="personale-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<br>
{% if option('use_location_picker') %}
<label><b>{{ 'Service place'|t }}</b></label>
<div id="map"></div>
<div id="search">
<input type="text" name="addr" value="" id="addr" size="10" />
<button type="button" onclick="addr_search('{{ 'Search results'|t }}', '{{ 'No results found'|t }}');" class="btn btn-primary">{{ 'Search'|t }}</button>
<div id="results"></div>
</div>
<input type="hidden" name="luogo" value="" />
<script src="resources/dist/maps.js" onload="load_map();"></script>
{% else %}
<label><b>{{ 'Service place'|t }}</b></label>
<input type="text" name="luogo" required value="{{ values.luogo }}">
{% endif %}
<br>
<br>
<label><b>{{ 'Others notes (ex. others infos)'|t }}</b></label><br>
<textarea name='note' id='note'></textarea>
<br>
<br>
<label><b>{{ 'Service type'|t }}</b></label>
<br>
<select name='tipo' class="tipi">
{% for tipo in service.tipologie %}
<option value='{{ tipo.name }}'>{{ tipo.name }}</option>
{% endfor %}
</select>
<br>
<input id="modalità" type="hidden" value="{{ service.modalità }}" name="mod"></input>
<input id="token" type="hidden" value="{{ service.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ service.id }}" name="id"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
</form>
<script>
{% if service.modalità == "edit" %}
$.each('{{ values.capo }}'.split(','), function( index, value ) {
$('.capo-'+value).prop('checked', true);
});
$.each('{{ values.autisti }}'.split(','), function( index, value ) {
$('.autisti-'+value).prop('checked', true);
});
$.each('{{ values.personale }}'.split(','), function( index, value ) {
$('.personale-'+value).prop('checked', true);
});
$( ".tipi" ).val('{{ values.tipo }}');
$('#note').val('{{ values.note }}');
{% endif %}
$('form').submit(function () {
var progressivo_valido = /^[0-9/]{3,6}$/
var progressivo = $('#progressivo').val();
if(!progressivo_valido.test(progressivo)){
var invia_progressivo = confirm("{{ 'The code has been detected as incorrect, do you want to add the service anyway?'|t }}");
} else {
var invia_progressivo = true;
}
return invia_progressivo;
});
</script>
{% endif %}
{% if service.modalità == "delete" %}
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
</style>
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the service?'|t }}</p>
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ service.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ service.id }}" name="id"></input>
<input id="increment" type="hidden" value="{{ increment }}" name="increment"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
</div>
{% endif %}
{% endif %}
</body>
</html>

View File

@ -1,175 +1,108 @@
<!DOCTYPE html>
<html>
<head>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
</head>
<style>
form {
border: 3px solid #f1f1f1;
}
input[type=text], input[type=password], input[type=email] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
textarea {
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
resize: none;
}
</style>
<body>
{% if training.modalità == "edit" or training.modalità == "add" %}
<form method="post">
<div class="container">
<label><b>{{ 'Training day'|t }}</b></label>
<div class="input-group">
<input aria-label="Date picker" placeholder="DD/MM/YYY" autocomplete="off" name="data" data-provide="datepicker" value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
{% if training.modalità == "edit" or training.modalità == "add" %}
<form method="post">
<div class="container">
<label><b>{{ 'Training day'|t }}</b></label>
<div class="input-group">
<input aria-label="Date picker" placeholder="DD/MM/YYY" autocomplete="off" name="data" data-provide="datepicker"
value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
<br>
<br>
<label><b>{{ 'Name'|t }}</b></label>
<input id="name" type="text" name="name" placeholder="1° training" required value="{{ values.name }}">
<br>
<br>
<label for="timePicker1"><b>{{ 'Start time'|t }}</b></label>
<input id="timePicker1" type="time" name="start_time" required value="{{ values.inizio }}">
<br>
<br>
<label for="timePicker2"><b>{{ 'End time'|t }}</b></label>
<input id="timePicker2" type="time" name="end_time" required value="{{ values.fine }}">
<br>
<br>
<label><b>{{ 'Chief'|t }}</b></label>
<br>
{% for user in training.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input capo capo-{{ user.id }}"
style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='capo[]'
value='{{ user.id }}'>
<label class="form-check-label" for="capo-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<script>
$('.capo').on('change', function () {
$('input[name="' + this.name + '"]').not(this).prop('checked', false);
});
</script>
<br>
<label><b>{{ 'Others people'|t }}</b></label>
<br>
{% for user in training.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input personale personale-{{ user.id }}"
style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='personale[]'
value='{{ user.id }}'>
<label class="form-check-label" for="personale-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<br>
<label><b>{{ 'Training place'|t }}</b></label>
<input type="text" name="luogo" required value="{{ values.luogo }}">
<br>
<br>
<label><b>{{ 'Others notes (ex. others infos)'|t }}</b></label><br>
<textarea name='note'></textarea>
<br>
<br>
<input id="modalità" type="hidden" value="{{ training.modalità }}" name="mod"></input>
<input id="id" type="hidden" value="{{ training.id }}" name="id"></input>
<input id="token" type="hidden" value="{{ training.token }}" name="token"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
<br>
<br>
<label><b>{{ 'Name'|t }}</b></label>
<input id="name" type="text" name="name" placeholder="1° training" required value="{{ values.name }}">
<br>
<br>
<label for="timePicker1"><b>{{ 'Start time'|t }}</b></label>
<input id="timePicker1" type="time" name="start_time" required value="{{ values.inizio }}">
<br>
<br>
<label for="timePicker2"><b>{{ 'End time'|t }}</b></label>
<input id="timePicker2" type="time" name="end_time" required value="{{ values.fine }}">
<br>
<br>
<label><b>{{ 'Chief'|t }}</b></label>
<br>
{% for user in training.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input capo capo-{{ user.id }}" style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='capo[]' value='{{ user.id }}'>
<label class="form-check-label" for="capo-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<script>
$('.capo').on('change', function() {
$('input[name="' + this.name + '"]').not(this).prop('checked', false);
</form>
<script>
{% if training.modalità == "edit" %}
$.each('{{ values.capo|striptags|e("js") }}'.split(','), function (index, value) {
$('.capo-' + value).prop('checked', true);
});
$.each('{{ values.personale|striptags|e("js") }}'.split(','), function (index, value) {
$('.personale-' + value).prop('checked', true);
});
$('#note').val('{{ values.note|e("js") }}');
{% endif %}
</script>
{% endif %}
{% if training.modalità == "delete" %}
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the training?'|t }}</p>
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ training.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ training.id }}" name="id"></input>
<input id="increment" type="hidden" value="{{ increment }}" name="increment"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
<br>
<label><b>{{ 'Others people'|t }}</b></label>
<br>
{% for user in training.personale %}
<div {{ user.name == "test" ? "style='display: none'" : "" }} class="form-check">
<input aria-label="{{ username(user.id) }}" class="form-check-input personale personale-{{ user.id }}" style="transform: scale(1.4); -webkit-transform: scale(1.4);" type="checkbox" name='personale[]' value='{{ user.id }}'>
<label class="form-check-label" for="personale-{{ user.id }}">
{{ username(user.id) }}
</label>
</div>
{% endfor %}
<br>
<label><b>{{ 'Training place'|t }}</b></label>
<input type="text" name="luogo" required value="{{ values.luogo }}">
<br>
<br>
<label><b>{{ 'Others notes (ex. others infos)'|t }}</b></label><br>
<textarea name='note'></textarea>
<br>
<br>
<input id="modalità" type="hidden" value="{{ training.modalità }}" name="mod"></input>
<input id="id" type="hidden" value="{{ training.id }}" name="id"></input>
<input id="token" type="hidden" value="{{ training.token }}" name="token"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
</form>
<script>
{% if training.modalità == "edit" %}
$.each('{{ values.capo|striptags|e("js") }}'.split(','), function( index, value ) {
$('.capo-'+value).prop('checked', true);
});
$.each('{{ values.personale|striptags|e("js") }}'.split(','), function( index, value ) {
$('.personale-'+value).prop('checked', true);
});
$('#note').val('{{ values.note|e("js") }}');
{% endif %}
</script>
{% endif %}
{% if training.modalità == "delete" %}
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
</style>
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the training?'|t }}</p>
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ training.token }}" name="token"></input>
<input id="id" type="hidden" value="{{ training.id }}" name="id"></input>
<input id="increment" type="hidden" value="{{ increment }}" name="increment"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
</div>
{% endif %}
{% endif %}
</body>
</html>

View File

@ -1,152 +1,81 @@
<!DOCTYPE html>
<html>
<head>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
<link href="favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
<script src="resources/dist/main.js"></script>
</head>
<style>
form {
border: 3px solid #f1f1f1;
}
input[type=text], input[type=password], input[type=email] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
}
textarea {
width: 100%;
height: 150px;
padding: 12px 20px;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 4px;
background-color: #f8f8f8;
resize: none;
}
</style>
<body>
{% if modalità == "edit" or modalità == "add" %}
<form method="post">
<div class="container">
<label><b>{{ 'E-mail'|t }}</b></label>
<input id="mail" type="text" name="mail" placeholder="{{ 'user@provider-email-domain.com'|t }}" required>
<br>
<br>
<label><b>{{ 'Name'|t }}</b></label>
<input id="name" type="text" name="name" placeholder="{{ 'Name Surname'|t }}" required>
<br>
<br>
<label><b>{{ 'Username'|t }}</b></label>
<input id="username" type="text" name="username" placeholder="{{ 'name.surname'|t }}" required>
<br>
<br>
<label><b>{{ 'Password'|t }}</b></label>
<input id="password" type="text" name="password" required>
<br>
<br>
<label><b>{{ 'Birthday'|t }}</b></label>
<div class="input-group">
<input placeholder="DD/MM/YYY" autocomplete="off" name="birthday" data-provide="datepicker" value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
<br>
<br>
<style>
.toggle.workaround {
border: 1px solid black;
}
</style>
<label><b>{{ 'Chief'|t }}</b></label><br>
<input type="checkbox" name="capo" data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Driver'|t }}</b></label><br>
<input type="checkbox" name="autista" data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Visible'|t }}</b></label><br>
<input type="checkbox" name="visible" checked data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Enabled'|t }}</b></label><br>
<input type="checkbox" name="enabled" checked data-toggle="toggle" data-style="workaround">
<br>
<br>
<input id="modalità" type="hidden" value="{{ modalità }}" name="mod"></input>
<input id="token" type="hidden" value="{{ token }}" name="token"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
</form>
{% endif %}
{% if modalità == "delete" %}
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
</style>
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the user?'|t }}</p>
{% if modalità == "edit" or modalità == "add" %}
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ token }}" name="token"></input>
<input id="id" type="hidden" value="{{ id }}" name="id"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
<div class="container">
<label><b>{{ 'E-mail'|t }}</b></label>
<input id="mail" type="text" name="mail" placeholder="{{ 'user@provider-email-domain.com'|t }}" required>
<br>
<br>
<label><b>{{ 'Name'|t }}</b></label>
<input id="name" type="text" name="name" placeholder="{{ 'Name Surname'|t }}" required>
<br>
<br>
<label><b>{{ 'Username'|t }}</b></label>
<input id="username" type="text" name="username" placeholder="{{ 'name.surname'|t }}" required>
<br>
<br>
<label><b>{{ 'Password'|t }}</b></label>
<input id="password" type="text" name="password" required>
<br>
<br>
<label><b>{{ 'Birthday'|t }}</b></label>
<div class="input-group">
<input placeholder="DD/MM/YYY" autocomplete="off" name="birthday" data-provide="datepicker"
value="{{ values.data }}" type="text" class="form-control">
<div class="input-group-addon">
<span class="glyphicon glyphicon-th"></span>
</div>
</div>
<br>
<br>
<style>
.toggle.workaround {
border: 1px solid black;
}
</style>
<label><b>{{ 'Chief'|t }}</b></label><br>
<input type="checkbox" name="capo" data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Driver'|t }}</b></label><br>
<input type="checkbox" name="autista" data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Visible'|t }}</b></label><br>
<input type="checkbox" name="visible" checked data-toggle="toggle" data-style="workaround">
<br>
<br>
<label><b>{{ 'Enabled'|t }}</b></label><br>
<input type="checkbox" name="enabled" checked data-toggle="toggle" data-style="workaround">
<br>
<br>
<input id="modalità" type="hidden" value="{{ modalità }}" name="mod"></input>
<input id="token" type="hidden" value="{{ token }}" name="token"></input>
<button type="submit">{{ 'Submit'|t }}</button>
</div>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
{% endif %}
{% if modalità == "delete" %}
<div style="margin: 0 auto; text-align: center">
<p>{{ 'Are you sure you want to delete the user?'|t }}</p>
<form method="post">
<input id="modalità" type="hidden" value="delete" name="mod"></input>
<input id="token" type="hidden" value="{{ token }}" name="token"></input>
<input id="id" type="hidden" value="{{ id }}" name="id"></input>
<button id="add" type="submit">{{ 'Submit'|t }}</button>
</form>
<script>
$('form').submit(function () {
return confirm("{{ 'The action cannot be canceled. Are you sure you want to continue?'|t }}");
});
</script>
</div>
{% endif %}
{% endif %}
</body>
</html>

View File

@ -1,14 +1,15 @@
{% extends "base.html" %}
{% block content %}
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<div id="list" hidden></div>
<b>TODO</b>
<script>
alert("TODO");
</script>
<br>
<br>
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<div id="list" hidden></div>
<b>TODO</b>
<script>
alert("TODO");
</script>
<br>
<br>
{% endblock %}

View File

@ -6,26 +6,27 @@
{% block content %}
{% if error %}
<div class='text-center' id="err">
<script>
var sound = new Howl({
src: ['{{ urlsoftware }}/resources/sounds/{{ error_sound }}'],
autoplay: true,
volume: 0.9,
});
sound.play();
</script>
<script>
$("#err").delay(5000).fadeOut(300);
</script>
{{ error.text }}
<img src='{{ urlsoftware }}/resources/images/{{ error_image }}'></img>
<script>
var sound = new Howl({
src: ['{{ urlsoftware }}/resources/sounds/{{ error_sound }}'],
autoplay: true,
volume: 0.9,
});
sound.play();
</script>
<script>
$("#err").delay(5000).fadeOut(300);
</script>
{{ error.text }}
<img src='{{ urlsoftware }}/resources/images/{{ error_image }}'></img>
</div>
{% endif %}
<div class="container text-center" id="modulogin">
<form method="post">
<img alt="VVF" src="{{ urlsoftware }}/resources/images/logo.png" class="img-resposive"><br><br><br>
<input type="text" name="name" placeholder="{{ 'username'|t }}" required autocomplete="username" autofocus><br><br>
<input type="password" name="password" placeholder="{{ 'password'|t }}" required autocomplete="current-password"><br><br>
<input type="password" name="password" placeholder="{{ 'password'|t }}" required
autocomplete="current-password"><br><br>
<div>
<div class="form-check">
<input type="checkbox" name="remember_me" value='1' id="remember_me checkbox1" type="checkbox">
@ -36,4 +37,4 @@ $("#err").delay(5000).fadeOut(300);
</form>
</div>
<br><br>
{% endblock %}
{% endblock %}

View File

@ -1,55 +1,52 @@
{% extends "base.html" %}
{% block content %}
<br>
<div class="text-center">
<p>{{ 'Are you available in case of alert?'|t }}</p>
<button class="btn btn-lg btn-success " onclick="Activate('{{ user.id }}')">{{ 'Activate'|t }}</button>
<button class="btn btn-lg btn-danger" style="background-color: red" onclick="Deactivate('{{ user.id }}')">{{ 'Deactivate'|t }}</button>
</div>
<br>
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<br>
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
<br>
<div class="text-center">
<p>{{ 'Are you available in case of alert?'|t }}</p>
<button class="btn btn-lg btn-success " onclick="activate('{{ user.id }}')">{{ 'Activate'|t }}</button>
<button class="btn btn-lg btn-danger" style="background-color: red"
onclick="deactivate('{{ user.id }}')">{{ 'Deactivate'|t }}</button>
</div>
<br>
<br>
<script>
function activate(id) {
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 1,
token_list: "{{ token_list }}"
},
success: function (data) {
alert("{{ 'Thanks, %s, you have given your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
#href {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
function deactivate(id) {
$.ajax({
url: "resources/ajax/ajax_change_availability.php",
method: "POST",
data: {
change_id: id,
dispo: 0,
token_list: "{{ token_list }}"
},
success: function (data) {
alert("{{ 'Thanks, %s, you have removed your availability in case of alert.'|t|format(user.name) }}");
location.reload();
}
});
}
th, td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table {
box-shadow: 2px 2px 25px rgba(0,0,0,0.5);
border-radius: 15px;
margin: auto;
}
</style>
</script>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
@ -70,7 +67,7 @@
</tbody>
</table>
<script>
window.loadTable("list");
loadTable("list");
</script>
</div>

View File

@ -1,49 +1,26 @@
{% extends "base.html" %}
{% block content %}
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<style>
th, td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
#href {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
table {
overflow-x: scroll;
box-shadow: 2px 2px 25px rgba(0,0,0,0.5);
border-radius: 15px;
margin: auto;
}
</style>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Action'|t }}</th>
<th>{{ 'Interested'|t }}</th>
<th>{{ 'Made by'|t }}</th>
<th>{{ 'Datetime'|t }}</th>
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
window.loadTable("log");
</script>
<br>
<br>
{% endblock %}
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Action'|t }}</th>
<th>{{ 'Interested'|t }}</th>
<th>{{ 'Made by'|t }}</th>
<th>{{ 'Datetime'|t }}</th>
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
loadTable("log");
</script>
<br>
<br>
{% endblock %}

View File

@ -6,19 +6,6 @@
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<br>
<style>
th, td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table {
box-shadow: 2px 2px 25px rgba(0,0,0,0.5);
border-radius: 15px;
margin: auto;
}
</style>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
@ -39,7 +26,7 @@
</tbody>
</table>
<script>
window.loadTable("list", true, 20000, true);
loadTable("list", true, 20000, true);
</script>
</div>
<br>

View File

@ -2,95 +2,43 @@
{% block content %}
<script src="resources/dist/maps.js"></script>
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
#href {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
th, td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table {
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
border-radius: 5px;
margin: auto;
}
#new-search-area {
width: 100%;
clear: both;
padding-top: 20px;
padding-bottom: 20px;
}
#new-search-area input {
width: 600px;
font-size: 20px;
padding: 5px;
margin-right: 150px;
margin-left: 80px;
}
</style>
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<p style="text-align: center;">
<a id='add' class="pjax_disable" href="edit_service.php?add">{{ 'Add service'|t }}</a>
</p>
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Date'|t }}</th>
<th>{{ 'Code'|t }}</th>
<th>{{ 'Start time'|t }}</th>
<th>{{ 'End time'|t }}</th>
<th>{{ 'Chief'|t }}</th>
<th>{{ 'Drivers'|t }}</th>
<th>{{ 'People'|t }}</th>
<th>{{ 'Place'|t }}</th>
<th>{{ 'Notes'|t }}</th>
<th>{{ 'Type'|t }}</th>
{% if option('service_edit') %}
<th>{{ 'Edit'|t }}</th>
{% endif %}
{% if option('service_remove') %}
<th>{{ 'Remove'|t }}</th>
{% endif %}
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
window.loadTable("services", true, 120000);
</script>
</div>
<br>
<br>
{% endblock %}
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<p style="text-align: center;">
<a id='add' class="pjax_disable" href="edit_service.php?add">{{ 'Add service'|t }}</a>
</p>
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Date'|t }}</th>
<th>{{ 'Code'|t }}</th>
<th>{{ 'Start time'|t }}</th>
<th>{{ 'End time'|t }}</th>
<th>{{ 'Chief'|t }}</th>
<th>{{ 'Drivers'|t }}</th>
<th>{{ 'People'|t }}</th>
<th>{{ 'Place'|t }}</th>
<th>{{ 'Notes'|t }}</th>
<th>{{ 'Type'|t }}</th>
{% if option('service_edit') %}
<th>{{ 'Edit'|t }}</th>
{% endif %}
{% if option('service_remove') %}
<th>{{ 'Remove'|t }}</th>
{% endif %}
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
loadTable("services", true, 120000);
</script>
</div>
<br>
<br>
{% endblock %}

View File

@ -2,93 +2,41 @@
{% block content %}
<script src="resources/dist/maps.js"></script>
<style>
#add {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
#href {
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: bold 12px Arial, Helvetica, sans-serif;
color: #fff;
padding: 10px 20px;
border: solid 1px #0076a3;
background: #0095cd;
}
th, td {
border: 1px solid grey;
border-collapse: collapse;
padding: 5px;
}
table {
box-shadow: 0px 3px 15px rgba(0,0,0,0.5);
border-radius: 5px;
margin: auto;
}
#new-search-area {
width: 100%;
clear: both;
padding-top: 20px;
padding-bottom: 20px;
}
#new-search-area input {
width: 600px;
font-size: 20px;
padding: 5px;
margin-right: 150px;
margin-left: 80px;
}
</style>
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150" style="display: block; margin-left: auto; margin-right: auto;">
<br>
<p style="text-align: center;">
<a id='add' class="pjax_disable" href="edit_training.php?add">{{ 'Add training'|t }}</a>
</p>
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Date'|t }}</th>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Start time'|t }}</th>
<th>{{ 'End time'|t }}</th>
<th>{{ 'Chief'|t }}</th>
<th>{{ 'People'|t }}</th>
<th>{{ 'Place'|t }}</th>
<th>{{ 'Notes'|t }}</th>
{% if option('training_edit') %}
<th>{{ 'Edit'|t }}</th>
{% endif %}
{% if option('training_remove') %}
<th>{{ 'Remove'|t }}</th>
{% endif %}
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
window.loadTable("trainings", true, 120000);
</script>
</div>
<br>
<br>
<br>
<img alt="VVF" src="./resources/images/owner.png" width="150"
style="display: block; margin-left: auto; margin-right: auto;">
<br>
<p style="text-align: center;">
<a id='add' class="pjax_disable" href="edit_training.php?add">{{ 'Add training'|t }}</a>
</p>
<br>
<div id="list" style="overflow-x:auto;">
<table style="width: 90%; text-align:center;">
<thead>
<tr>
<th>{{ 'Date'|t }}</th>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Start time'|t }}</th>
<th>{{ 'End time'|t }}</th>
<th>{{ 'Chief'|t }}</th>
<th>{{ 'People'|t }}</th>
<th>{{ 'Place'|t }}</th>
<th>{{ 'Notes'|t }}</th>
{% if option('training_edit') %}
<th>{{ 'Edit'|t }}</th>
{% endif %}
{% if option('training_remove') %}
<th>{{ 'Remove'|t }}</th>
{% endif %}
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
<script>
loadTable("trainings", true, 120000);
</script>
</div>
<br>
<br>
{% endblock %}

View File

@ -5,11 +5,8 @@
<div id='list'>
</div>
<script>
$(document).ready(function() {
$( "#list" ).load("resources/ajax/ajax_user_details.php?user={{ view_user }}&"+Math.random());
/* setInterval(function() {
$( "#list" ).load("resources/ajax/ajax_user_details.php?user={{ view_user }}&"+Math.random());
}, 10000); */
});
$(document).ready(function () {
$("#list").load("resources/ajax/ajax_user_details.php?user={{ view_user }}&" + Math.random());
});
</script>
{% endblock %}
{% endblock %}