<?PHP //options.php

    include("config.php");

    print_header();

?>
    <SCRIPT LANGUAGE="JavaScript" >
     <!--
    function insertfilter() {
      with (document.filter) {
      filter.value = String(choose.options[choose.selectedIndex].value);
      }
    }
    //-->
    </SCRIPT>

<?PHP
    print_heading("Options (you are logged in as $USERNAME)");
?>

<?PHP
// Search ////////////////////////////////////////////////////////////////////////////////
?>

<FORM NAME=search ACTION=tracks.php TARGET=mp3tracks>
<TABLE><TR>
<TD><INPUT TYPE=submit NAME=submit VALUE="Search tracks for:">
<TD><INPUT TYPE=text SIZE=40 NAME=search VALUE="">
</TR></TABLE>
</FORM>


<?PHP
// Filters /////////////////////////////////////////////////////////////////////////////////

    if (isset($filter)) {
        $result = filter($filter);
    } else {
        $status = status();
        $filter = $status["FILTER"];
    }

?>
<FORM NAME=filter ACTION=queue.php TARGET=mp3queue>
<TABLE><TR>
<TD><INPUT TYPE=submit NAME=submit VALUE="Set filter to:">
<TD><SELECT name=choose onChange="insertfilter()">
  <OPTION VALUE="<?=$filter?>" SELECTED>Current Filter ...</OPTION>
<?
    foreach ($filters as $filtername => $filterrules) {
        echo "<OPTION VALUE=\"$filterrules\">$filtername</OPTION>";
    }
?>
</SELECT>
</TD>
<TD><INPUT TYPE=text SIZE=40 NAME=filter VALUE="<?=$filter?>">
</TR></TABLE>
</FORM>

<?PHP
// Volume /////////////////////////////////////////////////////////////////////////////////

    if (isset($volume)) {
        $volume = volume($volume);
    } else {
        $volume = volume();
    }

    if (isset($bass)) {
        $bass = bass($bass);
    } else {
        $bass = bass();
    }

    if (isset($treble)) {
        $treble = treble($treble);
    } else {
        $treble = treble();
    }
?>
<TABLE><TR>
<TD>
<FORM NAME=volume ACTION=options.php TARGET=mp3options>
Volume: <SELECT NAME=vol onChange="window.location=document.volume.vol.options[document.volume.vol.selectedIndex].value">
  <?
     for ($i=100; $i>=0; $i-=5) {
         echo "<OPTION VALUE=\"options.php?volume=$i\"";
         if ($i >= $volume["VOLUME"] && $i< $volume["VOLUME"]+5) {
             echo " SELECTED ";
         }
         echo ">$i</OPTION>\n";
     }
  ?>
</SELECT>
</FORM>
</TD>

<TD>
<FORM NAME=bass ACTION=options.php TARGET=mp3options>
Bass: <SELECT NAME=vol onChange="window.location=document.bass.vol.options[document.bass.vol.selectedIndex].value">
  <?
     for ($i=100; $i>=0; $i-=5) {
         echo "<OPTION VALUE=\"options.php?bass=$i\"";
         if ($i == $bass["BASS"]) {
             echo " SELECTED ";
         }
         echo ">$i</OPTION>\n";
     }
  ?>
</SELECT>
</FORM>
</TD>

<TD>
<FORM NAME=treble ACTION=options.php TARGET=mp3options>
Treble: <SELECT NAME=vol onChange="window.location=document.treble.vol.options[document.treble.vol.selectedIndex].value">
  <?
     for ($i=100; $i>=0; $i-=5) {
         echo "<OPTION VALUE=\"options.php?treble=$i\"";
         if ($i == $treble["TREBLE"]) {
             echo " SELECTED ";
         }
         echo ">$i</OPTION>\n";
     }
  ?>
</SELECT>
</FORM>
</TD>

</TABLE>

