Файл: account.php
Строк: 805
<?
$urlpage='Страница аккаунта';
include("header.php");
require("inc/connect.inc.php");
if (isset($_COOKIE['id']) and isset($_COOKIE['hash']))
{
$query = mysql_query("SELECT *,INET_NTOA(login_ip) as login_ip FROM ".$db_pref."users WHERE id = '".intval($_COOKIE['id'])."' LIMIT 1");
$userdata = mysql_fetch_assoc($query);
if(($userdata['hash'] !== $_COOKIE['hash']) or ($userdata['id'] !== $_COOKIE['id'])
or (($userdata['login_ip'] !== $_SERVER['REMOTE_ADDR']) and ($userdata['login_ip'] !== "0.0.0.0")))
{
echo "<div align='center'><font color='red'><br><b>".$lang['error16']."</b></font><br><br></div>";
}
else
{
include("inc/usermenu.inc.php");
if($stat==0):
if ($roworder >0){
echo"<br><div align='center'><font color='green'><b>{$lang['account']}</b></font><br><br></div>";
}
else{
echo"<br><div align='center'><font color='red'><b>{$lang['account']}</b></font><br><br></div><br>";
}
?>
<table class="form" width="95%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td align="center"><i><h3><?=$lang['zakaz'];?></h3></i></td>
</tr>
<?
$sql1=mysql_query("select*from ".$db_pref."pays");
$row1=mysql_fetch_array($sql1);
$mat=$row1['urovni'];
$sql=mysql_query("select*from ".$db_pref."neworders where name='$user'");
$yes=mysql_num_rows($sql);
if($yes==0):
if($stat<$mat):
$sql1=mysql_query("select*from ".$db_pref."pays");
$row1=mysql_fetch_array($sql1);
$lang['zakaz1']=str_replace("{pay}",$row1['pay'],$lang['zakaz1']);
echo"<tr><td align='center' ><font color='red'>{$lang['zakaz1']} $money </b>";
?>
<br>
<br>
<b><a class="button" href="order.php"><i>.:: <?=$lang['zakaz2'];?> ::.</i></a></b></td>
</tr>
<?
endif;
else:
$row=mysql_fetch_array($sql);
$lang['zakaz3']=str_replace("{ur}",$row['rang'],$lang['zakaz3']);
?>
<tr>
<td align="center" ><?=$lang['zakaz3'];?></td>
</tr>
<tr>
<td align="center" >
<?=$lang['zakaz4'];?>
</td>
</tr>
<tr>
<td align="center" ><br><b><a class="button" href="sendmail.php?from_email=<?=$email;?>&tema=<?=$lang['zakaz5'];?>">..:: <?=$lang['mail4'];?> ::..</a></b></td>
</tr>
<?
endif;
?>
</table>
<?
else:
?>
<br>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<td colspan="2" align="center" width="95%">
<table background="images/10.png" class="form" width="95%" border="0" align="center" cellpadding="2" cellspacing="2">
<?
$sql1=mysql_query("select*from ".$db_pref."pays");
$row1=mysql_fetch_array($sql1);
$mat=$row1['urovni'];
$sql=mysql_query("select*from ".$db_pref."neworders where name='$user'");
$yes=mysql_num_rows($sql);
if($yes==0):
if($stat<$mat):
?>
<tr>
<td align="center"><i><h2><?=$lang['zakaz'];?></h2></i><br></td>
</tr>
<tr>
<?
$sql1=mysql_query("select*from ".$db_pref."pays");
$row1=mysql_fetch_array($sql1);
if($stat=='1'):
$pay=$row1['pay2'];
elseif($stat=='2'):
$pay=$row1['pay3'];
elseif($stat=="3"):
$pay=$row1['pay4'];
elseif($stat=="4"):
$pay=$row1['pay5'];
elseif($stat=="5"):
$pay=$row1['pay6'];
elseif($stat=="6"):
$pay=$row1['pay7'];
elseif($stat=="7"):
$pay=$row1['pay8'];
elseif($stat=="8"):
$pay=$row1['pay9'];
elseif($stat=="9"):
$pay=$row1['pay10'];
endif;
$lang['zakaz1']=str_replace("{pay}",$pay,$lang['zakaz1']);
?>
<td align="center" ><font color="red"><?=$lang['zakaz1'];?>
<?
echo"$money</b>";
?>
<br>
<br>
<b><a class="button" href="order.php"><i>.:: <?=$lang['zakaz2'];?> ::.</i></a></b></td>
</tr>
<?
else:
?>
<tr>
<td align="center" ><?=$lang['zakaz6'];?></td>
</tr>
<tr>
<td align="center" ><?=$lang['zakaz7'];?></td>
</tr>
<?
endif;
else:
$row=mysql_fetch_array($sql);
$lang['zakaz3']=str_replace("{ur}",$row['rang'],$lang['zakaz3']);
?>
<tr>
<td class="<?=$moduletable;?>" align="center" border="1"><i><h3><?=$lang['zakaz'];?></h3></i></td>
</tr>
<tr>
<td align="center" ><?=$lang['zakaz3'];?></td>
</tr>
<tr>
<td align="center" >
<?=$lang['zakaz4'];?>
</td>
</tr>
<tr>
<td align="center" ><b><br><a class="button" href="sendmail.php?from_email=<?=$email;?>&tema=<?=$lang['zakaz5'];?>">..:: <?=$lang['mail4'];?> ::..</a></b></td>
</tr>
<?
endif;
?>
</table>
</td>
</tr>
<tr>
<td width="50%" valign="top" align="center"><br>
<?if($matrix=="YES"){
?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td class="form3" colspan="2" align="center"><i><?=$lang['account7'];?></i></td>
</tr>
<tr>
<td class="form3"><?=$lang['account8'];?></td>
<td class="form3"><?=$lang['account9'];?></td>
</tr>
<tr>
<td class="form3">1 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent='$user'");
$ref1=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref1>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=1"><font color="green"><?=$ref1;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?>
</td>
</tr>
<?if($mat>=2){?>
<tr>
<td class="form3">2 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent2='$user'");
$ref2=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref2>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=2&ref=2"><font color="green"><?=$ref2;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?>
</td>
</tr>
<?}if($mat>=3){?>
<tr>
<td class="form3">3 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent3='$user'");
$ref3=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref3>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=3&ref=3"><font color="green"><?=$ref3;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?>
</td>
</tr>
<?}if($mat>=4){?>
<tr>
<td class="form3">4 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent4='$user'");
$ref4=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref4>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=4&ref=4"><font color="green"><?=$ref4;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?>
</td>
</tr>
<?}if($mat>=5){?>
<tr>
<td class="form3">5 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent5='$user'");
$ref5=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref5>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=5&ref=5"><font color="green"><?=$ref5;?>/<?=$mat_ref5;?></font></a><?else:?>0/<?=$mat_ref5;?><?endif;?>
</td>
</tr>
<?}if($mat>=6){?>
<tr>
<td class="form3">6 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent6='$user'");
$ref6=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref6>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=6&ref=6"><font color="green"><?=$ref6;?>/<?=$mat_ref6;?></font></a><?else:?>0/<?=$mat_ref6;?><?endif;?>
</td>
</tr>
<?}if($mat>=7){?>
<tr>
<td class="form3">7 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent7='$user'");
$ref7=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref7>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=7&ref=7"><font color="green"><?=$ref7;?>/<?=$mat_ref7;?></font></a><?else:?>0/<?=$mat_ref7;?><?endif;?>
</td>
</tr>
<?}if($mat>=8){?>
<tr>
<td class="form3">8 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent8='$user'");
$ref8=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref8>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=8&ref=8"><font color="green"><?=$ref8;?>/<?=$mat_ref8;?></font></a><?else:?>0/<?=$mat_ref8;?><?endif;?>
</td>
</tr>
<?}if($mat>=9){?>
<tr>
<td class="form3">9 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent9='$user'");
$ref9=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref9>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=9&ref=9"><font color="green"><?=$ref9;?>/<?=$mat_ref9;?></font></a><?else:?>0/<?=$mat_ref9;?><?endif;?>
</td>
</tr>
<?}if($mat>=10){?>
<tr>
<td class="form3">10 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent10='$user'");
$ref10=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref10>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=10&ref=10"><font color="green"><?=$ref10;?>/<?=$mat_ref10;?></font></a><?else:?>0/<?=$mat_ref10;?><?endif;?>
</td>
</tr>
<?}?>
</table>
<?
}else{?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td class="form3" colspan="2" align="center"><i><?=$lang['account7'];?></i></td>
</tr>
<tr>
<td class="form3"><?=$lang['account8'];?></td>
<td class="form3"><?=$lang['account9'];?></td>
</tr>
<tr>
<td class="form3">1 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent='$user'");
$ref1=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref1>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=1"><font color="green"><?=$ref1;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">2 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent2='$user'");
$ref2=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref2>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=2&ref=2"><font color="green"><?=$ref2;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">3 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent3='$user'");
$ref3=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref3>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=3&ref=3"><font color="green"><?=$ref3;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">4 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent4='$user'");
$ref4=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref4>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=4&ref=4"><font color="green"><?=$ref4;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">5 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent='$user'");
$ref1=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref1>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=5"><font color="green"><?=$ref1;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">6 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent2='$user'");
$ref2=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref2>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=6&ref=2"><font color="green"><?=$ref2;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">7 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent3='$user'");
$ref3=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref3>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=7&ref=3"><font color="green"><?=$ref3;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?>
</td>
</tr>
<tr>
<td class="form3">8 <?=$lang['account10'];?></td>
<?
$sql=mysql_query("select*from ".$db_pref."users where parent4='$user'");
$ref4=mysql_num_rows($sql);
?>
<td class="form3">
<?if($ref4>0):?><a title="<?=$lang['ref7'];?>" href="referrals.php?to=8&ref=4"><font color="green"><?=$ref4;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?>
</td>
</tr>
</table>
<?}?>
</td>
<td width="50%" valign="top" align="center"><br>
<?
if($matrix=="YES"){
?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<td class="form3"colspan="3" align="center"><i><?=$lang['account3'];?></i></td>
</tr>
<tr>
<td class="form3"><?=$lang['account4'];?></td>
<td class="form3"><?=$lang['account5'];?></td>
<td class="form3"><?=$lang['account6'];?></td>
</tr>
<tr>
<td class="form3">1</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='1'");
$ord1=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord1>0):?><a href="new_order.php?to=1"><font color="red"><?=$ord1;?></font></a><?else: echo $ord1;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='1'");
$cord1=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord1>0):?><a href="old_order.php?to=1"><font color="green"><?=$cord1;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?></td>
</tr>
<?if($mat>=2){?>
<tr>
<td class="form3">2</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='2'");
$ord2=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord2>0):?><a href="new_order.php?to=2"><font color="red"><?=$ord2;?></font></a><?else: echo $ord2;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='2'");
$cord2=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord2>0):?><a href="old_order.php?to=2"><font color="green"><?=$cord2;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?></td>
</tr>
<?}if($mat>=3){?>
<tr>
<td class="form3">3</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='3'");
$ord3=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord3>0):?><a href="new_order.php?to=3"><font color="red"><?=$ord3;?></font></a><?else: echo $ord3;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='3'");
$cord3=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord3>0):?><a href="old_order.php?to=3"><font color="green"><?=$cord3;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?></td>
</tr>
<?}if($mat>=4){?>
<tr>
<td class="form3">4</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='4'");
$ord4=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord4>0):?><a href="new_order.php?to=4"><font color="red"><?=$ord4;?></font></a><?else: echo $ord4;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='4'");
$cord4=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord4>0):?><a href="old_order.php?to=4"><font color="green"><?=$cord4;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?></td>
</tr>
<?}if($mat>=5){?>
<tr>
<td class="form3">5</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='5'");
$ord5=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord5>0):?><a href="new_order.php?to=5"><font color="red"><?=$ord5;?></font></a><?else: echo $ord5;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='5'");
$cord5=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord5>0):?><a href="old_order.php?to=5"><font color="green"><?=$cord5;?>/<?=$mat_ref5;?></font></a><?else:?>0/<?=$mat_ref5;?><?endif;?></td>
</tr>
<?}if($mat>=6){?>
<tr>
<td class="form3">6</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='6'");
$ord6=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord6>0):?><a href="new_order.php?to=6"><font color="red"><?=$ord6;?></font></a><?else: echo $ord6;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='6'");
$cord6=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord6>0):?><a href="old_order.php?to=6"><font color="green"><?=$cord6;?>/<?=$mat_ref6;?></font></a><?else:?>0/<?=$mat_ref6;?><?endif;?></td>
</tr>
<?}if($mat>=7){?>
<tr>
<td class="form3">7</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='7'");
$ord7=mysql_num_rows($sql);
n?>
<td class="form3"><?if($ord7>0):?><a href="new_order.php?to=7"><font color="red"><?=$ord7;?></font></a><?else: echo $ord7;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='7'");
$cord7=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord7>0):?><a href="old_order.php?to=7"><font color="green"><?=$cord7;?>/<?=$mat_ref7;?></font></a><?else:?>0/<?=$mat_ref7;?><?endif;?></td>
</tr>
<?}if($mat>=8){?>
<tr>
<td class="form3">8</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='8'");
$ord8=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord8>0):?><a href="new_order.php?to=8"><font color="red"><?=$ord8;?></font></a><?else: echo $ord8;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='8'");
$cord8=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord8>0):?><a href="old_order.php?to=8"><font color="green"><?=$cord8;?>/<?=$mat_ref8;?></font></a><?else:?>0/<?=$mat_ref8;?><?endif;?></td>
</tr>
<?}if($mat>=9){?>
<tr>
<td class="form3">9</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='9'");
$ord9=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord9>0):?><a href="new_order.php?to=9"><font color="red"><?=$ord9;?></font></a><?else: echo $ord9;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='9'");
$cord9=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord9>0):?><a href="old_order.php?to=9"><font color="green"><?=$cord9;?>/<?=$mat_ref9;?></font></a><?else:?>0/<?=$mat_ref9;?><?endif;?></td>
</tr>
<?}if($mat>=10){?>
<tr>
<td class="form3">10</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='10'");
$ord10=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord10>0):?><a href="new_order.php?to=10"><font color="red"><?=$ord10;?></font></a><?else: echo $ord10;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='10'");
$cord10=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord10>0):?><a href="old_order.php?to=10"><font color="green"><?=$cord10;?>/<?=$mat_ref10;?></font></a><?else:?>0/<?=$mat_ref10;?><?endif;?></td>
</tr>
<?}?>
</table>
<?
}
else{
?>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<td class="form3"colspan="3" align="center"><i><?=$lang['account3'];?></i></td>
</tr>
<tr>
<td class="form3"><?=$lang['account4'];?></td>
<td class="form3"><?=$lang['account5'];?></td>
<td class="form3"><?=$lang['account6'];?></td>
</tr>
<tr>
<td class="form3">1</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='1'");
$ord1=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord1>0):?><a href="new_order.php?to=1"><font color="red"><?=$ord1;?></font></a><?else: echo $ord1;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='1'");
$cord1=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord1>0):?><a href="old_order.php?to=1"><font color="green"><?=$cord1;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?></td>
</tr>
<tr>
<td class="form3">2</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='2'");
$ord2=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord2>0):?><a href="new_order.php?to=2"><font color="red"><?=$ord2;?></font></a><?else: echo $ord2;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='2'");
$cord2=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord2>0):?><a href="old_order.php?to=2"><font color="green"><?=$cord2;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?></td>
</tr>
<tr>
<td class="form3">3</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='3'");
$ord3=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord3>0):?><a href="new_order.php?to=3"><font color="red"><?=$ord3;?></font></a><?else: echo $ord3;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='3'");
$cord3=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord3>0):?><a href="old_order.php?to=3"><font color="green"><?=$cord3;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?></td>
</tr>
<tr>
<td class="form3">4</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='4'");
$ord4=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord4>0):?><a href="new_order.php?to=4"><font color="red"><?=$ord4;?></font></a><?else: echo $ord4;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='4'");
$cord4=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord4>0):?><a href="old_order.php?to=4"><font color="green"><?=$cord4;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?></td>
</tr>
<tr>
<td class="form3">5</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='5'");
$ord5=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord5>0):?><a href="new_order.php?to=5"><font color="red"><?=$ord5;?></font></a><?else: echo $ord5;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='5'");
$cord5=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord5>0):?><a href="old_order.php?to=5"><font color="green"><?=$cord5;?>/<?=$mat_ref;?></font></a><?else:?>0/<?=$mat_ref;?><?endif;?></td>
</tr>
<tr>
<td class="form3">6</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='6'");
$ord6=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord6>0):?><a href="new_order.php?to=6"><font color="red"><?=$ord6;?></font></a><?else: echo $ord6;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='6'");
$cord6=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord6>0):?><a href="old_order.php?to=6"><font color="green"><?=$cord6;?>/<?=$mat_ref2;?></font></a><?else:?>0/<?=$mat_ref2;?><?endif;?></td>
</tr>
<tr>
<td class="form3">7</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='7'");
$ord7=mysql_num_rows($sql);
n?>
<td class="form3"><?if($ord7>0):?><a href="new_order.php?to=7"><font color="red"><?=$ord7;?></font></a><?else: echo $ord7;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='7'");
$cord7=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord7>0):?><a href="old_order.php?to=7"><font color="green"><?=$cord7;?>/<?=$mat_ref3;?></font></a><?else:?>0/<?=$mat_ref3;?><?endif;?></td>
</tr>
<tr>
<td class="form3">8</td>
<?
$sql=mysql_query("select*from ".$db_pref."neworders where sname='$user' and rang='8'");
$ord8=mysql_num_rows($sql);
?>
<td class="form3"><?if($ord8>0):?><a href="new_order.php?to=8"><font color="red"><?=$ord8;?></font></a><?else: echo $ord8;endif;?></td>
<?
$sql=mysql_query("select*from ".$db_pref."oldorders where sname='$user' and rang='8'");
$cord8=mysql_num_rows($sql);
?>
<td class="form3"><?if($cord8>0):?><a href="old_order.php?to=8"><font color="green"><?=$cord8;?>/<?=$mat_ref4;?></font></a><?else:?>0/<?=$mat_ref4;?><?endif;?></td>
</tr>
</table>
<?}?>
</td>
</tr>
</table>
<?
endif;
$sql=mysql_query("select*from ".$db_pref."news where in_account='YES'");
$row=mysql_fetch_array($sql);
if($row>0):
?><br>
<div align="center">
<div class="s5_mod_h3_l">
<div class="s5_mod_h3_r">
<div class="s5_mod_h3_m">
<h3 class="s5_mod_h3"><span class="s5_h3_first"><?=$lang['news3'];?></span></h3>
</div>
</div>
</div>
</div>
<?
$sql=mysql_query("select*from ".$db_pref."news where in_account='YES' order by id desc");
while($row=mysql_fetch_array($sql)) {
$id=$row['id'];
$date=$row['date'];
$titles=$row['titles'];
$descriptions=$row['descriptions'];
$tags_smilie = array(
"/:angry:/siU",
"/:blink:/siU",
"/:blush:/siU",
"/:canthearyou:/siU",
"/:confused:/siU",
"/:cool:/siU",
"/:crazyfun:/siU",
"/:crazy:/siU",
"/:cry:/siU",
"/:disappointed:/siU",
"/:dontcare:/siU",
"/:dontknow:/siU",
"/:flag:/siU",
"/:flirt:/siU",
"/:funny:/siU",
"/:glasses:/siU",
"/:happy:/siU",
"/:hobo:/siU",
"/:huh:/siU",
"/:idea:/siU",
"/:insane:/siU",
"/:jumping:/siU",
"/:lol:/siU",
"/:love:/siU",
"/:mad:/siU",
"/:music:/siU",
"/:mybb:/siU",
"/:neutral:/siU",
"/:no:/siU",
"/:nope:/siU",
"/:offtop:/siU",
"/:playful:/siU",
"/:question:/siU",
"/:rain:/siU",
"/:rofl:/siU",
"/:rolleyes:/siU",
"/:sad:/siU",
"/:sceptic:/siU",
"/:shine:/siU",
"/:shock:/siU",
"/:sick:/siU",
"/:smile:/siU",
"/:smoke:/siU",
"/:stupor:/siU",
"/:surprise:/siU",
"/:suspicious:/siU",
"/:tired:/siU",
"/:tomato:/siU",
"/:tongue:/siU",
"/:unsure:/siU",
"/:wacko:/siU",
"/:whistle:/siU",
"/:wink:/siU",
"/:writing:/siU",
"/:yep:/siU"
);
$html_smilie = array(
"<img src=images/smilies/angry.gif width=20 height=18 border=0>",
"<img src=images/smilies/blink.gif width=19 height=20 border=0>",
"<img src=images/smilies/blush.gif width=21 height=21 border=0>",
"<img src=images/smilies/canthearyou.gif width=35 height=18 border=0>",
"<img src=images/smilies/confused.gif width=20 height=18 border=0>",
"<img src=images/smilies/cool.gif width=62 height=21 border=0>",
"<img src=images/smilies/crazyfun.gif width=19 height=17 border=0>",
"<img src=images/smilies/crazy.gif width=21 height=17 border=0>",
"<img src=images/smilies/cry.gif width=21 height=18 border=0>",
"<img src=images/smilies/disappointed.gif width=19 height=16 border=0>",
"<img src=images/smilies/dontcare.gif width=19 height=17 border=0>",
"<img src=images/smilies/dontknow.gif width=31 height=20 border=0>",
"<img src=images/smilies/flag.gif width=27 height=28 border=0>",
"<img src=images/smilies/flirt.gif width=19 height=20 border=0>",
"<img src=images/smilies/funny.gif width=19 height=16 border=0>",
"<img src=images/smilies/glasses.gif width=21 height=17 border=0>",
"<img src=images/smilies/happy.gif width=19 height=17 border=0>",
"<img src=images/smilies/hobo.gif width=21 height=21 border=0>",
"<img src=images/smilies/huh.gif width=19 height=20 border=0>",
"<img src=images/smilies/idea.gif width=35 height=31 border=0>",
"<img src=images/smilies/insane.gif width=21 height=16 border=0>",
"<img src=images/smilies/jumping.gif width=46 height=33 border=0>",
"<img src=images/smilies/lol.gif width=19 height=17 border=0>",
"<img src=images/smilies/love.gif width=21 height=30 border=0>",
"<img src=images/smilies/mad.gif width=21 height=18 border=0>",
"<img src=images/smilies/music.gif width=30 height=21 border=0>",
"<img src=images/smilies/mybb.gif width=50 height=26 border=0>",
"<img src=images/smilies/neutral.gif width=19 height=17 border=0>",
"<img src=images/smilies/no.gif width=20 height=18 border=0>",
"<img src=images/smilies/nope.gif width=20 height=18 border=0>",
"<img src=images/smilies/offtop.gif width=50 height=40 border=0>",
"<img src=images/smilies/playful.gif width=19 height=20 border=0>",
"<img src=images/smilies/question.gif width=27 height=19 border=0>",
"<img src=images/smilies/rain.gif width=32 height=35 border=0>",
"<img src=images/smilies/rofl.gif width=30 height=20 border=0>",
"<img src=images/smilies/rolleyes.gif width=19 height=17 border=0>",
"<img src=images/smilies/sad.gif width=19 height=20 border=0>",
"<img src=images/smilies/sceptic.gif width=19 height=17 border=0>",
"<img src=images/smilies/shine.gif width=21 height=16 border=0>",
"<img src=images/smilies/shock.gif width=21 height=21 border=0>",
"<img src=images/smilies/sick.gif width=40 height=20 border=0>",
"<img src=images/smilies/smile.gif width=19 height=20 border=0>",
"<img src=images/smilies/smoke.gif width=21 height=21 border=0>",
"<img src=images/smilies/stupor.gif width=21 height=17 border=0>",
"<img src=images/smilies/surprise.gif width=28 height=25 border=0>",
"<img src=images/smilies/suspicious.gif width=19 height=19 border=0>",
"<img src=images/smilies/tired.gif width=43 height=20 border=0>",
"<img src=images/smilies/tomato.gif width=51 height=45 border=0>",
"<img src=images/smilies/tongue.gif width=20 height=18 border=0>",
"<img src=images/smilies/unsure.gif width=19 height=20 border=0>",
"<img src=images/smilies/wacko.gif width=20 height=18 border=0>",
"<img src=images/smilies/whistle.gif width=32 height=16 border=0>",
"<img src=images/smilies/wink.gif width=19 height=20 border=0>",
"<img src=images/smilies/writing.gif width=22 height=24 border=0>",
"<img src=images/smilies/yep.gif width=19 height=18 border=0>"
);
$descriptions=preg_replace($tags_smilie, $html_smilie, $descriptions);
$tags_text = array(
"/[font=(.*)](.*)[/font]/siU",
"/[size=(8|10|12|14|16|18|20)](.*)[/size]/siU",
"/[b](.*)[/b]/siU",
"/[i](.*)[/i]/siU",
"/[u](.*)[/u]/siU",
"/[s](.*)[/s]/siU",
"/[left](.*)[/left]/siU",
"/[center](.*)[/center]/siU",
"/[right](.*)[/right]/siU",
"/[url=(.*)](.*)[/url]/siU",
"/[email](.*)[/email]/siU",
"/[img](.*)[/img]/siU",
"/[quote](.*)[/quote]/siU",
"/[quote=(.*)](.*)[/quote]/siU",
"/[color=(.*)](.*)[/color]/siU"
);
$html_text = array(
"<span style='font-family:\1'>\2</span>",
"<span style='font-size:\1px'>\2</span>",
"<strong>\1</strong>",
"<i>\1</i>",
"<u>\1</u>",
"<s>\1</s>",
"<div align='left'>\1</div>",
"<div align='center'>\1</div>",
"<div align='right'>\1</div>",
"<a href='\1' target='_blank'>\2</a>",
"<a href='mailto:\1'>\1</a>",
"<table border='0' align='center' width='100%' cellpadding='4' cellspacing='0'><tr><td><span style='font-size: 11px'><b>Прикрепленное изображение:</b></span></td></tr><tr><td bgcolor='#000000' style='border: #C0C0C0 1px solid;'><a href="\1" target="_blank"><img src="\1"></a></td></tr></table>",
"<table border='0' align='center' width='100%' cellpadding='4' cellspacing='0'><tr><td><span style='font-size: 11px'><b>Цитата:</b></span></td></tr><tr><td bgcolor='#000000' style='border: #C0C0C0 1px solid;'>\1</td></tr></table>",
"<table border='0' align='center' width='100%' cellpadding='4' cellspacing='0'><tr><td><span style='font-size: 11px'><b>Писал(а): \1</b></span></td></tr><tr><td bgcolor='#000000' style='border: #C0C0C0 1px solid;'>\2</td></tr></table>",
"<font color='\1'>\2</font>"
);
$descriptions=preg_replace($tags_text, $html_text, $descriptions);
?>
<TABLE width=95% align=center cellPadding=0 cellSpacing=0><TBODY>
<TR><TD width='1%'><IMG src='images/1.png' width=14 height=14 border=0></TD><TD width='96%' background='images/5.png'></TD><TD width='1%'><IMG src='images/3.png' width=14 height=14 border=0></TD></TR>
<TR><TD background='images/4.png'></TD>
<TD background='images/10.png'>
<div align="left" ><b><a href="sendmail.php">Admin</a> <small><?=$date;?></small></b>
<div class="accent"><div class="accent-left"></div><div class="accent-right"></div></div></div>
<div align="left" class="tabletext"><b><u><?=$titles;?></u></b></div>
<div align="left" class="tabletext"><?=$descriptions;?></div>
</TD>
<TD background='images/6.png'> </TD>
</TR><TR><TD><IMG src='images/8.png' width=14 height=14 border=0></TD><TD background='images/2.png'></TD><TD><IMG src='images/9.png' width=14 height=14 border=0></TD></TR>
</TBODY></TABLE>
<br>
<?
}
?>
<?
endif;
}
}
else
{
echo "<div align='center'><font color='red'><br><b>".$lang['error']."</b></font><br><br></div>";
}
include("footer.php");
?>