function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('slide', connectionSliderModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne());
 }
 function execute()
 {
     $model = connectionSliderModel::create();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('slides', $model->sort('sort', -1)->fetchAll());
     $this->smarty->assign('lang', $list);
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $page = Request::post('page');
     $this->smarty->assign('seo', connectionSeoModel::create()->getByPage($page));
     $this->smarty->assign('lang', $list);
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $pageModel = new connectionPagesModel();
     $this->smarty->assign('pages', $pageModel->fetchAll());
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('page_url', Settings::getValue('page_url'));
 }
 function execute()
 {
     $event = Request::post('event');
     $eventList = connectionNotificationModel::getEventList();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('eventInfo', $eventList[$event]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('event', connectionNotificationModel::create()->getEvent($event));
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $notification = connectionNotificationModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne();
     $eventList = connectionNotificationModel::getEventList();
     $this->smarty->assign('eventInfo', $eventList[$notification['event']]);
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('notification', $notification);
 }
 function execute()
 {
     $this->frame = false;
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $fieldID = Request::post('id');
     $model = new connectionFieldsModel();
     $this->smarty->assign('field', $model->getField($fieldID));
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     if (Request::post('id')) {
         $answer = connectionFaqAnswerModel::create()->where(array('id' => (int) Request::post('id')))->fetchOne();
         $this->smarty->assign('answer', $answer);
     }
     $this->smarty->assign('lang', $list);
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $model = new connectionFieldsModel();
     $fields = array();
     $fields['info'] = $model->getGroup('info');
     $fields['interest'] = $model->getGroup('interest');
     $this->smarty->assign('fields', $fields);
 }
 function execute()
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $model = new connectionCountryModel();
     $countries = array();
     foreach ($list as $lang) {
         $countries[$lang['iso']] = $model->getList($lang['iso']);
     }
     $this->smarty->assign('country', $countries);
 }
 public function hasVariant($id, $variant)
 {
     $locale = new Locales('connection');
     $list = $locale->getList();
     $where = array('id' => (int) $id);
     foreach ($list as $value) {
         $where['$or'][] = array($value['iso'] . '.variant' => $variant);
     }
     $result = $this->where($where)->fetchAll();
     if (sizeof($result) > 0) {
         return true;
     }
     return false;
 }
 function execute()
 {
     $page_id = Request::post('page_id');
     if (!$page_id) {
         exit;
     }
     $model = new connectionPagesModel();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $this->smarty->assign('lang', $list);
     $this->smarty->assign('page', $model->getPage($page_id));
     $this->smarty->display(APP_DIR . DS . App::getAppName() . DS . APP_TEMPLATES_DIR . DS . 'backend' . DS . '/include/modal/pageEdite.html');
     exit;
 }
 function execute()
 {
     $status = 'success';
     $model = connectionSliderModel::create();
     $locale = new Locales('connection');
     $list = $locale->getList();
     $data = Request::post('slide');
     if (!isset($data['link']) || empty($data['link'])) {
         $status = 'error';
     } else {
         if (isset($data['id'])) {
             $slide = $model->where(array('id' => (int) $data['id']))->fetchOne();
         }
         $dir = UPLOAD_DIR . DS . 'slider' . DS;
         File::mkdir($dir);
         foreach ($list as $lang) {
             $file = Request::files('slide_' . $lang['iso']);
             if (!$file || empty($file[0]['name'])) {
                 if (isset($data['id'])) {
                     $data[$lang['iso']]['image'] = isset($slide[$lang['iso']]['image']) ? $slide[$lang['iso']]['image'] : '';
                 }
                 continue;
             }
             $file = $file[0];
             $info = pathinfo($file['name']);
             $name = strtotime('now') . md5($file['name']) . uniqid() . '.' . $info['extension'];
             File::upload($file, $dir, $name);
             $data[$lang['iso']]['image'] = $name;
         }
         if (isset($data['id'])) {
             $id = $data['id'];
             unset($data['id']);
             $model->where(array('id' => (int) $id))->update($data);
         } else {
             $data['sort'] = 0;
             $model->insert($data);
         }
     }
     return array('status' => $status);
 }
 function execute()
 {
     $app = strtolower(Request::get('app_local'));
     $locale = new Locales($app);
     $this->smarty->assign('lang', $locale->getList());
 }