/** * add/update agency * @param integer $id */ function showUpdate($id = 0) { $this->data['id'] = $id; View::share('jsTag', HTML::script("{$this->assetURL}js/select.js")); // get list Category $categoryModel = new CategoryBaseModel(); $this->data['listCategory'] = $categoryModel->getAllForm(0); // get list Ad Format $AdFormatModel = new AdFormatBaseModel(); $this->data['listAdFormat'] = $AdFormatModel->getAllForm(); // get list Type $this->data['listAdType'] = Config::get('data.ad_type'); // get list Wmode $this->data['listWmode'] = Config::get('data.wmode'); // WHEN UPDATE SHOW CURRENT INFOMATION if ($id != 0) { $item = $this->model->with('campaign', 'adFormat')->find($id); if ($item) { $this->data['item'] = $item; } else { return Redirect::to($this->moduleURL . 'show-list'); } } if (Request::isMethod('post')) { if ($this->postUpdate($id, $this->data)) { return $this->redirectAfterSave(Input::get('save')); } } $this->layout->content = View::make('showUpdate', $this->data); }
/** * add/update agency * @param integer $id */ function showUpdate($id = 0) { $this->data['id'] = $id; View::share('jsTag', HTML::script("{$this->assetURL}js/select.js")); // get list country $countryModel = new CountryBaseModel(); $this->data['listCountry'] = $countryModel->getAllForm(); // get list Category $categoryModel = new CategoryBaseModel(); $this->data['listCategory'] = $categoryModel->getAllForm(); // get expected close month $this->data['listExpectedCloseMonth'] = getMonthRange(); // get list Currency $currencyModel = new CurrencyBaseModel(); $this->data['listCurrency'] = $currencyModel->getAllForm(); // get list Sale Status $this->data['listSaleStatus'] = Config::get('data.sale_status'); $this->loadLeftMenu('menu.campaignList'); // WHEN UPDATE SHOW CURRENT INFORMATION if ($id != 0) { $item = $this->model->with('agency', 'advertiser', 'sale', 'campaign_manager')->find($id); if ($item) { $this->data['item'] = $item; $this->loadLeftMenu('menu.campaignUpdate', array('item' => $item)); } else { return Redirect::to($this->moduleURL . 'show-list'); } } if (Request::isMethod('post')) { if ($this->postUpdate($id, $this->data)) { return Redirect::to($this->moduleURL . 'view/' . $this->data['id']); } } $this->layout->content = View::make('showUpdate', $this->data); }
/** * add/update agency * @param integer $id */ function showUpdate($id = 0) { $this->data['id'] = $id; View::share('jsTag', HTML::script("{$this->assetURL}js/select.js")); // get list Category $categoryModel = new CategoryBaseModel(); $this->data['listCategory'] = $categoryModel->getAllForm(0, 0, 'Run of Network'); // get list Flight Objective $this->data['listFlightObjective'] = Config::get('data.flight_objective'); $this->loadLeftMenu('menu.flightList'); // WHEN UPDATE SHOW CURRENT INFOMATION if ($id != 0) { $this->loadLeftMenu('menu.flightUpdate'); $item = $this->model->with('category', 'campaign', 'publisher', 'publisherSite', 'publisher_ad_zone')->find($id); if ($item) { $this->data['item'] = $item; } else { return Redirect::to($this->moduleURL . 'show-list'); } } if (Request::isMethod('post')) { if ($this->postUpdate($id, $this->data)) { return $this->redirectAfterSave(Input::get('save')); } } $this->layout->content = View::make('showUpdate', $this->data); }
public function getCategoryByIdAttribute() { $modelCate = new CategoryBaseModel(); $item = $modelCate->find($this->category)->select('id', 'name')->first(); if (!empty($item)) { return $item->name; } else { return FALSE; } }
/** * add/update agency * @param integer $id */ function showUpdate($id = 0) { $this->loadLeftMenu('menu.Ad'); $this->data['id'] = $id; View::share('jsTag', HTML::script("{$this->assetURL}js/select.js") . HTML::script("{$this->assetURL}js/selectize.js")); // get list Category $categoryModel = new CategoryBaseModel(); $this->data['listCategory'] = $categoryModel->getAllForm(0); // get list Ad Format $AdFormatModel = new AdFormatBaseModel(); $this->data['listAdFormat'] = json_encode($AdFormatModel->getAllForm()); // get list Type $this->data['listAdType'] = Config::get('data.ad_type'); // get list Wmode $this->data['listWmode'] = Config::get('data.wmode'); // get list Video Linear $this->data['listVideoLinear'] = Config::get('data.video_linear'); // get list Video Type Vast $this->data['listTypeVast'] = Config::get('data.video_type_vast'); /* Phuong-VM 2015/06/30 */ $this->data['listPlatform'] = Config::get('data.platform'); $this->data['audiences'] = array(); // WHEN UPDATE SHOW CURRENT INFOMATION if ($id != 0) { //get list Audience $this->data['audiences'] = $this->audience->getItems($id); $this->loadLeftMenu('menu.adUpdate'); $item = $this->model->find($id); // $this->data['adMapFlight'] = $item->flight->lists('name', 'id'); // $this->data['campaignMapFlight'] = $item->campaign->flight->lists('name', 'id'); if ($item) { $item->platform = json_decode($item->platform); $this->data['item'] = $item; } else { return Redirect::to($this->moduleURL . 'show-list'); } } if (Request::isMethod('post')) { if ($this->postUpdate($id, $this->data)) { return Redirect::to($this->moduleURL . 'show-list'); } } $this->layout->content = View::make('showUpdate', $this->data); }
public function register() { if (Request::isMethod('post')) { $this->postRegister(); } $countryModel = new CountryBaseModel(); $this->data['listCountry'] = $countryModel->getAllForm(); $this->data['listWebsiteCategory'] = CategoryBaseModel::where('status', 1)->where('parent_id', 0)->where('name', '!=', 'Other')->orderBy('name', 'asc')->get()->toArray(); $this->data['listLanguage'] = LanguageBaseModel::where('status', 1)->orderBy('name', 'asc')->get()->toArray(); $this->data['listReason'] = $this->model->reason; $this->data['errors'] = $this->errors; $this->layout->content = View::make('register', $this->data); }
public function contactInfo() { $this->layout = View::make('layout.main'); $this->layout->slugMenu = ''; $countryModel = new CountryBaseModel(); $this->data['listCountry'] = $countryModel->getAllForm(); $this->data['listWebsiteCategory'] = CategoryBaseModel::where('status', 1)->where('parent_id', 0)->where('name', '!=', 'Other')->orderBy('name', 'asc')->get()->toArray(); $this->data['listLanguage'] = LanguageBaseModel::where('status', 1)->orderBy('name', 'asc')->get()->toArray(); //$this->data['listReason'] = $this->model->reason; if (Request::isMethod('post')) { $this->postContactInfo($this->data); } $this->layout->slugMenu = ''; $this->layout->content = View::make('contactInfoPage', $this->data); }
function showUpdate($id = 0) { $this->data['id'] = $id; $this->data['user'] = FALSE; $this->data['statusLists'] = Config::get('data.approve_status'); //get country $this->data['countryLists'] = CountryBaseModel::select('id', 'country_name')->get(); //get language $this->data['languageLists'] = LanguageBaseModel::select('id', 'name')->get(); //get category $this->data['channelLists'] = CategoryBaseModel::select('id', 'name')->where('parent_id', 0)->where('status', 1)->get(); // WHEN UPDATE SHOW CURRENT INFOMATION if ($id != 0) { $item = $this->model->find($id); if ($item) { //get site language $this->data['languageSelected'] = $item->language->lists('id'); //get serve country $this->data['countryServeSelected'] = $item->serveCountry->lists('id'); //get site channel $this->data['channelSelected'] = $item->channel->lists('id'); $this->data['item'] = $item; if ($item->user_id != 0) { $user = Sentry::findUserById($item->user_id); $this->data['user'] = $user; } } else { return Redirect::to($this->moduleURL); } } if (Request::isMethod('post')) { if ($this->postUpdate($id)) { return Redirect::to($this->moduleURL); } } $this->layout->content = View::make('showCreate', $this->data); }
/** * add/update agency * @param integer $id */ function showUpdate($id = 0) { $this->data['id'] = $id; View::share('jsTag', HTML::script("{$this->assetURL}js/select.js") . HTML::script("{$this->assetURL}js/flight.js")); // get list Category $categoryModel = new CategoryBaseModel(); $this->data['listCategory'] = $categoryModel->getAllForm(0, 0, 'Run of Network'); $this->data['listEvent'] = array('' => 'Metric for Frequency Capping') + Config::get('data.event'); // get list Flight Objective //$this->data['provinceLists'] = ProvinceBaseModel::orderBy('order', 'asc')->get(); // get list Flight Objective $this->data['listFlightObjective'] = Config::get('data.flight_objective'); // get list flight type $this->data['listFlightType'] = Config::get('data.flight_type'); $this->data['getdate'] = Input::get('date', array()); //--Start--Phuong-VM add 05-05-2015 $geoModel = new GeoBaseModel(); $this->data['countryList'] = $geoModel->getCountry(); $this->data['countrySelected'][] = 'VN'; //--End--Phuong-VM add 05-05-2015 //$campaignRetargetingSelected = array(); $this->loadLeftMenu('menu.flightList'); //$campaignRange = json_encode(array()); // WHEN UPDATE SHOW CURRENT INFOMATION if (Request::isMethod('get')) { $this->data['listKeyword'] = array(); $this->data['audiences'] = array(); if ($id != 0) { $this->loadLeftMenu('menu.flightUpdate'); $item = $this->model->with('category', 'ad', 'campaign', 'publisherSite', 'publisher_ad_zone')->find($id); if ($item) { //--Start--Phuong-VM add 05-05-2015 $this->data['countrySelected'] = json_decode($item->country); $this->data['provinceLists'] = $geoModel->getRegionByCountry($this->data['countrySelected']); //--End--Phuong-VM add 05-05-2015 $this->data['provinceSelected'] = json_decode($item->province); $this->data['ageSelected'] = json_decode($item->age); $this->data['item'] = $item; $this->data['getdate'] = $item->getDate; $this->data['gettime'] = $item->getTime(); if (!empty($item->filter)) { $this->data['listKeyword'] = explode(',', $item->filter); } /*if( !empty($item->campaign_retargeting) && $item->campaign_retargeting != "null" ){ $campaignRange = $item->campaign_retargeting; $campaignRetargetingSelected = CampaignBaseModel::whereIn('id',json_decode($item->campaign_retargeting))->lists('name','id'); }*/ } else { return Redirect::to($this->moduleURL . 'show-list'); } } } else { $this->data['countrySelected'] = Input::get('selected_country'); $this->data['provinceLists'] = $geoModel->getRegionByCountry($this->data['countrySelected']); $this->data['provinceSelected'] = Input::get('selected_province'); /*$campaign_retargeting_selected = Input::get('campaign-retargeting-selected',array()); if (!empty($campaign_retargeting_selected)) { $campaignRetargetingSelected = CampaignBaseModel::whereIn('id',Input::get('campaign-retargeting-selected'))->lists('name','id'); }*/ } /*$this->data['campaignRange'] = $campaignRange; $this->data['campaignRetargetingSelected'] = $campaignRetargetingSelected;*/ if (Request::isMethod('post')) { if ($this->postUpdate($id, $this->data)) { return Redirect::to($this->moduleURL . 'view/' . $this->data['id']); } } $this->layout->content = View::make('showUpdate', $this->data); }
public function showListPublisher() { $this->data['defaultField'] = $this->defaultField; $this->data['defaultOrder'] = $this->defaultOrder; $this->data['defaultURL'] = $this->moduleURL; //get country $this->data['itemCountry'] = modelCountry::select('id', 'country_name')->get(); //get category $this->data['itemCate'] = modelCategory::select('id', 'name')->get(); $this->data['publisher_approved'] = Config::get('backend.publisher_approved'); if (method_exists($this, 'beforeShowList')) { $this->beforeShowList(); } $this->layout->content = View::make('showListPublisher', $this->data); }