Verteilerlisten, Mailsystem

This commit is contained in:
aschwarz 2023-04-28 09:41:23 +02:00
parent 3d58070a69
commit c69b2b8b5e
16 changed files with 817 additions and 65 deletions

View File

@ -41,6 +41,19 @@ for ($i = 0; $i < sizeof($empfaenger); $i++) {
array_push($mail_bcc, "$row1[mail]");
}
}
if ($trenner[0] == 'V') {
$query2 = "select mail
from jumi_mailverteiler a, jumi_mailverteiler_entries b
where a.mvid=b.mvid
and b.mvid=$trenner[1]";
$result2 = $db->query($query2) or die("Cannot execute query");
while ($row2 = $result2->fetch_array()) {
array_push($mail_bcc, "$row2[mail]");
}
}
}
@ -56,29 +69,28 @@ function save_mail($mail)
## Wegen dieser Funktion, wurde PHP Version aktiviert. Siehe ../Hinweise_zu_php8.txt
#####################################################
/*
# Scritp um sich $path anzeigen zu lassen:
$mbox = imap_open("{imap.ionos.de:993/imap/ssl}", "info@ju-and-mi.de", "passwort", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
if($mbox){
echo "connect";
}else{
echo "fail";
}
$list = imap_getmailboxes($mbox, "{imap.ionos.de:993/imap/ssl}", "*");
if (is_array($list)) {
foreach ($list as $key => $val) {
echo "($key) ";
echo imap_utf7_decode($val->name) . ",";
echo "'" . $val->delimiter . "',";
echo $val->attributes . "<br />\n";
}
} else {
echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
}
imap_close($mbox);
*/
// # Script um sich $path anzeigen zu lassen:
// $mbox = imap_open("{imap.ionos.de:993/imap/ssl}", "info@ju-and-mi.de", "passwort", OP_HALFOPEN)
// or die("can't connect: " . imap_last_error());
// if($mbox){
// echo "connect";
// }else{
// echo "fail";
// }
// $list = imap_getmailboxes($mbox, "{imap.ionos.de:993/imap/ssl}", "*");
// if (is_array($list)) {
// foreach ($list as $key => $val) {
// echo "($key) ";
// echo imap_utf7_decode($val->name) . ",";
// echo "'" . $val->delimiter . "',";
// echo $val->attributes . "<br />\n";
// }
// } else {
// echo "imap_getmailboxes failed: " . imap_last_error() . "\n";
// }
//
// imap_close($mbox);
$path = "{imap.ionos.de:993/imap/ssl}Gesendete Objekte";
$imapStream = imap_open($path, $mail->Username, $mail->Password);
@ -110,7 +122,7 @@ try {
//$mail->SetFrom($_POST["userEmail"], $_POST["userName"]);
//$mail->AddReplyTo($_POST["userEmail"], $_POST["userName"]);
$mail->SetFrom("info@ju-and-mi.de", "Info JU & MI");
$mail->AddAddress("info@ju-and-mi.de", "Info JU & MI");
# $mail->AddAddress("info@ju-and-mi.de", "Info JU & MI");
$mail->AddReplyTo("info@ju-and-mi.de", "Info JU & MI");
//$mail->addCC('cc@example.com');
foreach ($mail_bcc as $empfbcc) {
@ -135,10 +147,10 @@ try {
if (save_mail($mail)) {
#echo "Message saved!";
}
echo "<p class='success'>Mail Sent Successfully.</p>";
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Mail wurde versendet!</div>|***|success';
}
catch (Exception $e) {
echo "<p class='error'>Message could not be sent. Mailer Error: {$mail->ErrorInfo}</p>";
echo "<div class='alert alert-danger'><i class='fa fa-fw fa-thumbs-down'></i> Es konnte <b>keine Mail</b> verschickt werden! Mailer Error: {$mail->ErrorInfo}</div>|***|error";
}
?>

View File

@ -0,0 +1,111 @@
<?php
require_once("../config.inc.php");
$function = $_POST['function'];
if ($function == 'verteilersave') {
if (isset($_POST['verteilername'])) {
$verteilername = $_POST['verteilername'];
}
$db = dbconnect();
$result = $db->query("SELECT count(*) Anz FROM jumi_mailverteiler WHERE upper(bezeichnung)=upper('$verteilername')");
$row = $result->fetch_array();
if ($verteilername == ''){ //verschlüsseltes Passwort überprüfen
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Verteiler darf nicht leer sein.</div>|***|error';
exit;
}else if ($row['Anz'] > 0){ //verschlüsseltes Passwort überprüfen
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Verteiler ist bereits vorhanden.</div>|***|error';
exit;
}else{
$sql1 = $db->query("INSERT INTO jumi_mailverteiler ( bezeichnung ) VALUES ( '$verteilername' )");
if($sql1){
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Der Verteiler wurde gespeichert!</div>|***|success';
exit;
}else{
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Verteiler wurde nicht gespeichert: Insert Fehler Datenbank.</div>|***|error';
exit;
}
}
}
if ($function == 'erfuser') {
if (isset($_POST['mvid'])) {
$mvid = $_POST['mvid'];
}
if (isset($_POST['mveid'])) {
$mveid = $_POST['mveid'];
}
$db = dbconnect();
$sql1 = $db->query("INSERT INTO jumi_mailverteiler_user_zuord ( mvid, mveid ) VALUES ( $mvid, $mveid )");
if($sql1){
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Der Benutzer wurde zugewiesen!</div>|***|success|***|'.$mvid;
exit;
}else{
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Benutzer wurde nicht zugewiesen: Insert Fehler Datenbank.</div>|***|error';
exit;
}
}
if ($function == 'deluser') {
if (isset($_POST['mvid'])) {
$mvid = $_POST['mvid'];
}
if (isset($_POST['mveid'])) {
$mveid = $_POST['mveid'];
}
$sql1 = $db->query("DELETE FROM jumi_mailverteiler_user_zuord WHERE mvid='$mvid' AND mveid='$mveid'");
if($sql1){
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Der Benutzer wurde gelöscht!</div>|***|success|***|'.$mvid;
exit;
}else{
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Benutzer wurde nicht gelöscht: DELETE Fehler Datenbank.</div>|***|error';
exit;
}
}
if ($function == 'delVerteiler') {
if (isset($_POST['mvid'])) {
$mvid = $_POST['mvid'];
}
$stmt1 = $db->query("DELETE FROM jumi_mailverteiler_user_zuord WHERE mvid= $mvid");
$stmt2 = $db->query("DELETE FROM jumi_mailverteiler WHERE mvid= $mvid");
if ($stmt1 AND $stmt2) {
echo '<div class="alert alert-success"><i class="fa fa-fw fa-thumbs-up"></i> Der Verteiler wurde gelöscht!</div>|***|success';
exit;
} else {
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-thumbs-down"></i> Der Verteiler wurde nicht gelöscht: DELETE Fehler Datenbank.</div>|***|error';
exit;
}
}
/*
if ($function == 'deleteQuestion') {
$id2 = $_POST['id2'];
$stmt1 = $db->query("DELETE FROM jumi_umfragen_antworten WHERE ufid = $id2");
$stmt2 = $db->query("DELETE FROM jumi_umfragen_fragen WHERE ufid = $id2");
# ggf. bereis Abstimmergebnisse löschen
# Sonst werden keine neue Fragen erfasst
# unset($_SESSION["umfrageerf_ufid"]);
if ($stmt1 and $stmt2) {
echo "Success";
} else {
echo "Error";
}
}
*/
?>

View File

@ -27,6 +27,18 @@ require_once "../language/german.inc.php";
$table_data[] = $row;
}
$smarty->assign('table_data', $table_data);
# Gespeicherte Verteiler
$query1 = "SELECT mvid, bezeichnung
FROM jumi_mailverteiler
ORDER BY mvid ASC";
$result1 = $db->query($query1) or die("Cannot execute query");
while ($row1 = $result1->fetch_array()) {
$table_data1[] = $row1;
}
$smarty->assign('table_data1', $table_data1);
$smarty->assign('action', "$action");
$smarty->display("modern/dashboard/$templatename");

View File

@ -0,0 +1,47 @@
<?php
if (!isset($_SESSION)) {
session_start();
}
include_once '../classes/TestProjektSmarty.class_subdir.php';
$_SESSION['cur_page'] = $_SERVER['PHP_SELF']; // Fals man Seite direkt aufruft und Autologin funktioniert
require_once("../config.inc.php");
$templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html";
$smarty = new SmartyAdmin();
if(!rechte(basename(__FILE__), $uid)){
echo "<meta http-equiv=\"refresh\" content=\"0; URL=error.php\">";
exit;
}
require_once "../language/german.inc.php";
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = '';
}
if ($action == '') {
# Gespeicherte Werte
$query = "SELECT mvid, bezeichnung
FROM jumi_mailverteiler
ORDER BY mvid ASC";
$result = $db->query($query) or die("Cannot execute query");
while ($row = $result->fetch_array()) {
$table_data[] = $row;
}
$smarty->assign('table_data', $table_data);
}
$smarty->assign('action', "$action");
$smarty->display("$template/dashboard/$templatename");
?>

View File

@ -0,0 +1,65 @@
<?php
if (!isset($_SESSION)) {
session_start();
}
include_once '../classes/TestProjektSmarty.class_subdir.php';
require_once("../config.inc.php");
$templatename = substr(basename($_SERVER['PHP_SELF']), 0, -3) . "html";
$smarty = new SmartyAdmin();
if(!rechte('verteilerlisten.php', $uid)){
echo "<meta http-equiv=\"refresh\" content=\"0; URL=error.php\">";
exit;
}
require_once "../language/german.inc.php";
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = '';
}
if ($action == '') {
if (isset($_GET['edit'])) {
$mvid = $_GET['edit'];
$smarty->assign('verteiler_edit', $mvid);
}
$result_head = $db->query("SELECT bezeichnung FROM jumi_mailverteiler WHERE mvid=$mvid");
$row_head = $result_head->fetch_array();
$smarty->assign('verteiler_bezeichnung', $row_head['bezeichnung']);
# Nicht zugewiesene User
$query = "SELECT mveid, vorname, nachname
FROM jumi_mailverteiler_entries
WHERE mveid NOT IN (SELECT mveid FROM jumi_mailverteiler_user_zuord WHERE mvid=$mvid)
ORDER BY nachname ASC";
$result = $db->query($query) or die("Cannot execute query");
while ($row = $result->fetch_array()) {
$table_data[] = $row;
}
$smarty->assign('table_data', $table_data);
# Zugewiesene Rechte
$query1 = "SELECT mveid, vorname, nachname
FROM jumi_mailverteiler_entries
WHERE mveid IN (SELECT mveid FROM jumi_mailverteiler_user_zuord WHERE mvid=$mvid)
ORDER BY nachname ASC";
$result1 = $db->query($query1) or die("Cannot execute query1");
while ($row1 = $result1->fetch_array()) {
$table_data1[] = $row1;
}
$smarty->assign('table_data1', $table_data1);
}
$smarty->assign('action', "$action");
$smarty->display("$template/dashboard/$templatename");
?>

View File

@ -1,7 +1,7 @@
$(document).ready(function (e){
$("#frmEnquiry").on('submit',(function(e){
e.preventDefault();
$('#loader-icon').show();
//$('#loader-icon').show();
var valid;
valid = validateContact();
if(valid) {
@ -12,10 +12,21 @@
contentType: false,
cache: false,
processData:false,
success: function(data){
//alert(data);
$("#mail-status").html(data);
$('#loader-icon').hide();
success: function(result){
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
//https://developer.snapappointments.com/bootstrap-select/methods/#selectpickertoggle
$('.selectpicker').selectpicker('deselectAll');
document.getElementById("subject").value ="";
tinyMCE.get(0).setContent("");
}
$('#msg').show().delay(5000).fadeOut(500);
$('#msg').html(a[0]);
}
//alert(data);
//$("#mail-status").html(data);
//$('#loader-icon').hide();
},
error: function(){}
@ -29,7 +40,11 @@
$(".info").html('');
// $("#userName").removeClass("invalid");
// $("#userEmail").removeClass("invalid");
$("#empfaenger").removeClass("invalid");
// $('.selectpicker').removeClass('invalid').selectpicker('setStyle');
//https://github.com/snapappointments/bootstrap-select/issues/1891
$('.selectpicker').removeClass('invalid').selectpicker('setStyle').parent().removeClass('invalid ');
$("#subject").removeClass("invalid");
$("#content").removeClass("invalid");
// Bei TinyMCE geht das anders
@ -38,8 +53,7 @@
t.getBody().style.backgroundColor = color;
if($("#empfaenger").val()=='') {
$("#empfaenger").addClass("invalid");
$("#empfaenger").attr("title","Required");
$('.selectpicker').addClass('invalid').selectpicker('setStyle');
valid = false;
}
/*
@ -55,7 +69,6 @@
}
*/
if(!$("#subject").val()) {
$("#subject").addClass("invalid");
$("#subject").attr("title","Required");
valid = false;

View File

@ -14,10 +14,10 @@ function rollesave(){
if(a[1]=="success"){
document.getElementById("rollenname").value ="";
$(document).ajaxStop(function(){
window.location = "?";
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
@ -192,10 +192,10 @@ function delRole(rid) {
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
window.location = "?";
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(10000).fadeOut(500);
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},

View File

@ -0,0 +1,130 @@
function verteilersave(){
var verteilername = document.getElementById("verteilername").value;
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'verteilersave',
'verteilername': verteilername
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
document.getElementById("verteilername").value ="";
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function erfuser(mveid, mvid) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'erfuser',
'mveid': mveid,
'mvid': mvid
},
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('verteileruserzuordnung.php?edit='+value, function() {
$("#ZuordnungModal").modal("show");
});
});
}
$('#msg').show().delay(1000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
function deluser(mveid, mvid) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'deluser',
'mveid': mveid,
'mvid': mvid
},
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('verteileruserzuordnung.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 delVerteiler(mvid) {
r = confirm('Verteiler wirklich löschen?');
if (r) {
$.ajax({
type: 'POST',
url: '../controller/admin_verteilerlisten.php',
data: {
'function': 'delVerteiler',
'mvid': mvid
},
success: function(result) { //we got the response
if(result!=''){
var a = result.split('|***|');
if(a[1]=="success"){
$(document).ajaxStop(function(){
setTimeout(() => { window.location = "?"; }, 2000);
});
}
$('#msg').show().delay(2000).fadeOut(500);
$('#msg').html(a[0]);
}
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}

6
js/select/bootstrap-select.min.css vendored Normal file

File diff suppressed because one or more lines are too long

8
js/select/bootstrap-select.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
js/select/defaults-de_DE.min.js vendored Normal file
View File

@ -0,0 +1,7 @@
/*!
* Bootstrap-select v1.14.0-beta3 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2022 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"Bitte w\xe4hlen...",noneResultsText:"Keine Ergebnisse f\xfcr {0}",countSelectedText:function(e,t){return 1==e?"{0} Element ausgew\xe4hlt":"{0} Elemente ausgew\xe4hlt"},maxOptionsText:function(e,t){return[1==e?"Limit erreicht ({n} Element max.)":"Limit erreicht ({n} Elemente max.)",1==t?"Gruppen-Limit erreicht ({n} Element max.)":"Gruppen-Limit erreicht ({n} Elemente max.)"]},selectAllText:"Alles ausw\xe4hlen",deselectAllText:"Nichts ausw\xe4hlen",multipleSeparator:", "}});

View File

@ -3,7 +3,8 @@
<html lang="de">
<head>
<title>JU & MI Mailversand</title>
<link rel="stylesheet" href="../jquery/jquery.timepicker.min.css">
<!-- Latest compiled and minified CSS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.14.0-beta3/dist/js/i18n/defaults-*.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
@ -14,8 +15,21 @@
<script src="../jquery/jquery-3.4.1.min.js"></script>
<link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css">
<link href = "../jquery/jquery-ui-themes-1.13.2/jquery-ui.css" rel = "stylesheet">
<!-- SelectBox: https://github.com/snapappointments/bootstrap-select-->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="../js/select/bootstrap-select.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="../js/select/bootstrap-select.min.js"></script>
<!-- (Optional) Latest compiled and minified JavaScript translation files -->
<script src="../js/select/defaults-de_DE.min.js"></script>
<style>
#frmEnquiry div label {
.bootstrap-select.invalid>.dropdown-toggle {
background: #fbf2f2;
}
.bootstrap-select>.dropdown-toggle {
border: #D2D2D2 1px solid;
}
#frmEnquiry div label {
margin-left: 5px
}
.InputBox:focus {
@ -61,7 +75,6 @@
border: #e8e0e0 1px solid;
}
</style>
</head>
<body class="sb-nav-fixed">
<div id="navtop"></div>
@ -80,8 +93,8 @@
<div id="navleft"></div>
<div id="layoutSidenav_content">
<main>
<!--Anwendung-->
<script src="../js/components/admin_phpmailer.js"></script>
<!--Anwendung-->
<script src="../js/components/admin_phpmailer.js"></script>
<div class="container-fluid">
<div class="card">
<div class="card-header">
@ -93,29 +106,38 @@
<div class="row">
<form id="frmEnquiry" action="" method="post" enctype='multipart/form-data'>
<!--
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<input type="text" name="userName" id="userName" class="form-control InputBox" placeholder="Name">
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<input type="text" name="userName" id="userName" class="form-control InputBox" placeholder="Name">
</div>
</div>
</div>
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<input type="text" name="userEmail" id="userEmail" class="form-control InputBox" placeholder="Email">
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<input type="text" name="userEmail" id="userEmail" class="form-control InputBox" placeholder="Email">
</div>
</div>
</div>
-->
-->
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<label>Empfängerkreis</label><br />
<select name="empfaenger[]"class="form-control InputBox" id="empfaenger" multiple="multiple">
{section name=table_data loop=$table_data}
<option value="S-{$table_data[table_data].rid}">{$table_data[table_data].bezeichnung}</option>
{/section}
<option value="C-1">ChorsängerInnen</option>
</select>
<select name="empfaenger[]"class="form-control InputBox selectpicker" id="empfaenger" multiple="multiple" data-live-search="true">
<optgroup label="Systemintern">
{section name=table_data loop=$table_data}
<option value="S-{$table_data[table_data].rid}">{$table_data[table_data].bezeichnung}</option>
{/section}
</optgroup>
<optgroup label="Chor">
<option value="C-1">ChorsängerInnen</option>
</optgroup>
<optgroup label="Verteilerlisten">
{section name=table_data1 loop=$table_data1}
<option value="V-{$table_data1[table_data1].mvid}">{$table_data1[table_data1].bezeichnung}</option>
{/section}
</optgroup>
</optgroup>
</select>
</div>
</div>
<div class="row mt-2 mt-sm-4 mb-2 mb-sm-4">
<div class="col-12">
<input type="text" name="subject" id="subject" class="form-control InputBox" placeholder="Betreff">
@ -138,11 +160,12 @@
</div>
</div>
<div id="msg"></div>
<div id="msg1"></div>
</form>
<div id="loader-icon" style="display: none;">
<img src="../media/LoaderIcon.gif" />
</div>
<!--
<div id="loader-icon" style="display: none;">
<img src="../media/LoaderIcon.gif" />
</div>
-->
</div>
</main>
<!--
@ -167,3 +190,4 @@
</body>
</html>
{/if}

View File

@ -2,6 +2,7 @@
<!doctype html>
<html lang="de">
<head>
<title>JU & MI Rollen erfassen</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

View File

@ -57,7 +57,7 @@
<div class="card">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Nicht zugewiesene Lieder
Nicht zugewiesene Benutzer
</div>
<div class="card-body">
<table id="notassigned" class="table table-striped table-bordered table-responsive table-hover" >

View File

@ -0,0 +1,165 @@
{if $action == ''}
<!doctype html>
<html lang="de">
<head>
<title>JU & MI Verteilerlisten</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard -->
<link href="css/styles.css" rel="stylesheet" />
<!-- icons in nav-->
<script src="js/all.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css">
<script src="../jquery/jquery-3.4.1.min.js"></script>
<!-- jQuery UI CSS
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
-->
<script src="../jquery/jquery-ui.js"></script>
<style>
.btn-group > .btn{
margin-bottom:20px;
border-radius:20px !important;
}
</style>
<script type="text/javascript">
{literal}
function keysave(ele) {
if(event.key === 'Enter') {
verteilersave();
}
}
{/literal}
</script>
<style type="text/css">
.ui-sortable tr {
cursor:pointer;
}
.ui-sortable tr:hover {
background:rgba(244,251,17,0.45);
}
</style>
<script>
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
});
</script>
</head>
<!--<body onload="if(document.erfassen)document.erfassen.{$umfrageerf_focus}.focus();return false;">-->
<body class="sb-nav-fixed">
<div id="navtop"></div>
{literal}
<script>
$(function(){
// im Navbar muss der toggle in der Callbackfunktion definiert werden. Sonst findet jquery getelementbyID nicht
$("#navtop").load('navtop.php', null, function(){$.getScript('js/scripts.js');});
$("#navleft").load("nav.php");
$("#footer").load("footer.php");
});
</script>
{/literal}
<div id="layoutSidenav">
<!-- Navigation left -->
<div id="navleft"></div>
<div id="layoutSidenav_content">
<main>
<!--Anwendung-->
<script src="../js/components/admin_verteilerlisten.js"></script>
<div class="container-fluid">
<div class="card">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Verteilerlisten
</div>
<div class="row mt-1 mt-sm-1 mb-1 mb-sm-1">
<div class="col-4 col-md-4">Verteilerliste:</div>
<div class="col-8 col-md-8"><input class="form-control" type="text" name="verteilername" id="verteilername" size="60" onkeydown="keysave(this)"></div>
</div>
</div>
<div class="row">
<div class="row col-3"></div>
<div class="row col-6"><button class="btn btn-primary btn-sm mt-3" id="save" onclick="verteilersave();">Speichern</button></div>
<div class="row col-3"></div>
</div>
<br>
<div class="card">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Vorhandene Verteiler
</div>
<div class="card-body">
<div class="row mt-0 mt-sm-1 mb-0 mb-sm-1">
<div class="row mt-0 mb-0">
<div class="d-none col-md-7 d-md-block"><b>Rolle</b></div>
<div class="d-none col-md-5 d-md-block"><b>Aktion</b></div>
</div>
{section name=table_data loop=$table_data}
<div class="row mt-0 mt-sm-1 mb-0 mb-sm-1">
<div class="col-6 col-md-7">{$table_data[table_data].bezeichnung}</div>
<div class="col-6 col-md-5">
<a class="btn btn-success btn-rounded btn-icon btn-sm" data-bs-toggle="modal" value="{$table_data[table_data].mvid}|verteileruserzuordnung.php" onclick="ShowZuordnung(this)" data-bs-target="#ZuordnungModal"><i class="fa fa-user" style="width:18px;"></i></a>
<a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delVerteiler({$table_data[table_data].mvid})"><i class="fa fa-trash" style="width:18px;"></i></a>
</div>
</div>
{/section}
<!-- Modal -->
<div class="modal" id="ZuordnungModal" tabindex="-1" aria-labelledby="ZuordnungModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<!--<h5 class="modal-title" id="ZuordnungModalLabel">Rollenübersicht</h5>-->
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<!--<button type="button" class="btn btn-primary">Save changes</button>-->
</div>
</div>
</div>
</div>
<!-- Lösen Sie das Modal mit einem Button aus -->
{literal}
<script>
function ShowZuordnung(a){
let receive = a.getAttribute("value");
var a = receive.split('|');
var value = a[0];
var file = a[1];
$( '.modal-body' ).load( file+'?edit='+value , function () {
$( '#ZuordnungModal' ).modal({show: true });
});
}
</script>
{/literal}
</div>
</div>
</div>
<div id="msg"></div>
</main>
<!--
<button type="button" class="btn btn-primary" data-bs-toggle="popover" title="Popover Header" data-bs-content="Some content inside the popover">
Toggle popover
</button>
-->
<!-- footer -->
<div id="footer"></div>
</div>
</div>
<!--
<script>
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
</script>
-->
</body>
</html>
{/if}

View File

@ -0,0 +1,151 @@
{if $action == ''}
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../bootstrap/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<!-- nochmals bootstrap.css mit Erweiterungen vom Dashboard -->
<link href="css/styles.css" rel="stylesheet" />
<!-- icons in nav-->
<script src="js/all.js" crossorigin="anonymous"></script>
<!-- data Table: https://datatables.net/ -->
<script src="../bootstrap/data-table/jquery.min.js"></script>
<link rel="stylesheet" href="../bootstrap/data-table/dataTables.bootstrap5.min.css"></style>
<link rel="stylesheet" href="../bootstrap/data-table/rowReorder.dataTables.min.css"></style>
<script type="text/javascript" src="../bootstrap/data-table/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/dataTables.rowReorder.min.js"></script>
<script type="text/javascript" src="../bootstrap/data-table/dataTables.bootstrap5.min.js"></script>
<link rel="stylesheet" href="../bootstrap/node_modules/bootstrap-icons/font/bootstrap-icons.css">
<script src="../jquery/jquery-3.4.1.min.js"></script>
<!-- jQuery UI CSS
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
-->
<script src="../jquery/jquery-ui.js"></script>
<style>
.btn-group > .btn{
margin-bottom:20px;
border-radius:20px !important;
}
.ui-sortable tr {
cursor:pointer;
}
.ui-sortable tr:hover {
background:rgba(244,251,17,0.45);
}
.table>:not(caption)>*>* {
padding: 0.1rem 0.1rem;
}
p {
margin: 0;
}
</style>
</head>
<!--<body onload="if(document.erfassen)document.erfassen.{$umfrageerf_focus}.focus();return false;">-->
<body class="sb-nav-fixed">
<main>
<!--Anwendung-->
<script src="../js/components/admin_verteilerlisten.js"></script>
<p class="text-center"><b>{$verteiler_bezeichnung}</b></p>
<div class="container-fluid">
<div class="card">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Nicht zugewiesene Personen
</div>
<div class="card-body">
<table id="notassigned" class="table table-striped table-bordered table-responsive table-hover" >
<thead class="d-none">
<tr>
<th>Vorname</th>
<th>Nachname</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>
{section name=table_data loop=$table_data}
<tr>
<td>{$table_data[table_data].vorname}</td>
<td>{$table_data[table_data].nachname}</td>
<td>
<p class="text-center">
<a class="btn btn-success btn-rounded btn-icon btn-sm" onclick="erfuser({$table_data[table_data].mveid},{$verteiler_edit})"><i class="fa-solid fa-plus" style="width:18px;"></i></a>
</p>
</td>
</tr>
{/section}
</tbody>
</table>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Zugewiesene Personen
</div>
<div class="card-body">
<table id="assigned" class="table table-striped table-bordered table-responsive table-hover" >
<thead class="d-none">
<tr>
<th>Vorname</th>
<th>Nachname</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>
{section name=table_data1 loop=$table_data1}
<tr>
<td>{$table_data1[table_data1].vorname}</td>
<td>{$table_data1[table_data1].nachname}</td>
<td>
<p class="text-center">
<a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="deluser({$table_data1[table_data1].mveid},{$verteiler_edit})"><i class="fa-solid fa-minus" style="width:18px;"></i></a>
</p>
</td>
</tr>
{/section}
</tbody>
</table>
</div>
</div>
<div id="msg"></div>
</main>
</div>
<script src="../bootstrap/node_modules/move-js/move.js"></script>
<link href="../bootstrap/dist/scrollable-tabs.min.css" rel="stylesheet">
<script src="../bootstrap/dist/scrollable-tabs.min.js"></script>
</body>
<script>
$(document).ready(function(){
var table = new DataTable('#notassigned', {
rowReorder: true,
pageLength: 5,
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/de-DE.json',
search: "",
lengthMenu: "_MENU_ Zeilen",
},
});
var table2 = new DataTable('#assigned', {
rowReorder: true,
pageLength: 5,
language: {
url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/de-DE.json',
search: "",
lengthMenu: "_MENU_ Zeilen",
},
});
});
</script>
</html>
{/if}