reedited sweetalert version changes

This commit is contained in:
lukas-heiligenbrunner 2020-04-14 16:55:09 +02:00
parent 54e2cd7856
commit 1a481db4dd
8 changed files with 49 additions and 58 deletions

View File

@ -416,7 +416,7 @@
<!-- Bootstrap 4 -->
<script src="lib/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<!--<script src="lib/AdminLTE/dist/js/adminlte.js"></script>-->
<script src="lib/AdminLTE/dist/js/adminlte.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<!-- DataTables -->

View File

@ -3,19 +3,18 @@
<head>
<meta charset="utf-8">
<title>Login Page</title>
<!--Made with love by Mutiullah Samim -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="lib/bootstrap.min.css">
<!-- jQuery library -->
<script src="lib/jquery.min.js"></script>
<script src="lib/AdminLTE/plugins/jquery/jquery.min.js"></script>
<!-- Popper JS -->
<script src="lib/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="lib/bootstrap.min.js"></script>
<script src="lib/AdminLTE/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--Fontawesome CDN-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"

View File

@ -63,7 +63,7 @@ class Dashboard {
console.log(data);
if (data.status == "inserted") {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully created city!',
html: 'This alert closes automatically.',
timer: 1000,
@ -74,7 +74,7 @@ class Dashboard {
_this.reloadtable();
} else if (data.status == "exists") {
Swal.fire({
type: "warning",
icon: "warning",
title: 'Name already exists in db',
html: 'Close popup.',
}).then((result) => {
@ -179,7 +179,7 @@ class Dashboard {
$.post('/senddata/newdate', 'action=newdate&cityname=' + cityname.html() + "&zone=" + zone.html() + "&wastetype=" + wastetype.html() + "&date=" + date.val(), function (data) {
if (data.status == "success") {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully created Date!',
html: 'This alert closes automatically.',
timer: 1000,
@ -195,7 +195,7 @@ class Dashboard {
_this.reloadDateTable();
} else if (data.status == "citydoesntexist") {
Swal.fire({
type: "warning",
icon: "warning",
title: 'city name doesnt exist',
html: 'Close popup.',
}).then((result) => {
@ -275,7 +275,7 @@ class Dashboard {
console.log(data);
if (data.status === "success") {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully deleted city!',
html: 'This alert closes automatically.',
timer: 1000,
@ -286,7 +286,7 @@ class Dashboard {
reloadtable();
} else if (data.status === "dependenciesnotdeleted") {
Swal.fire({
type: "warning",
icon: "warning",
title: 'This city is a dependency of a date',
html: 'Do you want do delete it anyway with all dependencies?',
}).then((result) => {
@ -302,7 +302,7 @@ class Dashboard {
_this.citytable = $("#example2").DataTable();
} else if (data.query == "nodbconn") {
Swal.fire({
type: "error",
icon: "error",
title: 'No connection to Database',
html: 'Setup DB here --> <a href="index.html">click<a/>.',
}).then((result) => {
@ -345,7 +345,7 @@ class Dashboard {
console.log(data);
if (data.status == "success") {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully deleted city!',
html: 'This alert closes automatically.',
timer: 1000,
@ -356,7 +356,7 @@ class Dashboard {
reloadDateTable();
} else if (data.status == "dependenciesnotdeleted") {
Swal.fire({
type: "warning",
icon: "warning",
title: 'This city is a dependency of a date',
html: 'Do you want do delete it anyway with all dependencies?',
}).then((result) => {

View File

@ -124,7 +124,7 @@ class Device {
$.post('/senddata/Devicedata', 'action=addtodb&deviceid=' + id + '&cityname=' + cityname + '&zonename=' + zone + '&wastetype=' + wastetype, function (data) {
if (data.success) {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully configured!',
html: 'This alert closes added.',
timer: 1000,
@ -157,7 +157,7 @@ class Device {
console.log(data);
if (data.status === "success") {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully deleted city!',
html: 'This alert closes automatically.',
timer: 1000,
@ -168,7 +168,7 @@ class Device {
_this.reloadDevices();
} else if (data.status === "dependenciesnotdeleted") {
Swal.fire({
type: "warning",
icon: "warning",
title: 'This city is a dependency of a date',
html: 'Do you want do delete it anyway with all dependencies?',
}).then((result) => {
@ -261,7 +261,7 @@ class Device {
$.post('/senddata/Devicedata', 'action=savetodb&deviceid=' + id + '&cityname=' + cityname + '&zonename=' + zone + '&wastetype=' + wastetype + '&devicename=' + devicename + '&devicelocation=' + devicelocation, function (data) {
if (data.success) {
Swal.fire({
type: "success",
icon: "success",
title: 'Successfully configured!',
html: 'This alert closes automatically.',
timer: 1000,

View File

@ -10,7 +10,7 @@ $(document).ready(function () {
console.log(data);
if (data.status == "nodbconn"){
Swal.fire({
type: "error",
icon: "error",
title: 'No connection to Database',
html: 'Setup DB here --> <a href="index.html">click<a/>.',
}).then((result) => {

View File

@ -1,37 +1,38 @@
$(document).ready(function() {
$('#loginbtn').click(function(e) {
e.preventDefault();
console.log("clicked login button");
var username = $("#usernamefield")[0].value;
var firstname = $("#firstnamefield")[0].value;
var lastname = $("#lastnamefield")[0].value;
var email = $("#emailfield")[0].value;
var password = $("#passfield")[0].value;
var replypassword = $("#replpassfield")[0].value;
$(document).ready(function () {
$('#loginbtn').click(function (e) {
e.preventDefault();
console.log("clicked login button");
var username = $("#usernamefield")[0].value;
var firstname = $("#firstnamefield")[0].value;
var lastname = $("#lastnamefield")[0].value;
var email = $("#emailfield")[0].value;
var password = $("#passfield")[0].value;
var replypassword = $("#replpassfield")[0].value;
if (password != replypassword) {
console.log("passwords doesnt match");
}else {
$.post('/senddata/registerpost','username='+username+
'&firstname='+firstname+
'&lastname='+lastname+
'&email='+email+
'&password='+password,function(data){
if (password != replypassword) {
console.log("passwords doesnt match");
} else {
$.post('/senddata/registerpost',
'username=' + username +
'&firstname=' + firstname +
'&lastname=' + lastname +
'&email=' + email +
'&password=' + password, function (data) {
console.log(data);
console.log(data);
if (data.accept == true) {
console.log("successfully registered!");
$("#successbar").show();
if (data.accept == true) {
console.log("successfully registered!");
$("#successbar").show();
setTimeout(function() {
window.location = 'index.html';
},3000);
}else {
console.log("error!");
$("#errorbar").show();
setTimeout(function () {
window.location = 'index.html';
}, 3000);
} else {
console.log("error!");
$("#errorbar").show();
}
}, 'json');
}
},'json');
}
});
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long