Example #1
0
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     Yii::app()->page->title = "Каталог продукции";
     if (!Yii::app()->user->isGuest) {
         $itemModel = new CatalogItemsAdd();
         if (!empty($_POST["save_profile"])) {
             $itemModel->setAttributesFromArray($_POST["CatalogItemsAdd"]);
             $itemModel->user_id = Yii::app()->user->id;
             $itemModel->status_id = 3;
             // По умолчанию не активен
             $itemModel->date = time();
             if ($itemModel->saveParam()) {
                 $itemModel->onAddItem(new CModelEvent($itemModel), array("id" => $itemModel->id, "subject" => $itemModel->name, "date" => date("d.m.Y"), "description" => SiteHelper::getSubTextOnWorld($itemModel->description, 200), "link" => Yii::app()->params["adminEmail"] . SiteHelper::createUrl("/user/items/description/", array("id" => $itemModel->id))));
                 $this->redirect(SiteHelper::createUrl("/catalog/add/save", array("id" => $itemModel->id)));
             }
         }
         $addDopParams = null;
         if ($itemModel->category_id && $itemModel->category_id->id > 0) {
             $categoryModel = CatalogItemsCategory::fetch($itemModel->category_id->id);
             if ($categoryModel->table_name) {
                 $catalogClass = SiteHelper::getCamelCase($categoryModel->table_name);
                 $addDopParams = new $catalogClass();
             }
         }
         $this->render("add", array("form" => $itemModel, "addDopParams" => $addDopParams));
     } else {
         Yii::app()->session['redirect'] = SiteHelper::createUrl("/catalog/add");
         $this->render("addauthWidget");
     }
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $limit = 30;
     $p = (int) Yii::app()->request->getParam("p", 1);
     $catalog = Yii::app()->request->getParam("catalog", "");
     Yii::app()->page->title = "Выставить слаг";
     if (!empty($catalog)) {
         $catalogS = SiteHelper::getCamelCase($catalog);
         $items = $catalogS::fetchAll(DBQueryParamsClass::CreateParams()->setLimit($limit)->setCache(0)->setPage($p));
         //echo sizeof( $items )."*";
         //die;
         for ($i = 0; $i < sizeof($items); $i++) {
             if (strpos($items[$i]->description, "</xml>") !== false) {
                 $arr = explode("</xml>", $items[$i]->description);
                 $items[$i]->description = $arr[1];
                 if (empty($items[$i]->description)) {
                     $items[$i]->description = "  - ";
                 }
                 if (!$items[$i]->save()) {
                     //print_r( $items[$i]->getErrors() );
                     //die;
                 }
             }
         }
         if (sizeof($items) == $limit) {
             $this->redirect(SiteHelper::createUrl("/console/CheckDescription", array("catalog" => $catalog, "p" => $p + 1)));
         }
     } else {
         $items = array();
     }
     $this->render("index", array("items" => $items));
 }
Example #3
0
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     Yii::app()->page->title = "Описание продукции";
     $id = (int) Yii::app()->request->getParam("id", 0);
     if ($id > 0) {
         $item = CatalogItems::fetchParam($id);
         $otherItem = CatalogItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("id!=:id AND category_id=:cid")->setParams(array(":id" => $item->id, ":cid" => $item->category_id->id))->setOrderBy("price")->setLimit(10));
         $hotItem = CatalogItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("id!=:id AND is_hot=:hot")->setParams(array(":id" => $item->id, ":hot" => 1))->setOrderBy("price")->setLimit(10));
         if ($item->id > 0) {
             $favorites = Yii::app()->request->getParam("favorites", "");
             if ($favorites == "add") {
                 $res = Yii::app()->favorites->add("catalog_items", $item->id);
             }
             $newComment = new CatalogItemsCommentsAdd();
             // Сохраняем комментарий
             if (!empty($_POST["sentComment"])) {
                 $newComment->setAttributesFromArray($_POST["CatalogItemsCommentsAdd"]);
                 $newComment->date = time();
                 $newComment->user_id = Yii::app()->user->id;
                 $newComment->item_id = $id;
                 if ($newComment->save()) {
                     $newComment->formMessage = "Комментарий успешно отправлен.";
                     $newComment->onNewComment(new CModelEvent($newComment), array("id" => $item->id, "name" => $item->name, "subject" => $newComment->subject, "link" => SiteHelper::createUrl("/user/items/index", array("id" => $newComment->item_id))));
                 }
             }
             $listComments = CatalogItemsComments::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("item_id=:item_id AND is_valid=1")->setParams(array(":item_id" => $item->id))->setOrderBy("date DESC"));
             $this->render("item", array("item" => $item, "otherItem" => $otherItem, "hotItem" => $hotItem, "addForm" => $newComment, "listComments" => $listComments));
         } else {
             $this->redirect("/");
         }
     } else {
         $this->redirect("/");
     }
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $limit = 30;
     $p = (int) Yii::app()->request->getParam("p", 1);
     $catalog = Yii::app()->request->getParam("catalog", "");
     Yii::app()->page->title = "Выставить слаг";
     if (!empty($catalog)) {
         $catalogS = SiteHelper::getCamelCase($catalog);
         $items = $catalogS::fetchAll(DBQueryParamsClass::CreateParams()->setLimit($limit)->setCache(0)->setPage($p));
         //echo sizeof( $items )."*";
         //die;
         foreach ($items as $item) {
             //echo "#".$item->id."<br/>";
             $item->description = str_replace("< ", "<", $item->description);
             if (!$item->save()) {
                 print_r($item->getErrors());
                 //die;
             }
         }
         if (sizeof($items) == $limit) {
             $this->redirect(SiteHelper::createUrl("/console/CheckDescriptionTag", array("catalog" => $catalog, "p" => $p + 1)));
         }
     } else {
         $items = array();
     }
     $this->render("index", array("items" => $items));
 }
Example #5
0
 public function actionDescription($gallError = "")
 {
     $this->firmId = (int) Yii::app()->request->getParam("fid", 0);
     $id = (int) Yii::app()->request->getParam("id", 0);
     // Если не указан ID фирмы, то берем ID из описания тура
     if ($id > 0 && $this->firmId == 0) {
         $tourModel = CatalogTours::fetch($id);
         if ($tourModel->id > 0 && $tourModel->firm_id && $tourModel->firm_id->id > 0) {
             $this->firmId = $tourModel->firm_id->id;
         }
     }
     if ($this->firmId == 0) {
         die("id==0");
         $this->redirect(SiteHelper::createUrl("/user/firms"));
     }
     $firmModel = CatalogFirms::fetch($this->firmId);
     if ($firmModel->id == 0) {
         die("id==not correct");
         $this->redirect(SiteHelper::createUrl("/user/firms"));
     }
     parent::init();
     $this->addModel = "CatalogToursAdd";
     $this->tableName = "catalog_tours";
     $this->name = Yii::t("user", "туры");
     $_POST["CatalogToursAdd"]["firm_id"] = $this->firmId;
     $_POST["CatalogToursAdd"]["user_id"] = Yii::app()->user->getId();
     parent::actionDescription();
 }
 public function actionRecharge()
 {
     if (!Yii::app()->user->isGuest) {
         $error = "";
         if (!empty($_POST["recharge_submit"])) {
             $newPlantRequest = new OrderRequest();
             $price = (int) $_POST["price"];
             if ($price > 0) {
                 $newPlantRequest->user_id = Yii::app()->user->id;
                 $newPlantRequest->type_id = 2;
                 $newPlantRequest->status_id = 2;
                 $newPlantRequest->date = time();
                 $newPlantRequest->amount = $price;
                 if ($newPlantRequest->save()) {
                     $this->redirect(SiteHelper::createUrl("/merchant/index", array("id" => $newPlantRequest->id)));
                 }
             } else {
                 $error = "Вы ввели не верную сумму";
             }
         }
         Yii::app()->page->title = "Пополнения счета";
         $this->render("recharge", array("error" => $error));
     } else {
         $this->redirect(SiteHelper::createUrl("/"));
     }
 }
 public function run()
 {
     if ($this->beginCache("socialLink_block_" . Yii::app()->getLanguage(), array('duration' => 3600))) {
         if (!$this->url) {
             $this->url = SiteHelper::createUrl("") . $_SERVER["REQUEST_URI"];
         }
         $this->render("socialLink", array("id" => $this->id, "url" => $this->url));
         $this->endCache();
     }
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete()
 {
     if ($this->id > 0) {
         $item = CatComments::fetch($this->id);
         if ($item->id > 0) {
             $item->delete();
             $this->redirect(SiteHelper::createUrl("/console/comments"));
         }
     }
     $this->redirect(SiteHelper::createUrl("/console/comments"));
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete()
 {
     if ($this->id > 0) {
         $item = ExBanner::fetch($this->id);
         if ($item->id > 0) {
             $item->delete();
             $this->redirect(SiteHelper::createUrl("/console/banners"));
         }
     }
     $this->redirect(SiteHelper::createUrl("/console/banners"));
 }
 public function actionDescription()
 {
     $slug = Yii::app()->request->getParam("slug", "");
     if (!empty($slug)) {
         $item = CatalogMaps::fetchBySlug("map-" . $slug);
         Yii::app()->page->setTitle($item->name);
         $list = CatalogWheters::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("city_id=:id")->setParams(array(":id" => $item->city_id->id))->setLimit(-1));
         $this->render("description", array("item" => $item, "list" => $list));
     } else {
         $this->redirect(SiteHelper::createUrl("/uzbekistanMaps"));
     }
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     if (!Yii::app()->user->isGuest) {
         Yii::app()->page->title = "Оплата";
         /*
                     if( $_POST["register_submit_button"] )
                     {
                         $gateway = Yii::app()->getComponent('payment')->getGateway('PaypalExpress');
                         $response = $gateway->setupPurchase(100, array(
                             'return_url' => $this->createAbsoluteUrl(
                                 '/payment/callback', array('success' => 1, 'order_id' => 1)
                             ),
                             'cancel_return_url' => $this->createAbsoluteUrl(
                                 '/payment/callback', array('failed'  => 1, 'order_id'  => 1)
                             ),
                             'items' => array(
                                 array(
                                     'description' => 'Bla bla',
                                     'unit_price'  => 100,
                                     'quantity'    => 1,
                                     'id'              => 1
                                 )
                             )
                         ));
                         if ($response->success()) {
                             $this->redirect($gateway->urlForToken($response->token()));
                         }
         
                 // payment controller::callback action
                 // IPN
                         if (isset($_REQUEST['success'], $_GET['token'], $_GET['PayerID'])) {
                             $gateway = Yii::app()->getComponent('payment')->getGateway('PaypalExpress');
                             $response = $gateway->get_details_for($_GET['token'], $_GET['PayerID']);
                             $response = $gateway->purchase($response->amount());
                             if ($response->success()) {
                                 // success payment
                             } else {
                                 //error payment
                             }
                         }
                     }*/
         $id = Yii::app()->request->getParam("id", 0);
         if ($id > 0) {
             $order = OrderRequest::fetch($id);
             if ($order->id > 0 && $order->del == 0) {
                 $this->render('index', array("controller" => $this, "model" => $order));
             }
         } else {
             $this->redirect(SiteHelper::createUrl("/user/requsets"));
         }
     }
 }
Example #12
0
 public function run()
 {
     if ($this->beginCache('widgetInfo_' . $this->class . $this->category_id . "_" . Yii::app()->getLanguage(), array('duration' => 3600))) {
         $className = $this->class;
         if ($this->category_id > 0) {
             $dopCondition = " AND category_id='" . (int) $this->category_id . "'";
         } else {
             $dopCondition = "";
         }
         $this->render("infoWidget", array('title' => $this->title, 'link' => SiteHelper::createUrl($this->link . "/description"), 'linkAll' => SiteHelper::createUrl($this->link), 'list' => $className::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("image>''" . $dopCondition)->setOrderBy("id DESC")->setLimit(9))));
         $this->endCache();
     }
 }
 /**
  * Deletes a particular model.
  * If deletion is successful, the browser will be redirected to the 'admin' page.
  * @param integer $id the ID of the model to be deleted
  */
 public function actionDelete()
 {
     if ($this->id > 0) {
         $item = I18n::fetch($this->id);
         if ($item->id > 0) {
             $item->delete();
             $itemTranslate = I18nTranslate::fetch($this->id);
             $itemTranslate->delete();
             $this->redirect(SiteHelper::createUrl("/console/variable"));
         }
     }
     $this->redirect(SiteHelper::createUrl("/console/variable"));
 }
Example #14
0
 public function actionSave()
 {
     $addModel = new CatalogWorkAdd();
     if (!empty($_POST["CatalogWorkAdd"]) && !Yii::app()->user->isGuest) {
         $addModel->setAttributesFromArray($_POST["CatalogWorkAdd"]);
         $addModel->user_id = Yii::app()->user->getId();
         $addModel->status_id = 1;
         $addModel->active = 1;
         $addModel->date = time();
         if ($addModel->save()) {
             $id = $addModel->id;
             $this->redirect(SiteHelper::createUrl("/adsUsers", array("saved" => $id)));
         } else {
             $p = (int) Yii::app()->request->getParam("p", 1);
             $items = CatalogWork::fetchAll(DBQueryParamsClass::CreateParams()->setCache(0)->setLimit(25)->setPage($p)->setOrderBy("id DESC"));
             $this->render("index", array("items" => $items, "addModel" => $addModel));
         }
     }
 }
Example #15
0
 public function check_exists_params($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $identity = new UserIdentity($this->email, $this->password);
         $errorCode = $identity->authenticate();
         if ($errorCode == 0) {
             Yii::app()->user->login($identity);
         } else {
             if ($errorCode == 100) {
                 $textError = Yii::t("models", "Вы не подтвердили Свой Email") . ":" . $this->email . "<br/>";
                 $textError .= Yii::t("models", "Вам по почте должно было прийти письмо для подтверждения регистрации.") . "<br/><br/><b>" . Yii::t("models", "Письмо не пришло?") . "</b><br/><a href=\"" . SiteHelper::createUrl("/user/default/resend", array("email" => $this->email)) . "\">" . Yii::t("models", "отправить заново письмо для подтверждения регистрации на") . " " . $this->email . "</a>\n                                                   <br/><br/><b>" . Yii::t("models", "Все равно не пришло?</b><br/>Это странно, тогда Вам необходимо будет написать, с Email который вы указали при регистрации, письмо в службу тех. поддержки") . " <a href=\"mailto:" . Yii::app()->params["supportEmail"] . "\">" . Yii::app()->params["supportEmail"] . "</a><br/>" . Yii::t("models", "Пример письма:<br/>Заголовок письма - У меня проблемы с регистрацией<br/>Текст сообщения - Разберитесь пожалуйста");
                 $this->addErrors(array("0" => $textError));
             } else {
                 $textError = "Вы ввели не верный Email или ПАРОЛЬ<br/>";
                 $textError .= "<br/><b>" . Yii::t("models", "Забыли пароль?") . "</b><br/><a href=\"" . SiteHelper::createUrl("/user/default/lost") . "\">" . Yii::t("models", "восстановить пароль") . "</a>";
                 $this->addErrors(array("0" => $textError));
             }
         }
     }
 }
 public function textFind($findText)
 {
     Yii::app()->page->title = "Поиск продукции";
     if (!empty($findText)) {
         $arrayData = array();
         $listCid = CatalogItemsCategory::sql("SELECT c2.name as cid_name, c.name, c.id, count(i.id) as c FROM catalog_items_category c, catalog_items_category c2, catalog_items i WHERE ( i.name like '%" . $findText . "%' OR i.description like '%" . $findText . "%' ) AND c.id=i.category_id AND c2.id = c.owner GROUP BY i.category_id");
         for ($i = 0; $i < sizeof($listCid); $i++) {
             $cidName = $listCid[$i]["cid_name"];
             if (!empty($arrayData[$cidName]["count"])) {
                 $arrayData[$cidName]["count"] += $listCid[$i]["c"];
             } else {
                 $arrayData[$cidName]["count"] = $listCid[$i]["c"];
             }
             $arrayData[$cidName]["items"][] = $listCid[$i];
         }
         $items = CatalogItems::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("name like '%" . $findText . "%' OR description like '%" . $findText . "%'")->setLimit(10));
         $this->render("index", array("arrayData" => $arrayData, "items" => $items));
     } else {
         $this->redirect(SiteHelper::createUrl("/"));
     }
 }
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     $limit = 50;
     $p = (int) Yii::app()->request->getParam("p", 1);
     $catalog = Yii::app()->request->getParam("catalog", "");
     Yii::app()->page->title = "Выставить слаг";
     if (!empty($catalog)) {
         $catalogS = SiteHelper::getCamelCase($catalog);
         $items = $catalogS::fetchAll(DBQueryParamsClass::CreateParams()->setLimit($limit)->setCache(0)->setPage($p));
         sizeof($items);
         for ($i = 0; $i < sizeof($items); $i++) {
             $items[$i]->slug = SiteHelper::getSlug($items[$i]);
         }
         if (sizeof($items) > 0) {
             $this->redirect(SiteHelper::createUrl("/console/SetSlug", array("catalog" => $catalog, "p" => $p + 1)));
         }
     } else {
         $items = array();
     }
     $this->render("index", array("items" => $items));
 }
 public function init()
 {
     parent::init();
     $this->addModel = "CatalogFirmsServiceAdd";
     $this->tableName = "catalog_firms_service";
     $this->name = Yii::t("user", "Услуги компании");
     $this->firmId = (int) Yii::app()->request->getParam("fid", 0);
     $id = (int) Yii::app()->request->getParam("id", 0);
     $return = false;
     // Если не указан ID фирмы, то берем ID из описания тура
     if ($id > 0 && $this->firmId == 0) {
         $class = $this->addModel;
         $tourModel = $class::fetch($id);
         if ($tourModel->id > 0 && $tourModel->firm_id && $tourModel->firm_id->id > 0) {
             $this->firmId = $tourModel->firm_id->id;
         } else {
             $return = true;
         }
     }
     if ($return == true) {
         $this->redirect(SiteHelper::createUrl("/user/firms"));
     }
 }
Example #19
0
 public function renderTags($slug)
 {
     if (Yii::app()->controller->beginCache($slug . "-page-" . Yii::app()->getLanguage(), array('duration' => 3600 * 24 * 3))) {
         $params = $this->tag_params;
         if (!empty($params[$slug])) {
             $paramArray = $params[$slug];
         } elseif (!empty($params["default"])) {
             $paramArray = $params["default"];
         }
         $listClass = array("key01", "key02", "key03", "key04", "key05", "key06");
         if (!empty($paramArray)) {
             $listTags = array();
             foreach ($paramArray as $key => $value) {
                 $modelClass = SiteHelper::getCamelCase($key);
                 $sql = "del=0";
                 if (!empty($value[2])) {
                     $sql .= " AND " . $value[2];
                 }
                 $link = SiteHelper::createUrl($value[0]);
                 $listItems = $modelClass::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($sql)->setLimit($value[1])->setOrderBy("id DESC"));
                 foreach ($listItems as $item) {
                     if ($item->slug) {
                         $randClass = array_rand($listClass, 1);
                         $item->name = SiteHelper::getSubTextOnWorld($item->name, 60);
                         $listTags[] = '<a href="' . $link . "/" . $item->slug . '.html" title="' . SiteHelper::getStringForTitle($item->name) . '" class="' . $listClass[$randClass] . '">' . $item->name . '</a>';
                     }
                 }
             }
             shuffle($listTags);
             shuffle($listTags);
             foreach ($listTags as $key => $item) {
                 echo $item . " ";
             }
         }
         Yii::app()->controller->endCache();
     }
 }
Example #20
0
    </div>
    <a href="<?php 
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php 
echo SiteHelper::getStringForTitle($tour->category_id->name . "," . $tour->name);
?>
"><?php 
echo SiteHelper::getSubTextOnWorld($tour->name, 100);
?>
</a><br/>
    <?php 
echo SiteHelper::getSubTextOnWorld($tour->description, 150);
?>
    <div class="LParams">
        <a href="<?php 
echo SiteHelper::createUrl("/travelAgency/description") . "/" . $tour->firm_id->slug;
?>
.html" title="<?php 
echo Yii::t("page", "туристическая фирма");
?>
 <?php 
echo SiteHelper::getStringForTitle($tour->firm_id->name);
?>
"><?php 
echo $tour->firm_id->name;
?>
</a>
    </div>
</div>
Example #21
0
    echo Yii::t("user", "Удалить");
    ?>
</a>
            </div>
        </td>
    </tr>
<?php 
}
?>
</table>
    <?php 
if (sizeof($items) == 0) {
    ?>
<div class="textAlignCenter"><?php 
    echo Yii::t("page", "Список пуст");
    ?>
</div><?php 
}
?>
    <br/>
    <br/>
    <center>
        <a href="<?php 
echo SiteHelper::createUrl("/user/sales/description");
?>
"><?php 
echo Yii::t("user", "Добавить акцию");
?>
</a>
    </center>
</div>
Example #22
0
 public function render($view, $data = array(), $return = false)
 {
     if ($this->beforeRender($view)) {
         if (!Yii::app()->user->isGuest) {
             $userModel = CatalogUsers::fetch(Yii::app()->user->getId());
             if ($userModel->id > 0) {
                 $USER = $userModel;
             } else {
                 Yii::app()->user->logout();
                 $this->redirect(SiteHelper::createUrl("/"));
             }
         } else {
             $USER = new CatalogUsers();
         }
         $data = array_merge($data, array("Theme" => Yii::app()->getTheme(), "controller" => $this, "USER" => $USER));
         $output = $this->renderPartial($view, $data, true);
         if (($layoutFile = $this->getLayoutFile($this->layout)) !== false) {
             $output = $this->renderFile($layoutFile, array_merge($data, array("content" => $output)), true);
         }
         $this->afterRender($view, $output);
         $output = $this->processOutput($output);
         if ($return) {
             return $output;
         } else {
             echo $output;
         }
     }
 }
Example #23
0
    echo Yii::t("page", "Смотрите также");
    ?>
</h2>
        <div class="ITBlock ITBFirms ITBOthCountry">
            <?php 
    foreach ($other as $hotel) {
        ?>
                <?php 
        $this->widget("infoOneWidget", array("item" => $hotel));
        ?>
            <?php 
    }
    ?>
            <div class="textAlignRight">
                <a href="<?php 
    echo SiteHelper::createUrl("/touristInfo", array("category" => $item->category_id->slug));
    ?>
.html" class="cmore" title="<?php 
    echo Yii::t("page", "информация");
    ?>
 - <?php 
    echo $item->category_id->name;
    ?>
"><?php 
    echo Yii::t("page", "информация");
    ?>
 - <?php 
    echo $item->category_id->name;
    ?>
 ( <?php 
    echo $hotelCount;
    public function getList()
    {
        if (!Yii::app()->user->isGuest) {
            $list = Notifications::findByAttributes(array("user_id" => Yii::app()->user->id, "is_new" => 1));
            $cout = "";
            if (sizeof($list) > 0) {
                $cout .= '<div id="notificationsBlock">';
                foreach ($list as $item) {
                    $cout .= '<div class="NBItem">
                                <div class="NHeader">' . $item->subject . '<div class="floatRight"><a href="#" class="NHide" id="' . $item->id . '">скрыть</a>&nbsp;&nbsp;&nbsp;<a href="#" class="NBdesc">подробнее</a></div></div>
                                <div class="displayNone">
                                    Дата: <font>' . SiteHelper::getDateOnFormat($item->date, "d.m.Y") . '</font><br/>
                                    <div class="textAlignLeft">
                                        ' . $item->message . '
                                    </div>
                                </div>
                            </div>';
                }
                $cout .= '</div>
                         <script type="text/javascript">
                            $( document).ready( function()
                            {
                                $(".NHide").click( function()
                                {
                                    $.ajax({
                                            type: "GET",
                                            url: "' . SiteHelper::createUrl("/user/default/notificationHide/id") . '/"+this.id,
                                            success: function(msg){
                                                if( msg > 0 )
                                                {
                                                    $( $( "#"+msg )[0].parentNode.parentNode.parentNode ).remove();
                                                    if( $( "#notificationsBlock .NBItem" ).length == 0 )$( "#notificationsBlock" ).hide(400);
                                                }
                                            }
                                        });                                        
                                    return false;
                                })

                                $(".NBhide").click( function()
                                {
                                    $.ajax( "' . SiteHelper::createUrl("/user/notifications/show/id") . '/"+this.id );
                                    return false;
                                })

                                $(".NBdesc").click( function()
                                {
                                    var obj = $( this.parentNode.parentNode.parentNode ).find(".displayNone");
                                    if( obj.css("display") == \'none\' )
                                    {
                                        obj.show(500, "", function ()
                                        {
                                            $( this ).find(".textAlignLeft").show(300);
                                            $( this ).addClass("greyBack");
                                            $( this.parentNode ).find(".NBdesc").text( "кратко" );
                                        });
                                    }
                                    else
                                    {

                                        obj.find(".textAlignLeft").hide(300, \'\', function ()
                                        {
                                            $( this.parentNode ).removeClass("greyBack");
                                            $( this.parentNode ).hide(500);
                                            $( this.parentNode.parentNode).find(".NBdesc").text( "подробнее" );
                                        });
                                    }

                                    return false;
                                })
                            })
                        </script>';
            }
            return $cout;
        }
        return "";
    }
Example #25
0
        ?>
.html"><img src="<?php 
        echo ImageHelper::getImage($item->image, 2);
        ?>
" width="200" alt="<?php 
        echo $item->name;
        ?>
" /></a></a></div><?php 
    }
    ?>
        <div class="LHeader">
            <a title="<?php 
    echo $item->name;
    ?>
" href="<?php 
    echo SiteHelper::createUrl("/news/description") . "/" . $item->slug;
    ?>
.html"><?php 
    echo $item->name;
    ?>
</a>
            <?php 
    if ($item->col > 0) {
        ?>
<div class="floatRight rightInfo"><?php 
        echo Yii::t("page", "просмотров");
        ?>
: <b><?php 
        echo $item->col;
        ?>
</b></div><?php 
Example #26
0
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="panel panel-warning">
                    <div class="panel-heading"><?php 
    echo Yii::t("page", "Туры по странам");
    ?>
</div>
                    <div class="panel-body">
                        <ul>
                            <?php 
    foreach ($reCountry2 as $cItem => $values) {
        ?>
                                <li><a href="<?php 
        echo SiteHelper::createUrl("/travelAgency/description") . "/" . $item->slug;
        ?>
.html?country=<?php 
        echo $values->slug;
        ?>
&tab=tours" title="<?php 
        echo Yii::t("page", "туры");
        ?>
 <?php 
        echo $values->name_2;
        ?>
"><?php 
        echo $values->name;
        ?>
</a></li>
                            <?php 
Example #27
0
                <!--a class="clip" href="<?php 
    echo SiteHelper::createUrl("/travelAgency/description") . "/" . $item->firm_id->slug;
    ?>
.html" title="<?php 
    echo $item->firm_id->name;
    ?>
"><?php 
    echo Yii::t("page", "Фирма");
    ?>
: <b><?php 
    echo $item->firm_id->name;
    ?>
</b></a-->
                <br/>
                <a class="label" href="<?php 
    echo SiteHelper::createUrl($url . "/description") . "/" . $item->slug;
    ?>
.html" title="<?php 
    echo $item->name;
    ?>
">подробнее....</a>
            </div>
            <div class="well well-lg"><div class="limitText">
                    <?php 
    echo CCModelHelper::getLimitText($item->description, "200");
    ?>
                </div>
            </div>
        </div>
    </div>
<?php 
Example #28
0
    echo $catalogItemModel->name;
    ?>
</td>
        <td><?php 
    echo $status;
    ?>
</td>
        <td class="fieldActions">
            <a href="<?php 
    echo SiteHelper::createUrl("/console/comments/edit", array("id" => $item->id));
    ?>
">Редактировать</a>
            <a href="<?php 
    echo SiteHelper::createUrl("/console/comments/delete", array("id" => $item->id));
    ?>
"><?php 
    echo Yii::t("user", "Удалить");
    ?>
</a>
        </td>
    </tr>
<?php 
}
?>
</table>
<center>
    <a href="<?php 
echo SiteHelper::createUrl("/console/comments/edit");
?>
">Добавить</a>
</center>
Example #29
0
<div id="LMenu">
    <div class="MNHeader"><?php 
echo Yii::t("page", "Разделы");
?>
</div>
    <?php 
foreach (CatalogSections::fetchAll(DBQueryParamsClass::CreateParams()->setOrderBy("name")->setLimit(-1)) as $item) {
    ?>
        <div class="LMItem">
            <a href="<?php 
    echo SiteHelper::createUrl("/sections") . "/" . $item->slug;
    ?>
.html" title="<?php 
    echo $item->name;
    ?>
 - <?php 
    echo Yii::t("page", "категория частных объявлений");
    ?>
"><?php 
    echo $item->name;
    ?>
</a>
        </div>
    <?php 
}
?>
</div>
<br/>
<div class="lBanner"><?php 
echo Yii::app()->banners->getBannerByCategory("left");
?>
Example #30
0
</a><br/>
            <?php 
if ($item->price > 0) {
    echo Yii::t("page", "цена");
    ?>
: <b class="radColor"><?php 
    echo $item->price;
    ?>
</b><br/><?php 
}
?>
            <?php 
if ($item->user_id->id == Yii::app()->user->getId()) {
    ?>
<a href="<?php 
    echo SiteHelper::createUrl("/user/items/description", array("id" => $item->id));
    ?>
"><?php 
    echo Yii::t("page", "Редактировать");
    ?>
</a><br/><?php 
}
?>
            <br/>
        </div>
        <?php 
if (sizeof($images) > 0 || $item->image) {
    ?>
            <div class="floatLeft leftImages">
                <?php 
    if ($item->image) {