<?php
    global $ELEMENT;
?>
<form action='/<?=$UID?>/catalog/' method='get' id='filter_catalog' class='filter'>
    <table>
        <tr>
            <td class='filter'>
                <span>Element:</span>
<?php
                $selected = Array("", "", "", "", "");
                $selected[$filters["element"] - 1] = "selected";
?>
                <select name='element'>
                    <option value='0'>All</option>
                    <option value='<?=$ELEMENT["WATER"]?>' <?=$selected[0]?>>Water</option>
                    <option value='<?=$ELEMENT["FIRE"]?>' <?=$selected[1]?>>Fire</option>
                    <option value='<?=$ELEMENT["WIND"]?>' <?=$selected[2]?>>Wind</option>
                    <option value='<?=$ELEMENT["LIGHT"]?>' <?=$selected[3]?>>Light</option>
                    <option value='<?=$ELEMENT["DARK"]?>' <?=$selected[4]?>>Dark</option>
                </select>
            </td>
            <td class='filter' id='filter_stars'>
                <span>Stars:</span>
                <input type='number' name='min_stars' id='filter_stars_min' min='1' max='5' value='<?=$filters["min_stars"]?>'/>
                -
                <input type='number' name='max_stars' id='filter_stars_max' min='1' max='5' value='<?=$filters["max_stars"]?>'/>
            </td>
        </tr>
        <tr>
            <td class='filter' colspan='2'>
                <span>Name:</span>
                <input type='text' name='name' id='filter_name' value='<?=$filters["name"]?>'/>
            </td>
        </tr>
    </table>
    <div id='filter_apply'>
        <input type='submit' value='Apply'/>
    </div>
</form>
