PHPMailer

This commit is contained in:
aschwarz
2023-04-27 17:15:50 +02:00
parent de6abfa26c
commit 1235a0e270
167 changed files with 32558 additions and 22071 deletions

View File

@ -1,169 +1,169 @@
function checkUser(){
var mail = document.getElementById("mail").value;
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'checkuser',
'mail': mail
},
success: function(result) { //we got the response
if(result!=''){
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(result);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function membersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var bemerkung =tinyMCE.get('bemerkung').getContent()
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var singstimme = $("#singstimme").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'membersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'singstimme': singstimme,
'bemerkung': bemerkung
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
tinymce.get("bemerkung").setContent("");
var elements = document.getElementById("singstimme").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
/*
function userupdate(uid){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var pwdback = document.getElementById("pwdback");
if(pwdback.checked == true){
var var_pwdback = 1;
}else{
var var_pwdback = 0;
}
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'userupdate',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen,
'pwdback': var_pwdback,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function disableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'disableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function enableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'enableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function checkUser(){
var mail = document.getElementById("mail").value;
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'checkuser',
'mail': mail
},
success: function(result) { //we got the response
if(result!=''){
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(result);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function membersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var bemerkung =tinyMCE.get('bemerkung').getContent()
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var singstimme = $("#singstimme").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'membersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'singstimme': singstimme,
'bemerkung': bemerkung
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
tinymce.get("bemerkung").setContent("");
var elements = document.getElementById("singstimme").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
/*
function userupdate(uid){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var pwdback = document.getElementById("pwdback");
if(pwdback.checked == true){
var var_pwdback = 1;
}else{
var var_pwdback = 0;
}
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'userupdate',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen,
'pwdback': var_pwdback,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function disableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'disableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function enableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_member.php',
data: {
'function': 'enableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
*/

View File

@ -1,32 +1,32 @@
function changepwd(){
var password = document.getElementById("password").value;
var password_new1 = document.getElementById("password_new1").value;
var password_new2 = document.getElementById("password_new2").value;
$.ajax({
type: 'POST',
url: '../controller/admin_changepwd.php',
data: {
'function': 'changepwd',
'password': password,
'password_new1': password_new1,
'password_new2': password_new2
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("password").value ="";
document.getElementById("password_new1").value ="";
document.getElementById("password_new2").value ="";
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
function changepwd(){
var password = document.getElementById("password").value;
var password_new1 = document.getElementById("password_new1").value;
var password_new2 = document.getElementById("password_new2").value;
$.ajax({
type: 'POST',
url: '../controller/admin_changepwd.php',
data: {
'function': 'changepwd',
'password': password,
'password_new1': password_new1,
'password_new2': password_new2
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("password").value ="";
document.getElementById("password_new1").value ="";
document.getElementById("password_new2").value ="";
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}

View File

@ -1,163 +1,163 @@
function checkUser(){
var mail = document.getElementById("mail").value;
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'checkuser',
'mail': mail
},
success: function(result) { //we got the response
if(result!=''){
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(result);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function usersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'usersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
var elements = document.getElementById("rollen").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function userupdate(uid){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var pwdback = document.getElementById("pwdback");
if(pwdback.checked == true){
var var_pwdback = 1;
}else{
var var_pwdback = 0;
}
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'userupdate',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen,
'pwdback': var_pwdback,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function disableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'disableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function enableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'enableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
function checkUser(){
var mail = document.getElementById("mail").value;
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'checkuser',
'mail': mail
},
success: function(result) { //we got the response
if(result!=''){
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(result);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function usersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'usersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
var elements = document.getElementById("rollen").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function userupdate(uid){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var pwdback = document.getElementById("pwdback");
if(pwdback.checked == true){
var var_pwdback = 1;
}else{
var var_pwdback = 0;
}
//var my_data = $("form").serialize();
//komma getrennte Werte bei Mehrfachauswahl
var rollen = $("#rollen").val();
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'userupdate',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'rollen': rollen,
'pwdback': var_pwdback,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function disableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'disableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function enableuser(uid){
$.ajax({
type: 'POST',
url: '../controller/admin_create_user.php',
data: {
'function': 'enableuser',
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "edit_user.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}

View File

@ -1,20 +1,20 @@
function onClickDeleteSurvey(id) {
r = confirm('Gesamte Umfrage löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_edit.php',
data: {
'function': 'deleteSurvey',
'id': id
},
success: function(result) {
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
$(document).ajaxStop(function(){
window.location = "?";
});
}
});
}
function onClickDeleteSurvey(id) {
r = confirm('Gesamte Umfrage löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_edit.php',
data: {
'function': 'deleteSurvey',
'id': id
},
success: function(result) {
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
$(document).ajaxStop(function(){
window.location = "?";
});
}
});
}
}

View File

@ -1,114 +1,114 @@
function erf_multiple(){
var checkBox = document.getElementById("multiple");
if(checkBox.checked == true){
var var_multiple = 1;
}else{
var var_multiple = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'erfmultiple',
'multiple': var_multiple
},
success: function(result) { //we got the response
// if(result==-1){
// alert("Bitte zunächst die Frage erfassen");
// $(document).ajaxStop(function(){
// window.location = "?action=fragen&erfassen=1";
// });
// }else{
// $(document).ajaxStop(function(){
// window.location = "?action=fragen&erfassen=1";
// });
// }
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfassensave(){
var frage = document.getElementById("frage").value;
var antwort = document.getElementById("antwort").value;
var checkBox = document.getElementById("multiple");
if(checkBox.checked == true){
var var_multiple = 1;
}else{
var var_multiple = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'save',
'frage': frage,
'antwort': antwort,
'multiple': var_multiple
},
success: function(result) { //we got the response
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function onClickDelete(id) {
document.getElementById("antwort").value = "";
r = confirm('Antwort löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'delete',
'tabelle': 'jumi_umfragen_antworten',
'spalte': 'uaid',
'id': id
},
success: function(result) { //we got the response
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}
function onClickDeleteQuestion(id2) {
document.getElementById("frage").value = "";
document.getElementById("antwort").value = "";
r = confirm('Gesamte Frage löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'deleteQuestion',
'id2': id2
},
success: function(result) {
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
}
});
}
function erf_multiple(){
var checkBox = document.getElementById("multiple");
if(checkBox.checked == true){
var var_multiple = 1;
}else{
var var_multiple = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'erfmultiple',
'multiple': var_multiple
},
success: function(result) { //we got the response
// if(result==-1){
// alert("Bitte zunächst die Frage erfassen");
// $(document).ajaxStop(function(){
// window.location = "?action=fragen&erfassen=1";
// });
// }else{
// $(document).ajaxStop(function(){
// window.location = "?action=fragen&erfassen=1";
// });
// }
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfassensave(){
var frage = document.getElementById("frage").value;
var antwort = document.getElementById("antwort").value;
var checkBox = document.getElementById("multiple");
if(checkBox.checked == true){
var var_multiple = 1;
}else{
var var_multiple = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'save',
'frage': frage,
'antwort': antwort,
'multiple': var_multiple
},
success: function(result) { //we got the response
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function onClickDelete(id) {
document.getElementById("antwort").value = "";
r = confirm('Antwort löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'delete',
'tabelle': 'jumi_umfragen_antworten',
'spalte': 'uaid',
'id': id
},
success: function(result) { //we got the response
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}
function onClickDeleteQuestion(id2) {
document.getElementById("frage").value = "";
document.getElementById("antwort").value = "";
r = confirm('Gesamte Frage löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'deleteQuestion',
'id2': id2
},
success: function(result) {
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
$(document).ajaxStop(function(){
window.location = "?action=fragen&erfassen=1";
});
}
});
}
}

View File

@ -1,106 +1,106 @@
function login(){
var mail = document.getElementById("mail").value;
var password = document.getElementById("password").value;
var angemeldet_bleiben = document.getElementById("angemeldet_bleiben");
if(angemeldet_bleiben.checked == true){
var angemeldet_bleiben = 1;
}else{
var angemeldet_bleiben = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'login',
'mail': mail,
'password': password,
'angemeldet_bleiben': angemeldet_bleiben
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("mail").value ="";
document.getElementById("password").value ="";
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "index.php"; }, 1000);
});
}else{
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function passwortvergessen(){
var email = document.getElementById("mail_pwvergessen").value;
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'passwortvergessen',
'email': email
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("mail_pwvergessen").value ="";
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function resetpasswort(){
var password_new1 = document.getElementById("password_new1").value;
var password_new2 = document.getElementById("password_new2").value;
var code = document.getElementById("code").value;
var uid = document.getElementById("uid").value;
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'resetpasswort',
'password_new1': password_new1,
'password_new2': password_new2,
'code': code,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("password_new1").value ="";
document.getElementById("password_new2").value ="";
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "login.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
function login(){
var mail = document.getElementById("mail").value;
var password = document.getElementById("password").value;
var angemeldet_bleiben = document.getElementById("angemeldet_bleiben");
if(angemeldet_bleiben.checked == true){
var angemeldet_bleiben = 1;
}else{
var angemeldet_bleiben = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'login',
'mail': mail,
'password': password,
'angemeldet_bleiben': angemeldet_bleiben
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("mail").value ="";
document.getElementById("password").value ="";
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "index.php"; }, 1000);
});
}else{
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function passwortvergessen(){
var email = document.getElementById("mail_pwvergessen").value;
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'passwortvergessen',
'email': email
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("mail_pwvergessen").value ="";
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function resetpasswort(){
var password_new1 = document.getElementById("password_new1").value;
var password_new2 = document.getElementById("password_new2").value;
var code = document.getElementById("code").value;
var uid = document.getElementById("uid").value;
$.ajax({
type: 'POST',
url: '../controller/admin_login.php',
data: {
'function': 'resetpasswort',
'password_new1': password_new1,
'password_new2': password_new2,
'code': code,
'uid': uid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("password_new1").value ="";
document.getElementById("password_new2").value ="";
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "login.php"; }, 1000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}

View File

@ -1,294 +1,294 @@
function notenbuchsave() {
var notenbuch = document.getElementById("notenbuchname").value;
var anz_lizenz = document.getElementById("notenbuchlizenz").value;
var checkliz = document.getElementById("checkliz");
if (checkliz.checked == true) {
var var_checkliz = 1;
} else {
var var_checkliz = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'notenbuchsave',
'notenbuch': notenbuch,
'var_checkliz': var_checkliz,
'anz_lizenz': anz_lizenz
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
document.getElementById("notenbuchname").value = "";
window.location = "?";
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function notenbuchupdate(zsid) {
var notenbuch = document.getElementById("notenbuchname").value;
var anz_lizenz = document.getElementById("notenbuchlizenz").value;
var checkliz = document.getElementById("checkliz");
if (checkliz.checked == true) {
var var_checkliz = 1;
} else {
var var_checkliz = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'notenbuchupdate',
'notenbuch': notenbuch,
'var_checkliz': var_checkliz,
'zsid': zsid,
'anz_lizenz': anz_lizenz
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
document.getElementById("notenbuchname").value = "";
window.location = "?";
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function editNotenbuch(zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'editNotenbuch',
'zsid': zsid
},
success: function(result) { //we got the response
const obj = JSON.parse(result);
var bezeichnung = obj.bezeichnung;
var lizenzpflicht = obj.lizenzpflicht;
var anzahl_lizenz = obj.anzahl_lizenz;
document.getElementById('notenbuchname').value = bezeichnung;
document.getElementById('save').onclick = function() {
notenbuchupdate(zsid)
};
document.getElementById('save').innerText = 'Update';
if (lizenzpflicht == 1) {
document.getElementById("checkliz").checked = true;
document.getElementById('notenbuchlizenz').disabled = false;
document.getElementById('notenbuchlizenz').value = anzahl_lizenz;
} else {
document.getElementById("checkliz").checked = false;
document.getElementById('notenbuchlizenz').disabled = true;
document.getElementById('notenbuchlizenz').value = '';
}
// if(result!=''){
// var a = result.split('|***|');
// if(a[1]=="success"){
// setTimeout(function() {
// document.getElementById("notenbuchname").value ="";
// window.location = "?";
// }, 1000);
// }
// $('#msg').show().delay(1000).fadeOut(500);
// $('#msg').html(a[0]);
// }
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfzuordnung(jndid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'erfzuordnung',
'jndid': jndid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenbuchzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delzuordnung(jndid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delzuordnung',
'jndid': jndid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenbuchzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
}, 2000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfNotenUser(csid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'erfNotenUser',
'csid': csid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenuserzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delNotenUser(csid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delNotenUser',
'csid': csid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenuserzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delZusammenstellung(zsid) {
r = confirm('Zusammenstellung löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delZusammenstellung',
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function notenbuchsave() {
var notenbuch = document.getElementById("notenbuchname").value;
var anz_lizenz = document.getElementById("notenbuchlizenz").value;
var checkliz = document.getElementById("checkliz");
if (checkliz.checked == true) {
var var_checkliz = 1;
} else {
var var_checkliz = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'notenbuchsave',
'notenbuch': notenbuch,
'var_checkliz': var_checkliz,
'anz_lizenz': anz_lizenz
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
document.getElementById("notenbuchname").value = "";
window.location = "?";
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function notenbuchupdate(zsid) {
var notenbuch = document.getElementById("notenbuchname").value;
var anz_lizenz = document.getElementById("notenbuchlizenz").value;
var checkliz = document.getElementById("checkliz");
if (checkliz.checked == true) {
var var_checkliz = 1;
} else {
var var_checkliz = 0;
}
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'notenbuchupdate',
'notenbuch': notenbuch,
'var_checkliz': var_checkliz,
'zsid': zsid,
'anz_lizenz': anz_lizenz
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
document.getElementById("notenbuchname").value = "";
window.location = "?";
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function editNotenbuch(zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'editNotenbuch',
'zsid': zsid
},
success: function(result) { //we got the response
const obj = JSON.parse(result);
var bezeichnung = obj.bezeichnung;
var lizenzpflicht = obj.lizenzpflicht;
var anzahl_lizenz = obj.anzahl_lizenz;
document.getElementById('notenbuchname').value = bezeichnung;
document.getElementById('save').onclick = function() {
notenbuchupdate(zsid)
};
document.getElementById('save').innerText = 'Update';
if (lizenzpflicht == 1) {
document.getElementById("checkliz").checked = true;
document.getElementById('notenbuchlizenz').disabled = false;
document.getElementById('notenbuchlizenz').value = anzahl_lizenz;
} else {
document.getElementById("checkliz").checked = false;
document.getElementById('notenbuchlizenz').disabled = true;
document.getElementById('notenbuchlizenz').value = '';
}
// if(result!=''){
// var a = result.split('|***|');
// if(a[1]=="success"){
// setTimeout(function() {
// document.getElementById("notenbuchname").value ="";
// window.location = "?";
// }, 1000);
// }
// $('#msg').show().delay(1000).fadeOut(500);
// $('#msg').html(a[0]);
// }
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfzuordnung(jndid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'erfzuordnung',
'jndid': jndid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenbuchzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
}, 1000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delzuordnung(jndid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delzuordnung',
'jndid': jndid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
setTimeout(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenbuchzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
}, 2000);
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfNotenUser(csid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'erfNotenUser',
'csid': csid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenuserzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delNotenUser(csid, zsid) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delNotenUser',
'csid': csid,
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('notenuserzuordnung.php?edit=' + value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delZusammenstellung(zsid) {
r = confirm('Zusammenstellung löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_notenbuch.php',
data: {
'function': 'delZusammenstellung',
'zsid': zsid
},
success: function(result) { //we got the response
if (result != '') {
var a = result.split('|***|');
if (a[1] == "success") {
$(document).ajaxStop(function() {
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}

View File

@ -1,38 +1,38 @@
// Anders als sonst. Hier ist das Javascript auf der ID des Textfelds
// https://stackoverflow.com/questions/8300381/jquery-ui-autocomplete-how-to-send-post-data
$("#titel").autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
url: "../controller/admin_suche.php",
data: {
term: request.term,
function: "titel"
},
success: response,
dataType: 'json',
delay: 10
});
}
}, {
minLength: 2
});
$("#verlag").autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
url: "../controller/admin_suche.php",
data: {
term: request.term,
function: "verlag"
},
success: response,
dataType: 'json',
delay: 10
});
}
}, {
minLength: 2
// Anders als sonst. Hier ist das Javascript auf der ID des Textfelds
// https://stackoverflow.com/questions/8300381/jquery-ui-autocomplete-how-to-send-post-data
$("#titel").autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
url: "../controller/admin_suche.php",
data: {
term: request.term,
function: "titel"
},
success: response,
dataType: 'json',
delay: 10
});
}
}, {
minLength: 2
});
$("#verlag").autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
url: "../controller/admin_suche.php",
data: {
term: request.term,
function: "verlag"
},
success: response,
dataType: 'json',
delay: 10
});
}
}, {
minLength: 2
});

View File

@ -1,22 +1,22 @@
function onClickSaveParameter() {
var inputs = $(":input").serializeArray()
inputs = JSON.stringify(inputs)
$.ajax({
type: 'POST',
url: '../controller/admin_parameter.php',
data: {
'function': 'saveParameter',
'inputs': inputs
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
function onClickSaveParameter() {
var inputs = $(":input").serializeArray()
inputs = JSON.stringify(inputs)
$.ajax({
type: 'POST',
url: '../controller/admin_parameter.php',
data: {
'function': 'saveParameter',
'inputs': inputs
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}

View File

@ -0,0 +1,73 @@
$(document).ready(function (e){
$("#frmEnquiry").on('submit',(function(e){
e.preventDefault();
$('#loader-icon').show();
var valid;
valid = validateContact();
if(valid) {
$.ajax({
url: "../controller/admin_phpmailer.php",
type: "POST",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
success: function(data){
//alert(data);
$("#mail-status").html(data);
$('#loader-icon').hide();
},
error: function(){}
});
}
}));
function validateContact() {
var valid = true;
$(".InputBox").css('background-color','');
$(".info").html('');
// $("#userName").removeClass("invalid");
// $("#userEmail").removeClass("invalid");
$("#empfaenger").removeClass("invalid");
$("#subject").removeClass("invalid");
$("#content").removeClass("invalid");
// Bei TinyMCE geht das anders
var t = tinyMCE.get(0);
var color = '#fff';
t.getBody().style.backgroundColor = color;
if($("#empfaenger").val()=='') {
$("#empfaenger").addClass("invalid");
$("#empfaenger").attr("title","Required");
valid = false;
}
/*
if(!$("#userEmail").val()) {
$("#userEmail").addClass("invalid");
$("#userEmail").attr("title","Required");
valid = false;
}
if(!$("#userEmail").val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
$("#userEmail").addClass("invalid");
$("#userEmail").attr("title","Invalid Email");
valid = false;
}
*/
if(!$("#subject").val()) {
$("#subject").addClass("invalid");
$("#subject").attr("title","Required");
valid = false;
}
if($("#content").val()=='') {
var color = '#fbf2f2';
t.getBody().style.backgroundColor = color;
$("#content").attr("title","Required");
valid = false;
}
return valid;
}
});

View File

@ -1,207 +1,207 @@
function rollesave(){
var rollenname = document.getElementById("rollenname").value;
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'rollesave',
'rollenname': rollenname
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("rollenname").value ="";
$(document).ajaxStop(function(){
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfzuordnung(val) {
var param = val.split('|');
var meid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'erfzuordnung',
'meid': meid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('rollenzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delzuordnung(val) {
var param = val.split('|');
var meid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'delzuordnung',
'meid': meid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('rollenzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfuser(val) {
var param = val.split('|');
var uid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'erfuser',
'uid': uid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('userzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function deluser(val) {
var param = val.split('|');
var uid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'deluser',
'uid': uid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('userzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delRole(rid) {
r = confirm('Rolle löschen? Benutzer sind dann unzugeordnet!');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'delRole',
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}
function rollesave(){
var rollenname = document.getElementById("rollenname").value;
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'rollesave',
'rollenname': rollenname
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("rollenname").value ="";
$(document).ajaxStop(function(){
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfzuordnung(val) {
var param = val.split('|');
var meid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'erfzuordnung',
'meid': meid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('rollenzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delzuordnung(val) {
var param = val.split('|');
var meid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'delzuordnung',
'meid': meid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('rollenzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfuser(val) {
var param = val.split('|');
var uid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'erfuser',
'uid': uid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('userzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function deluser(val) {
var param = val.split('|');
var uid = param[0];
var rid = param[1];
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'deluser',
'uid': uid,
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
// Refresh Modal
var value = a[2];
// load the url and show modal on success
$("#ZuordnungModal .modal-body").load('userzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function delRole(rid) {
r = confirm('Rolle löschen? Benutzer sind dann unzugeordnet!');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_rollen.php',
data: {
'function': 'delRole',
'rid': rid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
window.location = "?";
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}

View File

@ -1,40 +1,40 @@
function membersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var alter16 = document.querySelector('input[name="alter16"]:checked').value;
//komma getrennte Werte bei Mehrfachauswahl
var singstimme = $("#singstimme").val();
$.ajax({
type: 'POST',
url: '../controller/selfregistration.php',
data: {
'function': 'membersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'singstimme': singstimme,
'alter16': alter16
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
var elements = document.getElementById("singstimme").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
function membersave(){
var vorname = document.getElementById("vorname").value;
var nachname = document.getElementById("nachname").value;
var mail = document.getElementById("mail").value;
var alter16 = document.querySelector('input[name="alter16"]:checked').value;
//komma getrennte Werte bei Mehrfachauswahl
var singstimme = $("#singstimme").val();
$.ajax({
type: 'POST',
url: '../controller/selfregistration.php',
data: {
'function': 'membersave',
'vorname': vorname,
'nachname': nachname,
'mail': mail,
'singstimme': singstimme,
'alter16': alter16
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("vorname").value ="";
document.getElementById("nachname").value ="";
document.getElementById("mail").value ="";
var elements = document.getElementById("singstimme").options;
for(var i = 0; i < elements.length; i++){
elements[i].selected = false;
}
}
$('#msg1').show().delay(10000).fadeOut(500);
$('#msg1').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}