<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title> ECMall </title>
  <meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
  <link href="admin/styles/general.css" rel="stylesheet" type="text/css" />
  {script src="ecmall,ajax,validator,ui.datagrid,ui.calendar"}
  <script type="text/javascript" src="?act=jslang"></script>
  <script type="text/javascript">
    Event.observe(window, 'load', function() {
      var grid = new ui.DataGrid($("data-grid"));
      grid.action = "modify";
    });
    function drop_partner(partner_id) {
        if(confirm('{$lang.confirm_drop_partner}')) {
            Ajax.call('admin.php?app=partner&act=drop&partner_id='+partner_id, function(s) {
                if(s.done) {
                    location.reload();
                } else {
                    alert(s.msg);
                }
            });
        }
    }
  </script>
 </head>

 <body>
  <ul id="container">
    <li id="header">
      <h1>{$lang.partner_view}</h1>
      <div class="link">[<a href="admin.php?app=partner&amp;act=add">{$lang.partner_add}</a>]</div>
      <div id="desc">
        <div id="page-selector">
          {$lang.goto_page}{page_selector from=$list.info url=$url_format}
        </div>
        <span>{$stats}</span>
      </div>
    </li>
    <li id="wrapper">
      <table class="grid" cellspacing="0" id="data-grid">
        <tr>
          <th readOnly="false" columnName="partner_name" dataType="string" required="true" class="first-cell"><input class="checkAll" type="checkbox" /> {sort_link by=partner_name text=$lang.partner_name}</th>
          <th readOnly="false" columnName="partner_website" dataType="string" required="true">{sort_link by=partner_website text=$lang.partner_website}</th>
          <th readOnly="false" columnName="partner_logo" dataType="string" required="true">{sort_link by=partner_logo text=$lang.partner_logo}</th>
          <th readOnly="false" columnName="sort_order" dataType="int" required="true">{sort_link by=sort_order text=$lang.sort_order}</th>
          <th>{$lang.handler}</th>
        </tr>
        {foreach from=$list.data item=item}
        <tr id="{$item.partner_id}">
          <td class="first-cell"><input name="id" value="{$item.partner_id}" type="checkbox" /> <span>{$item.partner_name|escape}</span></td>
          <td><span>{$item.partner_website}</span>&nbsp;</td>
          <td>{if $item.partner_logo}<img src="{$item.partner_logo}" height="30" />{else}N/A{/if}</td>
          <td><span>{$item.sort_order}</span></td>
          <td>
            <a href="./admin.php?app=partner&amp;act=edit&amp;partner_id={$item.partner_id}">{$lang.edit}</a>
            <a href="javascript:;" onclick="drop_partner({$item.partner_id})">{$lang.delete}</a>
          </td>
        </tr>
        {foreachelse}
          <tr><td colspan="5" class="no-records">{$lang.no_records}</td></tr>
        {/foreach}
        <tr>
        <td colspan="5"><ul id="batch-links">
            <li class="batch-link" action="batch" param="drop">{$lang.delete}</li>
          </ul></td>
        </tr>
      </table>
      <div id="page-list">{page_links from=$list.info url=$url_format}</div>
    </li>
    {include file="admin/templates/footer.html"}
  </ul>
 </body>
</html>
