public function getDashboardFilghtWebsite()
 {
     $flight = Input::get("flight");
     $campaign = Input::get("campaign");
     $ad = Input::get("ad");
     if ($flight > 0) {
         $datas = TrackingSummaryBaseModel::getDataPerDate(date('Y-m-d'), $campaign, $ad, $flight, 'site');
         $this->data['datas'] = $datas;
         $this->data['flight'] = $flight;
         return View::make("dashboardFilghtWebsite", $this->data);
     }
     return "";
 }
Example #2
0
 function getDailyInventory()
 {
     $typeapp = 'site';
     $datas = TrackingSummaryBaseModel::getDataPerDate(date('Y-m-d'), $this->campaign_id, $this->ad_id, $this->id, $typeapp);
     if (isset($datas['summary']) && count($datas['summary']) > 0) {
         $sumImpression = $sumImpressionOver = $sumUniqueImpression = $sumUniqueImpressionOver = $sumClick = $sumClickOver = $sumUniqueClick = $sumUniqueClickOver = 0;
         foreach ($datas['summary'] as $data) {
             $frequency = 0;
             if ($data['total_impression'] > 0 && $data['total_unique_impression'] > 0) {
                 $frequency = number_format(($data['total_impression'] + $data['total_impression_over']) / ($data['total_unique_impression'] + $data['total_unique_impression_over']), 2);
             }
             $ctr = 0;
             if ($data['total_click'] > 0 && $data['total_impression'] > 0) {
                 $ctr = number_format(($data['total_click'] + $data['total_click_over']) / ($data['total_impression'] + $data['total_impression_over']) * 100, 2);
             }
             $sumImpression += $data['total_impression'];
             $sumImpressionOver += $data['total_impression_over'];
             $sumUniqueImpression += $data['total_unique_impression'];
             $sumUniqueImpressionOver += $data['total_unique_impression_over'];
             $sumClick += $data['total_click'];
             $sumClickOver += $data['total_click_over'];
             $sumUniqueClick += $data['total_unique_click'];
             $sumUniqueClickOver += $data['total_unique_click_over'];
         }
         $sumFrequency = 0;
         if ($sumImpression > 0 && $sumUniqueImpression > 0) {
             $sumFrequency = number_format(($sumImpression + $sumImpressionOver) / ($sumUniqueImpression + $sumUniqueImpressionOver), 2);
         }
         $sumCTR = 0;
         if ($sumClick > 0 && $sumImpression > 0) {
             $sumCTR = number_format(($sumClick + $sumClickOver) / ($sumImpression + $sumImpressionOver) * 100, 2);
         }
         return array("sumImpression" => $sumImpression, "sumImpressionOver" => $sumImpressionOver, "sumUniqueImpression" => $sumUniqueImpression, "sumUniqueImpressionOver" => $sumUniqueImpressionOver, "sumClick" => $sumClick, "sumClickOver" => $sumClickOver, "sumUniqueClick" => $sumUniqueClick, "sumUniqueClickOver" => $sumUniqueClickOver, "sumFrequency" => $sumFrequency, "sumCTR" => $sumCTR);
     }
     return "0";
 }
 function getReportDateDetail()
 {
     $flight = Input::get('flight');
     $campaign = Input::get('campaign');
     $ad = Input::get('ad');
     $date = Input::get('date');
     $typeapp = Input::get('typeapp');
     if ($typeapp == "") {
         $typeapp = 'hour';
     }
     $items['typeapp'] = $typeapp;
     $items['tracking'] = TrackingSummaryBaseModel::getDataPerDate($date, $campaign, $ad, $flight, $typeapp);
     return View::make("reportdate", $items);
 }