Exemplo 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);
     }
 }
Exemplo n.º 2
0
<?php

$this->widget('addressLineWidget', array('links' => array(Yii::t("travelAgency", "Туристические агентства") . $item->country_id->name_2 => SiteHelper::createUrl("/travelAgency"), $item->name)));
$listComments = CatalogFirmsComments::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id AND active=1")->setParams(array(":firm_id" => $item->id))->setOrderBy("id DESC")->setLimit(-1)->setCache(0));
$listService = CatalogFirmsService::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("firm_id=:firm_id AND active=1")->setParams(array(":firm_id" => $item->id))->setLimit(-1)->setCache(0));
$toursCondition = "firm_id=:firm_id AND active=1";
$tourParams = array(":firm_id" => $item->id);
$country = Yii::app()->request->getParam("country", "");
if (!empty($country)) {
    $countryModel = CatalogCountry::fetchBySlug($country);
} else {
    $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