diff --git a/admin/music.php b/admin/music.php
index a1cc102..bbf6c9d 100644
--- a/admin/music.php
+++ b/admin/music.php
@@ -41,6 +41,31 @@
break;
case 've':
$pdo->exec("UPDATE `version` SET `name` = '".addslashes($_GET['name'])."', `number` = '".$_GET['number']."' WHERE `id_version` = '".$_GET['id_version']."';");
+ if(isset($_GET["soprano"])){
+ $pdo->exec("UPDATE `version` SET `soprano` = '1' WHERE `id_version` = ". $_GET['id_version']);
+ }else{
+ $pdo->exec("UPDATE `version` SET `soprano` = '0' WHERE `id_version` = ". $_GET['id_version']);
+ }
+ if(isset($_GET["alto"])){
+ $pdo->exec("UPDATE `version` SET `alto` = '1' WHERE `id_version` = ". $_GET['id_version']);
+ }else{
+ $pdo->exec("UPDATE `version` SET `alto` = '0' WHERE `id_version` = ". $_GET['id_version']);
+ }
+ if(isset($_GET["tenor"])){
+ $pdo->exec("UPDATE `version` SET `tenor` = '1' WHERE `id_version` = ". $_GET['id_version']);
+ }else{
+ $pdo->exec("UPDATE `version` SET `tenor` = '0' WHERE `id_version` = ". $_GET['id_version']);
+ }
+ if(isset($_GET["basse"])){
+ $pdo->exec("UPDATE `version` SET `basse` = '1' WHERE `id_version` = ". $_GET['id_version']);
+ }else{
+ $pdo->exec("UPDATE `version` SET `basse` = '0' WHERE `id_version` = ". $_GET['id_version']);
+ }
+ if(isset($_GET["tutti"])){
+ $pdo->exec("UPDATE `version` SET `tutti` = '1' WHERE `id_version` = ". $_GET['id_version']);
+ }else{
+ $pdo->exec("UPDATE `version` SET `tutti` = '0' WHERE `id_version` = ". $_GET['id_version']);
+ }
break;
case 'vd':
$version = $pdo->query("SELECT * FROM version WHERE `id_version` = '".$_GET['id_version']."' ")->fetch(PDO::FETCH_ASSOC);
@@ -58,6 +83,22 @@
}
if(move_uploaded_file($_FILES["version"]["tmp_name"], $target)){
$pdo->exec("INSERT INTO `version` (`name`, `id_music`, `url`, `number`) VALUES ('".addslashes($_POST['name'])."', '".$_GET['id']."', '".$music['directory'] . "/" . $_POST['name'] . ".mp3"."', '".$_POST['number']."');");
+ $id = $pdo->lastInsertId();
+ if(str_contains($_POST["name"], "SOPRANO")){
+ $pdo->exec("UPDATE `version` SET `soprano` = '1' WHERE `id_version` = ". $id);
+ }
+ if(str_contains($_POST["name"], "ALTO")){
+ $pdo->exec("UPDATE `version` SET `alto` = '1' WHERE `id_version` = ". $id);
+ }
+ if(str_contains($_POST["name"], "TENOR")){
+ $pdo->exec("UPDATE `version` SET `tenor` = '1' WHERE `id_version` = ". $id);
+ }
+ if(str_contains($_POST["name"], "BASSE")){
+ $pdo->exec("UPDATE `version` SET `basse` = '1' WHERE `id_version` = ". $id);
+ }
+ if(str_contains($_POST["name"], "TUTTI")){
+ $pdo->exec("UPDATE `version` SET `tutti` = '1' WHERE `id_version` = ". $id);
+ }
}else{
echo "Error";
}
@@ -132,6 +173,26 @@
+
+ >
+
+
+
+ >
+
+
+
+ >
+
+
+
+ >
+
+
+
+ >
+
+