<?php
// kutubxonadagi yangi maqolalar umastery dan
echo '<div class="phdr"><a href="/library/">Maqolalar</a></b>(foydali)</div>';
$req = mysql_query("SELECT COUNT(*) FROM `library_texts` WHERE  `type` = 'bk' AND `moder` = '1'");
$total = mysql_result($req, 0);
if ($total > 0) {
    $req = mysql_query("SELECT * FROM `library_texts` WHERE  `type` = 'bk' AND `moder` = '1' ORDER BY `time` DESC LIMIT " . $start . "," . $kmess);
    $i = 0;
    while ($newf = mysql_fetch_array($req)) {
        echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
echo '<img src="img/gb.png" width="16" height="16" align="middle" /> <b><a href="../library/index.php?id=' . $newf['id'] . '">' . htmlentities($newf['name'], ENT_QUOTES, 'UTF-8') . '</a></b><br/>';
        echo ' <div class="sub">Qo`shildi:  (' . functions::display_date($newf['time']) . ') | O`qildi: ' . $newf['count'] . '</div>';
        echo '</div>';
          $i;
    }
    if ($total > $kmess) {
        echo '<p>' . functions::display_pagination('?get=maqola&amp;', $start, $total, $kmess) . '</p>';
    }
}
?>