<?php
@session_start();
require_once $_SERVER['DOCUMENT_ROOT']."/includes/start.php";
if(isset($_SESSION['auth']) and $_SESSION['auth']==1){
echo $_up;

///$cat = mysql_fetch_assoc(mysql_query("SELECT `name` FROM `shop_cat` WHERE `id_cat`='$id'"));

mysql_query("update users set op=0 where id='$usr[id]' limit 1");

$count_op=mysql_result(mysql_query("SELECT COUNT(*) FROM `op` WHERE `for_id`=$usr[id]"), 0);
$page=isset($_GET['p'])?$_GET['p']:1;

$op_q=mysql_query("SELECT * FROM `op` WHERE `for_id`=$usr[id] ORDER BY `id` LIMIT ".(($page-1)*10).", 10");
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `op` WHERE for_id=$usr[id]"), 0);
if($total==0){
echo 'В разделе нет вещей :('; exit;
}
while($res=mysql_fetch_array($op_q)){

echo '<div class="list" style="border-bottom:1px solid white;">'.$res[text].'<br><small><b>Когда: '.$res['date'].'</b></small></div>';

}
nav($count_op, $page, '?id='.$id.'&', 10); //навигация



echo '<br><br>';
echo $_down;

}else{

header ("Location: /?"); exit;

}
?>

