Fublin,
$req = mysql_query("SELECT * FROM `mail_konts` WHERE `id_user`='" . $user_id . "' AND `type`='1' AND `read`='1'
union
SELECT * FROM `mail_konts` AND `id_user`='" . $user_id . "' AND `type`='1' AND `read`='2' ORDER BY `time` DESC LIMIT $start, $kmess");
echo '<form action="index.php?do=delete" method="post">';
while($row = mysql_fetch_assoc($req)) {
$res = mysql_fetch_assoc(mysql_query('SELECT * FROM `users` WHERE `id` = ' . $row['id_kont']));
echo ($i % 2) ? '<div class="list2">':'<div class="list1">';
if($row['read'] == 1){
$arg = array ('text' => '<a href="index.php?do=history&id=' . $res['id'] . '">', 'red' =>'<font size="3"><b><span class="red">', 'end' =>'</span></b></font>', 'mail' =>'');
echo functions::display_user($res, $arg) . '<div class="nn"><input type="checkbox" name="delch[]" value="' . $row['id_kont'] . '"/></div>';
}
if($row['read'] == 2){
$arg = array ('text' => '<a href="index.php?do=history&id=' . $res['id'] . '">',
'mail' =>''
);
}
echo functions::display_user($res, $arg) . '<div class="nn"><input type="checkbox" name="delch[]" value="' . $row['id_kont'] . '"/></div>';
echo '</div>';
++$i;