diff --git a/controller/admin_notenbuch.php b/controller/admin_notenbuch.php index 5cef74b..104580f 100644 --- a/controller/admin_notenbuch.php +++ b/controller/admin_notenbuch.php @@ -42,10 +42,10 @@ if ($function == 'erfzuordnung') { $db = dbconnect(); $sql1 = $db->query("INSERT INTO jumi_noten_zusammenstellung_zuord ( jndid, zsid) VALUES ( $jndid, $zsid )"); if($sql1){ - echo '
Das Recht wurde zugewiesen!
|***|success|***|'.$jndid; + echo '
Die Noten wurden zugewiesen!
|***|success|***|'.$jndid; exit; }else{ - echo '
Das Recht wurde nicht zugewiesen: Insert Fehler Datenbank.
|***|error'; + echo '
Die Noten wurden nicht zugewiesen: Insert Fehler Datenbank.
|***|error'; exit; } } @@ -60,27 +60,27 @@ if ($function == 'delzuordnung') { $sql1 = $db->query("DELETE FROM jumi_noten_zusammenstellung_zuord WHERE jndid='$jndid' AND zsid='$zsid'"); if($sql1){ - echo '
Das Recht wurde gelöscht!
|***|success|***|'.$jndid; + echo '
Die Noten wurden entfernt!
|***|success|***|'.$jndid; exit; }else{ - echo '
Das Recht wurde nicht gelöscht: DELETE Fehler Datenbank.
|***|error'; + echo '
Die Noten wurdne nicht entfernt: DELETE Fehler Datenbank.
|***|error'; exit; } } -if ($function == 'erfuser') { - if (isset($_POST['rid'])) { - $rid = $_POST['rid']; +if ($function == 'erfNotenUser') { + if (isset($_POST['zsid'])) { + $zsid = $_POST['zsid']; } - if (isset($_POST['uid'])) { - $uid = $_POST['uid']; + if (isset($_POST['csid'])) { + $csid = $_POST['csid']; } $db = dbconnect(); - $sql1 = $db->query("INSERT INTO jumi_admin_rollen_user_zuord ( rid, uid) VALUES ( $rid, $uid )"); + $sql1 = $db->query("INSERT INTO jumi_noten_zus_saenger_zuord ( zsid, csid) VALUES ( $zsid, $csid )"); if($sql1){ - echo '
Der Benutzer wurde zugewiesen!
|***|success|***|'.$rid; + echo '
Der Benutzer wurde zugewiesen!
|***|success|***|'.$zsid; exit; }else{ echo '
Der Benutzer wurde nicht zugewiesen: Insert Fehler Datenbank.
|***|error'; @@ -88,17 +88,17 @@ if ($function == 'erfuser') { } } -if ($function == 'deluser') { - if (isset($_POST['rid'])) { - $rid = $_POST['rid']; +if ($function == 'delNotenUser') { + if (isset($_POST['zsid'])) { + $zsid = $_POST['zsid']; } - if (isset($_POST['uid'])) { - $uid = $_POST['uid']; + if (isset($_POST['csid'])) { + $csid = $_POST['csid']; } - $sql1 = $db->query("DELETE FROM jumi_admin_rollen_user_zuord WHERE rid='$rid' AND uid='$uid'"); + $sql1 = $db->query("DELETE FROM jumi_noten_zus_saenger_zuord WHERE zsid='$zsid' AND csid='$csid'"); if($sql1){ - echo '
Der Benutzer wurde gelöscht!
|***|success|***|'.$rid; + echo '
Der Benutzer wurde gelöscht!
|***|success|***|'.$zsid; exit; }else{ echo '
Der Benutzer wurde nicht gelöscht: DELETE Fehler Datenbank.
|***|error'; @@ -107,14 +107,14 @@ if ($function == 'deluser') { } -if ($function == 'delRole') { - if (isset($_POST['rid'])) { - $rid = $_POST['rid']; +if ($function == 'delZusammenstellung') { + if (isset($_POST['zsid'])) { + $zsid = $_POST['zsid']; } - $stmt1 = $db->query("DELETE FROM jumi_admin_rollen_rechte_zuord WHERE rid= $rid"); - $stmt2 = $db->query("DELETE FROM jumi_admin_rollen_user_zuord WHERE rid= $rid"); - $stmt3 = $db->query("DELETE FROM jumi_admin_rolle WHERE rid= $rid"); + $stmt1 = $db->query("DELETE FROM jumi_noten_zusammenstellung_zuord WHERE zsid= $zsid"); + $stmt2 = $db->query("DELETE FROM jumi_noten_zus_saenger_zuord WHERE zsid= $zsid"); + $stmt3 = $db->query("DELETE FROM jumi_noten_zusammenstellung WHERE zsid= $zsid"); if ($stmt1 AND $stmt2 AND $stmt3) { echo '
Die Rolle wurde gelöscht!
|***|success'; exit; @@ -124,26 +124,4 @@ if ($function == 'delRole') { } } -/* - -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"; - } -} - -*/ ?> \ No newline at end of file diff --git a/controller/admin_notenupload.php b/controller/admin_notenupload.php index 1d49a3e..1529964 100644 --- a/controller/admin_notenupload.php +++ b/controller/admin_notenupload.php @@ -9,6 +9,7 @@ if ($function == 'save_with_files') { ## Dieses Script wird für jede Datei einzeln aufgerufen durch vpb_uploader.js. Bei 3 Dateien, 3x $titel = $_POST['titel']; + $liednr = $_POST['liednr']; $songbook = $_POST['songbook']; $verlag = $_POST['verlag']; #csid gesetzt, wenn Member bearbeitet wird @@ -94,6 +95,7 @@ if ($function == 'save_with_files') $result = $db->query("SELECT jndid FROM jumi_noten_daten WHERE titel = '$titel' + AND liednr = '$liednr' AND vid = '$vid' AND sbid = '$sbid' AND anz_lizenzen = '$anz_lizenzen' @@ -103,6 +105,7 @@ if ($function == 'save_with_files') if ($row['jndid'] == '' AND $jndid_edit == '-1') { $sql1 = $db->query("INSERT INTO jumi_noten_daten ( titel + , liednr , vid , sbid , anz_lizenzen @@ -112,6 +115,7 @@ if ($function == 'save_with_files') ) VALUES ( '$titel' + , '$liednr' , '$vid' , '$sbid' , '$anz_lizenzen' @@ -126,6 +130,7 @@ if ($function == 'save_with_files') { $sql1 = $db->query( "UPDATE jumi_noten_daten SET titel = '$titel' + ,liednr = '$liednr' ,vid = '$vid' ,sbid = '$sbid' ,anz_lizenzen = '$anz_lizenzen' @@ -200,6 +205,7 @@ if ($function == 'save_with_files') if ($function == 'save_without_files') { $titel = $_POST['titel']; + $liednr = $_POST['liednr']; $songbook = $_POST['songbook']; $verlag = $_POST['verlag']; $jndid_edit = $_POST['jndid_edit']; @@ -257,6 +263,7 @@ if ($function == 'save_without_files') $datum = date("Y-m-d H:i:s"); if($jndid_edit == '-1'){ $sql1 = $db->query("INSERT INTO jumi_noten_daten ( titel + , liednr , vid , sbid , anz_lizenzen @@ -266,6 +273,7 @@ if ($function == 'save_without_files') ) VALUES ( '$titel' + , '$liednr' , '$vid' , '$sbid' , '$anz_lizenzen' @@ -287,6 +295,7 @@ if ($function == 'save_without_files') }else{ $sql1 = $db->query( "UPDATE jumi_noten_daten SET titel = '$titel' + ,liednr = '$liednr' ,vid = '$vid' ,sbid = '$sbid' ,anz_lizenzen = '$anz_lizenzen' diff --git a/dashboard/notenupload.php b/dashboard/notenupload.php index 1c1d091..8c95b24 100644 --- a/dashboard/notenupload.php +++ b/dashboard/notenupload.php @@ -20,7 +20,7 @@ require_once "../language/german.inc.php"; $jndid = $_GET['editjndid']; $smarty->assign('create_edit', $jndid); - $result0 = $db->query("SELECT a. jndid, titel, anz_lizenzen, streamlizenz, b.bezeichnung songbook, c.bezeichnung verlag + $result0 = $db->query("SELECT a. jndid, titel, liednr, anz_lizenzen, streamlizenz, b.bezeichnung songbook, c.bezeichnung verlag FROM jumi_noten_daten a, jumi_noten_songbook b, jumi_noten_verlag c WHERE a.sbid=b.sbid AND a.vid=c.vid @@ -28,6 +28,7 @@ require_once "../language/german.inc.php"; ORDER BY titel ASC;"); $row0 = $result0->fetch_array(); $smarty->assign('notenupload_titel', $row0['titel']); + $smarty->assign('notenupload_liednr', $row0['liednr']); $smarty->assign('notenupload_anz_lizenzen', $row0['anz_lizenzen']); $smarty->assign('notenupload_streamlizenz', $row0['streamlizenz']); $smarty->assign('notenupload_songbook', $row0['songbook']); diff --git a/dashboard/notenuserzuordnung.php b/dashboard/notenuserzuordnung.php new file mode 100644 index 0000000..94ff1b0 --- /dev/null +++ b/dashboard/notenuserzuordnung.php @@ -0,0 +1,64 @@ +"; + exit; +} +require_once "../language/german.inc.php"; + + + +if (isset($_GET['action'])) { + $action = $_GET['action']; +} else { + $action = ''; +} + + +if ($action == '') { + if (isset($_GET['edit'])) { + $zsid = $_GET['edit']; + $smarty->assign('zusammenstellung_edit', $zsid); + } + + $result_head = $db->query("SELECT bezeichnung FROM jumi_noten_zusammenstellung WHERE zsid=$zsid"); + $row_head = $result_head->fetch_array(); + $smarty->assign('notenzuordnung_bezeichnung', $row_head['bezeichnung']); + + # Nicht zugewiesene User + $query = "SELECT csid, vorname, nachname + FROM jumi_chor_saenger + WHERE csid NOT IN (SELECT csid FROM jumi_noten_zus_saenger_zuord WHERE zsid=$zsid) + 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 csid, vorname, nachname + FROM jumi_chor_saenger + WHERE csid IN (SELECT csid FROM jumi_noten_zus_saenger_zuord WHERE zsid=$zsid) + 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"); +?> diff --git a/js/components/admin_notenbuch.js b/js/components/admin_notenbuch.js index 7a3f5c8..1835efe 100644 --- a/js/components/admin_notenbuch.js +++ b/js/components/admin_notenbuch.js @@ -14,9 +14,9 @@ function notenbuchsave(){ setTimeout(function() { document.getElementById("notenbuchname").value =""; window.location = "?"; - }, 2000); + }, 1000); } - $('#msg').show().delay(2000).fadeOut(500); + $('#msg').show().delay(1000).fadeOut(500); $('#msg').html(a[0]); } }, @@ -48,9 +48,9 @@ function erfzuordnung(jndid, zsid) { $("#ZuordnungModal .modal-body").load('notenbuchzuordnung.php?edit='+value, function() { $("#ZuordnungModal").modal("show"); }); - }, 2000); + }, 1000); } - $('#msg').show().delay(2000).fadeOut(500); + $('#msg').show().delay(1000).fadeOut(500); $('#msg').html(a[0]); } }, @@ -84,7 +84,7 @@ function delzuordnung(jndid, zsid) { }); }, 2000); } - $('#msg').show().delay(2000).fadeOut(500); + $('#msg').show().delay(1000).fadeOut(500); $('#msg').html(a[0]); } }, @@ -94,20 +94,16 @@ function delzuordnung(jndid, zsid) { }); } -/* -function erfuser(val) { - var param = val.split('|'); - var uid = param[0]; - var rid = param[1]; +function erfNotenUser(csid, zsid) { $.ajax({ type: 'POST', url: '../controller/admin_notenbuch.php', data: { - 'function': 'erfuser', - 'uid': uid, - 'rid': rid + 'function': 'erfNotenUser', + 'csid': csid, + 'zsid': zsid }, success: function(result) { //we got the response if(result!=''){ @@ -117,7 +113,7 @@ function erfuser(val) { // 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-body").load('notenuserzuordnung.php?edit='+value, function() { $("#ZuordnungModal").modal("show"); }); }); @@ -132,18 +128,15 @@ function erfuser(val) { }); } -function deluser(val) { - var param = val.split('|'); - var uid = param[0]; - var rid = param[1]; +function delNotenUser(csid, zsid) { $.ajax({ type: 'POST', url: '../controller/admin_notenbuch.php', data: { - 'function': 'deluser', - 'uid': uid, - 'rid': rid + 'function': 'delNotenUser', + 'csid': csid, + 'zsid': zsid }, success: function(result) { //we got the response if(result!=''){ @@ -154,7 +147,7 @@ function deluser(val) { // 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-body").load('notenuserzuordnung.php?edit='+value, function() { $("#ZuordnungModal").modal("show"); }); }); @@ -170,16 +163,15 @@ function deluser(val) { } - -function delRole(rid) { - r = confirm('Rolle löschen? Benutzer sind dann unzugeordnet!'); +function delZusammenstellung(zsid) { + r = confirm('Zusammenstellung löschen?'); if (r) { $.ajax({ type: 'POST', url: '../controller/admin_notenbuch.php', data: { - 'function': 'delRole', - 'rid': rid + 'function': 'delZusammenstellung', + 'zsid': zsid }, success: function(result) { //we got the response if(result!=''){ @@ -199,4 +191,3 @@ function delRole(rid) { }); } } -*/ \ No newline at end of file diff --git a/js/file_upload/vpb_uploader.js b/js/file_upload/vpb_uploader.js index fc8d107..d9e7411 100644 --- a/js/file_upload/vpb_uploader.js +++ b/js/file_upload/vpb_uploader.js @@ -190,6 +190,7 @@ function vpb_multiple_file_uploader(vpb_configuration_settings) { dataString.append('upload_file_ids', ids); var titel = document.getElementById("titel").value; + var liednr = document.getElementById("liednr").value; var songbook = document.getElementById("songbook").value; var verlag = document.getElementById("verlag").value; var anz_lizenzen = document.getElementById("anz_lizenzen").value; @@ -203,6 +204,7 @@ function vpb_multiple_file_uploader(vpb_configuration_settings) { var streamlizenz = 0; } dataString.append('titel', titel); + dataString.append('liednr', liednr); dataString.append('songbook', songbook); dataString.append('verlag', verlag); dataString.append('anz_lizenzen', anz_lizenzen); @@ -302,6 +304,7 @@ function vpb_multiple_file_uploader(vpb_configuration_settings) { // By A. Schwarz: Insert ohne File vpb_multiple_file_uploader.prototype.vasINSERT = function() { var titel = document.getElementById("titel").value; + var liednr = document.getElementById("liednr").value; var songbook = document.getElementById("songbook").value; var verlag = document.getElementById("verlag").value; var anz_lizenzen = document.getElementById("anz_lizenzen").value; @@ -321,6 +324,7 @@ function vpb_multiple_file_uploader(vpb_configuration_settings) { data: { 'function': 'save_without_files', 'titel': titel, + 'liednr': liednr, 'songbook': songbook, 'verlag': verlag, 'anz_lizenzen': anz_lizenzen, diff --git a/media/file_upload/noten/20230405_082833_Ju_and_Mi.pptx b/media/file_upload/noten/20230405_082833_Ju_and_Mi.pptx new file mode 100644 index 0000000..a171cfc Binary files /dev/null and b/media/file_upload/noten/20230405_082833_Ju_and_Mi.pptx differ diff --git a/templates/modern/dashboard/edit_noten.html b/templates/modern/dashboard/edit_noten.html index 760bd3f..a534ee0 100644 --- a/templates/modern/dashboard/edit_noten.html +++ b/templates/modern/dashboard/edit_noten.html @@ -60,7 +60,7 @@ Titel - Verlag + Verlag Songbook Lizenzmenge Streamlizenz @@ -71,7 +71,7 @@ {section name=table_data loop=$table_data} {$table_data[table_data].titel} - {$table_data[table_data].verlag} + {$table_data[table_data].verlag} {$table_data[table_data].songbook} {$table_data[table_data].anz_lizenzen} {$table_data[table_data].streamlizenz_vorh} diff --git a/templates/modern/dashboard/notenbuch.html b/templates/modern/dashboard/notenbuch.html index 9429ad8..b9c9a67 100644 --- a/templates/modern/dashboard/notenbuch.html +++ b/templates/modern/dashboard/notenbuch.html @@ -102,8 +102,8 @@ $(document).ready(function(){
{$table_data[table_data].bezeichnung}
- - + +
diff --git a/templates/modern/dashboard/notenbuchzuordnung.html b/templates/modern/dashboard/notenbuchzuordnung.html index af2190c..df0bbac 100644 --- a/templates/modern/dashboard/notenbuchzuordnung.html +++ b/templates/modern/dashboard/notenbuchzuordnung.html @@ -13,6 +13,19 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +

{$notenzuordnung_bezeichnung}

+
+
+
+ + Nicht zugewiesene SägerIn +
+
+ + + + + + + + + + {section name=table_data loop=$table_data} + + + + + + {/section} + +
VornameNachnameAktion
{$table_data[table_data].vorname}{$table_data[table_data].nachname} +

+ +

+
+
+
+
+
+
+ + Zugewiesene SägerIn +
+
+ + + + + + + + + + {section name=table_data1 loop=$table_data1} + + + + + + {/section} + +
VornameNachnameAktion
{$table_data1[table_data1].vorname}{$table_data1[table_data1].nachname} +

+ +

+
+
+
+
+
+ + + + + + + +{/if} diff --git a/templates/modern/dashboard/survey_edit.html b/templates/modern/dashboard/survey_edit.html index e142eb4..4f1d516 100644 --- a/templates/modern/dashboard/survey_edit.html +++ b/templates/modern/dashboard/survey_edit.html @@ -46,11 +46,11 @@
-
Nr
-
Überschrift
-
Startdatum
-
Enddatum
-
Bearbeiten
+
Nr
+
Überschrift
+
Startdatum
+
Enddatum
+
Bearbeiten
{section name=table_data1 loop=$table_data1}
diff --git a/templates/modern/dashboard/userzuordnung.html b/templates/modern/dashboard/userzuordnung.html index b649c95..9259db9 100644 --- a/templates/modern/dashboard/userzuordnung.html +++ b/templates/modern/dashboard/userzuordnung.html @@ -60,7 +60,7 @@
- Nicht zugewiesene Benutzer + Nicht zugewiesene Lieder