View file new_users.php

File size: 1.56Kb
<?

$resg = mysql_query("SELECT * FROM `user` where `pol`='0' ORDER BY `date_reg` DESC");
$resb = mysql_query("SELECT * FROM `user` where `pol`='1' ORDER BY `date_reg` DESC");
$arrg = mysql_fetch_array($resg);
$arrb = mysql_fetch_array($resb);

if(empty($arrb['avatar']))
{
	$avab = 'АВАТАР ОТСУТСТВУЕТ...';
}
else
{
	$avab = '<image src="avatar/'.$arrb['id'].''.$arrb['avatar'].'.alt="avas" width="50" height="50" />';
}

if(empty($arrg['avatar']))
{
	$avag = 'АВАТАР ОТСУТСТВУЕТ...';
}
else
{
	$avag = '<image src="avatar/'.$arrg['id'].''.$arrg['avatar'].'/>';
}

if(!empty($arrg['ank_d_r']) && !empty($arrg['ank_m_r']) && !empty($arrg['ank_g_r']) )
{
	$birthg = strtotime($arrg['ank_d_r'].'-'.$arrg['ank_m_r'].'-'.$arrg['ank_g_r']);
	$ageg = intval((time()-$birthg)/(3600*24*365));
//	echo $birth.'<br />'.$age.'<br />';
}
else
{
	$ageg = '[данных нет]';
}

if(!empty($arrb['ank_d_r']) && !empty($arrb['ank_m_r']) && !empty($arrb['ank_g_r']) )
{
	$birthb = strtotime($arrb['ank_d_r'].'-'.$arrb['ank_m_r'].'-'.$arrb['ank_g_r']);
	$ageb = intval((time()-$birthb)/(3600*24*365));
//	echo $birth.'<br />'.$age.'<br />';
}
else
{
	$ageb = '[данных нет]';
}

echo '<center class=\"menu\"><table border="1">
<tr><td align="center" colspan="2">Новые</td></tr>
<tr><td align="center" width="50%">Девушка</td><td align="center" width="50%">Парень</td></tr>
<tr><td valign="bottom" align="center" width="50%">'.$avag.' <br />'.$arrg['nick'].'<br />Возраст - '.$ageg.'</td><td valign="bottom" align="center" width="50%">'.$avab.' <br />'.$arrb['nick'].'<br />Возраст - '.$ageb.'</td></tr>
</table></center>';
?>