{extends file="layout/layout.tpl"}
{block name=main}
    <div class="slim-mainpanel">
      <div class="container">
        <div class="slim-pageheader">
          <ol class="breadcrumb slim-breadcrumb">
            <li class="breadcrumb-item"><a href="#">Admin</a></li>
            <li class="breadcrumb-item"><a href="#">License</a></li>
            <li class="breadcrumb-item active" aria-current="page">List</li>
          </ol>
          <h6 class="slim-pagetitle">LICENSES</h6>
        </div><!-- slim-pageheader -->

        <div class="section-wrapper">
             {if $msg}
          <div class="alert alert-success mg-b-0" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
            <strong>[SUCCESS]</strong> {$msg}
          </div><br>
          {/if}      
          <div class="table-wrapper">
            <table id="datatable1" class="table display responsive nowrap">
              <thead>
                <tr>
                  <th class="wd-15p">UserID</th>
                  <th class="wd-15p">IP</th>
                  <th class="wd-15p">HardwareID</th>
                  <th class="wd-15p">Status</th>
                  <th class="wd-25p">Version</th>
                  <th class="wd-25p">Expire</th>
                  <th class="wd-25p">Action</th>
                  <th class="wd-25p">Delet</th>
                </tr>
              </thead>
              <tbody>

                 
                 {foreach key=i item=k from=$license}
                <tr>
                  {$user = $userModel->where('Id', $k['OwnerID'])->findAll()}
                  <td>{$user[0]['Name']}</td>
                  <td>{$k['Information1']}</td>
                  <td>{$k['Information2']}</td>
                  <td>{$k['Status'] === (1) ? 'Ativada' : 'Desativada'}</td>
                  <td>{$plans[$k['ProductId']]}</td>
                  <td>{$k['Expire']}</td>
                  <td><a href="{base_url()}/admin/license/edit/{$k['UserID']}" class="btn btn-success">Editar</button></td>
                  <td><a href="{base_url()}/admin/license/delete/{$k['UserID']}" class="btn btn-success">Delet</button></td>
                </tr>
              {/foreach}
              </tbody>
            </table>
          </div><!-- table-wrapper -->
        </div><!-- section-wrapper -->
      </div><!-- container -->
    </div><!-- slim-mainpanel -->
    {/block}