Leitgedanken/lieder/suchopt_status_search.php
2022-11-21 09:47:28 +01:00

55 lines
1.6 KiB
PHP

<?php
require_once("../config.inc.php");
$db = dbconnect();
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = '';
}
if ($action == '') {
//A=Auch in Aufführungsreife Lieder, P=Probebestand, U=Unbekannte Lieder, K=Keine Statuseinschränkung/alle
$result_lied_status = $db->query("SELECT lied_status
FROM profil
WHERE user = '$user_admin'");
$row_lied_status = $result_lied_status->fetch_array();
$status = $row_lied_status['lied_status'];
echo "
<html>
<head>
<style type=\"text/css\">
select{
width:250px;
}
</style>
</head>
<body>
<form action=?action=save method=\"POST\" name=\"wort_erf\">
<select name='status' onchange=\"this.form.submit()\">
<option value=\"K\"";if($status == 'K'){ echo " selected";} echo">Keine Statusbeschränkung</option>
<option value=\"A\"";if($status == 'A'){ echo " selected";} echo">Aufführbare Lieder</option>
<option value=\"P\"";if($status == 'P'){ echo " selected";} echo">Übphase</option>
<option value=\"U\"";if($status == 'U'){ echo " selected";} echo">Unbekannte Lieder</option>
</select>
</body>
</html>
";
}
if ($action == 'save') {
$status = $_POST["status"];
echo "<script language=\"javascript\">
top.frames[2].location.href = \"lieder_personalisieren.php\";
</script>";
$db->query("UPDATE profil
SET lied_status='$status'
WHERE user='$user_admin'");
echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF'] ."\">";
}
?>