public function actionView($id = 0, $url = '') { if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $model = $this->loadModel($id, 1); if (!$model->active) { throw404(); } if ($model->id == 4) { //User Agreement $field = 'body_' . Yii::app()->language; $model->{$field} = str_replace('{site_domain}', IdnaConvert::checkDecode(Yii::app()->getBaseUrl(true)), $model->{$field}); $model->{$field} = str_replace('{site_title}', CHtml::encode(Yii::app()->name), $model->{$field}); } $this->showSearchForm = $model->widget && $model->widget == 'apartments' ? true : false; if (Yii::app()->request->isAjaxRequest) { $this->renderPartial('view', array('model' => $model)); } else { $this->render('view', array('model' => $model)); } }
public function actionUpdate($id) { $model = $this->loadModel($id); $model->scenario = 'update'; if (issetModule('rbac')) { if (Yii::app()->user->role == User::ROLE_MODERATOR && $model->role == User::ROLE_ADMIN) { throw404(); } } $this->performAjaxValidation($model); if (isset($_POST[$this->modelName])) { $model->attributes = $_POST[$this->modelName]; if (isset($_POST[$this->modelName]['password']) && $_POST[$this->modelName]['password']) { if (demo()) { Yii::app()->user->setFlash('error', tc('Sorry, this action is not allowed on the demo server.')); unset($model->password, $model->salt); $this->redirect(array('update', 'id' => $model->id)); } else { $model->scenario = 'changePass'; } } else { unset($model->password, $model->salt); } if ($model->validate()) { if ($model->scenario == 'changePass') { $model->setPassword(); } if ($model->save(false)) { $this->redirect(array('view', 'id' => $model->id)); } } } $this->render('update', array('model' => $model)); }
public function actionIndex() { $this->checkCookieEnabled(); $this->htmlPageId = 'index'; $page = Menu::model()->findByPk(InfoPages::MAIN_PAGE_ID); if (issetModule('seo')) { $seo = SeoFriendlyUrl::model()->findByAttributes(array('model_name' => 'InfoPages', 'model_id' => InfoPages::MAIN_PAGE_ID)); if ($seo) { $this->setSeo($seo); } } $langs = Lang::getActiveLangs(); $countLangs = count($langs); if (!isFree() && !isset($_GET['lang']) && ($countLangs > 1 || $countLangs == 1 && param('useLangPrefixIfOneLang'))) { $canonicalUrl = Yii::app()->getBaseUrl(true); $canonicalUrl .= '/' . Yii::app()->language; Yii::app()->clientScript->registerLinkTag('canonical', null, $canonicalUrl); } Yii::app()->user->setState('searchUrl', NULL); $lastNews = News::getLastNews(); if (Yii::app()->request->isAjaxRequest) { // $modeListShow = User::getModeListShow(); // if ($modeListShow == 'table') { // # нужны скрипты и стили, поэтому processOutput установлен в true только для table // $this->renderPartial('index', array('page' => $page, 'newsIndex' => $lastNews), false, true); // } // else { $this->renderPartial('index', array('page' => $page, 'newsIndex' => $lastNews)); // } } else { $this->render('index', array('page' => $page, 'newsIndex' => $lastNews)); } }
public function checkAccess($operation, $params = array(), $allowCaching = true) { if (issetModule('rbac')) { if ($allowCaching && $params === array() && isset($this->_access[$operation])) { return $this->_access[$operation]; } $access = Yii::app()->getAuthManager()->checkAccess($operation, $this->getId(), $params); if ($allowCaching && $params === array()) { $this->_access[$operation] = $access; } return $access; } else { if (Yii::app()->user->isGuest) { # гость if ($operation == 'guest') { return true; } } else { if (Yii::app()->user->getState('isAdmin')) { #админ return true; } else { # авторизированный пользователь if ($operation == 'registered' || $operation == 'guest') { return true; } } } return false; } }
public function init() { parent::init(); if (!issetModule('tariffPlans') || !issetModule('paidservices')) { throw404(); } }
public static function saveOther(Apartment $ad) { if (ApartmentVideo::saveVideo($ad)) { $ad->panoramaFile = CUploadedFile::getInstance($ad, 'panoramaFile'); $ad->scenario = 'panorama'; if (!$ad->validate()) { return false; } } $city = ""; if (issetModule('location')) { $city .= $ad->locCountry ? $ad->locCountry->getStrByLang('name') : ""; $city .= $city && $ad->locCity ? ", " : ""; $city .= $ad->locCity ? $ad->locCity->getStrByLang('name') : ""; } else { $city = $ad->city ? $ad->city->getStrByLang('name') : ""; } // data if ($ad->address && $city && (param('useGoogleMap', 1) || param('useYandexMap', 1) || param('useOSMMap', 1))) { if (!$ad->lat && !$ad->lng) { # уже есть $coords = Geocoding::getCoordsByAddress($ad->address, $city); if (isset($coords['lat']) && isset($coords['lng'])) { $ad->lat = $coords['lat']; $ad->lng = $coords['lng']; } } } return true; }
public function search() { $criteria = new CDbCriteria(); $tmp = 'title_' . Yii::app()->language; $criteria->compare('id', $this->id); $criteria->compare($tmp, $this->{$tmp}, true); if (issetModule('location') && param('useLocation', 1)) { $criteria->compare('loc_country', $this->loc_country); $criteria->compare('loc_region', $this->loc_region); $criteria->compare('loc_city', $this->loc_city); } else { $criteria->compare('city_id', $this->city_id); } $criteria->addCondition('owner_id = ' . Yii::app()->user->id); if ($this->active === '0' || $this->active) { $criteria->addCondition('active = :active'); $criteria->params[':active'] = $this->active; } if ($this->owner_active === '0' || $this->owner_active) { $criteria->addCondition('owner_active = :active'); $criteria->params[':active'] = $this->owner_active; } if ($this->type) { $criteria->addCondition('type = :type'); $criteria->params[':type'] = $this->type; } if ($this->obj_type_id) { $criteria->addCondition('obj_type_id = :obj_type_id'); $criteria->params[':obj_type_id'] = $this->obj_type_id; } $criteria->addCondition('active <> :draft'); $criteria->params['draft'] = Apartment::STATUS_DRAFT; $criteria->addInCondition('type', self::availableApTypesIds()); return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'id DESC'), 'pagination' => array('pageSize' => param('userPaginationPageSize', 20)))); }
public static function updateStatusAd() { if (Yii::app()->request->getIsAjaxRequest() || !issetModule('paidservices')) { return false; } if (!oreInstall::isInstalled()) { return false; } $data = Yii::app()->statePersister->load(); // Обновляем статусы 1 раз в сутки if (isset($data['next_check_status'])) { if ($data['next_check_status'] < time()) { $data['next_check_status'] = time() + self::TIME_UPDATE; Yii::app()->statePersister->save($data); self::checkStatusAd(); self::clearApartmentsStats(); // обновляем курсы валют Currency::model()->parseCbr(); } } else { $data['next_check_status'] = time() + self::TIME_UPDATE; Yii::app()->statePersister->save($data); self::checkStatusAd(); self::clearApartmentsStats(); } }
public function parseUrl($request) { if (issetModule('seo') && $this->parseReady === false && oreInstall::isInstalled()) { if (preg_match('#^([\\w-]+)#i', $request->pathInfo, $matches)) { $activeLangs = Lang::getActiveLangs(); $arr = array(); foreach ($activeLangs as $lang) { $arr[] = 'url_' . $lang . ' = :alias'; } $condition = '(' . implode(' OR ', $arr) . ')'; $seo = SeoFriendlyUrl::model()->find(array('condition' => 'direct_url = 1 AND ' . $condition, 'params' => array('alias' => $matches[1]))); if ($seo !== null) { foreach ($activeLangs as $lang) { $field = 'url_' . $lang; if ($seo->{$field} == $matches[1]) { setLangCookie($lang); Yii::app()->setLanguage($lang); //$_GET['lang'] = $lang; } } $_GET['url'] = $matches[1]; //$_GET['id'] = $seo->model_id; //Yii::app()->controller->seo = $seo; return 'infopages/main/view'; } } $this->parseReady = true; } return parent::parseUrl($request); }
public function init() { parent::init(); if (!issetModule('messages')) { throw404(); } $this->cityActive = SearchForm::cityInit(); }
public function getPaidserviceName() { $return = ''; if ($this->tariff_id && issetModule('tariffPlans')) { $return = tt('Purchase tariff plan', 'tariffPlans'); } elseif (isset($this->paidservice) && $this->paidservice) { $return = $this->paidservice->name; } return $return; }
public function actionView($id = 0, $url = '') { if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $model = $this->loadModel($id, 1); $this->render('view', array('model' => $model)); }
public function actionView($id = 0, $url = '') { $criteria = new CDbCriteria(); $criteria->order = 'sorter'; $criteria->condition = 'active=1'; $articles = Article::model()->cache(param('cachingTime', 1209600), Article::getCacheDependency())->findAll($criteria); if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $this->render('view', array('model' => $this->loadModel($id), 'articles' => $articles)); }
public function actionView($id = 0, $url = '') { // if(Yii::app()->user->getState('isAdmin')){ // $this->redirect(array('backend/main/view', 'id' => $id)); // } if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $model = $this->loadModel($id, 1); $this->render('view', array('model' => $model)); }
public function viewSimilarAds($data = null) { $similarAds = new SimilarAds(); $criteria = new CDbCriteria(); $criteria->addCondition('active = ' . Apartment::STATUS_ACTIVE); $criteria->addCondition('deleted = 0'); if (param('useUserads')) { $criteria->addCondition('owner_active = ' . Apartment::STATUS_ACTIVE); } if ($data->id) { $criteria->addCondition('t.id != :id'); $criteria->params[':id'] = $data->id; } if (issetModule('location')) { if ($data->loc_city) { $criteria->addCondition('loc_city = :loc_city'); $criteria->params[':loc_city'] = $data->loc_city; } } else { if ($data->city_id) { $criteria->addCondition('city_id = :city_id'); $criteria->params[':city_id'] = $data->city_id; } } if ($data->obj_type_id) { $criteria->addCondition('obj_type_id = :obj_type_id'); $criteria->params[':obj_type_id'] = $data->obj_type_id; } if ($data->type) { $criteria->addCondition('type = :type'); $criteria->params[':type'] = $data->type; } if ($data->price_type) { $criteria->addCondition('price_type = :price_type'); $criteria->params[':price_type'] = $data->price_type; } /*$criteria->limit = param('countListitng'.User::getModeListShow(), 10);*/ $criteria->limit = 8; $criteria->order = 't.id ASC'; $ads = $similarAds->getSimilarAds($criteria); if ($ads) { $similarAds->publishAssets(); } //print_r($criteria); $this->render('widgetSimilarAds_list', array('ads' => $ads)); }
public static function getMainData($id) { if ($id) { $addSelect = ''; $addSelectJoin = ''; if (issetModule('location')) { $addSelect = ' lc.name_' . Yii::app()->language . ' as loc_country_name, lr.name_' . Yii::app()->language . ' as loc_region_name, lcc.name_' . Yii::app()->language . ' as loc_city_name, ap.loc_country, ap.loc_region, ap.loc_city, '; $addSelectJoin = ' LEFT JOIN {{location_country}} lc ON lc.id = ap.loc_country LEFT JOIN {{location_region}} lr ON lr.id = ap.loc_region LEFT JOIN {{location_city}} lcc ON lcc.id = ap.loc_city '; } $sql = ' SELECT ap.id, ap.type, ap.obj_type_id, ap.city_id, ap.price, ap.num_of_rooms, ap.floor, ap.floor_total, ap.square, ap.land_square, ap.window_to, ap.title_' . Yii::app()->language . ', ap.description_' . Yii::app()->language . ', ap.description_near_' . Yii::app()->language . ', ap.address_' . Yii::app()->language . ', ap.berths, ap.price_type, ap.lat, ap.lng, ap.date_updated, ap.date_created, ' . $addSelect . ' ac.name_' . Yii::app()->language . ' as city_name, awt.title_' . Yii::app()->language . ' as window_to_name, u.phone as owner_phone, u.email as owner_email, u.id as owner_id, u.username as owner_username, aop.name_' . Yii::app()->language . ' as obj_type_name FROM {{apartment}} ap ' . $addSelectJoin . ' LEFT JOIN {{apartment_obj_type}} aop ON aop.id = ap.obj_type_id LEFT JOIN {{apartment_city}} ac ON ac.id = ap.city_id LEFT JOIN {{apartment_window_to}} awt ON awt.id = ap.window_to LEFT JOIN {{users}} u ON u.id = ap.owner_id WHERE ap.id = "' . (int) $id . '" '; //echo Yii::app()->db->cache(param('cachingTime', 1209600), self::getFullDependency($id))->createCommand($sql)->text; $results = Yii::app()->db->cache(param('cachingTime', 1209600), self::getFullDependency($id))->createCommand($sql)->queryRow(); return $results; } return false; }
public static function getApartments($limit = 10, $usePagination = 1, $all = 1, $criteria = null) { $pages = array(); Yii::app()->getModule('apartments'); if ($criteria === null) { $criteria = new CDbCriteria(); } if (!$all) { $criteria->addCondition('t.deleted = 0'); $criteria->addCondition('t.active = ' . Apartment::STATUS_ACTIVE); if (param('useUserads')) { $criteria->addCondition('owner_active = ' . Apartment::STATUS_ACTIVE); } } $sort = new CSort('Apartment'); $sort->attributes = array('price' => 'price', 'date_created' => 'date_created'); if (!$criteria->order) { $sort->defaultOrder = 't.date_up_search DESC, t.sorter DESC'; } $sort->applyOrder($criteria); $sorterLinks = self::getSorterLinks($sort); $criteria->addCondition('t.owner_id = 1 OR t.owner_active = 1'); $criteria->addInCondition('t.type', Apartment::availableApTypesIds()); $criteria->addInCondition('t.price_type', array_keys(Apartment::getPriceArray(Apartment::PRICE_SALE, true))); // find count $apCount = Apartment::model()->count($criteria); if ($usePagination) { $pages = new CPagination($apCount); $pages->pageSize = $limit; $pages->applyLimit($criteria); } else { $criteria->limit = $limit; } if (issetModule('seo')) { $criteria->with = array('seo'); } // $apartments = Apartment::model() // ->cache(param('cachingTime', 1209600), Apartment::getImagesDependency()) // ->with(array('images')) // ->findAll($criteria); return array('pages' => $pages, 'sorterLinks' => $sorterLinks, 'apCount' => $apCount, 'criteria' => $criteria); }
public function actionView($id = 0, $url = '') { if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $model = $this->loadModel($id, 1); if (!$model->active) { throw404(); } if (isset($_GET['is_ajax'])) { $this->renderPartial('view', array('model' => $model)); } else { $this->render('view', array('model' => $model)); } }
public function myDateValidator($param) { $dateStart = CDateTimeParser::parse($this->date_start, self::getYiiDateFormat()); // format to unix timestamp $dateEnd = CDateTimeParser::parse($this->date_end, self::getYiiDateFormat()); // format to unix timestamp if ($param == 'date_start' && $dateStart < CDateTimeParser::parse(date('Y-m-d'), 'yyyy-MM-dd')) { $this->addError('date_start', tt('Wrong check-in date', 'booking')); } if ($param == 'date_end' && $dateEnd <= $dateStart) { $this->addError('date_end', tt('Wrong check-out date', 'booking')); } if (issetModule('bookingcalendar')) { $result = Yii::app()->db->createCommand()->select('id')->from('{{booking_calendar}}')->where('apartment_id = "' . $this->apartment_id . '" AND status = "' . Bookingcalendar::STATUS_BUSY . '" AND UNIX_TIMESTAMP(date_start) > "' . $dateStart . '" AND UNIX_TIMESTAMP(date_end) < "' . $dateEnd . '"')->queryScalar(); if ($param == 'date_start' && $result) { $this->addError('date', tt('You chose dates in the range of which there are busy days', 'bookingcalendar')); } } }
public function actionBookingform($isFancy = 0) { Yii::app()->getModule('apartments'); $this->modelName = 'Apartment'; $apartment = $this->loadModel(); $this->modelName = 'Booking'; $booking = new Booking(); $booking->scenario = 'bookingform'; if (isset($_POST['Booking']) && BlockIp::checkAllowIp(Yii::app()->controller->currentUserIpLong) && !$apartment->deleted) { $booking->attributes = $_POST['Booking']; $booking->apartment_id = $apartment->id; $booking->user_ip = Yii::app()->controller->currentUserIp; $booking->user_ip_ip2_long = Yii::app()->controller->currentUserIpLong; if ($booking->validate()) { $booking->time_inVal = $this->getI18nTimeIn($booking->time_in); $booking->time_outVal = $this->getI18nTimeOut($booking->time_out); if (issetModule('bookingtable')) { Bookingtable::addRecord($booking); } $types = Apartment::getI18nTypesArray(); $booking->type = $types[Apartment::TYPE_RENT]; $ownerApartment = User::model()->findByPk($apartment->owner_id); $booking->ownerEmail = $ownerApartment->email; $notifier = new Notifier(); $notifier->raiseEvent('onNewBooking', $booking, array('user' => $ownerApartment)); Yii::app()->user->setFlash('success', tt('Operation successfully complete. Your order will be reviewed by owner.')); $this->redirect($apartment->getUrl()); } } $user = null; if (!Yii::app()->user->isGuest) { $user = User::model()->findByPk(Yii::app()->user->getId()); } if ($isFancy) { $this->excludeJs(); $this->renderPartial('bookingform', array('apartment' => $apartment, 'model' => $booking, 'isFancy' => true, 'user' => $user), false, true); } else { $this->render('bookingform', array('apartment' => $apartment, 'model' => $booking, 'isFancy' => false, 'user' => $user)); } }
/** * Authenticates a user. * @return boolean whether authentication succeeds. */ public function authenticate() { $user = User::model()->find('LOWER(email)=?', array(strtolower($this->username))); if ($user === null) { $this->errorCode = self::ERROR_USERNAME_INVALID; return 0; } if (!$user->validatePassword($this->password)) { $this->errorCode = self::ERROR_PASSWORD_INVALID; return 0; } elseif (!$user->active) { showMessage(Yii::t('common', 'Login'), Yii::t('common', 'Your account not active. The reasons: you not followed the link in the letter which has been sent at registration. Or administrator deactivate your account'), null, true); return 0; } else { $this->_id = $user->id; $this->username = $user->username; $this->setState('email', $user->email); $this->setState('username', $user->username); $this->setState('phone', $user->phone); if ($user->role == User::ROLE_ADMIN) { $this->setState('isAdmin', 1); } if (issetModule('rbac')) { $auth = Yii::app()->getAuthManager(); if (!$auth->isAssigned($user->role, $this->_id)) { if ($auth->assign($user->role, $this->_id)) { //Yii::app()->authManager->save(); } } } else { if ($user->role == User::ROLE_MODERATOR) { $this->errorCode = self::ERROR_PASSWORD_INVALID; return 0; } } $this->errorCode = self::ERROR_NONE; } return $this->errorCode == self::ERROR_NONE; }
public function actionView($id = 0, $url = '') { if ($url && issetModule('seo')) { $seo = SeoFriendlyUrl::getForView($url, $this->modelName); if (!$seo) { throw404(); } $this->setSeo($seo); $id = $seo->model_id; } $model = $this->loadModel($id); if ($model) { if (Yii::app()->request->getParam('is_ajax')) { $this->renderPartial('view', array('model' => $model), false, true); } else { $this->render('view', array('model' => $model)); } } else { Yii::app()->user->setFlash('error', tc('Page not found.')); $this->redirect(array('/site/index')); } }
public static function getLangForMap() { # язык в RFC 3066 switch (Yii::app()->language) { case 'ru': $langCode = 'ru-RU'; break; case 'uk': $langCode = 'uk-UA'; break; case 'tr': $langCode = 'tr-TR'; break; default: $langCode = 'en-US'; } if (issetModule('lang') && !isFree()) { $langInfo = Lang::model()->find('name_iso = :name_iso', array('name_iso' => Yii::app()->language)); if ($langInfo && isset($langInfo->name_rfc3066)) { $langCode = $langInfo->name_rfc3066; } } return $langCode; }
<?php $this->breadcrumbs = array($model->getStrByLang('title')); $this->menu = array(array('label' => tt('Manage apartments'), 'url' => array('admin')), array('label' => tt('Add apartment'), 'url' => array('create')), array('label' => tt('Update apartment'), 'url' => array('update', 'id' => $model->id)), array('label' => tt('Delete apartment'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => tt('Are you sure you want to delete this apartment?')))); $this->breadcrumbs = array($model->getStrByLang('title')); $this->pageTitle .= ' - ' . CHtml::encode($model->getStrByLang('title')); ?> <div class="<?php echo issetModule('viewpdf') ? 'div-pdf-fix' : ''; ?> "> <?php if (issetModule('viewpdf')) { echo '<div class="floatleft pdficon"> <a href="' . Yii::app()->baseUrl . '/viewpdf/main/view?id=' . $model->id . '" target="_blank"><img src="' . Yii::app()->theme->baseUrl . '/images/design/file_pdf.png" alt="' . Yii::t('common', 'Pdf version') . '" title="' . Yii::t('common', 'Pdf version') . '" /> </a></div>'; } ?> <div class="floatleft-title"> <div> <div class="div-title"> <h1 class="h1-ap-title"><?php echo CHtml::encode($model->getStrByLang('title')); ?> </h1> </div> <?php if ($model->rating) {
?> <?php $this->endWidget(); ?> <!-- form --> </div> <?php if (issetModule('paidservices')) { echo '<div class="well">'; echo '<h6>' . tc('Current paid services') . '</h6>'; echo $model->getPaidHtml(true, true); echo '</div>'; } if (issetModule('seo') && !$model->isNewRecord && $model->active != Apartment::STATUS_DRAFT) { $this->widget('application.modules.seo.components.SeoWidget', array('model' => $model)); } ?> <?php // reInit google map (for preventing incorrect work in hidden tab) Yii::app()->clientScript->registerScript('gmap-init', ' var useYandexMap = ' . param('useYandexMap', 1) . '; var useGoogleMap = ' . param('useGoogleMap', 1) . '; var useOSMap = ' . param('useOSMMap', 1) . '; var lang = "' . Yii::app()->language . '"; var address = "";
?> <div> <p><?php echo tt('The file is exported to the UTP-8 without BOM charset.'); ?> </p> <p><?php echo tt('Separators are ";".'); ?> </p> </div> <?php $columns = array(array('class' => 'CCheckBoxColumn', 'header' => tt('Select'), 'id' => 'itemsSelectedExport'), array('name' => 'id', 'htmlOptions' => array('class' => 'apartments_id_column', 'style' => 'text-align: center;'), 'sortable' => false), array('name' => 'active', 'type' => 'raw', 'value' => 'Yii::app()->controller->returnControllerStatusHtml($data, "apartments-grid", 1)', 'htmlOptions' => array('class' => 'apartments_status_column'), 'filter' => Apartment::getModerationStatusArray(), 'sortable' => false), array('name' => 'type', 'type' => 'raw', 'value' => 'Apartment::getNameByType($data->type)', 'htmlOptions' => array('style' => 'width: 100px;'), 'filter' => Apartment::getTypesArray(), 'sortable' => false)); if (issetModule('location')) { $columns[] = array('name' => 'loc_country', 'value' => '$data->loc_country ? $data->locCountry->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Country::getCountriesArray(0, 1)); $columns[] = array('name' => 'loc_region', 'value' => '$data->loc_region ? $data->locRegion->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Region::getRegionsArray($model->loc_country, 0, 1)); $columns[] = array('name' => 'loc_city', 'value' => '$data->loc_city ? $data->locCity->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => City::getCitiesArray($model->loc_region, 0, 1)); } else { $columns[] = array('name' => 'city_id', 'value' => '(isset($data->city ) && $data->city_id) ? $data->city->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'filter' => ApartmentCity::getAllCity(), 'sortable' => false); } $columns[] = array('name' => 'ownerEmail', 'htmlOptions' => array('style' => 'width: 150px;'), 'type' => 'raw', 'value' => '(isset($data->user) && $data->user->role != "admin") ? CHtml::link(CHtml::encode($data->user->email), array("/users/backend/main/view","id" => $data->user->id)) : tt("administrator", "common")'); $columns[] = array('header' => tc('Name'), 'name' => 'title_' . Yii::app()->language, 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->{"title_".Yii::app()->language}), $data->getUrl())', 'sortable' => false); ?> <div class="form"> <?php $this->widget('CustomHistoryGridView', array('id' => 'export-grid', 'dataProvider' => $model->searchExport(), 'filter' => $model, 'selectableRows' => 2, 'selectionChanged' => 'js:selItemsSelected', 'columns' => $columns)); ?>
</div> <div class="rowold"> <?php echo $form->labelEx($model, 'phone'); ?> <?php echo $form->textField($model, 'phone', array('size' => 20, 'maxlength' => 15, 'class' => 'span2')); ?> <?php echo $form->error($model, 'phone'); ?> </div> <?php if (issetModule('paidservices')) { ?> <div class="rowold"> <?php echo $form->labelEx($model, 'balance'); ?> <?php echo $form->textField($model, 'balance', array('size' => 20, 'maxlength' => 15, 'class' => 'span2')); ?> <?php echo $form->error($model, 'balance'); ?> </div> <?php } ?>
<?php if (issetModule('formeditor')) { echo '<dl class="ap-descr">'; Yii::import('application.modules.formeditor.models.HFormEditor'); $rows = HFormEditor::getExtendedFields(); HFormEditor::renderViewRows($rows, $data); echo '</dl>'; } $prev = ''; $column1 = 0; $column2 = 0; $column3 = 0; foreach ($data->references as $item) { if ($item['title']) { if ($prev != $item['style']) { $column2 = 0; $column3 = 0; echo '<div class="clear"></div>'; } ${$item}['style']++; $prev = $item['style']; echo '<div class="' . $item['style'] . '">'; echo '<span class="viewapartment-subheader">' . CHtml::encode($item['title']) . '</span>'; echo '<ul class="apartment-description-ul">'; foreach ($item['values'] as $key => $value) { if ($value) { if (param('useReferenceLinkInView')) { echo '<li><span>' . CHtml::link(CHtml::encode($value), $this->createAbsoluteUrl('/service-' . $key)) . '</span></li>'; } else { echo '<li><span>' . CHtml::encode($value) . '</span></li>';
<img class="shadow" alt="Предложения" src="/images/narezka/tury.jpg"> </a> </div><!-- end .column_left --> <div class="content"> <?php echo $content; ?> <div class="clear"></div> </div><!-- end .content --> </div> <?php if (issetModule('advertising')) { $this->renderPartial('//../modules/advertising/views/advert-bottom', array()); } ?> </div><!-- end .site --> <div class="footer"> <div class="myfooter"> <?php echo getGA();
<?php $this->pageTitle .= ' - ' . tt('Booking applications', 'usercpanel'); $this->breadcrumbs = array(tc('Control panel') => Yii::app()->createUrl('/usercpanel'), tt('Booking applications', 'usercpanel')); if (issetModule('bookingcalendar')) { echo "<div class='flash-notice'>" . tt('booking_table_to_calendar', 'booking') . "</div>"; } ?> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'users-booking-grid', 'dataProvider' => $model->search(true), 'filter' => $model, 'columns' => array(array('name' => 'active', 'type' => 'raw', 'value' => 'Yii::app()->controller->returnBookingTableStatusHtml($data, "users-booking-grid", 1)', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Bookingtable::getAllStatuses()), array('name' => 'apartment_id', 'type' => 'raw', 'value' => '(isset($data->apartment) && $data->apartment->id) ? CHtml::link($data->apartment->id, $data->apartment->getUrl()) : tc("No")', 'filter' => false, 'sortable' => false), array('name' => 'username', 'value' => '$data->username', 'filter' => true, 'sortable' => false), array('name' => 'email', 'value' => '$data->email', 'filter' => true, 'sortable' => false), array('name' => 'phone', 'value' => '$data->phone', 'filter' => true, 'sortable' => false), array('name' => 'comment', 'value' => 'truncateText($data->comment)', 'filter' => true, 'sortable' => false), array('name' => 'date_start', 'value' => '(isset($data->timein) && $data->time_in) ? $data->date_start . " (". $data->timein->getStrByLang("title").")" : "" ', 'filter' => true, 'sortable' => false, 'htmlOptions' => array('style' => 'width:150px;')), array('name' => 'date_end', 'value' => '(isset($data->timeout) && $data->time_out) ? $data->date_end . " (". $data->timeout->getStrByLang("title").")" : "" ', 'filter' => true, 'sortable' => false, 'htmlOptions' => array('style' => 'width:150px;')), array('header' => tt('Creation date', 'booking'), 'value' => '$data->date_created', 'type' => 'raw', 'filter' => false, 'sortable' => false)))); Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.jeditable.js', CClientScript::POS_END); Yii::app()->clientScript->registerScript('editable_select_booking_table', "\n\t\tfunction ajaxSetBookingTableStatus(elem, id, id_elem, items){\n\t\t\t\$('#editable_select-'+id_elem).editable('" . Yii::app()->controller->createUrl("bookingtableactivate") . "', {\n\t\t\t\tdata : items,\n\t\t\t\ttype : 'select',\n\t\t\t\tcancel : '" . tc('Cancel') . "',\n\t\t\t\tsubmit : '" . tc('Ok') . "',\n\t\t\t\tstyle : 'inherit',\n\t\t\t\tsubmitdata : function() {\n\t\t\t\t\treturn {id : id_elem};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t", CClientScript::POS_HEAD);