File size: 1.58Kb
<?php
$k=$query3;
if ($k<1) $k=1;
# Выбор списка услуг
$q3=@mysql(DBName,"SELECT * FROM `finance_billing` ORDER BY `time` DESC LIMIT ".($k-1).", 26");
$s=@mysql_num_rows($q3);
print '<table border=0 width=100% bgcolor=#70E2A0><tr bgcolor=#D8998B>'.
'<th><b>ID</b></th>'.
'<th><b>Дата/Время</b></th>'.
'<th><b>Пользователь</b></th>'.
'<th><b>ID_user</b></th>'.
'<th><b>Тип</b></th>'.
'<th><b>Сумма</b></th>'.
'<th><b>Описание</b></th>'.
'<th><b>Остаток</b></th>'.
'</tr>';
if ($s>25) {$s=25;$nextp=true;} else $nextp=false;
for ($i=0;$i<$s;$i++)
{
$data3=@mysql_fetch_array($q3);
if ($col) {$color='#96BDE0';$col=false;} else {$color='#7AABD8';$col=true;}
print '<tr bgcolor='.$color.'>';
print '<th>'.($k+$i).'</th>';
print '<th> '.date("j.m.Y H:i",$data3['time']).'</a> </th>';
$q__=@mysql(DBName,"SELECT * FROM `users` WHERE `num` = '".$data3['id_user']."' LIMIT 0, 1");
$data__=mysql_fetch_array($q__);
print '<th> <a href="?'.$id.'/finance/users/'.$data3['id_user'].'">'.$data__['login'].'.'.$data__['domain'].'.ru</a> </th>';
print '<th> '.$data3['id_user'].' </th>';
print '<th>'.$data3['direct'].'</th>';
print '<th>'.sprintf ("%01.2f",$data3['pay']).' у.е.</th>';
print '<th>'.$data3['descr'].'</th>';
print '<th>'.sprintf ("%01.2f",$data3['sum']).' у.е.</th>';
print '</tr>';
}
print '</table>';
if ($k>1) print '<b><a href="?'.$id.'/finance/history/all/'.($k-25).'"><<<Назад</a>';
if ($nextp) print ' <a href="?'.$id.'/finance/history/all/'.($k+25).'">Далее>>></a></b>';
exit;
?>