/** * @return mixed */ public function makeOva() { $data = Input::all(); $deliveryModel = new Delivery(); if ((new MakeOvaHandle())->checkInputValid($data)) { $this->data['ad'] = $deliveryModel->getAd($data['aid']); \View::addLocation(base_path() . '/resources/views/delivery'); if (Input::get('wid') != 99999999) { $this->data['vast'] = url() . "/make-vast?" . $_SERVER['QUERY_STRING']; } else { $this->data['vast'] = 'http://yomedia.vn/demo/demo_vast.xml'; } $body = \View::make('ova', $this->data); return response($body, 200)->header('Content-Type', 'text/xml; charset=UTF-8'); } exit; }
function makeVAST($adID, $flightPublisherID, $publisherAdZoneID, $checksum = '', $isOverReport = false, $referrer = '') { // get ad data $deliveryModel = new Delivery(); $ad = $deliveryModel->getAd($adID); $adZone = $deliveryModel->getAdzone($publisherAdZoneID); if ($adZone) { $flightWebsite = $deliveryModel->getFullFlightWebsite($flightPublisherID, $adZone->publisher_site_id, $adZone->ad_format_id, ''); /*if ($flightWebsite) { $rawTrackingSummary = new RawTrackingSummary(); $rawTrackingSummary->addSummary('ads_request', $flightWebsite->website_id, $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flightWebsite->flight->ad_id, $flightWebsite->flight->campaign_id, $flightWebsite->publisher_base_cost, $isOverReport); }*/ } if ($ad && $flightPublisherID && $publisherAdZoneID) { $XMLView = 'none'; $this->initVast($ad, $flightPublisherID, $publisherAdZoneID, $checksum, $isOverReport, $referrer); if (!empty($this->id)) { if ($this->type_vast == self::VAST_INLINE) { $XMLView = 'inline'; } else { $XMLView = 'wrapper'; } } $this->setHeaderVast(); \View::addLocation(base_path() . '/resources/views/vast'); $body = \View::make($XMLView)->with('ad', $this); return response($body, 200, $this->header); } else { return $this->makeEmptyVast(); } }