<?
$system['title'] = 'Гости';
require SYS . 'header.php';

$k_post=$sql -> selectCount("SELECT COUNT(*) FROM `users` WHERE `credit` > '0' ");

if ($k_post == 0) {
  ?>
  <div class="alert" style="margin: 2px;">Список гостей пуст</div>
  <?
} else {
  $k_page = k_page($k_post, $system['page_str']);
  $page = page($k_page);
  $start =  $system['page_str'] * $page -  $system['page_str'];

$array = $sql -> select("SELECT * FROM `users` WHERE `credit` > '0'  ORDER BY `credit` DESC LIMIT $start, $system[page_str]");

foreach ($array AS $guest){
?><div class='nav1'>
<?= login($guest['id'], 1)?> Кредит: <?=$guest['credit']?> руб.<?

echo "  </div>\n";
}

  if ($k_page > 1) { 
    str('?func=' . $func .  '&amp;', $k_page, $page);
  }
}
