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

    <div class="panel panel-default">
      <div class="panel-body">
        {=$TEXT[0]|replace: '{name}', $ACCOUNT['fname'] . ' ' . $ACCOUNT['lname'] | noescape}
      </div>
    </div>

    {* == IF LIMIT SET TO 0, WE DON`T SHOW == *}

    {if AFF_DASH_PAYMENTS_LIMIT > 0}
      <h2><span class="pull-right showall_link"><a href="{$META['basehref']}?p=payments">{$TEXT[8]}</a></span>{$H2TEXT[0]}</h2>

      {if $PAYMENTS}
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th data-sort="int">{$PTEXT[1]}</th>
                  <th data-sort="float">{$PTEXT[2]}</th>
                  <th data-sort="string">{$PTEXT[3]}</th>
                </tr>
              </thead>
              <tbody>
                {$PAYMENTS | noescape}
              </tbody>
            </table>
          </div>
        </div>
      </div>
      {else}
      <div class="panel panel-danger">
        <div class="panel-body nodata">
          <i class="fa fa-warning fa-fw"></i> {$PTEXT[4]}
        </div>
      </div>
      {/if}
    {/if}

    {* == IF LIMIT SET TO 0, WE DON`T SHOW == *}

    {if AFF_DASH_COMMISSIONS_LIMIT > 0}
      <h2><span class="pull-right showall_link"><a href="{$META['basehref']}?p=commissions">{$TEXT[8]}</a></span>{$H2TEXT[1]}</h2>

      {if $COMMISSIONS}
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th data-sort="string">{$CTEXT[5]}</th>
                  <th data-sort="int">{$CTEXT[6]}</th>
                  <th data-sort="float">{$CTEXT[7]}</th>
                  <th data-sort="float">{$CTEXT[8]}</th>
                  <th data-sort="string">{$CTEXT[9]}</th>
                </tr>
              </thead>
              <tbody>
                {$COMMISSIONS | noescape}
              </tbody>
            </table>
          </div>
        </div>
      </div>
      {else}
      <div class="panel panel-danger">
        <div class="panel-body nodata">
          <i class="fa fa-warning fa-fw"></i> {$CTEXT[10]}
        </div>
      </div>
      {/if}
    {/if}

    {* == IF LIMIT SET TO 0, WE DON`T SHOW == *}

    {if AFF_DASH_REFERRALS_LIMIT > 0}
      <h2><span class="pull-right showall_link"><a href="{$META['basehref']}?p=referrals">{$TEXT[8]}</a></span>{$H2TEXT[2]}</h2>

      {if $REFERRALS}
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th data-sort="string">{$RTEXT[2]}</th>
                  <th data-sort="string">{$RTEXT[3]}</th>
                  <th data-sort="float">{$RTEXT[4]}</th>
                </tr>
              </thead>
              <tbody>
                {$REFERRALS | noescape}
              </tbody>
            </table>
          </div>
        </div>
      </div>
      {else}
      <div class="panel panel-danger">
        <div class="panel-body nodata">
          <i class="fa fa-warning fa-fw"></i> {$RTEXT[5]}
        </div>
      </div>
      {/if}
    {/if}

  </div>
  <div class="col-lg-3 col-md-4">
    <div class="panel panel-default menuboxarea">
      <div class="panel-heading">
        <i class="fa fa-code fa-fw"></i> {$TEXT[9]}
      </div>
      <div class="panel-body affcode">
        <p>{$CODE}</p>
      </div>
    </div>
    <div class="panel panel-default menuboxarea">
      <div class="panel-heading">
        <i class="fa fa-bar-chart fa-fw"></i> {$TEXT[1]}
      </div>
      <div class="panel-body">
        {$TEXT[4]}: <span class="highlight"><br><a href="{$META['basehref']}?p=referrals">{$TOTALS[2] | noescape}</a></span><br><br>
        {$TEXT[2]}: <span class="highlight"><br><a href="{$META['basehref']}?p=commissions">{$TOTALS[0] | noescape}</a></span><br><br>
        {$TEXT[3]}: <span class="highlight"><br><a href="{$META['basehref']}?p=payments">{$TOTALS[1] | noescape}</a></span><hr>
        {$CTEXT[4]}: <span class="highlight"><br><a href="{$META['basehref']}?p=payments">{$LAST_PAYMENT | noescape}</a></span>
      </div>
    </div>

    {include 'right-panel.tpl'}
    
  </div>
</div>