Beispiel #1
0
        $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();
$video_categories = $video_category->getAll();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">

body {
    font-family: Arial, Helvetica, sans-serif;
 public function video_advertise()
 {
     if ($no_auth = $this->checkAuth()) {
         return $no_auth;
     }
     $ad = new \VclubAdvertising();
     $self = $this;
     $this->app['ads'] = array_map(function ($row) use($self) {
         if (!is_numeric($row['must_watch'])) {
             $row['must_watch'] = $self->setLocalization($row['must_watch']);
         }
         return $row;
     }, $ad->getAllWithStatForMonth());
     $this->app['dropdownAttribute'] = $this->getVideoAdvertiseDropdownAttribute();
     return $this->app['twig']->render($this->getTemplateName(__METHOD__));
 }
 public function video_advertise_list_json()
 {
     if ($this->isAjax) {
         if ($no_auth = $this->checkAuth()) {
             return $no_auth;
         }
     }
     $response = array('data' => array(), 'recordsTotal' => 0, 'recordsFiltered' => 0);
     $ad = new \VclubAdvertising();
     $self = $this;
     $response["data"] = array_map(function ($row) use($self) {
         if (!is_numeric($row['must_watch'])) {
             $row['must_watch'] = $self->setLocalization($row['must_watch']);
         }
         settype($row['status'], 'int');
         return $row;
     }, $ad->getAllWithStatForMonth());
     $response["recordsFiltered"] = $response["recordsTotal"] = (string) count($response["data"]);
     $response["draw"] = !empty($this->data['draw']) ? $this->data['draw'] : 1;
     $error = "";
     if ($this->isAjax) {
         $response = $this->generateAjaxResponse($response);
         return new Response(json_encode($response), empty($error) ? 200 : 500);
     } else {
         return $response;
     }
 }