<div class="row">
  <div class="col-lg-9 col-md-8">

    <div class="panel panel-default">
      <div class="panel-body">
        {$TEXT[0]}
      </div>
    </div>

    {if $PAYMENTS}
    <div class="panel panel-default">
      <div class="panel-body">
        <div class="table-responsive">
          <table class="table table-striped table-hover" id="sortTable">
            <thead>
              <tr>
                <th data-sort="int">{$TEXT[1]}</th>
                <th data-sort="float">{$TEXT[2]}</th>
                <th data-sort="string">{$TEXT[3]}</th>
              </tr>
            </thead>
            <tbody>
              {$PAYMENTS | noescape}
            </tbody>
          </table>
        </div>
        <hr>
        <div class="text-center">
          <button class="btn btn-success" type="button" data-export="{if isset($_SERVER['QUERY_STRING'])}{$_SERVER['QUERY_STRING']}{/if}"><i class="fa fa-save fa-fw"></i> {$TEXT[8]}</button>
        </div>
      </div>
    </div>

    {* == PAGINATION == *}
    
    {$PAGES | noescape}

    {else}
    <div class="panel panel-danger">
      <div class="panel-body nodata">
        <i class="fa fa-warning fa-fw"></i> {$TEXT[4]}
      </div>
    </div>
    {/if}

  </div>
  <div class="col-lg-3 col-md-4">
    <div class="panel panel-default menuboxarea">
      <div class="panel-heading">
        <i class="fa fa-bar-chart fa-fw"></i> {$HTEXT[1]}
      </div>
      <div class="panel-body">
        {$HTEXT[4]}:<br><span class="highlight"><a href="{$META['basehref']}?p=referrals">{$TOTALS[2] | noescape}</a></span><br><br>
        {$HTEXT[2]}:<br><span class="highlight"><a href="{$META['basehref']}?p=commissions">{$TOTALS[0] | noescape}</a></span><br><br>
        {$HTEXT[3]}:<br><span class="highlight"><a href="{$META['basehref']}?p=payments">{$TOTALS[1] | noescape}</a></span><hr>
        {$CTEXT[4]}:<br><span class="highlight"><a href="{$META['basehref']}?p=payments">{$LAST_PAYMENT | noescape}</a></span>
      </div>
    </div>
    <div class="panel panel-default menuboxarea">
      <div class="panel-heading">
        <i class="fa fa-filter fa-fw"></i> {$TEXT[5]}
      </div>
      <div class="panel-body">
        <form method="get" action="index.php">
          <input type="hidden" name="p" value="payments">
          <div class="form-group">
            <label>{$TEXT[6]}</label>
            <div class="form-group input-group">
              <span class="input-group-addon"><i class="fa fa-calendar-check-o fa-fw"></i></span>
              <input type="text" class="form-control mswdatepicker" name="from" value="{$FROM_DATE}">
            </div>
            <div class="form-group input-group">
              <span class="input-group-addon"><i class="fa fa-calendar-check-o fa-fw"></i></span>
              <input type="text" class="form-control mswdatepicker" name="to" value="{$TO_DATE}">
            </div>
          </div>
          <hr>
          <button class="btn btn-primary"><i class="fa fa-check fa-fw"></i> {$TEXT[7]}</button>
        </form>
      </div>
    </div>
    {include 'right-panel.tpl'}
  </div>
</div>