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

53 lines
1.4 KiB
PHP

<?php
require_once("../config.inc.php");
$db = dbconnect();
if (isset($_GET['action'])) {
$action = $_GET['action'];
} else {
$action = '';
}
if ($action == '') {
$result_lied_bestand = $db->query("SELECT lied_bestand
FROM profil
WHERE user = '$user_admin'");
$row_lied_bestand = $result_lied_bestand->fetch_array();
$bestand = $row_lied_bestand['lied_bestand'];
echo "
<html>
<head>
<style type=\"text/css\">
select{
width:250px;
}
</style>
</head>
<body>
<form action=?action=save method=\"POST\" name=\"wort_erf\">
<select name='bestand' onchange=\"this.form.submit()\">
<option value=\"ALL\"";if($bestand == 'ALL'){ echo " selected";} echo">Gesamtbestand</option>
<option value=\"GB\"";if($bestand == 'GB'){ echo " selected";} echo">Gesangbuch</option>
<option value=\"CB\"";if($bestand == 'CB'){ echo " selected";} echo">Chorbuch</option>
</select>
</body>
</html>
";
}
if ($action == 'save') {
$bestand = $_POST["bestand"];
echo "<script language=\"javascript\">
top.frames[2].location.href = \"lieder_personalisieren.php\";
</script>";
$db->query("UPDATE profil
SET lied_bestand='$bestand'
WHERE user='$user_admin'");
echo "<meta http-equiv=\"refresh\" content=\"0; URL=".$_SERVER['PHP_SELF'] ."\">";
}
?>