public function remove_video_ads() { if (!$this->isAjax || $this->method != 'POST' || empty($this->postData['adsid'])) { $this->app->abort(404, $this->setlocalization('Page not found')); } if ($no_auth = $this->checkAuth()) { return $no_auth; } $data = array(); $data['action'] = 'removeAds'; $error = $this->setlocalization('Failed'); $ad = new \VclubAdvertising(); if ($ad->delById($this->postData['adsid'])) { $error = ''; } $response = $this->generateAjaxResponse($data, $error); return new Response(json_encode($response), empty($error) ? 200 : 500); }
} if (!empty($_POST['add'])) { Admin::checkAccess(AdminAccess::ACCESS_CREATE); $ad->add($_POST); header("Location: vclub_ad.php"); exit; } else { if (!empty($_POST['edit']) && $id) { Admin::checkAccess(AdminAccess::ACCESS_EDIT); $ad->updateById($id, $_POST); header("Location: vclub_ad.php"); exit; } else { if (!empty($_GET['del']) && $id) { Admin::checkAccess(AdminAccess::ACCESS_DELETE); $ad->delById($id); header("Location: vclub_ad.php"); exit; } } } if (!empty($_GET['edit']) && !empty($id)) { $current_ad = $ad->getById($id); } $ads = $ad->getAllWithStatForMonth(); if (!empty($_GET['id'])) { $denied_categories = $ad->getDeniedVclubCategoriesForAd((int) $_GET['id']); } else { $denied_categories = array(); } $video_category = new VideoCategory();