Esempio n. 1
0
 public function actionDescription()
 {
     Yii::app()->page->setInfo(array("description" => $this->description, "keyWord" => $this->keyWord));
     $id = 0;
     $class = $this->classModel;
     if (!empty($_GET["slug"])) {
         $model = $class::fetchBySlug(trim($_GET["slug"]));
         if ($model->id > 0) {
             $_GET["id"] = $model->id;
             $id = $model->id;
         }
     }
     $error = Yii::t("page", "Произошла ошибка перехода на страницу, проверьте правильно написания адреса страницы");
     if ($id > 0) {
         $item = CatalogFirmsService::fetch($id);
         if ($item->id > 0) {
             CCModelHelper::colCounter($item);
             // Картинки тура
             $images = ImageHelper::getImages($item);
             Yii::app()->page->title = $item->name . " - " . Yii::t("page", "услуги от компании");
             $this->render('description', array("item" => $item, "images" => $images, "firmsService" => CatalogFirmsService::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id AND id!=:id")->setParams(array(":firm_id" => $item->firm_id, ":id" => $item->id))->setCache(0)), "firmsItems" => CatalogFirmsItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id")->setParams(array(":firm_id" => $item->firm_id))->setCache(0))));
         } else {
             throw new CHttpException("", $error);
         }
     } else {
         throw new CHttpException("", $error);
     }
 }
Esempio n. 2
0
    $countryModel = new CatalogCountry();
}
$category = Yii::app()->request->getParam("category", "");
if (!empty($category)) {
    $categoryModel = CatalogToursCategory::fetchBySlug($category);
} else {
    $categoryModel = new CatalogToursCategory();
}
if ($countryModel->id > 0) {
    $toursCondition .= " AND country_id='" . $countryModel->id . "'";
}
if ($categoryModel->id > 0) {
    $toursCondition .= " AND category_id='" . $categoryModel->id . "'";
}
$listTours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($toursCondition)->setParams($tourParams)->setOrderBy("pos DESC")->setLimit(-1)->setCache(0));
$listItems = CatalogFirmsItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id AND active=1")->setParams(array(":firm_id" => $item->id))->setLimit(-1)->setCache(0));
?>
<div id="InnerText" class="innerPage">
    <br/>
    <?php 
SiteHelper::renderDinamicPartial("pageDescriptionTop");
?>
    <h1><?php 
echo $item->name;
?>
 <font>- <?php 
echo Yii::t("travelAgency", "туристическое агенство");
?>
 <?php 
echo $item->country_id->name_2;
?>