Размер файла: 4.39Kb
<?
if(!@include("birzha/head.php")) exit;
switch ($act)
{
case 'history':
$chooze=intval(trim($_GET['s']));
$page=intval(trim($_GET['page']));
if ($chooze==1)
{
echo "<div class='fn'>---<br/><b>Ввод</b> | <a href='?act=history&s=2'>Вывод</a> | <a href='?act=history'>Ставки</a> | <a href='?act=history&s=3'>Покупки</a><br/>---<br/>";
}
elseif ($chooze==2)
{
echo "<div class='fn'>---<br/><b>Вывод</b> | <a href='?act=history&s=1'>Ввод</a> | <a href='?act=history'>Ставки</a> | <a href='?act=history&s=3'>Покупки</a><br/>---<br/>";
}
elseif ($chooze==3)
{
echo "<div class='fn'>---<br/><b>Покупки</b> | <a href='?act=history&s=1'>Ввод</a> | <a href='?act=history&s=2'>Вывод</a> | <a href='?act=history'>Ставки</a><br/>---<br/>";
}
else
{
echo "<div class='fn'>---<br/><b>Ставки</b> | <a href='?act=history&s=1'>Ввод</a> | <a href='?act=history&s=2'>Вывод</a> | <a href='?act=history&s=3'>Покупки</a><br/>---<br/>";
}
if ($chooze==1)
{
$sql=mysql_query("SELECT * FROM `history` WHERE `type`='1' and `summa`>0 and `login`='".$club['login']."';");
$checker=mysql_num_rows($sql);
}
elseif ($chooze==2)
{
$sql=mysql_query("SELECT * FROM `history` WHERE `type`='2' and `summa`>0 and `login`='".$club['login']."';");
$checker=mysql_num_rows($sql);
}
elseif ($chooze==3)
{
$sql=mysql_query("SELECT * FROM `history` WHERE `type`='4' and `summa`>0 and `credit`>0 and `login`='".$club['login']."';");
$checker=mysql_num_rows($sql);
}
else
{
$sql=mysql_query("SELECT * FROM `history` WHERE `type`='3' and `summa`>0 and `credit`>0 and `login`='".$club['login']."';");
$checker=mysql_num_rows($sql);
}
if (!isset($page) || !is_numeric($page) || $page<0 || $page>$checker)
{
$page=0;
}
else
{
$page=intval(trim($_GET['page']));
}
if ($chooze==1)
{
$baza=mysql_query("SELECT * FROM `history` WHERE `type`='1' and `summa`>0 and `login`='".$club['login']."' ORDER BY `time` DESC LIMIT $page,10;");
$num=mysql_num_rows($baza);
}
elseif ($chooze==2)
{
$baza=mysql_query("SELECT * FROM `history` WHERE `type`='2' and `summa`>0 and `login`='".$club['login']."' ORDER BY `time` DESC LIMIT $page,10;");
$num=mysql_num_rows($baza);
}
elseif ($chooze==3)
{
$baza=mysql_query("SELECT * FROM `history` WHERE `type`='4' and `summa`>0 and `credit`>0 and `login`='".$club['login']."' ORDER BY `time` DESC LIMIT $page,10;");
$num=mysql_num_rows($baza);
}
else
{
$baza=mysql_query("SELECT * FROM `history` WHERE `type`='3' and `summa`>0 and `credit`>0 and `login`='".$club['login']."' ORDER BY `time` DESC LIMIT $page,10;");
$num=mysql_num_rows($baza);
}
if ($num>0)
{
while ($getinf=mysql_fetch_array($baza))
{
$time=date("d.m.Y H:i:s",$getinf['time']);
if ($chooze==1)
{
echo "[".$time."]-[".$getinf['summa']."руб.]<br/>---<br/>";
}
elseif ($chooze==2)
{
echo "[".$time."]-[".$getinf['summa']."руб.]<br/>---<br/>";
}
elseif ($chooze==3)
{
echo "[".$time."]-[".$getinf['credit']."кр.]-[".$getinf['summa']."руб.]<br/>---<br/>";
}
else
{
echo "[".$time."]-[".$getinf['credit']."кр.]-[".$getinf['summa']."руб.]<br/>---<br/>";
}
}
$lim=$page+10;
if ($page>=10)
{
if ($chooze>0)
{
$pagenz=$page-10;
echo "<a href='?act=history&s=".$chooze."&page=".$pagenz."'>Пред.</a>";
if ($num<10||$lim==$checker)
{
echo "<br/>---<br/>";
}
}
else
{
$pagenz=$page-10;
echo "<a href='?act=history&page=".$pagenz."'>Пред.</a>";
if ($num<10||$lim==$checker)
{
echo "<br/>---<br/>";
}
}
}
if ($num>=10&&$page>=10&&$lim!=$checker)
{
echo " | ";
}
if ($num>=10&&$lim!=$checker)
{
if ($chooze>0)
{
$page+=10;
echo "<a href='?act=history&s=".$chooze."&page=".$page."'>След.</a><br/>---<br/>";
}
else
{
$page+=10;
echo "<a href='?act=history&page=".$page."'>След.</a><br/>---<br/>";
}
}
echo "</div>";
}
else
{
if ($chooze==1)
{
echo "История ввода средств пуста!<br/>---</div>";
}
elseif($chooze==2)
{
echo "История вывода средств пуста!<br/>---</div>";
}
elseif($chooze==3)
{
echo "История ваших покупок на бирже пуста!<br/>---</div>";
}
else
{
echo "История ваших ставок на бирже пуста!<br/>---</div>";
}
}
break;
}
include_once('birzha/down.php');
?>