{include file="$admintemplatepath/header.template"}
{include file="$admintemplatepath/navigation.template" showOpt=blockedHosts title=$locale->tr("blockedHosts")}
{if $pluginEnabled}
<form name="blockedHosts" action="admin.php" method="post">
 <div id="list">
  {include file="$admintemplatepath/successmessage.template"}
  {include file="$admintemplatepath/errormessage.template"}
  <table class="info">
   <tr>
    <th style="width:10px;"><input class="checkbox" type="checkbox" class="check" name="all" id="all" value="1" onclick="toggleAllChecks('blockedHosts');" /></th>
    <th style="width:150px;">{$locale->tr("ip_address")}</th>
    <th style="width:200px;">{$locale->tr("reason")}</th>
    <th style="width:150px;">{$locale->tr("date")}</th>
    <th style="width:150px;">{$locale->tr("type")}</th>
    <th style="width:95px;">{$locale->tr("actions")}</th>
   </tr>
   {foreach from=$blockedhosts item=blockedhost}
    <tr>
     <td align="center"><input class="checkbox" type="checkbox" name="deleteBlockedHost[{$blockedhost->getId()}]" value="{$blockedhost->getId()}"/></td>
     <td class="col_highlighted"><a href="admin.php?op=editBlockedHost&amp;hostId={$blockedhost->getId()}">{$blockedhost->getHost()}/{$blockedhost->getMask()}</a></td>
     <td>{$blockedhost->getReason()}</td>
     {assign var=blockedhostDate value=$blockedhost->getDateObject()}
     <td>{$locale->formatDate($blockedhostDate,"%d/%m/%Y %H:%M")}</td>
     <td>
      {if $blockedhost->getType() == 1}{$locale->tr("access_blocked")}{/if}
      {if $blockedhost->getType() == 2}{$locale->tr("posting_blocked")}{/if}
      {** {if $blockedhost->isGlobal()} <b>[{$locale->tr("global")}]</b>{/if} **}
     </td>
     <td>
      <div class="list_action_button">
       <a href="?op=editBlockedHost&amp;hostId={$blockedhost->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
       <a href="?op=deleteBlockedHost&amp;hostId={$blockedhost->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
      </div>
     </td>
    </tr>
   {/foreach}
  </table>
  <div id="list_action_bar">  
   <input type="hidden" name="op" value="deleteBlockedHosts" />
   <input type="submit" value="{$locale->tr("delete")}" name="deleteSelected" />
  </div> 
 </div> 
</form>
{else}
 {include file="$admintemplatepath/errormessage.template"} 
{/if}
{include file="$admintemplatepath/footernavigation.template"}
{include file="$admintemplatepath/footer.template"}