<?
include_once'../system/xcms_core.php';
$q=$db->query("select * from `ads` where `id`='$id'")->fetch(PDO::FETCH_ASSOC);
if($q){
$db->prepare("update `ads` set `oute`=`oute`+1 where `id`='$id'")->execute();
$db->prepare("update `user` set `balans`=`balans`+1 where `id`='$user[id]'")->execute();
header('location: '.$q['link']);
}
?>