<?php if (!$pager->getNbResults()): ?>
<div class="lui__list_empty">Нет элементов</div>
<?php else: ?>

<table width="100%" cellspacing="0" cellpadding="3" border="0" class="lui__list_table<?php echo (isset($_partial_no_scroll) && $_partial_no_scroll === true ? '' : ' lui__list_table_donor lui__list_table__sourse'); ?>" id="<?php echo (isset($_partial_no_scroll) && $_partial_no_scroll === true ? '' : 'lui__list_table_donor'); ?>">
      <thead>
        <tr>
<!--          <th id="sf_admin_list_batch_actions" class="sf_admin_batch_checkbox__td"><input id="sf_admin_list_batch_checkbox" type="checkbox" onclick="$('.sf_admin_batch_checkbox').prop('checked', $(this).is(':checked'));" /></th>-->
          <?php include_partial('statistic/list_th_tabular', array('sort' => $sort, '_partial_filters' => (isset($_partial_filters) ? $_partial_filters : array()), '_partial' => $_partial)) ?>

          <th id="sf_admin_list_th_actions">&nbsp;</th>
        </tr>
      </thead>

      <tbody>
      <?php
      $e_count = Doctrine_Query::create()
          ->select("e.*")
          ->from("Export e")
          ->count();

      $b_count = Doctrine_Query::create()
          ->select("e.*")
          ->from("Export e")
          ->where("e.logic_type = 'bid'")
          ->count();

      $w_count = Doctrine_Query::create()
          ->select("e.*")
          ->from("Export e")
          ->where("e.logic_type = 'wait'")
          ->count();

      $baw_count = Doctrine_Query::create()
          ->select("e.*")
          ->from("Export e")
          ->where("e.logic_type = 'bid_after_wait'")
          ->count();

      $u_count = Doctrine_Query::create()
          ->select("u.*")
          ->from("User u")
          ->where("u.is_super_admin = '0'")
          ->count();

      $ub_count = Doctrine_Query::create()
          ->select("u.*")
          ->from("User u")
          ->leftJoin("u.Export e")
          ->where("u.is_super_admin = '0'")
          ->andWhere("e.logic_type = 'bid'")
          ->count();

      $uw_count = Doctrine_Query::create()
          ->select("u.*")
          ->from("User u")
          ->leftJoin("u.Export e")
          ->where("u.is_super_admin = '0'")
          ->andWhere("e.logic_type = 'wait'")
          ->count();

      $ubaw_count = Doctrine_Query::create()
          ->select("u.*")
          ->from("User u")
          ->leftJoin("u.Export e")
          ->where("u.is_super_admin = '0'")
          ->andWhere("e.logic_type = 'bid_after_wait'")
          ->count();

      ?>
      <tr class="sf_admin_row odd sf_admin_row_custom" data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Заявки «Будут копить»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $w_count . " из " . $e_count;?></td>
          <td></td>
      </tr>
      <tr class="sf_admin_row even  " data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Заявки «Накопили объём»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $baw_count . " из " . $e_count;?></td>
          <td></td>
      </tr>
      <tr class="sf_admin_row odd sf_admin_row_custom" data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Заявки «Оставили заявку на вывоз»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $b_count . " из " . $e_count;?></td>
          <td></td>
      </tr>
      <tr class="sf_admin_row even sf_admin_row_custom" data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Пользователи «Будут копить»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $uw_count . " из " . $u_count;?></td>
          <td></td>
      </tr>
      <tr class="sf_admin_row odd sf_admin_row_custom" data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Пользователи «Накопили объём»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $ubaw_count . " из " . $u_count;?></td>
          <td></td>
      </tr>
      <tr class="sf_admin_row even sf_admin_row_custom" data-href="" valign="top">
          <td class="sf_admin_enum sf_admin_list_td_logic_type">Пользователи «Оставили заявку на вывоз»</td>
          <td class="sf_admin_text sf_admin_list_td_weight"><?php echo $ub_count . " из " . $u_count;?></td>
          <td></td>
      </tr>

<!--        --><?php //$notice_ids = (class_exists(Export) && method_exists(Export, 'getNoticeIds')) ? Export::getNoticeIds() : array();?>
<!--        --><?php //foreach ($pager->getResults() as $i => $export): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
<!--          <tr class="sf_admin_row --><?php //echo $odd ?><!-- --><?php //echo (in_array($export->getId(), $notice_ids) ? 'sf_admin_row_notice' : '') ?><!-- --><?php //echo !$sf_user->hasCredential('statistic_edit') ? ' sf_admin_tr_stop' : ''?><!--" valign="top" data-href="--><?php //echo ($_partial && (!isset($_partial_no_scroll) || $_partial_no_scroll === false) ? '?_spath=' : '') . url_for('export/edit?id=' . $export->getPrimaryKey() . (isset($_partial_no_scroll) && $_partial_no_scroll === true ? '&return=' . $sf_request->getUri() : ''));?><!--">-->
<!--            --><?php ////include_partial('statistic/list_td_batch_actions', array('export' => $export, 'helper' => $helper)) ?>
<!--            --><?php //include_partial('statistic/list_td_tabular', array('export' => $export, '_partial_filters' => (isset($_partial_filters) ? $_partial_filters->getRawValue() : array()), '_partial' => $_partial)) ?>
<!--            <td>-->
<!--            --><?php ////include_partial('statistic/list_td_actions', array('export' => $export, 'helper' => $helper)) ?>
<!--            </td>-->
<!--          </tr>-->
<!--        --><?php //endforeach; ?>
      </tbody>
</table>
<?php endif; ?>

<?php //include_partial('statistic/list_footer', array('export' => $export, 'helper' => $helper)) ?>
<style type="text/css">
    .lui__list_actions__wrapper{
        display: none;
    }
    .sf_admin_row_custom{
        cursor: default;
    }
</style>