Initial commit: apps.supersam24.ru

This commit is contained in:
root committed 2026-10-22 00:04:27 +03:00
commit 72afea602d
2747 files changed
+682150

No files matched your search

+208
View File
@@ -0,0 +1,208 @@
<div id="result"></div>
<div id="map"></div>
<a tabindex="-1" href="/services" title="{{::config.primarySiteTitle}}" target="_blank" class="delivery-logo-row">
<img class="apps-logo" src="/img/logo-<?=$jsConfig['siteDomain'];?>.png" alt="{{::config.primarySiteTitle}}">
</a>
<script type="text/javascript">
function resultsClose() {
$('#result').removeClass('active');
}
function init() {
var myMap = new ymaps.Map('map', {
center: [<?=$delivery['location'];?>],
zoom: 17,
type: 'yandex#map',
controls: []
}),
searchFinishPoint = new ymaps.control.SearchControl({
options: {
useMapBounds: true,
noCentering: true,
noPopup: true,
noPlacemark: true,
placeholderContent: 'Адрес доставки',
size: 'large',
float: 'none',
position: { left: 10, top: 44 }
}
}),
calculator = new DeliveryCalculator(myMap, myMap.getCenter()) ;
searchFinishPoint.events.add('load', function (event) { $('#result').removeClass('active'); });
searchFinishPoint.events.add('clear', function (event) { $('#result').removeClass('active'); });
searchFinishPoint.events.add('submit', function (event) { $('#result').removeClass('active'); });
myMap.controls.add(searchFinishPoint);
calculator.setStartPoint([<?=$delivery['location'];?>]);
searchFinishPoint.events.add('resultselect', function (e) {
var results = searchFinishPoint.getResultsArray(),
selected = e.get('index'),
point = results[selected].geometry.getCoordinates();
calculator.setFinishPoint(point);
})
.add('load', function (event) {
if (!event.get('skip') && searchFinishPoint.getResultsCount()) {
searchFinishPoint.showResult(0);
}
});
}
function DeliveryCalculator(map, finish) {
this._map = map;
this._start = null;
this._route = null;
this._startBalloon;
this._finishBalloon;
map.events.add('click', this._onClick, this);
}
var ptp = DeliveryCalculator.prototype;
ptp._onClick= function (e) {
if (this._start) {
this.setFinishPoint(e.get('coords'));
} else {
this.setStartPoint(e.get('coords'));
}
};
ptp._onStartDragEnd = function (e) {
var coords = this._start.geometry.getCoordinates();
this.geocode("start", coords);
};
ptp._onFinishDragEnd = function (e) {
var coords = this._finish.geometry.getCoordinates();
this.geocode("finish", coords);
};
ptp.getDirection = function () {
if(this._route) {
this._map.geoObjects.remove(this._route);
}
if (this._start && this._finish) {
var self = this,
start = this._start.geometry.getCoordinates(),
finish = this._finish.geometry.getCoordinates(),
startBalloon = this._startBalloon,
finishBalloon = this._finishBalloon;
ymaps.route([
finish,
start,
], {multiRoute: true})
.then(function (router) {
//self._map.geoObjects.add(router);
var routes = router.getRoutes(), distanceWithTolls = 0, distanceWithoutTolls = 0, distance = 0,
selectedRoute, selectedRouteWithTolls, selectedRouteWithoutTolls;
for (var i = 0, l = routes.getLength(); i < l; i++) {
var route = routes.get(i);
if (!route.properties.get('blocked')) {
distance = Math.ceil(route.properties.get('distance').value / 1000)
if (route.properties.get('hasTolls')) {
if ((distanceWithTolls == 0) || (distance < distanceWithTolls)) {
selectedRouteWithTolls = route;
distanceWithTolls = distance;
}
} else {
if ((distanceWithoutTolls == 0) || (distance < distanceWithoutTolls)) {
selectedRouteWithoutTolls = route;
distanceWithoutTolls = distance;
}
}
}
}
if (distanceWithoutTolls > 0) { //route without tolls exists
selectedRoute = selectedRouteWithoutTolls;
distance = distanceWithoutTolls;
} else {
selectedRoute = selectedRouteWithTolls;
distance = distanceWithTolls;
}
router.setActiveRoute(selectedRoute);
var /*distance = Math.round(router.getLength() / 1000),*/
distanceLabel = "",
message = '<div class="resultInner"><span>Расстояние: ' + (distance < 1 ? 1 : distance) + 'км.</span><br/>' +
'<span style="font-weight: bold; font-style: italic; ">Стоимость доставки: %sр.</span><span id="resultsClose" onClick="javascript:resultsClose();">&times;</span><div>'
distanceLabel = self.calculate(distance);
self._route = selectedRoute.getPaths();
self._route.options.set({ strokeWidth: 5, strokeColor: '0000ffff', opacity: 0.5 });
self._map.geoObjects.add(self._route);
self._start.properties.set('balloonContentBody', startBalloon + message.replace('%s', distanceLabel));
self._finish.properties.set('balloonContentBody', finishBalloon + message.replace('%s', distanceLabel));
$('#result').html(finishBalloon + message.replace('%s', distanceLabel)).addClass('active');
});
self._map.setBounds(self._map.geoObjects.getBounds())
}
};
ptp.setStartPoint = function (position) {
if(this._start) {
this._start.geometry.setCoordinates(position);
}
else {
this._start = new ymaps.Placemark(position, { iconContent: 'А', }, { draggable: false });
this._start.events.add('dragend', this._onStartDragEnd, this);
this._map.geoObjects.add(this._start);
}
this.geocode("start", position);
};
ptp.setFinishPoint = function (position) {
if(this._finish) {
this._finish.geometry.setCoordinates(position);
}
else {
this._finish = new ymaps.Placemark(position, { iconContent: 'Б' }, { draggable: true });
this._finish.events.add('dragend', this._onFinishDragEnd, this);
this._map.geoObjects.add(this._finish);
}
if (this._start) {
this.geocode("finish", position);
}
};
ptp.geocode = function (str, point) {
ymaps.geocode(point).then(function(geocode) {
if (str == "start") {
this._startBalloon = "<h3><?=$delivery['address'];?></h3><p>" + geocode.geoObjects.get(0).properties.get('description') + "</p>";
this._start.properties.set('balloonContentBody', this._startBalloon);
} else {
this._finishBalloon = geocode.geoObjects.get(0) &&
geocode.geoObjects.get(0).properties.get('balloonContentBody') || '';
}
this.getDirection();
}, this);
}
ptp.calculate = function (len) {
// Константы.
var DELIVERY_TARIF = <?=$delivery['costPerKm'];?>,
MINIMUM_COST = <?=$delivery['minimalCost'];?>;
if (len == 1) return (MINIMUM_COST);
return Math.max((len - 1) * DELIVERY_TARIF + MINIMUM_COST, MINIMUM_COST);
};
ymaps.ready(init);
</script>
<?php $this->Assign('title', $siteTitle);?>
+10
View File
@@ -0,0 +1,10 @@
<?php
$class = 'message';
if (!empty($params['class'])) {
$class .= ' ' . $params['class'];
}
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="<?= h($class) ?>" onclick="this.classList.add('hidden');"><?= $message ?></div>
+4
View File
@@ -0,0 +1,4 @@
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<p><?= $message ?></p>
</div>
+6
View File
@@ -0,0 +1,6 @@
<?php
if (!isset($params['escape']) || $params['escape'] !== false) {
$message = h($message);
}
?>
<div class="message success" onclick="this.classList.add('hidden')"><?= $message ?></div>
+7
View File
@@ -0,0 +1,7 @@
<?php use Cake\Core\Configure;?>
<script type="text/javascript">
supersamApp.factory('config', function() {
return <?php echo json_encode(isset($jsConfig) ? $jsConfig : []); ?>;
});
</script>
+38
View File
@@ -0,0 +1,38 @@
<script type="text/javascript">
function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
else return null;
}
function setCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
(function($, document) {
$(document).ready(function () {
var cookieConsent = getCookie("cookie_consent");
if (cookieConsent == null) {
$("<div class=\"cookie-consent-container-wrap\"><div class=\"cookie-consent-container\"></div>"+
"<div class=\"cookie-consent-content\">"+
"<div><span>Мы используем файлы cookie, чтобы обеспечить максимальное удобство пользователям. Продолжая использовать этот сайт, вы даете согласие на использование файлов cookies.</span> <a href=\"https://supersamsev.ru/cookie-policy\" class=\"cookie-consent-more\" target=\"_blank\">Подробнее</a></div>"+
"<a class=\"cookie-consent-ok\">Согласен</a>"+
"</div>"+
"</div>").appendTo('body');
$(".cookie-consent-ok").on('click', function () {
setCookie('cookie_consent', true, 1095);
$(".cookie-consent-container-wrap").css({'opacity': '0', 'visibility': 'hidden'});
});
}
})
})(jQuery, document);
</script>
+8
View File
@@ -0,0 +1,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon_32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon_16.png">
<link rel="shortcut icon" type="image/png" href="/img/favicon/favicon_16.png" />
<?php foreach(['57', '60', '76', '114', '120', '128', '144', '152', '167', '180', '192'] as $s) {
echo '<link rel="apple-touch-icon-precomposed" sizes="' . $s . 'x' . $s . '" href="/img/favicon/apple-touch-icon-' . $s . '-precomposed.png" />' . "\n";
} ?>
<link rel="apple-touch-icon-precomposed" href="/img/favicon/apple-touch-icon-57-precomposed.png" />
+2
View File
@@ -0,0 +1,2 @@
<?php
echo json_encode($result);
+15
View File
@@ -0,0 +1,15 @@
<div class="page-404">
<div class="container">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12 text-center">
<a href="<?=$jsConfig['primarySiteUrl'];?>" title="<?=$jsConfig['primarySiteTitle'];?>"><img class="apps-logo" src="/img/logo-<?=$jsConfig['siteDomain'];?>.png"></a><br/><br/>
<?= $this->element("services");?>
</div>
</div>
</div>
</div>
</div>
</div>
+34
View File
@@ -0,0 +1,34 @@
<div>
<a href="https://supersam24.ru" class="services-link btn btn-primary">Магазин фурнитуры</a>
<a href="https://supersamsev.ru" class="services-link btn btn-primary">Магазин ДСП</a>
<a href="https://prometeysev.ru" class="services-link btn btn-primary">Все для кухни, ремонта и дома</a>
<div class="services-social-links">
<a class="vk" href="https://vk.com/supersam_aristo" target="_blank">
<img src="/img/social/vk-h.png">
</a>
</div>
<br/><br/></div>
<b>Также вы можете воспользоваться нашими сервисами:</b><br/>
<div>
<?php
foreach ($jsConfig["appsList"] as $app) {
if (!empty($app['url'])) {
echo '<a href="' . $app['url'] . '" class="services-link btn btn-info">' . (!empty($app['site_label']) ? $app['site_label'] : $app['label_long']) . '</a>';
}
}
?>
</div>
<br/>
<div>
<?php
foreach ($jsConfig["delivery"] as $delivery) {
if (empty($delivery['is_deleted'])) {
echo '<a href="/delivery/' . $delivery['slug'] . '" class="services-link btn btn-info">' . $delivery['label404'] . '</a>';
}
}
?>
</div>
+20
View File
@@ -0,0 +1,20 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
$content = explode("\n", $content);
foreach ($content as $line) :
echo '<p> ' . $line . "</p>\n";
endforeach;
+16
View File
@@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
echo $content;
+34
View File
@@ -0,0 +1,34 @@
<?php
use Cake\Core\Configure;
use Cake\Error\Debugger;
$this->layout = 'error';
if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->assign('title', $message);
$this->assign('templateName', 'error400.ctp');
$this->start('file');
?>
<?php if (!empty($error->queryString)) : ?>
<p class="notice">
<strong>SQL Query: </strong>
<?= h($error->queryString) ?>
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?= $this->element('auto_table_warning') ?>
<?php
if (extension_loaded('xdebug')) :
xdebug_print_function_stack();
endif;
$this->end();
endif;
?>
<?= $this->element("page404");?>
+39
View File
@@ -0,0 +1,39 @@
<?php
use Cake\Core\Configure;
use Cake\Error\Debugger;
$this->layout = 'error';
if (Configure::read('debug')) :
$this->layout = 'dev_error';
$this->assign('title', $message);
$this->assign('templateName', 'error500.ctp');
$this->start('file');
?>
<?php if (!empty($error->queryString)) : ?>
<p class="notice">
<strong>SQL Query: </strong>
<?= h($error->queryString) ?>
</p>
<?php endif; ?>
<?php if (!empty($error->params)) : ?>
<strong>SQL Query Params: </strong>
<?php Debugger::dump($error->params) ?>
<?php endif; ?>
<?php if ($error instanceof Error) : ?>
<strong>Error in: </strong>
<?= sprintf('%s, line %s', str_replace(ROOT, 'ROOT', $error->getFile()), $error->getLine()) ?>
<?php endif; ?>
<?php
echo $this->element('auto_table_warning');
if (extension_loaded('xdebug')) :
xdebug_print_function_stack();
endif;
$this->end();
endif;
?>
<?= $this->element("page404");?>
@@ -0,0 +1,24 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title><?= $this->fetch('title') ?></title>
</head>
<body>
<?= $this->fetch('content') ?>
</body>
</html>
@@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
echo $this->fetch('content');
+16
View File
@@ -0,0 +1,16 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
* @link https://cakephp.org CakePHP(tm) Project
* @since 0.10.0
* @license https://opensource.org/licenses/mit-license.php MIT License
*/
echo $this->fetch('content');
+55
View File
@@ -0,0 +1,55 @@
<?php use Cake\Core\Configure; ?>
<!DOCTYPE html>
<html>
<head>
<?= $this->Html->charset() ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><?= $this->fetch('title');?></title>
<?php echo $this->element("favicon"); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php if (empty($isRejectedBrowser)) {
$release = "?v".Configure::read('Release');
$cssList = [
"delivery.css",
];
foreach ($cssList as $key => $css) {
$cssList[$key] = $css.$release;
}
echo $this->Html->css($cssList);
} else {
echo $this->Html->css('jquery.reject');
} ?>
<?= $this->fetch('meta'); ?>
<?= $this->fetch('css'); ?>
<?= $this->fetch('script'); ?>
<base href="/">
</head>
<body>
<?php if (empty($isRejectedBrowser)) {
$scripts = [
"jquery.min.js",
];
foreach ($scripts as $key => $script) {
$scripts[$key] = $script.$release;
}
$scripts[] = "https://api-maps.yandex.ru/2.1/?apikey=".$apiKey."&lang=ru_RU";
echo $this->Html->script($scripts);
echo $this->fetch('content');
echo $this->element('cookie_consent');
} else {
echo $this->Html->script("jquery-1.min.js");
echo $this->Html->script("jquery.reject.js");
echo $this->Html->script("jquery.reject-config.js");
} ?>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
<?php use Cake\Core\Configure; ?>
<!DOCTYPE html>
<html>
<head>
<?= $this->Html->charset() ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>СуперСам :: 404</title>
<?php echo $this->element("favicon"); ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php if (empty($isRejectedBrowser)) {
$release = "?v".Configure::read('Release');
$cssList = [
"bootstrap.min.css",
"styles.css",
];
foreach ($cssList as $key => $css) {
$cssList[$key] = $css.$release;
}
echo $this->Html->css($cssList);
} else {
echo $this->Html->css('jquery.reject');
} ?>
<?= $this->fetch('meta'); ?>
<?= $this->fetch('css'); ?>
<?= $this->fetch('script'); ?>
<base href="/">
</head>
<body>
<?php if (empty($isRejectedBrowser)) {
$scripts = [
"jquery.min.js",
];
foreach ($scripts as $key => $script) {
$scripts[$key] = $script.$release;
}
echo $this->Html->script($scripts);
echo $this->fetch('content');
echo $this->element('cookie_consent');
} else {
echo $this->Html->script("jquery-1.min.js");
echo $this->Html->script("jquery.reject.js");
echo $this->Html->script("jquery.reject-config.js");
} ?>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
<?php
if (!isset($channel)) :
$channel = [];
endif;
if (!isset($channel['title'])) :
$channel['title'] = $this->fetch('title');
endif;
echo $this->Rss->document(
$this->Rss->channel([], $channel, $this->fetch('content'))
);
+18
View File
@@ -0,0 +1,18 @@
<div class="services">
<div class="container">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-12 text-center">
<a href="<?=$jsConfig['primarySiteUrl'];?>" title="<?=$jsConfig['primarySiteTitle'];?>"><img src="/img/logo.png"></a><br/><br/>
<?= $this->element("services");?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $this->Assign('title', $siteTitle);?>