View file userf.php

File size: 1Kb
<?php
include 'inc/db.php';
include 'inc/1.php';
$id=intval($_GET['id']);
if (!$_GET['id']){header("Location: /index.php");
exit;}
$ank=gus($id);
if ($ank['name']==''){header("Location: /index.php");
exit;}
echo "<div class='t2'>Файлы пользователя</div>";
if (!$_GET['p'])$_GET['p']=1;
$p=intval($_GET['p']);
$start=(($p*15)-15);
$q=mysql_query("SELECT `id`, `name`, `ras`, `time` FROM `obmen` WHERE `user` = '$id' ORDER BY `time` DESC LIMIT $start, 15");
$b=1;
while ($f=mysql_fetch_assoc($q)){
$post=($b%2);
echo "<div class='p$post'>";
$name=out($f['name']);
$ras=htmlspecialchars($f['ras']);
$time=vremja($f['time']);
echo "<a href='file.php?id=$f[id]'>$name.$ras</a> ($ank[name])<br>[$time]";
echo "</div>";
$b++;
}
$q1=(mysql_num_rows(mysql_query("SELECT `id` FROM `obmen` WHERE `user` = '$id'"))/15);
$q2=round(mysql_num_rows(mysql_query("SELECT `id` FROM `obmen` WHERE `user` = '$id'"))/15);
if ($q1>$q2)$pages=($q2+1);
pages($pages, $p, "?p");
include 'inc/foot.php';
?>