} } else { if (isset($_POST['REJECT_RESTRICTION_ID']) && $user->type == 'SUPER_USER') { $result = $user->approveRestriction($_POST['REJECT_RESTRICTION_ID'], $_POST['RESTRICTION_TABLE'], false); if ($result) { showBanner('#restrictionRejected'); } else { showBanner('#error'); } } else { if (isset($_POST['APPROVE_RESTRICTION_ID']) && $user->type == 'SUPER_USER') { $result = $user->approveRestriction($_POST['APPROVE_RESTRICTION_ID'], $_POST['RESTRICTION_TABLE'], true); if ($result) { showBanner('#restrictionApproved'); } else { showBanner('#error'); } } } } ?> <div class="contents"> <div id="restrictionApproved" class="alert alert-success" style="display: none;"> <strong><i class="fa fa-check"></i>Restriction Approved.</strong> </div> <div id="restrictionRejected" class="alert alert-danger" style="display: none;"> <strong><i class="fa fa-times"></i>Restriction Rejected.</strong> </div> <div id="restrictionDeleted" class="alert alert-warning" style="display: none;"> <strong><i class="fa fa-trash"></i>Restriction Deleted.</strong> </div>
public function getApiAd() { $this->layout = null; $response = null; $responseType = ''; $deliveryStatus = ''; $requestType = Input::get('rt', Delivery::REQUEST_TYPE_AD); $flightWebsiteID = Input::get('fpid', ''); $zoneID = Input::get('zid', 0); $data = Input::all(); $trackingModel = new Tracking(); $deliveryModel = new Delivery(); $isOverReport = $data['ovr'] = false; $showBanner = showBanner(); if ($showBanner !== FALSE) { $flightWebsiteID = $showBanner; } $responseData = []; $hostReferer = $trackingModel->getRequestReferer(); $responseType = $trackingModel->checkPreProcess($requestType, $hostReferer, $zoneID); //read redis 1 $data['ref'] = $hostReferer; $adZone = $deliveryModel->getAdzone($zoneID); if ($adZone) { $platform = ''; $flightWebsites = $deliveryModel->getAvailableAds($adZone->publisher_site_id, $adZone->ad_format_id, $flightWebsiteID, $platform); if ($flightWebsites) { //sort available flights base on priority and retargeting //TO DO retargeting $flightWebsites = $deliveryModel->sortAvailableFlightWebsites($flightWebsites); //lấy ad từ list thỏa điều kiện để trả về $deliveryInfo = $deliveryModel->getFullFlightInfo($flightWebsites, $adZone->publisher_site_id, $adZone->ad_format_id); $redis = new RedisBaseModel(env('REDIS_HOST', '127.0.0.1'), env('REDIS_PORT_6', '6379'), false); foreach ($flightWebsites as $k => $flightWebsite) { if (!empty($flightWebsite) && !empty($deliveryInfo['flightDates'][$flightWebsite->flight_id]) && !empty($deliveryInfo['flights'][$flightWebsite->flight_id])) { $flightDates = $deliveryInfo['flightDates'][$flightWebsite->flight_id]; $flight = $deliveryInfo['flights'][$flightWebsite->flight_id]; $ad = $deliveryInfo['ads'][$flight->ad_id]; $arrPlatform = json_decode($ad->platform); if (!empty($arrPlatform) && in_array('mobile_app', $arrPlatform) || isLocal()) { $checkFlightDate = $deliveryModel->checkFlightDate($flightDates, $flight); //flight date ok if ($checkFlightDate) { $deliveryStatus = $deliveryModel->deliveryAd($ad, $flightWebsite, $flight, $flightDates); if ($deliveryStatus == Delivery::DELIVERY_STATUS_OK || $deliveryStatus == Delivery::DELIVERY_STATUS_OVER_REPORT) { //Check retargeting if (!empty($flight->audience)) { $check = false; $audience = json_decode($flight->audience, true); if (!empty($audience['audience_id'])) { if (isset($_COOKIE["yoAu_{$audience['audience_id']}"]) && !empty($_COOKIE["uuid"])) { if ($_COOKIE["yoAu_{$audience['audience_id']}"] === '1' || substr($_COOKIE["yoAu_{$audience['audience_id']}"], 0, 2) === '1.') { $check = true; } } if ($audience['operator'] === 'not in') { $check = !$check; } } if ($check === false) { $deliveryStatus == Delivery::RESPONSE_TYPE_AUDIENCE_LIMIT; continue; } } //trả về ad này $serveAd = $ad; $data['aid'] = $ad->id; $data['fpid'] = $flightWebsite->id; //over report if ($deliveryStatus == Delivery::DELIVERY_STATUS_OVER_REPORT) { $data['ovr'] = $isOverReport = true; } $responseType = Delivery::RESPONSE_TYPE_ADS_SUCCESS; break; } } else { $deliveryStatus = Delivery::RESPONSE_TYPE_FLIGHTDATE_NOT_AVAILABLE; } } else { $deliveryStatus = Delivery::PLATFORM_TYPE_INVALID; } } } } if ($responseType != Delivery::RESPONSE_TYPE_ADS_SUCCESS) { $responseType = Delivery::RESPONSE_TYPE_NOT_AVAILABLE; } } if (empty($responseType)) { $responseType = Delivery::RESPONSE_TYPE_INVALID; } elseif ($responseType == Delivery::RESPONSE_TYPE_ADS_SUCCESS) { (new RawTrackingSummary())->addSummary('ads_request', $data['fpid'], $adZone->id, $adZone->ad_format_id, $flightWebsite->flight_id, $flightWebsite->id, $flight->ad_id, $flight->campaign_id, $flightWebsite->publisher_base_cost, $isOverReport); if (!empty($serveAd)) { pr($serveAd); $responseData['w'] = intval($serveAd->width); $responseData['h'] = intval($serveAd->height); $responseData['mime'] = !empty($serveAd->mime) ? $serveAd->mime : ''; if ($serveAd->ad_type === 'html') { $responseData['adm'] = urlencode($serveAd->html_source); } else { $responseData['adm'] = urlencode($serveAd->source_url); } $responseData['pos'] = !empty($serveAd->position) ? $serveAd->position : ''; $arrTrackingImpression = []; $arrTrackingImpression[] = urlencode(urlTracking('impression', $data['aid'], $data['fpid'], $zoneID, '', '', $data['ovr'], '') . '&plf=mobile_app'); if (!empty($serveAd->third_impression_track)) { $thirdImpressionTrackArr = explode("\n", $serveAd->third_impression_track); if (!empty($thirdImpressionTrackArr)) { foreach ($thirdImpressionTrackArr as $item) { $arrTrackingImpression[] = urlencode($this->replaceParam($item)); } } } $responseData['nimp'] = $arrTrackingImpression; $arrTrackingClick = []; $arrTrackingClick[] = urlencode(urlTracking('click', $data['aid'], $data['fpid'], $zoneID, '', '', $data['ovr'], '') . '&plf=mobile_app'); if (!empty($serveAd->third_click_track)) { $thirdClickTrackArr = explode("\n", $serveAd->third_click_track); if (!empty($thirdClickTrackArr)) { foreach ($thirdClickTrackArr as $item) { $arrTrackingClick[] = urlencode($this->replaceParam($item)); } } } $responseData['nclk'] = $arrTrackingClick; $responseData['lpage'] = urlencode($this->replaceParam($serveAd->destination_url)); $responseData['xml'] = null; } } pr($responseData); pr($deliveryStatus); pr($responseType, 1); return response()->json($responseData); }
<section id="body"> <?php showBanner(); ?> <section id="inbody"> <section <?php if ($_GET['id'] == 'contact') { echo 'class="fullwidth"'; } ?> > <?php echo $bodyText; ?> </section> <?php if ($_GET['id'] != 'contact') { ?> <aside id="norm"><?php showAside(); ?> </aside> <?php } ?> <div class="clearall"></div> </section> <?php if ($_GET['id'] == 'projects') {
} } else { echo "<li id='text'>"; echo "<a href='{$click}' onClick=\"javascript: pageTracker._trackPageview('/outgoing/{$affiliate}/{$type}/{$trackUrl}');\">{$name}</a>"; echo "</li>\n"; } } echo "</ul></div>"; } echo "</div>\n\n"; // end right hand content pane, end centerbox span ?> </div></div> <?php if ($pagetype == 'review') { showBanner($reviewbanner_query, "ban"); } else { showBanner($landscapebanner_query, "ban"); } ?> <div id='footer'> </div> <?php // EOP stuff like GA code and dbclose include $Include_Dir . "concertreservations_ga.php"; include $Include_Dir . "concertreservations_dbclose.php"; //echo " <!-- "; print_r(get_defined_vars()); echo " --> "; ?> </body> </html>
<?php include('header.php'); if(beforeRunFunctions()) { exit; }; if(isset($_GET)){ $_SESSION['GET'] = $_GET; } ?> <body> <div id="outerHeader"> </div> <div id="main"> <div id="title"> <?php showTitle(); ?> </div> <div id="banner"> <?php showBanner(); ?> </div> <div id="container"> <div id="content"> <div id="leftMargin"> <?php showLeftBar(); ?> </div> <?php showRightBar(); ?> <div id="topToolbar" class="ajax"> <?php showTopToolbar(); ?> </div> <div id="bodyContent" class="ajax"> <?php showContent(); ?> </div> <div id="innerFooter"> <?php showFooter(); ?>