function sold() { $id=intval($_GET['id']); if (isset($_SESSION['user_id'])) { House::setUserStatus($id,$_SESSION['user_id'],REALTY_STATUS_SOLD); } else { if (!isset($_SESSION['admin'])) { echo "Not admin"; //header("Location: /index.html"); exit(); } house::setStatus($id,REALTY_STATUS_SOLD); } header("Location: ".$_SERVER['HTTP_REFERER']); exit(); }