Файл: gonki.us/my_auto.php
Строк: 39
<?php
require_once('system/incfiles/core.php');
if(empty($user)) header('Location: /auth.php');
if(isset($_GET['peresest'])){
$id = abs(intval($_GET['peresest']));
$auto = $db->query('SELECT * FROM `my_auto` WHERE `id` = "'.$id.'"')->fetch_array();
if(empty($id) or $auto['id'] == NULL or $auto['id_us'] != $user['id']){
header('Location: /');
}else{
$db->query("UPDATE `user` SET `auto` = '$auto[id]' WHERE `id` = '$user[id]'");
header('Location: /');
}
}
$title = $copy.': Мои авто';
require_once(ROOT.'system/incfiles/header.php');
echo '<div class="razd5">Мои авто</div>';
$count = $db->query('SELECT * FROM `my_auto` WHERE `id_us` = "'.$user['id'].'"')->num_rows;
$n = new navigator($count, '10');
$q = 'SELECT * FROM `my_auto` WHERE `id_us` = "'.$user['id'].'" '.$n->limit;
$query = $db->query($q);
echo $n->back();
while($post = $query->fetch_array()){
echo '<div class="menu_j"><a class="top_menu_j" href="?peresest='.$post['id'].'"><span style="float:right"><span class="class">'.$post['class'].'</span><span class="name"><b>'.$post['name'].' </b></span><br /><img src="/system/design/ico/ls.png" alt=""/> <font color="darkorange">'.$post['ls'].'л.с. </font></span><img src="'.$post['img'].'" alt="" style="width:100px"/><br /><img src="'.$post['neon'].'" alt="" style="width:100px; margin-top:-17px;"/></a></div>';
}
echo $n->next();
require_once(ROOT.'system/incfiles/footer.php');
?>