<?php $q = ($sf_request->hasParameter('q') && $sf_request->getParameter('q') != '' ? '&q=' . $sf_request->getParameter('q') : ''); ?>
<?php slot('sf_admin.current_header') ?>
<th class="sf_admin_text sf_admin_list_th_name">
  <?php if ('name' == $sort[0]): ?>
    <?php echo link_to(__('Имя', array(), 'messages'), '@callback', array('query_string' => 'sort=name&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc') . $q)) ?>
    <?php echo ($sort[1] == 'asc' ? '▼' : '▲');?>
  <?php else: ?>
    <?php echo link_to(__('Имя', array(), 'messages'), '@callback', array('query_string' => 'sort=name&sort_type=desc' . $q)) ?>
  <?php endif; ?>
</th>
<?php end_slot(); ?>
<?php include_slot('sf_admin.current_header') ?><?php $q = ($sf_request->hasParameter('q') && $sf_request->getParameter('q') != '' ? '&q=' . $sf_request->getParameter('q') : ''); ?>
<?php slot('sf_admin.current_header') ?>
<th class="sf_admin_text sf_admin_list_th_phone">
  <?php if ('phone' == $sort[0]): ?>
    <?php echo link_to(__('Телефон', array(), 'messages'), '@callback', array('query_string' => 'sort=phone&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc') . $q)) ?>
    <?php echo ($sort[1] == 'asc' ? '▼' : '▲');?>
  <?php else: ?>
    <?php echo link_to(__('Телефон', array(), 'messages'), '@callback', array('query_string' => 'sort=phone&sort_type=desc' . $q)) ?>
  <?php endif; ?>
</th>
<?php end_slot(); ?>
<?php include_slot('sf_admin.current_header') ?><?php $q = ($sf_request->hasParameter('q') && $sf_request->getParameter('q') != '' ? '&q=' . $sf_request->getParameter('q') : ''); ?>
<?php slot('sf_admin.current_header') ?>
<th class="sf_admin_boolean sf_admin_list_th_is_done">
  <?php if ('is_done' == $sort[0]): ?>
    <?php echo link_to(__('Позвонили', array(), 'messages'), '@callback', array('query_string' => 'sort=is_done&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc') . $q)) ?>
    <?php echo ($sort[1] == 'asc' ? '▼' : '▲');?>
  <?php else: ?>
    <?php echo link_to(__('Позвонили', array(), 'messages'), '@callback', array('query_string' => 'sort=is_done&sort_type=desc' . $q)) ?>
  <?php endif; ?>
</th>
<?php end_slot(); ?>
<?php
if ($tab == '1') {
include_slot('sf_admin.current_header') ?><?php $q = ($sf_request->hasParameter('q') && $sf_request->getParameter('q') != '' ? '&q=' . $sf_request->getParameter('q') : ''); ?>
<?php slot('sf_admin.current_header') ?>
    <th class="sf_admin_text sf_admin_list_th_offer_id">
        <?php if ('offer_id' == $sort[0]): ?>
            <?php echo link_to(__('Товар', array(), 'messages'), '@callback', array('query_string' => 'sort=offer_id&sort_type=' . ($sort[1] == 'asc' ? 'desc' : 'asc') . $q)) ?>
            <?php echo($sort[1] == 'asc' ? '▼' : '▲'); ?>
        <?php else: ?>
            <?php echo link_to(__('Товар', array(), 'messages'), '@callback', array('query_string' => 'sort=offer_id&sort_type=desc' . $q)) ?>
        <?php endif; ?>
    </th>
    <?php end_slot();
}?>
<?php include_slot('sf_admin.current_header') ?><?php $q = ($sf_request->hasParameter('q') && $sf_request->getParameter('q') != '' ? '&q=' . $sf_request->getParameter('q') : ''); ?>
<?php slot('sf_admin.current_header') ?>
<th class="sf_admin_date sf_admin_list_th_created_at">
  <?php if ('created_at' == $sort[0]): ?>
    <?php echo link_to(__('Дата', array(), 'messages'), '@callback', array('query_string' => 'sort=created_at&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc') . $q)) ?>
    <?php echo ($sort[1] == 'asc' ? '▼' : '▲');?>
  <?php else: ?>
    <?php echo link_to(__('Дата', array(), 'messages'), '@callback', array('query_string' => 'sort=created_at&sort_type=desc' . $q)) ?>
  <?php endif; ?>
</th>
<?php end_slot(); ?>
<?php include_slot('sf_admin.current_header') ?>