Пример #1
0
        echo $item->name;
        ?>
" /></a><?php 
    }
    ?>
                <?php 
    foreach ($images as $image) {
        ?>
                    <a href="<?php 
        echo $image->image;
        ?>
" title="<?php 
        echo $item->name . " " . $image->name;
        ?>
" rel="lightbox[roadtrip]"><img src="<?php 
        echo ImageHelper::getImage($image->image, 2);
        ?>
" title="<?php 
        echo $item->name . " " . $image->name;
        ?>
" alt="<?php 
        echo $item->name . " " . $image->name;
        ?>
" /></a>
                <?php 
    }
    ?>
            </div>
        <?php 
}
?>
Пример #2
0
    ?>
" alt="<?php 
    echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
    ?>
" /></a>
        <?php 
} elseif (sizeof($listImages) > 0) {
    ?>
            <a href="<?php 
    echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
    ?>
.html" title="<?php 
    echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
    ?>
"><img src="<?php 
    echo ImageHelper::getImage($listImages[0]->image, 2);
    ?>
" alt="<?php 
    echo SiteHelper::getStringForTitle($tour->name . "," . $tour->category_id->name);
    ?>
" /></a>
        <?php 
}
?>
    </div>
    <a href="<?php 
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php 
echo SiteHelper::getStringForTitle($tour->category_id->name . "," . $tour->name);
?>
Пример #3
0
" alt="" /></div><?php 
        }
        ?>
                        <?php 
        if ($banner->image) {
            $i = 2;
        } else {
            $i = 1;
        }
        foreach ($listImages as $LItem) {
            ?>
                            <div class="LII_<?php 
            echo $i;
            ?>
"><img src="<?php 
            echo ImageHelper::getImage($LItem->image, 3);
            ?>
" alt="" /></div>
                            <?php 
            $i++;
        }
        ?>
                    </div>
                <?php 
    }
    ?>
            </td>
            <td>
                <a href="<?php 
    echo SiteHelper::createUrl("/user/firmBanners/description", array("id" => $banner->id, "fid" => $item->id));
    ?>
Пример #4
0
<?php

foreach ($items as $item) {
    ?>
    <div class="listItems">
        <?php 
    if ($item->image) {
        ?>
<div class="IImage"><a title="<?php 
        echo $item->name;
        ?>
" href="<?php 
        echo SiteHelper::createUrl("/news/description") . "/" . $item->slug;
        ?>
.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 
Пример #5
0
<div class="textAlignCenter"><?php 
        echo Yii::t("page", "Список пуст");
        ?>
</div><?php 
    }
    ?>
                <?php 
    foreach ($listGallery as $gall) {
        ?>
                    <div class="LGItem">
                        <div>
                            <a href="<?php 
        echo $gall->image;
        ?>
" data-lightbox="roadtrip"><img src="<?php 
        echo ImageHelper::getImage($gall->image, 3);
        ?>
" /></a>
                        </div>
                        <input type="text" name="ITitle[<?php 
        echo $gall->id;
        ?>
]" value="<?php 
        echo $gall->name;
        ?>
" placeholder="<?php 
        echo Yii::t("page", "описание фото");
        ?>
" /><br/>
                        <a href="<?php 
        echo SiteHelper::createUrl("/user/" . Yii::app()->controller->getId() . "/description", array("id" => $item->id, "gall_id" => $gall->id, "action" => "delGallery"));
Пример #6
0
<div class="IBItem">
    <div class="IBIImage">
        <a href="<?php 
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug . ".html";
?>
" title=""><img src="<?php 
echo ImageHelper::getImage($tour->image, 2);
?>
" alt="" /></a>
    </div>
    <?php 
if ($tour->price > 0) {
    ?>
<p><?php 
    echo $tour->price;
    ?>
</p><?php 
}
?>
    <!--php if( $tour->col>0 ) : ?><div class="floatRight rightInfo">просмотров: <b><= $tour->col ></b></div><php endif; -->
    <br/><a href="<?php 
echo SiteHelper::createUrl("/tours/description") . "/" . $tour->slug;
?>
.html" title="<?php 
echo $tour->name;
?>
"><?php 
echo $tour->name;
?>
</a><br/>
    <div class="LParams">
Пример #7
0
 static function infoForm($form)
 {
     $fields = $form->attributeLabels();
     $relationList = $form->getRelationFields();
     $relations = $form->relations();
     $fieldType = $form->fieldType();
     $requiredFields = $form->getRequiredAttributes();
     $placeholder = $form->attributePlaceholder();
     $cout = "";
     $classTable = get_class($form);
     foreach ($fields as $field => $key) {
         if (!$form->{$field}) {
             continue;
         }
         // Вытаскиваем тип поля
         $fieldTypeValue = !empty($fieldType[$field]) ? $fieldTypeValue = $fieldType[$field] : "";
         if (!in_array($field, $relationList) && (empty($fieldTypeValue) || empty($relations[$fieldTypeValue]))) {
             // Подсказка к полю
             if (!empty($placeholder[$field])) {
                 $fieldPlaceholder = $placeholder[$field];
             } else {
                 $fieldPlaceholder = "";
             }
             if (!empty($fieldType[$field])) {
                 $input = "";
                 switch ($fieldType[$field]) {
                     case "url":
                         $input = '<a href="' . $form->{$field} . '" target="_blank">' . $form->{$field} . '</a>';
                         break;
                     case "email":
                         $input = '<div><a href="#" onclick="$(this.parentNode).load(\'' . SiteHelper::createUrl("site/getInfo", array("catalog" => "CatalogFirms", "id" => $form->id, "field" => "email")) . '\' ); return false;"> [ показать email ]</a></div>';
                         break;
                     case "email_open":
                         $input = $form->{$field};
                         break;
                     case "date":
                         $input = date("Y-m-d", $form->{$field});
                         break;
                     case "checkbox":
                         $input = "+";
                         break;
                     case "visual_textarea":
                         $input = $form->{$field};
                         break;
                     case "image":
                         $input = '<img src="../' . ImageHelper::getImage($form->{$field}, 2, $form) . '" width="100" /><br/>';
                         break;
                     case "file":
                         $input = '<a href="../' . $form->{$field} . '" target="_blank">' . $form->{$field} . '</a><br/>';
                         break;
                     default:
                         $input = $form->{$field};
                 }
             } else {
                 $input = $form->{$field};
             }
         } else {
             $input = "";
             // проверяем нет ли привязки данного поля к сязи один ко многим
             if (!empty($fieldTypeValue) && !empty($relations[$fieldTypeValue])) {
                 $relation = $relations[$fieldTypeValue];
             } else {
                 $relation = $form->getRelationByField($field);
             }
             // привязка один к одному
             $relationItems = CCModelHelper::getRelationItems($relation, $form);
             $fieldName = $field;
             if (sizeof($relationItems) > 0) {
                 if ($relation[0] == CCModel::HAS_MANY || $relation[0] == CCModel::MANY_MANY) {
                     /*
                     $relationModel = RelationParamsClass::CreateParams()
                         ->setLeftId( $form->id )
                         ->setLeftClass( $classTable )
                         ->setRightClass( $relation[1] ) ;
                     
                     $listValues = SiteHelper::getRelation( $relationModel );
                     $input .=    '<div class="relationListItems">
                                         <ul>';
                     
                     foreach( $relationItems as $relationData )
                     {
                         if( !empty( $listValues[ $relationData->id ] ) )$checked = "checked=\"checked\"";
                         else $checked = "";
                     
                         $input .= '<li><input type="checkbox" name="'.$classTable .'['.$relation[1].'][]" '.$checked.' value="'.$relationData->id.'" id="'.$field[1]."_".$relationData->id.'" /><label for="'.$field[1]."_".$relationData->id.'">'.$relationData->name.'</li>';
                     }
                     
                     $input .=   '       </ul>
                                  </div>';
                     */
                 } else {
                     $input = $form->{$fieldName}->name;
                 }
             }
         }
         if (!empty($input)) {
             $cout .= '<tr>
                          <th>' . $fields[$field] . ':</th>
                          <td>' . $input . '</td>
                       </tr>';
         }
     }
     return $cout;
 }
Пример #8
0
    static function getAnimateImageBlock($item, $link, $title = "", $count = 3)
    {
        if (!$item->image) {
            $countImages = $count + 1;
        } else {
            $countImages = $count;
        }
        $count = 0;
        if (defined("YII_SUBDOMAIN") && YII_SUBDOMAIN == "wap-") {
            $countImages = 1;
        }
        $titleValue = !empty($title) ? $title : $item->name;
        $listImages = ImageHelper::getImages($item, $countImages);
        echo '<div class="listItemsImages">';
        if (sizeof($listImages) > 0 || $item->image) {
            ?>
                <?php 
            if ($item->image) {
                ?>
<div class="LII_1"><a href="<?php 
                echo $link;
                ?>
" title="<?php 
                echo $titleValue;
                ?>
"><img src="<?php 
                echo ImageHelper::getImage($item->image, 2);
                ?>
" alt="<?php 
                echo $titleValue;
                ?>
" /></a></div><?php 
            }
            ?>
                <?php 
            if ($item->image) {
                $i = 2;
            } else {
                $i = 1;
            }
            foreach ($listImages as $LItem) {
                if ($i == 1) {
                    $imageSize = 2;
                } else {
                    $imageSize = 3;
                }
                ?>
                        <div class="LII_<?php 
                echo $i;
                ?>
">
                            <?php 
                if ($i == 1) {
                    ?>
<a href="<?php 
                    echo $link;
                    ?>
" title="<?php 
                    echo $titleValue;
                    ?>
"><?php 
                }
                ?>
                            <img src="<?php 
                echo ImageHelper::getImage($LItem->image, $imageSize);
                ?>
" alt="<?php 
                echo $titleValue;
                ?>
" />
                            <?php 
                if ($i == 1) {
                    ?>
</a><?php 
                }
                ?>
                        </div>
                        <?php 
                $i++;
            }
            ?>
        <?php 
        }
        echo '</div>';
    }
Пример #9
0
    ?>
" title="<?php 
    echo $item["name"];
    ?>
"><?php 
    echo $item["name"];
    ?>
</a></div>
                <div class="LTImag2"><a href="<?php 
    echo SiteHelper::createUrl("/tours/description") . "/" . $item["slug"] . ".html";
    ?>
" title="<?php 
    echo $item["name"];
    ?>
"><img src="<?php 
    echo ImageHelper::getImage($item["image2"], 2);
    ?>
" alt="<?php 
    echo $item["name"];
    ?>
" /></a></div>
                <?php 
    if ($item["price"] > 0) {
        ?>
<div class="LTPrice2">от <b><?php 
        echo $item["price"];
        ?>
$</b>&nbsp;</div><?php 
    }
    ?>
            </div>
 public function actionShow($idIn = 0, $locatIn = "", $return = FALSE)
 {
     $id = (int) Yii::app()->request->getParam("id", 0);
     if ($id == 0 && $idIn > 0) {
         $id = $idIn;
     }
     $locat = Yii::app()->request->getParam("location", "");
     if (empty($locat) && !empty($locatIn)) {
         $locat = $locatIn;
     }
     /*
     График:
         По странам ( сортировка по цене ) 31
         По категориям ( сортировка по цене ) 30
         По странам ( сортировка по просмотрам)
         По категориям ( сортировка по просмотрам )
     
        Определям кандидата по очереди сначала города потом категории
            Выбираем по сортировке первую страну
            Проверяем по очередньсти
     
        Формируем письмо
            Заголовок ( зависит от того по стране или категории + от сортировки )
            указываем группу подписциков
            указываем группу рассылоку
     
        И полетели
     */
     $cout = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
         <meta http-equiv="Cache-Control" content="public"/>
         <meta http-equiv="Cache-Control" content="max-age=86400, must-revalidate"/>
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     </head>
     <body>';
     $logTable = SubscribeTable::fetch($id);
     if ($logTable->id > 0) {
         if ($locat == "uzb" && $logTable->country_id->id == 1) {
             return "";
         }
         $countryId = 0;
         $categoryId = 0;
         if ($logTable->country_id->id > 0) {
             $countryId = $logTable->country_id->id;
             $countryModel = CatalogCountry::fetch($countryId);
         }
         if ($logTable->category_id->id > 0) {
             $categoryId = $logTable->category_id->id;
             $categoryModel = CatalogToursCategory::fetch($categoryId);
         }
         if ($countryId > 0 || $categoryId > 0) {
             $info = [];
             if ($countryId > 0) {
                 $toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND price>0 AND active=1")->setParams([":cid" => $countryModel->id])->setOrderBy("price")->setLimit(1)->setCache(0));
                 $tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid AND id !=:id AND active=1")->setParams([":cid" => $countryModel->id, ":id" => $toursMinPrice[0]->id])->setLimit(7)->setOrderBy("rating DESC, price"));
                 $tours[] = $toursMinPrice[0];
                 $info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $countryModel->id])->setLimit(4)->setOrderBy("id DESC"));
                 $subject = $countryModel->title . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
             } else {
                 $params = [":cid" => $categoryModel->id];
                 $condition = "category_id=:cid";
                 if ($locat == "uzb") {
                     echo $locat . "==uzb<br/>";
                     $params = array_merge($params, [":country" => 1]);
                     $condition .= " AND country_id!=:country";
                 } else {
                     $params = array_merge($params, [":country" => 1]);
                     $condition .= " AND country_id=:country";
                 }
                 echo $condition . "*";
                 $toursMinPrice = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition)->setParams($params)->setOrderBy("price")->setLimit(1)->setCache(0));
                 $tours = CatalogTours::fetchAll(DBQueryParamsClass::CreateParams()->setConditions($condition . " AND id !=:id")->setParams(array_merge($params, [":id" => $toursMinPrice[0]->id]))->setLimit(7)->setOrderBy("rating DESC, price"));
                 $tours[] = $toursMinPrice[0];
                 //$info = CatalogInfo::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("country_id=:cid")->setParams([":cid" => $categoryModel->id])->setLimit(4)->setOrderBy("id DESC"));
                 if ($tours[sizeof($tours) - 1]->price > 0) {
                     $subject = "Тур - " . $categoryModel->name . ", от " . $tours[sizeof($tours) - 1]->price . ($tours[sizeof($tours) - 1]->currency_id->id ? $tours[sizeof($tours) - 1]->currency_id->title : "\$");
                 } else {
                     $subject = "Тур - " . $categoryModel->name;
                 }
             }
             $message = "Предлагаем Вашему вниманию интересную подборку с нашего портала <a href=\"http://www.world-travel.uz\">World-Travel.uz</a>.<br/><br/><h1>" . $subject . "</h1><br/><table>";
             $n = 0;
             $reserveNum = 0;
             $reserveList = [];
             foreach ($tours as $tour) {
                 if ($tour->id == 0) {
                     continue;
                 }
                 $image = ImageHelper::getImages($tour, 1);
                 // Если картинки для тура нету, то берем её из резерва catalog_image_reserve
                 if (sizeof($image) == 0) {
                     if (sizeof($reserveList) == 0) {
                         $reserveList = CatalogImageReserve::findByAttributes(["country_id" => $tour->country_id->id]);
                     }
                     if (sizeof($reserveList) > 0) {
                         $new = new CatGallery();
                         if (!empty($reserveList[$reserveNum])) {
                             $new->image = $reserveList[$reserveNum]->image;
                         } else {
                             if ($tour->country_id->banner) {
                                 $new->image = $tour->country_id->banner;
                             } else {
                                 $new->image = $tour->country_id->image;
                             }
                         }
                         $image[] = $new;
                         $reserveNum++;
                     }
                 }
                 if ($n == 0 || $n == 2 || $n == 4 || $n == 6) {
                     $message .= "<tr>";
                 }
                 $message .= "<td style=\"width:50%;text-align:center;vertical-align: top;background-color: #EEE9DD;padding: 10px;border: 1px solid #fff;\">\n                            <table width=\"100%\">\n                                <tr>\n                                    <td style=\"background:#E4DDCD;font-size:13px;text-align: right;padding-right: 5px;vertical-align: middle;\"><b>" . $tour->name . "</b></td>";
                 if ($tour->price > 0) {
                     $message .= "<td style=\"background:#E4DDCD;vertical-align: top;line-height: 14px;text-align: center;\"><span style=\"font-size:10px;\">от</span><br/><b style=\"color:#ff4f00;font-size:24px;\"> " . $tour->price . ($tour->currency_id->id ? $tour->currency_id->title : "\$") . "</b><br/></td>";
                 }
                 $message .= "</tr>\n                            </table>";
                 if (sizeof($image) > 0) {
                     $message .= "<div style=\"max-height: 134px;overflow: hidden;\"><img src=\"" . (SiteHelper::createUrl("/") . ImageHelper::getImage($image[0]->image, 2)) . "\" style=\"max-width:200px\"/></div>";
                 }
                 //if( $tour->included )$message .= "<td>Включенно: ".$tour->included."</td></tr>";
                 if ($tour->duration) {
                     $message .= $tour->duration . "<br/>";
                 }
                 if ($tour->category_id->id > 0) {
                     $message .= "Тур - " . $tour->category_id->name2 . "<br/>";
                 }
                 $message .= "<div><a style=\"margin-top: 11px;background:#ff4f00;color:#fff;font-weight: bold;display: inline-block;padding: 5px 10px;border-radius: 4px;\" href=\"" . SiteHelper::createUrl("/tours/description") . "/" . $tour->slug . ".html\">Заказать</a></div></td>";
                 //
                 if ($n == 1 || $n == 3 || $n == 5 || $n == 7) {
                     $message .= "</tr>";
                 }
                 $n++;
             }
             $message .= '</table></div><br/>';
             if (sizeof($info) > 0) {
                 $message .= '<div style="background: #e4ddcd;padding: 0px 10px 10px 10px;overflow: hidden;"><table>';
                 foreach ($info as $item) {
                     $message .= "<tr><td colspan=\"2\"><h3 style=\"margin:10px 0px 5px 0px;\">" . $item->name . "</h3></td></tr>\n                                     <tr>\n                                        <td colspan=\"2\" style=\"border-bottom:1px solid #F4F1EA;padding-bottom:10px;\">\n                                            <table width=\"100%\">\n                                                <tr>\n                                                    <td><img src=\"" . SiteHelper::createUrl("/") . ImageHelper::getImage($item->image, 2) . "\" style=\"padding-right: 10px;\" alt=\"" . $item->name . "\" /></td>\n                                                    <td style=\"text-align: justify;vertical-align:top\">" . SiteHelper::getSubTextOnWorld($item->description, 350) . "<br/><div align=\"right\"><a href=\"" . SiteHelper::createUrl("/touristInfo/description") . $item->slug . ".html\">читайте подробнее >>></a></div></td>\n                                                </tr>\n                                            </table>\n                                        </td>\n                                     </tr>";
                     //
                 }
                 $message .= "</table></div>";
             }
             $cout .= $message . "</body></html>";
             //if( SubscribesUzHelper::sendEmails( array( 7, 35, 41 ), $subject, $message, 3 ) )echo "Ура отправил";
             //                                                                        else echo "Что-то пошло не так";
         }
     }
     if ($return) {
         return $cout;
     } else {
         echo $cout;
     }
 }
Пример #11
0
        echo sizeof($info) > 0 ? "col-lg-6 col-md-6 col-sm-12 col-xs-12" : "col-xs-12";
        ?>
" id="CGI01">
            <h3>Галлерея</h3>
            <div>
                <?php 
        foreach ($gallery as $gal) {
            ?>
                    <div class="CGItem"><a href="<?php 
            echo $gal->image;
            ?>
" data-toggle="lightbox" data-gallery="multiimages" title="<?php 
            echo $item->title;
            ?>
"><img src="<?php 
            echo ImageHelper::getImage($gal->image, 2);
            ?>
" alt="<?php 
            echo $item->title;
            ?>
" /></a></div>
                <?php 
        }
        ?>
                <script type="text/javascript">
                    $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
                        event.preventDefault();
                        $(this).ekkoLightbox();
                    });
                </script>
            </div>