ADD hotels - hotellook

This commit is contained in:
Krivchikov Dmitry 2016-04-16 14:08:50 +03:00
parent fdb0a0bdb5
commit c1314e8504
1 changed files with 162 additions and 154 deletions

View File

@ -52,7 +52,7 @@ $index = 0;
<?php endif; ?> <?php endif; ?>
<?php if ($photos): ?> <?php if ($photos): ?>
<?php foreach ($photos as $photo): ?> <?php foreach ($photos as $photo): ?>
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>" data-full="/photos/big/<?= $photo->name ?>" data-caption="<?= $photo->getOriginalLink()?>" alt="<?= $point->name ?> на wikipoints.ru"> <img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>" data-full="/photos/big/<?= $photo->name ?>" data-caption="<?= $photo->getOriginalLink() ?>" alt="<?= $point->name ?> на wikipoints.ru">
<?php endforeach; ?> <?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<span data-thumb="/img/mapThumb.png"> <span data-thumb="/img/mapThumb.png">
@ -73,7 +73,7 @@ $index = 0;
} }
?> ?>
<?php if($extraParams): ?> <?php if ($extraParams): ?>
<div style="width: 100%; text-align: center;"> <div style="width: 100%; text-align: center;">
<table class="table table-bordered table-hover" style="background-color: #fff; display: inline-table; width: 100%; max-width: 700px; text-align: left;"> <table class="table table-bordered table-hover" style="background-color: #fff; display: inline-table; width: 100%; max-width: 700px; text-align: left;">
<thead> <thead>
@ -81,16 +81,17 @@ $index = 0;
<th colspan="2">Дополнительная информация:</th> <th colspan="2">Дополнительная информация:</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($extraParams as $extraParam) { <?php
foreach ($extraParams as $extraParam) {
print '<tr>'; print '<tr>';
print '<td>'.$extraParam->name.'</td>'; print '<td>' . $extraParam->name . '</td>';
if(false && $point->isPaid()) { if (false && $point->isPaid()) {
print '<td>'; print '<td>';
print '<span id="extraHolder'.$extraParam->id.'" class="extraHolder" onclick="showExtraParam('.$extraParam->id.')" style="display: block;">'.mb_substr($extraParam->value, 0, 5, 'UTF-8').'… <span class="glyphicon glyphicon-chevron-right"></span></span>'; print '<span id="extraHolder' . $extraParam->id . '" class="extraHolder" onclick="showExtraParam(' . $extraParam->id . ')" style="display: block;">' . mb_substr($extraParam->value, 0, 5, 'UTF-8') . '… <span class="glyphicon glyphicon-chevron-right"></span></span>';
print '<span style="display: none;" id="extraData'.$extraParam->id.'" class="extraData">'.Helper::replaceUrls($extraParam->value).'</span>'; print '<span style="display: none;" id="extraData' . $extraParam->id . '" class="extraData">' . Helper::replaceUrls($extraParam->value) . '</span>';
print '</td>'; print '</td>';
} else { } else {
print '<td>'.Helper::replaceUrls($extraParam->value).'</td>'; print '<td>' . Helper::replaceUrls($extraParam->value) . '</td>';
} }
print '</tr>'; print '</tr>';
} }
@ -102,25 +103,25 @@ $index = 0;
<?php if ($photoLinks): ?> <?php if ($photoLinks): ?>
Использованы фотоматериалы с сайтов: <?= $photoLinks ?> Использованы фотоматериалы с сайтов: <?= $photoLinks ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<p style="margin-top: 5px; text-align: right;"> <p style="margin-top: 5px; text-align: right;">
<?php if (App::$user && App::$user->id): ?> <?php if (App::$user && App::$user->id): ?>
<nobr>[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveFavorite(<?= $point->id ?>)"><span id="myFavoritesButton" class="glyphicon glyphicon-star<?= $point->inFavorites ? '' : '-empty' ?>"></span> Хочу посетить</button> ]</nobr> <nobr>[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveFavorite(<?= $point->id ?>)"><span id="myFavoritesButton" class="glyphicon glyphicon-star<?= $point->inFavorites ? '' : '-empty' ?>"></span> Хочу посетить</button> ]</nobr>
<nobr>[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveLike(<?= $point->id ?>)"><span id="myLikesButton" class="glyphicon glyphicon-<?= $point->iLike ? 'ok' : 'thumbs-up' ?>"></span> Нравится</button> ]</nobr> <nobr>[ <button type="button" class="btn btn-link" style="color: #333;" onclick="addRemoveLike(<?= $point->id ?>)"><span id="myLikesButton" class="glyphicon glyphicon-<?= $point->iLike ? 'ok' : 'thumbs-up' ?>"></span> Нравится</button> ]</nobr>
<?php else: ?> <?php else: ?>
<nobr>[ <span class="glyphicon glyphicon-star"></span> <?= $countInFavs ?> - в закладках ]</nobr> <nobr>[ <span class="glyphicon glyphicon-star"></span> <?= $countInFavs ?> - в закладках ]</nobr>
<nobr>[ <span class="glyphicon glyphicon-thumbs-up"></span> <?= $countLikes ?> - нравится ]</nobr> <nobr>[ <span class="glyphicon glyphicon-thumbs-up"></span> <?= $countLikes ?> - нравится ]</nobr>
<?php endif; ?> <?php endif; ?>
<nobr>[ <span class="glyphicon glyphicon-user"></span> <a href="/user/<?= $point->authorUser->id ?>"><?= $point->authorUser->nick ?></a> - <span class="glyphicon glyphicon-pencil" title="<?= date('d-m-Y H:i', $point->date) ?>"></span> <?= $point->authorUser->getPointsCount() ?> ]</nobr> <nobr>[ <span class="glyphicon glyphicon-user"></span> <a href="/user/<?= $point->authorUser->id ?>"><?= $point->authorUser->nick ?></a> - <span class="glyphicon glyphicon-pencil" title="<?= date('d-m-Y H:i', $point->date) ?>"></span> <?= $point->authorUser->getPointsCount() ?> ]</nobr>
<?php if (App::$user && App::$user->isAdmin == 1): ?> <?php if (App::$user && App::$user->isAdmin == 1): ?>
<nobr>[ <span class="glyphicon glyphicon-new-window"></span> <a href="<?= $point->source ?>" target="_blank">источник: <?= $point->source ?></a> ]</nobr> <nobr>[ <span class="glyphicon glyphicon-new-window"></span> <a href="<?= $point->source ?>" target="_blank">источник: <?= $point->source ?></a> ]</nobr>
<?php endif; ?> <?php endif; ?>
</p> </p>
</div> </div>
</div> </div>
<br/> <br/>
<?php if ($pointsAirport && $usersAirport && $pointsAirport->id != $usersAirport->id): ?> <?php if ($pointsAirport && $usersAirport && $pointsAirport->id != $usersAirport->id): ?>
<div class="row"> <div class="row">
<div class="col-md-12 text-center"> <div class="col-md-12 text-center">
<script charset="utf-8" type="text/javascript"> <script charset="utf-8" type="text/javascript">
@ -128,12 +129,12 @@ $index = 0;
window.TP_FORM_SETTINGS["394e02eacac3a5c9b000360787c2d5d2"] = { window.TP_FORM_SETTINGS["394e02eacac3a5c9b000360787c2d5d2"] = {
"handle": "394e02eacac3a5c9b000360787c2d5d2", "handle": "394e02eacac3a5c9b000360787c2d5d2",
"widget_name": "Поисковая форма — точка", "widget_name": "Поисковая форма — точка",
"border_radius": "2", "border_radius": "3",
"additional_marker": null, "additional_marker": null,
"width": null, "width": null,
"show_logo": true, "show_logo": true,
"show_hotels": false, "show_hotels": false,
"form_type": "avia", "form_type": "avia_hotel",
"locale": "ru", "locale": "ru",
"currency": "rub", "currency": "rub",
"sizes": "default", "sizes": "default",
@ -141,15 +142,22 @@ $index = 0;
"active_tab": "avia", "active_tab": "avia",
"search_host": "hydra.aviasales.ru", "search_host": "hydra.aviasales.ru",
"hotels_host": "hotellook.ru/search", "hotels_host": "hotellook.ru/search",
"hotel": "", "hotel": {
"hotel_alt": "", "name": "<?= $pointsAirport->cityRu?>",
"avia_alt": "", "location": "<?= $pointsAirport->countryRu?>",
"hotels_count": "89",
"search_id": "12104",
"search_type": "city",
"country_name": "Россия"
},
"hotel_alt": "Hotellook — Поиск дешёвых отелей!",
"avia_alt": "Aviasales — Поиск дешёвых авиабилетов!",
"retargeting": true, "retargeting": true,
"trip_class": "economy", "trip_class": "economy",
"depart_date": null, "depart_date": "<?= date('Y-m-d', strtotime('+7 days')) ?>",
"return_date": null, "return_date": null,
"check_in_date": null, "check_in_date": "<?= date('Y-m-d', strtotime('+7 days')) ?>",
"check_out_date": null, "check_out_date": "<?= date('Y-m-d', strtotime('+10 days')) ?>",
"id": 70240, "id": 70240,
"marker": 52337, "marker": 52337,
"origin": { "origin": {
@ -157,7 +165,7 @@ $index = 0;
"iata": "<?= $usersAirport->iata?>" "iata": "<?= $usersAirport->iata?>"
}, },
"destination": { "destination": {
"name": "<?= '';//$pointsAirport->cityRu?>", "name": "<?= $pointsAirport->cityRu?>",
"iata": "<?= $pointsAirport->iata?>" "iata": "<?= $pointsAirport->iata?>"
}, },
"color_scheme": { "color_scheme": {
@ -182,12 +190,12 @@ $index = 0;
{ {
"one_way": true, "one_way": true,
"origin": { "origin": {
"name": "<?= $usersAirport->cityRu?>", "name": "<?= $usersAirport->cityRu ?>",
"iata": "<?= $usersAirport->iata?>" "iata": "<?= $usersAirport->iata ?>"
}, },
"destination": { "destination": {
"name": "<?= $pointsAirport->cityRu?>", "name": "<?= $pointsAirport->cityRu ?>",
"iata": "<?= $pointsAirport->iata?>" "iata": "<?= $pointsAirport->iata ?>"
} }
} }
] ]
@ -197,13 +205,13 @@ $index = 0;
"hotel_marker_format": "marker=", "hotel_marker_format": "marker=",
"hotelscombined_marker": null, "hotelscombined_marker": null,
"responsive": true, "responsive": true,
"height": 194 "height": 245
}; };
</script> </script>
<script charset="utf-8" src="//www.travelpayouts.com/widgets/394e02eacac3a5c9b000360787c2d5d2.js?v=727" async></script> <script charset="utf-8" src="//www.travelpayouts.com/widgets/394e02eacac3a5c9b000360787c2d5d2.js?v=727" async></script>
</div> </div>
</div> </div>
<?php else: ?> <?php else: ?>
<div class="row"> <div class="row">
<div class="col-md-12" style="text-align: center;"> <div class="col-md-12" style="text-align: center;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
@ -218,11 +226,11 @@ $index = 0;
</script> </script>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<?= self::renderPartial('comments/all.php',array('parentId'=>$point->id, 'parentType' => 'point'),TRUE); ?> <?= self::renderPartial('comments/all.php', array('parentId' => $point->id, 'parentType' => 'point'), TRUE); ?>
</div> </div>
</div> </div>
<hr/> <hr/>
@ -230,7 +238,7 @@ $index = 0;
<!--googleoff: all--> <!--googleoff: all-->
<!--noindex--> <!--noindex-->
<?php if ($articles): ?> <?php if ($articles): ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3 style="margin-top: 0;">Эта точка в статьях:</h3> <h3 style="margin-top: 0;">Эта точка в статьях:</h3>
@ -242,7 +250,7 @@ $index = 0;
<hr/> <hr/>
<?php endif; ?> <?php endif; ?>
<?php if (!empty($closestPoints)): ?> <?php if (!empty($closestPoints)): ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3 style="margin-top: 0;">Поблизости расположены:</h3> <h3 style="margin-top: 0;">Поблизости расположены:</h3>
@ -252,7 +260,7 @@ $index = 0;
<hr/> <hr/>
<?php endif; ?> <?php endif; ?>
<?php if (!$articles): ?> <?php if (!$articles): ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3 style="margin-top: 0;">Похожие точки:</h3> <h3 style="margin-top: 0;">Похожие точки:</h3>
@ -260,13 +268,13 @@ $index = 0;
</div> </div>
</div> </div>
<hr/> <hr/>
<?php endif; ?> <?php endif; ?>
<!--/noindex--> <!--/noindex-->
<!--googleon: all--> <!--googleon: all-->
<?= self::renderPartial('randomPoint.php', array('randomPoint'=>$randomPoint), true)?> <?= self::renderPartial('randomPoint.php', array('randomPoint' => $randomPoint), true) ?>
</div> </div>
<script> <script>
function showExtraParam(id){ function showExtraParam(id) {
// $('#extraHolder'+id).hide(); // $('#extraHolder'+id).hide();
// $('#extraData'+id).show(); // $('#extraData'+id).show();
$('.extraHolder').hide(); $('.extraHolder').hide();