{extends "base.tpl.html"}
{block title}{t 1=$issue_id}Redeem Incident - Issue#%1{/t}{/block}

{block content}
<br />
<form method="POST" action="redeem_incident.php" name="redeem_incident">
    <input type="hidden" name="iss_id" value="{$issue_id}">
    <table class="bordered">
        {foreach from=$incident_details item=type_details key=type_id}
        <tr class="{cycle values='odd,even'}">
            <td>
                {if $res|default:'' == ''}<input type="checkbox" name="redeem[{$type_id}]" value="1" {if $redeemed[$type_id].is_redeemed == 1}checked{/if}>{/if}
                <a id="link" href="javascript:void(null);" onClick="toggleCheckbox('redeem_incident', 'redeem[{$type_id}]', 0);">{$type_details.title} ({t}Total{/t}: {$type_details.total}; {t}Left{/t}: {$type_details.total-$type_details.redeemed})</a>
            </td>
        </tr>
        {/foreach}
        {if $res|default:'' == ''}
        <tr class="buttons">
            <td align="center">
                <input type="submit" name="submit" value="{t}Redeem Incidents{/t}" class="shortcut">
            </td>
        </tr>
        {/if}
    </table>
    {if $res|default:'' != ''}
    <script type="text/javascript">
        <!--
        {if $core.current_user_prefs.close_popup_windows}
            setTimeout('Eventum.close_and_refresh()', 2000);
        {/if}
        //-->
    </script>
    {if not $core.current_user_prefs.close_popup_windows}
    <span><a href="javascript:void(null);" onClick="Eventum.close_and_refresh();">{t}Continue{/t}</a></span>
    {/if}
    {/if}
</form>
{/block}
