/**
  *     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);
 }
 /**
  *     trigger before show list render view
  */
 function beforeShowList()
 {
     $this->loadLeftMenu('menu.Ad');
     // get list country
     $countryModel = new CountryBaseModel();
     $this->data['listCountry'] = $countryModel->getAllForm();
     View::share('jsTag', HTML::script("{$this->assetURL}js/select.js"));
     // get list Category
     $categoryModel = new CategoryBaseModel();
     $this->data['listCategory'] = array('' => '-- Select Channel --') + $categoryModel->getAllForm(0, 0, 'Run of Network');
     // get list Model
     $this->data['listModel'] = array('' => '-- Select Model --') + Config::get('data.flight_model');
 }
 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);
 }
Exemple #4
0
 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);
 }
 /**
  *     add/update agency
  *     @param  integer $id 
  */
 function showUpdate($id = 0)
 {
     $this->data['id'] = $id;
     // get list country
     $countryModel = new CountryBaseModel();
     $this->data['listCountry'] = $countryModel->getAllForm();
     // WHEN UPDATE SHOW CURRENT INFOMATION
     if ($id != 0) {
         View::share('jsTag', HTML::script("{$this->assetURL}js/contact.js"));
         $item = $this->model->with('contact')->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 userManager()
 {
     // get list country
     $modelUser = new User();
     $countryModel = new CountryBaseModel();
     $this->data['listCountry'] = $countryModel->getAllForm();
     $this->data['defaultField'] = $this->defaultField;
     $this->data['defaultOrder'] = $this->defaultOrder;
     $this->data['defaultURL'] = $this->moduleURL;
     $this->data['showField'] = $modelUser->getShowFieldUserManager();
     $this->layout->content = View::make('userManager', $this->data);
 }