Commit c8fd5491 by Яков

two

parent 48680c56
discount_phone:
class: sfDoctrineRouteCollection
options:
model: DiscountPhone
module: discount_phone
prefix_path: /discount_phone
column: id
with_wildcard_routes: true
discount:
class: sfDoctrineRouteCollection
options:
model: Discount
module: discount
prefix_path: /discount
column: id
with_wildcard_routes: true
notification_emails:
class: sfDoctrineRouteCollection
options:
......
<?php
if (!$form->isNew()) {
$discount = Doctrine::getTable('DiscountPhone')->findOneByOrderId($form->getObject()->getId());
$offers = $form->getObject()->getOffers();
if (count($offers) > 0) {
?>
<div class="advanced_custom">
<?php
if ($discount) {
?>
<div>Использована скидка <?php echo $discount->getDiscount()->getTitle() . ' с ' . $discount->getActiveDiscount() . '%' ?></div>
<?php
}
?>
<div class="advanced_custom__h">Товарные предложения<sup>&nbsp;<?php echo count($offers);?></sup></div>
<div class="content">
<table width="100%" cellspacing="0" cellpadding="0">
......@@ -25,7 +17,7 @@ if (!$form->isNew()) {
<?php
$total = 0;
foreach ($offers as $offer) {
echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['price']/$offer['amount'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['Offer']['price'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
$total += $offer['price'];
}
echo '<tr class="advanced_custom__tr_divider_top"><td align="right" colspan="4"><nobr><b>Итого:&nbsp;</b>' . number_format($total, 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
......
<?php
require_once dirname(__FILE__).'/../lib/discountGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/discountGeneratorHelper.class.php';
/**
* discount actions.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountActions extends autoDiscountActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: Discount
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: discount
with_doctrine_route: true
actions_base_class: sfActions
order: 45
config:
tabs:
0: { label: 'Скидки' }
1: { label: 'Телефоны', url_for: 'discount_phone/index?tab=1' }
actions: ~
fields:
id: {label: 'id'}
title: {label: Название}
utm: {label: 'UTM'}
comment: {label: 'Комментарий'}
url: {label: 'Ссылка', help: 'Для автоматической генерации оставьте поле пустым'}
created_at: {label: 'Дата создания'}
updated_at: {label: 'Дата изменения'}
phones: {label: ''}
list:
layout: ~
title: 'Скидки'
display: [title, utm, comment, url, _phones, created_at]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
class: false
form: ~
edit:
title: Редактирование скидки
new:
title: Добавление скидки
\ No newline at end of file
<?php
/**
* discount module configuration.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountGeneratorConfiguration extends BaseDiscountGeneratorConfiguration
{
public function getFormActions()
{
return array( '_list' => NULL, '_save' => NULL, '_save_and_add' => NULL, '_save_and_list' => NULL,);
}
public function getListObjectActions()
{
return array( '_edit' => NULL,);
}
public function getListBatchActions()
{
return array();
}
}
<?php
/**
* discount module helper.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountGeneratorHelper extends BaseDiscountGeneratorHelper
{
}
<?php if ($field->isPartial()): ?>
<?php include_partial('discount_phone/'.$name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php elseif ($field->isComponent()): ?>
<?php include_component('discount_phone', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?>
<?php else: ?>
<div class="<?php echo $class ?><?php $form[$name]->hasError() and print ' errors' ?>">
<div>
<?php $opts = $form[$name]->getWidget()->getOptions(); ?>
<?php if (key_exists('type', $opts) && $opts['type'] == 'checkbox'): ?>
<div class="content"><label><?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes); ?><?php echo $label; ?></label></div>
<?php else: ?>
<span class="inline-label"><?php echo $form[$name]->renderLabel($label) ?></span>
<div class="content">
<?php echo $name == 'url' ? 'http://'.$this->context->getRequest()->getHost().'/ru/discount/' : ''; ?> <?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?><?php echo ($name == 'url' ? '/ ' : '') ?> <?php echo ( $name == 'url' && !$form->isNew() ? '<div style="margin-left: 10px !important;" class="pseudo_button lui_pseudo pseudo_button_file_wrapper only_root_button" >Скопировать в буфер обмена</div>' : ''); ?>
<?php echo $form[$name]->renderError() ?>
<?php if ($help): ?><span class="help"><?php echo __($help, array(), 'messages') ?></span><?php elseif ($help = $form[$name]->renderHelp()): ?><span class="help"><?php echo strip_tags($help, '<a><i>') ?></span><?php endif; ?>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php
if ($name == 'url') {
?>
<script>
$('.pseudo_button').on('click', function (e) {
try {
}
document.execCommand('copy');
} catch(err) {
console.log('Can`t copy');
})
</script>
<?php
}
?>
\ No newline at end of file
<?php
echo link_to('Перейти к телефонам', 'discount_phone/filter?discount_phone_filters[discount_id]=' . $discount->getId(), array("class" => "lui_pseudo", "onclick" => "event.stopPropagation();"));
?>
\ No newline at end of file
<?php
require_once dirname(__FILE__).'/../lib/discount_phoneGeneratorConfiguration.class.php';
require_once dirname(__FILE__).'/../lib/discount_phoneGeneratorHelper.class.php';
/**
* discount_phone actions.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneActions extends autoDiscount_phoneActions
{
}
generator:
class: sfDoctrineGenerator
param:
model_class: DiscountPhone
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: discount_phone
with_doctrine_route: true
actions_base_class: sfActions
skip: true
config:
tabs:
0: { label: 'Скидки', url_for: 'discount/index?tab=0' }
1: { label: 'Телефоны' }
actions: ~
fields:
id: {label: 'id'}
phone: {label: 'Телефон'}
discount_id: {label: 'Скидка'}
active_discount: {label: 'Текущая скидка'}
order_id: {label: ' заказа'}
created_at: {label: 'Создана'}
updated_at: {label: 'Активирована'}
discount: {label: 'Скидка'}
list:
layout: ~
title: 'Скидки'
display: [phone, _discount, created_at, _updated_at]
max_per_page: 100
object_actions:
_delete: ~
_edit: ~
search:
fields: false
export: false
filter:
display: [discount_id]
form: ~
edit:
title: Редактирование телефона
new:
title: Добавление телефона
\ No newline at end of file
<?php
/**
* discount_phone module configuration.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: configuration.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneGeneratorConfiguration extends BaseDiscount_phoneGeneratorConfiguration
{
public function getListBatchActions()
{
return array();
}
public function getListActions()
{
return array();
}
}
<?php
/**
* discount_phone module helper.
*
* @package sf
* @subpackage discount_phone
* @author Atma
* @version SVN: $Id: helper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discount_phoneGeneratorHelper extends BaseDiscount_phoneGeneratorHelper
{
}
<?php
echo $discount_phone->getDiscountId() ? $discount_phone->getDiscount()->getTitle() : '';
?>
\ No newline at end of file
<?php
echo $discount_phone->getOrderId() ? $discount_phone->getUpdatedAt() : '';
?>
\ No newline at end of file
......@@ -21,7 +21,6 @@ all:
class: sfSessionStorage
param:
session_name: om
session_cookie_lifetime: 2592000
routing:
class: sfPatternRouting
param:
......
......@@ -8,10 +8,6 @@ homepage:
requirements:
sf_culture: (?:ru|en)
homepage_discount:
url: /:sf_culture/discount/:url/
param: { module: main, action: index }
search:
url: /:sf_culture/search/
param: { module: search, action: search }
......@@ -28,10 +24,6 @@ review:
url: /:sf_culture/review/
param: { module: review, action: index }
discount:
url: /:sf_culture/discount/
param: { module: discount, action: index }
catalog:
url: /:sf_culture/catalog/
param: { module: catalog, action: index }
......@@ -56,10 +48,6 @@ basket_complete:
url: /:sf_culture/basket/complete/
param: { module: basket, action: complete }
basket_check_discount:
url: /:sf_culture/basket/check_discount/
param: { module: discount, action: check_discount }
catalog_show_cat:
url: /catalog/:alias/
param: { module: catalog, action: show_cat }
......@@ -96,10 +84,6 @@ uploader:
url: /uploader/
param: { module: main, action: uploader }
check_discount_term:
url: /check_discount_term/
param: { module: discount, action: check_discount_term }
page_show:
url: /:sf_culture/:alias/
class: sfDoctrineRoute
......
......@@ -6,7 +6,7 @@ prod:
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
web_debug: true
web_debug: false
cache: true
etag: false
logging_enabled: false
......
......@@ -4,18 +4,18 @@ default:
metas:
robots: 'index, follow'
stylesheets:
- 'fonts.css?deploy=1519103092'
- 'g.css?deploy=1519103094'
- 'p.css?deploy=1519103095'
- 'a.css?deploy=1519103092'
- 'fonts.css?deploy=1519103100'
- 'g.css?deploy=1519103101'
- 'p.css?deploy=1519103104'
- 'a.css?deploy=1519103102'
- 'nouislider.css?deploy=1519103100'
javascripts:
- 'jquery-2.1.4.min.js?deploy=1519103092'
- 'jquery.plugins.js?deploy=1519103092'
- 'jquery.cycle2.min.js?deploy=1519103092'
- 'jquery.cycle2.swipe.js?deploy=1519103092'
- 'jquery.cycle2.carousel.min.js'
- 'nouislider.js?deploy=1519103092'
- 'init.d.js?deploy=1519103092'
- 'jquery-2.1.4.min.js?deploy=1519103100'
- 'jquery.plugins.js?deploy=1519103100'
- 'jquery.cycle2.min.js?deploy=1519103100'
- 'jquery.cycle2.swipe.js?deploy=1519103100'
- 'jquery.cycle2.carousel.min.js?deploy=1519103100'
- 'nouislider.js?deploy=1519103100'
- 'init.d.js?deploy=1519103100'
has_layout: true
layout: layout
......@@ -344,30 +344,6 @@ class basketActions extends sfActions
$this->order_form->bind($request->getParameter($this->order_form->getName()));
if($this->order_form->isValid()){
$params =$request->getParameter($this->order_form->getName());
$phone = $params['phone'];
if ($this->getUser()->hasAttribute('active_discount') && $this->getUser()->getAttribute('active_discount') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $phone)
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')
AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($discount) > 0) {
$discount = intval($discount->getFirst()->getActiveDiscount());
} else {
$discount = 0;
}
} else {
$discount = 0;
}
$order = $this->order_form->save();
$basket->setBasketOrderId($order->getId());
$basket->save();
......@@ -388,45 +364,22 @@ class basketActions extends sfActions
$products['sum'] = 0;
foreach ($basket->getBasketOffer() as $key => $basketOffer)
foreach ($basket->getBasketOffer()->toArray() as $key => $basketOffer)
{
$offerTranslation = Doctrine_Query::create()
->select('o.*, t.*')
->from('Offer o')
->where('o.id = ?', intval($basketOffer->getOfferId()))
->where('o.id = ?', intval($basketOffer['offer_id']))
->leftJoin('o.Translation t')
->fetchArray();
if ($discount && $offerTranslation[0]['discount_available'] == 1) {
$basketOffer->setPrice($basketOffer->getPrice()/100*(100-$discount));
$basketOffer->save();
}
$products['elem'][$key]['name'] = $offerTranslation[0]['Translation']['ru']['title'];
$products['elem'][$key]['price'] = number_format(intval($basketOffer->getPrice())/$basketOffer->getAmount(), 0, ',', ' ');
$products['elem'][$key]['count'] = $basketOffer->getAmount();
$products['sum'] = $products['sum'] + intval($basketOffer->getPrice());
}
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$phone_discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $this->getUser()->getAttribute('phone_number'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\') AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($phone_discount) > 0) {
$phone_discount = $phone_discount->getFirst();
$phone_discount->setOrderId($order->getId());
$phone_discount->save();
$products['elem'][$key]['price'] = intval($basketOffer['price'])/$basketOffer['amount'];
$products['elem'][$key]['count'] = $basketOffer['amount'];
$products['sum'] = $products['sum'] + intval($basketOffer['price']);
}
$this->getUser()->setAttribute('active_discount', false);
$this->getUser()->setAttribute('phone', false);
$this->getUser()->setAttribute('number_of_views', false);
$emails_dirty = NotificationEmailsTable::getInstance()->createQuery('e')
->select('e.email')
......@@ -467,6 +420,7 @@ class basketActions extends sfActions
);
}
$this->redirect('@basket_complete');
}
}
......
......@@ -24,8 +24,5 @@ class basketComponents extends sfComponents
if(count($this->offers) > 0){
$this->info = $user->getBasketInfo();
}
if ($this->getUser()->hasAttribute('active_discount') && $this->getUser()->getAttribute('active_discount') != false) {
$this->percent = $this->getUser()->getAttribute('active_discount');
}
}
}
\ No newline at end of file
......@@ -13,15 +13,12 @@
</thead>
<tbody valign="middle">
<?php
if (!isset($percent)) {
$percent = false;
}
$summ = 0;
$productFreeShipping = 1;
foreach ($offers as $offer){
if ($offer['Product']['free_shipping'] == 0) {
$productFreeShipping = 0;
}
//print_r($offer);
$quantity_type = $offer['Translation'][$culture]['quantity_type'];
if ($offer['quantity_type_select']) {
$quantity_type = (isset(Offer::$quantity_type_select_values[$offer['quantity_type_select']]) ? Offer::$quantity_type_select_values[$offer['quantity_type_select']] : '');
......@@ -33,7 +30,7 @@
$offer_img = $offer_imgs[0];
}
//print_r($offer['Product']);
echo '<td valign="top"><a style="border: none" href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/"><div class="basket_img ' . ($offer['discount_available'] == 1 ? 'discount' : '') . '" ' . ($offer_img ? 'style="background-image: url(/u/i/' . Page::replaceImageSize($offer_img, 'S') . ');"' : '') . '></div></a>';
echo '<td valign="top"><a style="border: none" href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/"><div class="basket_img" ' . ($offer_img ? 'style="background-image: url(/u/i/' . Page::replaceImageSize($offer_img, 'S') . ');"' : '') . '></div></a>';
echo '<td><div class="basket_offer_title"><a href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/">' . $offer['Translation'][$culture]['title'] . '</a></div></td>';
echo '</td>';
echo '<td class="align_center"><div class="product_counter" data-id="' . $offer['id'] . '">';
......@@ -41,22 +38,15 @@
echo '<input autocomplete="off" type="text" class="product_counter_val" value="' . $offer['BasketOffer'][0]['amount'] . '" data-symbol="false" onkeyup="counterLite.update($(this))">';
echo '<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this))">';
echo '</div><span class="name_unit">' . ($quantity_type != '' ? $quantity_type : '') . '</span></td>';
if ($percent && $offer['discount_available'] == 1) {
echo '<td valign="middle" class="basket_offers_table__price align_center"><div style="position: relative"><div class="basket_discount"><span style="text-decoration: line-through">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;</span><span style="font-size: 15px" class="rub">i</span></div><div class="basket_item">' . number_format($offer['price']/100*(100-$percent), 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></div></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item"> ' . number_format($offer['BasketOffer'][0]['price']/100*(100-$percent), 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
$summ = $summ + $offer['BasketOffer'][0]['price']/100*(100-$percent);
}else {
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item">' . number_format($offer['BasketOffer'][0]['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
$summ = $summ + $offer['BasketOffer'][0]['price'];
}
echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['BasketOffer'][0]['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
echo '<td width="1" align="center"><div class="basket_clean" onclick="basket.delete(this);"></div></td>';
echo '</tr>';
}
?>
</tbody>
</table>
<div class="basket_total" data-delivery-info="<?php echo $productFreeShipping ?>"><?php echo __('Итого');?>:<div class="basket_total__price"><?php echo number_format($summ, 0, ',', ' ');?></div>&nbsp;<span class="rub">i</span></div>
<div class="basket_total" data-delivery-info="<?php echo $productFreeShipping ?>"><?php echo __('Итого');?>:<div class="basket_total__price"><?php echo number_format($info['price'], 0, ',', ' ');?></div>&nbsp;<span class="rub">i</span></div>
</div>
</div>
......
......@@ -42,7 +42,7 @@ echo '<h1 class="content_title">' . __('Корзина') . '</h1>';
<?php
echo '<h2>' . __('Контактные данные') . ':</h2>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="255" required="1" placeholder="Как к вам обращаться" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="noempty" class="basket_buyer__inp_name validate_it" name="basket_order[username]" id="basket_order_username" type="text"></div>';
echo '<div class="basket_buyer__item"><div class="phone_info"></div><input size="27" maxlength="24" required="1" placeholder="Номер телефона" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="phone" class="basket_buyer__inp_name phone_mask validate_it" name="basket_order[phone]" id="basket_order_phone" type="text"></div>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="24" required="1" placeholder="Номер телефона" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="phone" class="basket_buyer__inp_name validate_it" name="basket_order[phone]" id="basket_order_phone" type="text"></div>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="24" required="1" placeholder="Email" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="email" class="basket_buyer__inp_name validate_it" name="basket_order[email]" id="basket_order_email" type="text"></div>';
?>
</div>
......@@ -86,126 +86,11 @@ echo '<h1 class="content_title">' . __('Корзина') . '</h1>';
<?php
echo '<h2>' . __('Общая сумма заказа') . '</h2>';
echo '<div class="basket_order__price">' . $info['priceText'] . '&nbsp;<span class="rub">i</span></div>';
echo '<input type="submit" class="btn green_b_btn order_btn btn_disabled" value="' . __('Оформить заказ') . '" disabled>';
echo '<input type="submit" class="btn green_b_btn order_btn btn_disabled" value="' . __('Оформить заказ') . '" onclick="yaCounter48466937.reachGoal(\'ORDER\')" disabled>';
?>
</div>
<script type="text/javascript">
var lastvalue = '';
var lastvalueunmask = '';
function mask(str) {
var arr = str.split('');
if (str.length >= 2)
{
arr.splice(2,0," (");
if (str.length >= 5)
{
arr.splice(6,0,") ");
}
if (str.length >=8)
{
arr.splice(10,0,"-");
}
if (str.length >= 10)
{
arr.splice(13,0,"-");
}
}
return arr.join('');
}
function unmask(str) {
var rep = /[()\-\s]/g;
var value = str.replace(rep, '');
return value;
}
$('.phone_mask').on('input', function () {
var value = unmask($(this).val());
var last = value.slice(-1);
var first = value.charAt(0);
var rep = /(^\+7)(9)([0-9]{0,9})/g;
if ((value.length == 2) && (first == '+'))
{
if (value == '+9')
{
value = '+79';
lastvalue = '+79';
}else
{
value = '+7';
lastvalue = '+7';
}
}else
if ((value == '7') || (value == '8'))
{
value = '+7';
} else
if (value == '9')
{
value = '+79';
} else
{
var execval = rep.exec(value);
if (execval != null)
{
value = execval[0];
} else
{
if ((last != '9'))
{
value = value.substring(0, value.length - 1)
}
}
}
$(this).val(mask(value));
lastvalue = $(this).val();
lastvalueunmask = value;
});
$('.phone_mask').on('keydown', function (event) {
var key = event.keyCode || event.charCode;
if( key == 8 || key == 46 ){
var value = unmask($('.phone_mask').val());
value = value.substring(0, value.length - 1);
$('.phone_mask').val(mask(value));
lastvalue = $('.phone_mask').val();
return false;
}
});
$('.phone_mask').on('blur', function (e) {
if ($('.phone_mask').val().length == 18) {
$.ajax({
url: '/ru/basket/check_discount/',
dataType: 'json',
type: 'post',
data: {phone: $('.phone_mask').val()},
success: function (data) {
if (data.status == 'success' && data.active_discount > 0) {
$('.basket_refresh').html(data.body);
$($('.top_right')[1]).addClass('discount_basket');
$('.phone_info').html('На этом номере обнаружена скидка ' + data.active_discount + '%')
} else if (data.status == 'success' && data.active_discount == 0) {
$('.basket_refresh').html(data.body);
$($('.top_right')[1]).removeClass('discount_basket');
$('.phone_info').html('На этом номере скидка не обнаружена')
}
},
error: function (error) {
console.log(error);
}
})
}
})
$(document).ready(function () {
var delivery_info = $('.basket_total').data('delivery-info');
console.log(delivery_info);
......
......@@ -141,7 +141,7 @@ class catalogActions extends sfActions
->orderBy('p.sort asc');
//->andWhere("CHAR_LENGTH(p.product_img) > 0");
$products_q = Doctrine_Query::create()
->select("p.id, p.alias, p.product_img, p.is_detail, p.offer_count, p.is_delete, c.*, t.id, t.lang, t.title, o.id, o.product_id, o.price, o.quantity_type_select, o.discount_available, ot.*, ppv.*")
->select("p.id, p.alias, p.product_img, p.is_detail, p.offer_count, p.is_delete, c.*, t.id, t.lang, t.title, o.id, o.product_id, o.price, o.quantity_type_select, ot.*, ppv.*")
->from("Product p")
->leftJoin("p.CatProduct c")
->leftJoin("p.Translation t")
......
......@@ -86,7 +86,7 @@
<tr>
<td colspan="5">
<i class="br40"></i>
<a href="" class="btn green_btn calculator_table__btn">Добавить в корзину</a>
<a href="" class="btn green_btn calculator_table__btn" onclick="yaCounter48466937.reachGoal('ADD');">Добавить в корзину</a>
</td>
</tr>
</tbody>
......
......@@ -50,11 +50,3 @@ echo '<h1 class="content_title">' . $translation[$culture]['title'] . '</h1>';
}
?>
</div>
<script>
$('.discount_available').on('click', function (e) {
if ($(window).width() < 650) {
$(this).toggleClass('show');
}
})
</script>
<?php
/**
* discount actions.
*
* @package sf
* @subpackage discount
* @author Atma
* @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class discountActions extends sfActions
{
public function executeIndex(sfWebRequest $request)
{
if ($request->hasParameter('discount')) {
$data = $request->getParameter('discount');
$discount = Doctrine::getTable('Discount')->findOneByUrl($data['url']);
if ($discount) {
$date_now = new DateTime('now');
$date_now->modify('+1 day');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
$check_discounts = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $data['phone'])
->andWhere('dp.discount_id != ?', $discount->getId())
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')
AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->fetchArray();
if (count($check_discounts) == 1) {
echo include_partial('discount/form', array('status' => 'error', 'error' => 'У вас уже есть скидка ' . $check_discounts[0]["active_discount"] . '%'));
} else {
$check_phone = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $data['phone'])
->andWhere('dp.discount_id = ?', $discount->getId())
->fetchArray();
if (count($check_phone) == 0) {
$discount_phone = new DiscountPhone();
$discount_phone->setDiscountId($discount->getId());
$discount_phone->setPhone($data['phone']);
$discount_phone->save();
$this->getUser()->setAttribute('number_of_views', 3);
$this->getUser()->setAttribute('phone_number', $data['phone']);
$this->getUser()->setAttribute('active_discount', 3);
echo include_partial('discount/form', array('status' => 'complete'));
} else {
if (is_numeric($check_phone[0]['order_id'])) {
echo include_partial('discount/form', array('status' => 'error', 'error' => 'Вы уже использовали данную скидку'));
} else {
$date_created = new DateTime($check_phone[0]['created_at']);
$interval = $date_now->diff($date_created);
$interval = $interval->format('%a');
$remained = 30 - $interval;
if (intval($remained) <= 30) {
echo include_partial('discount/form', array('status' => 'error', 'error' => "У вас уже есть данная скидка.\n Осталось " . $remained . " дней"));
} else {
echo include_partial('discount/form', array('status' => 'error', 'error' => 'Вы не можете активировать скидку второй раз'));
}
}
}
}
}
}
return sfView::NONE;
}
public function executeCheck_discount(sfWebRequest $request)
{
if ($request->hasParameter('phone') && $request->getParameter('phone') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $request->getParameter('phone'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')
AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($discount) > 0) {
$discount = $discount->getFirst();
$this->getUser()->setAttribute('active_discount', $discount->getActiveDiscount());
$this->getUser()->setAttribute('phone', $request->getParameter('phone'));
//sfContext::getInstance()->getConfiguration()->loadHelpers('Components');
//$body = include_component('basket', 'basket');
echo json_encode(array('status' => 'success', 'active_discount' => $discount->getActiveDiscount(), 'body' => $this->getComponent('basket', 'basket')));
} else {
$this->getUser()->setAttribute('active_discount', false);
$this->getUser()->setAttribute('phone', false);
echo json_encode(array('status' => 'success', 'active_discount' => 0, 'body' => $this->getComponent('basket', 'basket')));
}
}
return sfView::NONE;
}
public function executeCheck_discount_term (sfWebRequest $request) {
if ($this->getUser()->hasAttribute('active_discount') && $this->getUser()->getAttribute('active_discount') != false && $this->getUser()->hasAttribute('phone_number') && $this->getUser()->getAttribute('phone_number') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $this->getUser()->getAttribute('phone_number'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')
AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($discount) > 0) {
$discount = $discount->getFirst();
echo json_encode(array('status' => 'success', 'active_discount' => $discount->getActiveDiscount()));
} else {
echo json_encode(array('status' => 'success', 'active_discount' => 0));
}
}else {
echo json_encode(array('status' => 'success', 'active_discount' => 0));
}
return sfView::NONE;
}
}
<?php
class discountComponents extends sfComponents
{
public function executeForm($request)
{
if ($request->hasParameter('url')) {
$discount = Doctrine::getTable('Discount')->findOneByUrl($request->getParameter('url'));
if ($discount) {
$this->status = 'success';
$this->discount = $request->getParameter('url');
} else {
$this->status = 'error';
$this->error = 'Cкидка не найдена';
$this->discount = $request->getParameter('url');
}
}
}
}
\ No newline at end of file
<?php
if ($status == 'success') {
echo '<div class="image_discount">';
echo '</div>';
echo '<div class="form_discount">';
echo '<div id="discount" class="discount_form__title">' . __('Вы получили скидку 3%') . '</div>';
echo '<div class="discount_form_text">Введите номер телефона, чтобы сохранить скидку</div>';
echo '<form class="discount_form" method="post" action="' . url_for('@discount') . '" onsubmit="discount.submit(this);return false;">';
echo '<div class="discount_form__process">';
echo '<div class="discount_form__inp_wrap"><input name="discount[phone]" type="text" id="phone_mask" class="form_type_1__input validate_it" placeholder="Номер телефона" onkeyup="form_validator.check($(this))" data-check-rule="phone" autocomplete="off" required></div>';
echo '<input name="discount[url]" type="hidden" value="' . $discount . '">';
$culture = $sf_user->getCulture();
?>
<div class="discount_form__checkbox">
<label class="checkbox ver2">
<input type="checkbox" class="validater validate_it not_custom" onchange="form_validator.check($(this))"
data-check-rule="checked" autocomplete="off" required>
<span class="checkbox_span"></span>
<span class="checkbox_text"><?php echo __('Я принимаю условия') ?> <a
href="<?php echo '/' . $culture . '/terms-of-use/' ?>"
target="_blank"><?php echo __('пользовательского соглашения') ?></a><?php echo __(' и ') ?>
<a href="<?php echo '/' . $culture . '/privacy-policy/' ?>"
target="_blank"><?php echo __('политики конфиденциальности') ?></a></span>
</label>
</div>
<i class="br15"></i>
<?php
echo '<input type="submit" class="discount_form__submit green_b_btn send btn_disabled" value="' . __('Cохранить') . '" disabled />';
echo '</div>';
echo '</form>';
echo '<div class="discount_form_head_text">Хотите скидку больше?<br>Тогда посмотрите семь товаров.</div>';
echo '<div class="discount_form_text">В течение 30 дней вы можете сделать заказ со скидкой.</div>';
echo '</div>';
} elseif ($status == 'complete') {
echo '<div class="form_discount">';
echo '<div id="discount" class="discount_form__title">' . __('Скидка успешно активирована!') . '</div>';
echo '<div class="discount_form__submit green_b_btn" onclick="discount.close();">Понятно</div>';
echo '</div>';
} elseif ($status == 'error') {
echo '<div class="form_discount">';
echo '<div id="discount" class="discount_form__title">' . __($error) . '</div>';
echo '<div class="discount_form__submit green_b_btn" onclick="discount.close();">Понятно</div>';
echo '</div>';
}
?>
<script>
var lastvalue = '';
var lastvalueunmask = '';
function mask(str) {
var arr = str.split('');
if (str.length >= 2)
{
arr.splice(2,0," (");
if (str.length >= 5)
{
arr.splice(6,0,") ");
}
if (str.length >=8)
{
arr.splice(10,0,"-");
}
if (str.length >= 10)
{
arr.splice(13,0,"-");
}
}
return arr.join('');
}
function unmask(str) {
var rep = /[()\-\s]/g;
var value = str.replace(rep, '');
return value;
}
$('#phone_mask').on('input', function () {
var value = unmask($(this).val());
var last = value.slice(-1);
var first = value.charAt(0);
var rep = /(^\+7)(9)([0-9]{0,9})/g;
if ((value.length == 2) && (first == '+'))
{
if (value == '+9')
{
value = '+79';
lastvalue = '+79';
}else
{
value = '+7';
lastvalue = '+7';
}
}else
if ((value == '7') || (value == '8'))
{
value = '+7';
} else
if (value == '9')
{
value = '+79';
} else
{
var execval = rep.exec(value);
if (execval != null)
{
value = execval[0];
} else
{
if ((last != '9'))
{
value = value.substring(0, value.length - 1)
}
}
}
$(this).val(mask(value));
lastvalue = $(this).val();
lastvalueunmask = value;
});
$('#phone_mask').on('keydown', function (event) {
var key = event.keyCode || event.charCode;
if( key == 8 || key == 46 ){
var value = unmask($('#phone_mask').val());
value = value.substring(0, value.length - 1);
$('#phone_mask').val(mask(value));
lastvalue = $('#phone_mask').val();
return false;
}
});
</script>
......@@ -17,6 +17,7 @@ class mainActions extends sfActions
*/
public function executeIndex(sfWebRequest $request)
{
/**/
$this->setLayout('layoutHome');
$this->video = Doctrine_Query::create()
->select("v.*, t.*")
......@@ -61,7 +62,6 @@ class mainActions extends sfActions
->andWhere("c.is_main = 1")
->orderBy("RAND()")
->fetchOne();
}
public function executeDl(sfWebRequest $request)
{
......
<table class="lending" style="width: 100%" cellspacing="0" cellpadding="0">
<tr>
<td>
......
......@@ -56,41 +56,5 @@ class productActions extends sfActions
$this->setLayout('layoutPage');
if ($this->getUser()->hasAttribute('number_of_views') && $this->getUser()->getAttribute('number_of_views') != false) {
$number_of_view = $this->getUser()->getAttribute('number_of_views');
if ($this->getUser()->getAttribute('number_of_views') < 10) {
if (!$this->getUser()->hasAttribute('ids_view_product') || $this->getUser()->getAttribute('ids_view_product') == false) {
$this->getUser()->setAttribute('ids_view_product', $this->product['id'] . ';');
} else {
$str_ids = $this->getUser()->getAttribute('ids_view_product');
$ids = explode(';', $str_ids);
if (!in_array($this->product['id'], $ids)) {
$number_of_view++;
$this->getUser()->setAttribute('number_of_views', $number_of_view);
$this->getUser()->setAttribute('ids_view_product', $str_ids . $this->product['id'] . ';');
}
}
}
if ($number_of_view == 5 || $number_of_view == 7 || $number_of_view == 10) {
if ($this->getUser()->hasAttribute('phone_number') && $this->getUser()->getAttribute('phone_number') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$phone_discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $this->getUser()->getAttribute('phone_number'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\') AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($phone_discount) > 0) {
$phone_discount = $phone_discount->getFirst();
$phone_discount->setActiveDiscount($number_of_view);
$phone_discount->save();
$this->getUser()->setAttribute('active_discount', $number_of_view);
}
}
}
}
}
}
......@@ -3,24 +3,14 @@ if (isset($product)) {
$translation = $product['Translation'];
$productImg = explode(';', $product['product_img']);
$productImg = (count($productImg) > 0 ? $productImg[0] : false);
$q = Doctrine::getTable('Product')->findOneById($product['id'])->getOffer();
$discount_available = false;
foreach ($q as $offer) {
if ($offer->getDiscountAvailable() == 1) {
$discount_available = true;
break;
}
}
echo '<div class="catalog_category_child_item ' . ($discount_available ? 'discount' : '') . '">';
if ($discount_available) {
echo '<div class="discount_available"><div class="discount_available_desc">Ищите наши QR-коды в видео и соц. сетях и забирайте скидку</div><div class="discount_available_title">Доступен со скидкой</div></div>';
}
echo '<div class="catalog_category_child_item">';
echo '<' . ($product['is_detail'] ? 'a' : 'span') . ' href="' . url_for("@product_show?alias=" . $product['alias']) . '" class="anb">';
if($productImg){
echo '<img src="/i/n.gif" style="background-image: url(/u/i/' . Page::replaceImageSize($productImg, 'S') . ');" />';
}else
{
$offerImg = '';
$q = Doctrine::getTable('Product')->findOneById($product['id'])->getOffer();
foreach ($q as $offer) {
if (strlen($offer->getImg()) > 3)
$offerImg = $offer->getImg();
......
......@@ -115,7 +115,7 @@ $view = 'much';
<input data-initialized="1" data-id="<?php echo $offer['id']; ?>" type="radio" name="offer" onchange="counterLite.change($(this))">
<?php if ($offer['price'] > 1) { ?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr <?php echo ($offer['discount_available'] == 1 ? 'class="discount' : '') ?>">
<tr>
<td><?php echo $offer['title'] . $quantity_type; ?></td>
<td style="white-space: nowrap;" align="right">
<?php echo $offer_str; ?>
......@@ -125,7 +125,7 @@ $view = 'much';
<div class="product_counter min" data-id="<?php echo $offer['id']; ?>" data-price="<?php echo $offer['price'];?>">
<input type="button" class="product_counter_minus" data-symbol="-" onclick="counterLite.update($(this))">
<input autocomplete="off" type="text" class="product_counter_val" value="<?php echo ( $infoAmount ? $infoAmount : 0 ) ?>" data-symbol="-+" onkeyup="counterLite.update($(this))">
<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this))">
<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this)); yaCounter48466937.reachGoal('ADD');">
</div>
</td>
</tr>
......
......@@ -11,7 +11,7 @@
?>
<title><?php include_slot('title', sfConfig::get('app_www_title')); ?></title>
</head>
<body <?php echo ($sf_request->hasParameter('url') ? 'class="scroll_hidden overlay_discount_active"' : '')?>>
<body>
<script type="text/javascript">
var culture = '<?php echo $sf_user->getCulture();?>';
</script>
\ No newline at end of file
......@@ -14,5 +14,4 @@
</table>
<?php include(sfConfig::get('sf_app_template_dir') . '/bottom.php'); ?>
<?php include(sfConfig::get('sf_app_template_dir') . '/footer.php'); ?>
<?php include(sfConfig::get('sf_app_template_dir') . '/footer.php'); ?>
\ No newline at end of file
......@@ -5,13 +5,6 @@
?>
</div>
</div>
<?php
if ($sf_request->hasParameter('url')) {
echo '<div class="overlay_discount overlay_discount_active" onclick="discount.close();"><div class="overlay_discount__item" onclick="event.stopPropagation();">';
include_component('discount','form');
echo '</div></div>';
}
?>
<div id="panel"></div>
<div class="search_overlay" onclick="search.close();">
<div class="search_overlay__line" onclick="event.stopPropagation();">
......
......@@ -24,15 +24,15 @@
<?php
/*<div class="region"><a href="" class="green_link bbs_d">Уфа, Респ. Башкортостан</a></div>*/
if (csSettings::get('phone')) {
echo '<div class="header__phone">' . __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '">' . csSettings::get('phone') . '</a></div>';
echo '<div class="header__phone">' . __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" onclick="yaCounter48466937.reachGoal(\'PHONE\');">' . csSettings::get('phone') . '</a></div>';
}
if (csSettings::get('email')) {
echo '<div><nobr>' . __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a></div>';
echo '<div><nobr>' . __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '" onclick="yaCounter48466937.reachGoal(\'POST\'); return true;">' . csSettings::get('email') . '</a></div>';
}
?>
</td>
<td class="top_right">
<a href="" class="callback_open_link green_link bbs_d" onclick="callback.open();return false;"><?php echo __('Заказать звонок');?></a>
<a href="" class="callback_open_link green_link bbs_d" onclick="callback.open();yaCounter48466937.reachGoal('CALL');return false;"><?php echo __('Заказать звонок');?></a>
</td>
</tr>
</table>
......@@ -45,9 +45,6 @@
<table class="second_floor__table" style="width: 100%; height: 100%" cellpadding="0" cellspacing="0">
<tr>
<?php
if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
$active_discount = $sf_user->getAttribute('active_discount');
}
$module_action = $sf_request->getParameter('module') . '_' . $sf_request->getParameter('action');
echo '<td width="100' . ($module_action == 'basket_complete' ? '%' : '') . '" align="center">';
$logo = '<img width="100" height="51" src="/i/logo.svg" />';
......@@ -57,7 +54,7 @@
echo '<td class="top_menu">';
include_component('main', 'menu');
echo '</td>';
echo '<td style="position: relative;" class="top_right ' . ($module_action == 'basket_index' ? (isset($active_discount) ? 'discount_basket' : '') : (isset($active_discount) ? 'discount d' . $active_discount : '') ) . '">';
echo '<td class="top_right">';
if($module_action != 'search_search'){
echo '<div class="search_btn" onclick="search._show();"></div>';
}
......
<?php
if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
$discount = $sf_user->getAttribute('active_discount');
} else {
$discount = false;
}
?>
<div class="header_mobile mobile <?php echo ($discount ? 'discount d' . $discount : '' )?>">
<div class="header_mobile mobile">
<table cellspacing="0" cellpadding="0" width="100%">
<tbody align="left" valign="middle">
<tr>
<td colspan="2">
<?php echo csSettings::get('phone') ? '<a href="tel:'. csSettings::get('phone') .'" class="header_mobile__phone_link">'. csSettings::get('phone') .'</a>' : ''; ?>
<?php echo csSettings::get('phone') ? '<a href="tel:'. csSettings::get('phone') .'" class="header_mobile__phone_link" onclick="yaCounter48466937.reachGoal(\'PHONE\');">'. csSettings::get('phone') .'</a>' : ''; ?>
</td>
<td width="1" align="right">
......@@ -43,13 +36,13 @@ if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_
</ul>
<div class="burder__contacts">
<?php if (csSettings::get('phone')) {
echo __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" class="anb">' . csSettings::get('phone') . '</a><i class="br10"></i>';
echo __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" class="anb" onclick="yaCounter48466937.reachGoal(\'PHONE\');">' . csSettings::get('phone') . '</a><i class="br10"></i>';
}
if (csSettings::get('email')) {
echo __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a>';
echo __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '" onclick="yaCounter48466937.reachGoal(\'POST\');return true;">' . csSettings::get('email') . '</a>';
} ?>
</div>
<a href="" class="btn white_b_btn burder__callback_link" onclick="callback.open();return false;">Заказать звонок</a>
<a href="" class="btn white_b_btn burder__callback_link" onclick="callback.open();yaCounter48466937.reachGoal('CALL');return false;">Заказать звонок</a>
</div>
......
......@@ -3,7 +3,7 @@ all:
arm_title: 'Иди в баню - АРМ'
seo_header_sepr: ' - '
email_order: 'ufaros@gmail.com'
email_from: 'noreply@stone-dev.atmadev.ru'
email_from: 'noreply@idivbanu.ru'
secret_key: '2R]btNuO%c/L!}}[v"tY!pWX2JZ{03;!'
default_culture: ru_RU
import_auth_user: bath
......
......@@ -2,6 +2,6 @@ all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=127.0.0.1;dbname=stone_dev'
dsn: 'mysql:host=127.0.0.1;dbname=idivbanu'
username: root
password: h7!nIay6HUtu
......@@ -481,9 +481,6 @@ Offer:
sort:
type: integer
default: 0
discount_available:
type: boolean
default: false
relations:
Product:
onDelete: CASCADE
......@@ -546,11 +543,6 @@ BasketOrder:
type: boolean
notnull: true
default: false
relations:
DiscountPhone:
onDelete: SET NULL
local: id
foreign: order_id
BasketOffer:
columns:
......@@ -624,48 +616,4 @@ Callback:
default: false
offer_id:
type: text
notnull: false
Discount:
actAs:
Timestampable: ~
columns:
title:
type: string(255)
notnull: true
utm:
type: string(255)
notnull: true
comment:
type: string(1000)
notnull: false
url:
type: string(20)
DiscountPhone:
actAs:
Timestampable: ~
columns:
phone:
type: string(20)
notnull: true
discount_id:
type: integer
notnull: true
order_id:
type: string(255)
notnull: false
default: null
active_discount:
type: integer
notnull: true
default: 3
relations:
BasketOrder:
onDelete: SET NULL
local: order_id
foreign: id
Discount:
onDelete: CASCADE
local: discount_id
foreign: id
\ No newline at end of file
notnull: false
\ No newline at end of file
......@@ -6,7 +6,7 @@
host=192.168.2.7
port=22
user=root
dir=/www/idivbanu.ru/
dir=/www/stone-dev.atmadev.ru/
type=rsync
[stone]
host=192.168.2.7
......
......@@ -4,21 +4,6 @@
/.ramcache
/.ramcache/*
/config/databases.yml
/symfony
/test
/upload
/data/exchange
/log
/.ramcache
/.idea
/.git
/config/databases.yml
/config/app.yml
/data
/apps/www/config/factories.yml
/apps/arm/config/factories.yml
/symfony
/web/index.php
/web/a.php
/web/u
/config/properties.ini
/config/rsync_exclude.txt
\ No newline at end of file
/symfony
\ No newline at end of file
<?php
/**
* Discount filter form.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class DiscountFormFilter extends BaseDiscountFormFilter
{
public function configure()
{
}
}
<?php
/**
* DiscountPhone filter form.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class DiscountPhoneFormFilter extends BaseDiscountPhoneFormFilter
{
public function configure()
{
$this->disableLocalCSRFProtection();
}
}
<?php
/**
* OfferTranslation filter form.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class OfferTranslationFormFilter extends BaseOfferTranslationFormFilter
{
public function configure()
{
}
}
<?php
/**
* Discount filter form base class.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseDiscountFormFilter extends BaseFormFilterDoctrine
{
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'utm' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'comment' => new sfWidgetFormFilterInput(),
'url' => new sfWidgetFormFilterInput(),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
));
$this->setValidators(array(
'title' => new sfValidatorPass(array('required' => false)),
'utm' => new sfValidatorPass(array('required' => false)),
'comment' => new sfValidatorPass(array('required' => false)),
'url' => new sfValidatorPass(array('required' => false)),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
));
$this->widgetSchema->setNameFormat('discount_filters[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'Discount';
}
public function getFields()
{
return array(
'id' => 'Number',
'title' => 'Text',
'utm' => 'Text',
'comment' => 'Text',
'url' => 'Text',
'created_at' => 'Date',
'updated_at' => 'Date',
);
}
}
<?php
/**
* DiscountPhone filter form base class.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseDiscountPhoneFormFilter extends BaseFormFilterDoctrine
{
public function setup()
{
$this->setWidgets(array(
'phone' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'discount_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Discount'), 'add_empty' => true)),
'order_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BasketOrder'), 'add_empty' => true)),
'active_discount' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
));
$this->setValidators(array(
'phone' => new sfValidatorPass(array('required' => false)),
'discount_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Discount'), 'column' => 'id')),
'order_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('BasketOrder'), 'column' => 'id')),
'active_discount' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
));
$this->widgetSchema->setNameFormat('discount_phone_filters[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'DiscountPhone';
}
public function getFields()
{
return array(
'id' => 'Number',
'phone' => 'Text',
'discount_id' => 'ForeignKey',
'order_id' => 'ForeignKey',
'active_discount' => 'Number',
'created_at' => 'Date',
'updated_at' => 'Date',
);
}
}
......@@ -21,7 +21,6 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'is_wholesale' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'sort' => new sfWidgetFormFilterInput(),
'discount_available' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
));
......@@ -35,7 +34,6 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'is_wholesale' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'sort' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'discount_available' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
));
......@@ -66,7 +64,6 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => 'Boolean',
'is_wholesale' => 'Boolean',
'sort' => 'Number',
'discount_available' => 'Boolean',
'created_at' => 'Date',
'updated_at' => 'Date',
);
......
<?php
/**
* OfferTranslation filter form base class.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseOfferTranslationFormFilter extends BaseFormFilterDoctrine
{
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'quantity_type' => new sfWidgetFormFilterInput(array('with_empty' => false)),
));
$this->setValidators(array(
'title' => new sfValidatorPass(array('required' => false)),
'quantity_type' => new sfValidatorPass(array('required' => false)),
));
$this->widgetSchema->setNameFormat('offer_translation_filters[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'OfferTranslation';
}
public function getFields()
{
return array(
'id' => 'Number',
'title' => 'Text',
'quantity_type' => 'Text',
'lang' => 'Text',
);
}
}
<?php
/**
* offerTranslation filter form base class.
* OfferTranslation filter form base class.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseofferTranslationFormFilter extends BaseFormFilterDoctrine
abstract class BaseOfferTranslationFormFilter extends BaseFormFilterDoctrine
{
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(),
'title' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'quantity_type' => new sfWidgetFormFilterInput(array('with_empty' => false)),
));
$this->setValidators(array(
'title' => new sfValidatorPass(array('required' => false)),
'title' => new sfValidatorPass(array('required' => false)),
'quantity_type' => new sfValidatorPass(array('required' => false)),
));
$this->widgetSchema->setNameFormat('offer_translation_filters[%s]');
......@@ -31,15 +33,16 @@ abstract class BaseofferTranslationFormFilter extends BaseFormFilterDoctrine
public function getModelName()
{
return 'offerTranslation';
return 'OfferTranslation';
}
public function getFields()
{
return array(
'id' => 'Number',
'title' => 'Text',
'lang' => 'Text',
'id' => 'Number',
'title' => 'Text',
'quantity_type' => 'Text',
'lang' => 'Text',
);
}
}
<?php
/**
* offerTranslation filter form.
* OfferTranslation filter form.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class offerTranslationFormFilter extends BaseofferTranslationFormFilter
class OfferTranslationFormFilter extends BaseOfferTranslationFormFilter
{
public function configure()
{
......
<?php
/**
* Discount form.
*
* @package sf
* @subpackage form
* @author Atma
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class DiscountForm extends BaseDiscountForm
{
public function configure()
{
$this->useFields(array('title', 'utm', 'comment', 'url'));
}
}
<?php
/**
* DiscountPhone form.
*
* @package sf
* @subpackage form
* @author Atma
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class DiscountPhoneForm extends BaseDiscountPhoneForm
{
public function configure()
{
$this->useFields(array('phone', 'discount_id', 'order_id'));
}
public function isValid()
{
$is_valid = parent::isValid();
if ($is_valid) {
$dp = Doctrine_Query::create()
->from("DiscountPhone dp")
->where("dp.phone = ?", $this->getValue('phone'))
->andWhere("dp.id != ?", $this->getValue('id'))
->andWhere("dp.order_id is null")
->count();
if($dp > 0) {
$is_valid = false;
$this->getErrorSchema()->addError(new sfValidatorError($this->getValidator('phone'), 'Пользователь уже добавил скидку'), 'phone');
}
}
return $is_valid;
}
}
......@@ -13,7 +13,7 @@ class OfferForm extends BaseOfferForm
public function configure()
{
$this->embedI18n(array('ru', 'en'));
$this->useFields(array('ru', 'en', 'quantity_type_select', 'price', 'sort', 'discount_available', 'img', 'product_id'));
$this->useFields(array('ru', 'en', 'quantity_type_select', 'price', 'sort', 'is_wholesale', 'img', 'product_id'));
$parentId = sfContext::getInstance()->getRequest()->getParameter('parentId');
if($parentId){
......@@ -22,7 +22,7 @@ class OfferForm extends BaseOfferForm
$this->setDefault('product_id', $parentId);
}
}
$this->widgetSchema['discount_available'] = new sfWidgetFormInputCheckbox(array('label' => 'Доступен со скидкой?'), array("required" => true));
$this->widgetSchema['is_wholesale'] = new sfWidgetFormInputCheckbox(array('label' => 'Чужой товар'), array("required" => true));
$this->widgetSchema['product_id'] = new sfWidgetFormInputHidden();
$this->widgetSchema['ru']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255, "required" => true));
$this->widgetSchema['en']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255, "required" => true));
......
<?php
/**
* Discount form base class.
*
* @method Discount getObject() Returns the current form's model object
*
* @package sf
* @subpackage form
* @author Atma
* @version SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseDiscountForm extends BaseFormDoctrine
{
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(array(), array()),
'title' => new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true)),
'utm' => new sfWidgetFormInputText(array(), array("size" => 64, "maxlength" => 255, "required" => true)),
'comment' => new sfWidgetFormTextarea(array(), array("rows" => 5, "cols" => 70)),
'url' => new sfWidgetFormInputText(array(), array("size" => 20, "maxlength" => 20)),
'created_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
'updated_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
));
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
'title' => new sfValidatorString(array('max_length' => 255)),
'utm' => new sfValidatorString(array('max_length' => 255)),
'comment' => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
'url' => new sfValidatorString(array('max_length' => 20, 'required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('discount[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'Discount';
}
}
<?php
/**
* DiscountPhone form base class.
*
* @method DiscountPhone getObject() Returns the current form's model object
*
* @package sf
* @subpackage form
* @author Atma
* @version SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseDiscountPhoneForm extends BaseFormDoctrine
{
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(array(), array()),
'phone' => new sfWidgetFormInputText(array(), array("size" => 20, "maxlength" => 20, "required" => true)),
'discount_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Discount'), 'add_empty' => false), array("required" => true)),
'order_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BasketOrder'), 'add_empty' => true), array()),
'active_discount' => new sfWidgetFormInputText(array(), array("size" => 8, "maxlength" => 8, "required" => true)),
'created_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
'updated_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
));
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
'phone' => new sfValidatorString(array('max_length' => 20)),
'discount_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Discount'))),
'order_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BasketOrder'), 'required' => false)),
'active_discount' => new sfValidatorInteger(array('required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('discount_phone[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
public function getModelName()
{
return 'DiscountPhone';
}
}
......@@ -24,7 +24,6 @@ abstract class BaseOfferForm extends BaseFormDoctrine
'is_delete' => new sfWidgetFormInputCheckbox(array(), array("required" => true)),
'is_wholesale' => new sfWidgetFormInputCheckbox(array(), array("required" => true)),
'sort' => new sfWidgetFormInputText(array(), array("size" => 8, "maxlength" => 8)),
'discount_available' => new sfWidgetFormInputCheckbox(array(), array()),
'created_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
'updated_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
));
......@@ -39,7 +38,6 @@ abstract class BaseOfferForm extends BaseFormDoctrine
'is_delete' => new sfValidatorBoolean(array('required' => false)),
'is_wholesale' => new sfValidatorBoolean(array('required' => false)),
'sort' => new sfValidatorInteger(array('required' => false)),
'discount_available' => new sfValidatorBoolean(array('required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
......
......@@ -22,6 +22,9 @@ class wwwBasketOrderForm extends BaseBasketOrderForm
$this->validatorSchema['delivery_type'] = new sfValidatorChoice(array('choices' => array(0 => 'Самовывоз', 1 => 'Доставка по адресу'), 'required' => true));
$this->validatorSchema['phone'] = new sfValidatorString(array('max_length' => 24, 'required' => true));
$this->validatorSchema['phone'] = new sfValidatorAnd(array(
new sfValidatorNumber(array('required' => true)),
new sfValidatorString(array('max_length' => 24, 'required' => true))
));
}
}
<?php
/**
* Discount
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @package sf
* @subpackage model
* @author Atma
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
class Discount extends BaseDiscount
{
public function save(Doctrine_Connection $conn = null) {
$save = parent::save($conn);
if ($this->getUrl() == '') {
$rand = Page::generate_rand_string(20);
$this->setUrl($rand);
}
return parent::save($conn);
}
}
<?php
/**
* DiscountPhone
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @package sf
* @subpackage model
* @author Atma
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
class DiscountPhone extends BaseDiscountPhone
{
}
<?php
class DiscountPhoneTable extends Doctrine_Table
{
public static function getInstance()
{
return Doctrine_Core::getTable('DiscountPhone');
}
}
\ No newline at end of file
<?php
class DiscountTable extends Doctrine_Table
{
public static function getInstance()
{
return Doctrine_Core::getTable('Discount');
}
}
\ No newline at end of file
......@@ -17,7 +17,6 @@
* @property boolean $is_confirm_admin
* @property boolean $is_payed
* @property boolean $is_given
* @property DiscountPhone $DiscountPhone
* @property Doctrine_Collection $Basket
*
* @method string getUsername() Returns the current record's "username" value
......@@ -32,7 +31,6 @@
* @method boolean getIsConfirmAdmin() Returns the current record's "is_confirm_admin" value
* @method boolean getIsPayed() Returns the current record's "is_payed" value
* @method boolean getIsGiven() Returns the current record's "is_given" value
* @method DiscountPhone getDiscountPhone() Returns the current record's "DiscountPhone" value
* @method Doctrine_Collection getBasket() Returns the current record's "Basket" collection
* @method BasketOrder setUsername() Sets the current record's "username" value
* @method BasketOrder setPhone() Sets the current record's "phone" value
......@@ -46,7 +44,6 @@
* @method BasketOrder setIsConfirmAdmin() Sets the current record's "is_confirm_admin" value
* @method BasketOrder setIsPayed() Sets the current record's "is_payed" value
* @method BasketOrder setIsGiven() Sets the current record's "is_given" value
* @method BasketOrder setDiscountPhone() Sets the current record's "DiscountPhone" value
* @method BasketOrder setBasket() Sets the current record's "Basket" collection
*
* @package sf
......@@ -129,11 +126,6 @@ abstract class BaseBasketOrder extends sfDoctrineRecord
public function setUp()
{
parent::setUp();
$this->hasOne('DiscountPhone', array(
'local' => 'id',
'foreign' => 'order_id',
'onDelete' => 'SET NULL'));
$this->hasMany('Basket', array(
'local' => 'id',
'foreign' => 'basket_order_id'));
......
<?php
/**
* BaseDiscount
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @property string $title
* @property string $utm
* @property string $comment
* @property string $url
* @property Doctrine_Collection $DiscountPhone
*
* @method string getTitle() Returns the current record's "title" value
* @method string getUtm() Returns the current record's "utm" value
* @method string getComment() Returns the current record's "comment" value
* @method string getUrl() Returns the current record's "url" value
* @method Doctrine_Collection getDiscountPhone() Returns the current record's "DiscountPhone" collection
* @method Discount setTitle() Sets the current record's "title" value
* @method Discount setUtm() Sets the current record's "utm" value
* @method Discount setComment() Sets the current record's "comment" value
* @method Discount setUrl() Sets the current record's "url" value
* @method Discount setDiscountPhone() Sets the current record's "DiscountPhone" collection
*
* @package sf
* @subpackage model
* @author Atma
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
abstract class BaseDiscount extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('discount');
$this->hasColumn('title', 'string', 255, array(
'type' => 'string',
'notnull' => true,
'length' => 255,
));
$this->hasColumn('utm', 'string', 255, array(
'type' => 'string',
'notnull' => true,
'length' => 255,
));
$this->hasColumn('comment', 'string', 1000, array(
'type' => 'string',
'notnull' => false,
'length' => 1000,
));
$this->hasColumn('url', 'string', 20, array(
'type' => 'string',
'length' => 20,
));
}
public function setUp()
{
parent::setUp();
$this->hasMany('DiscountPhone', array(
'local' => 'id',
'foreign' => 'discount_id'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
}
\ No newline at end of file
<?php
/**
* BaseDiscountPhone
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @property string $phone
* @property integer $discount_id
* @property string $order_id
* @property integer $active_discount
* @property BasketOrder $BasketOrder
* @property Discount $Discount
*
* @method string getPhone() Returns the current record's "phone" value
* @method integer getDiscountId() Returns the current record's "discount_id" value
* @method string getOrderId() Returns the current record's "order_id" value
* @method integer getActiveDiscount() Returns the current record's "active_discount" value
* @method BasketOrder getBasketOrder() Returns the current record's "BasketOrder" value
* @method Discount getDiscount() Returns the current record's "Discount" value
* @method DiscountPhone setPhone() Sets the current record's "phone" value
* @method DiscountPhone setDiscountId() Sets the current record's "discount_id" value
* @method DiscountPhone setOrderId() Sets the current record's "order_id" value
* @method DiscountPhone setActiveDiscount() Sets the current record's "active_discount" value
* @method DiscountPhone setBasketOrder() Sets the current record's "BasketOrder" value
* @method DiscountPhone setDiscount() Sets the current record's "Discount" value
*
* @package sf
* @subpackage model
* @author Atma
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
abstract class BaseDiscountPhone extends sfDoctrineRecord
{
public function setTableDefinition()
{
$this->setTableName('discount_phone');
$this->hasColumn('phone', 'string', 20, array(
'type' => 'string',
'notnull' => true,
'length' => 20,
));
$this->hasColumn('discount_id', 'integer', null, array(
'type' => 'integer',
'notnull' => true,
));
$this->hasColumn('order_id', 'string', 255, array(
'type' => 'string',
'notnull' => false,
'length' => 255,
));
$this->hasColumn('active_discount', 'integer', null, array(
'type' => 'integer',
'notnull' => true,
'default' => 3,
));
}
public function setUp()
{
parent::setUp();
$this->hasOne('BasketOrder', array(
'local' => 'order_id',
'foreign' => 'id',
'onDelete' => 'SET NULL'));
$this->hasOne('Discount', array(
'local' => 'discount_id',
'foreign' => 'id',
'onDelete' => 'CASCADE'));
$timestampable0 = new Doctrine_Template_Timestampable();
$this->actAs($timestampable0);
}
}
\ No newline at end of file
......@@ -15,7 +15,6 @@
* @property boolean $is_delete
* @property boolean $is_wholesale
* @property integer $sort
* @property boolean $discount_available
* @property Product $Product
* @property Doctrine_Collection $BasketOffer
*
......@@ -29,7 +28,6 @@
* @method boolean getIsDelete() Returns the current record's "is_delete" value
* @method boolean getIsWholesale() Returns the current record's "is_wholesale" value
* @method integer getSort() Returns the current record's "sort" value
* @method boolean getDiscountAvailable() Returns the current record's "discount_available" value
* @method Product getProduct() Returns the current record's "Product" value
* @method Doctrine_Collection getBasketOffer() Returns the current record's "BasketOffer" collection
* @method Offer setInnerId() Sets the current record's "inner_id" value
......@@ -42,7 +40,6 @@
* @method Offer setIsDelete() Sets the current record's "is_delete" value
* @method Offer setIsWholesale() Sets the current record's "is_wholesale" value
* @method Offer setSort() Sets the current record's "sort" value
* @method Offer setDiscountAvailable() Sets the current record's "discount_available" value
* @method Offer setProduct() Sets the current record's "Product" value
* @method Offer setBasketOffer() Sets the current record's "BasketOffer" collection
*
......@@ -103,10 +100,6 @@ abstract class BaseOffer extends sfDoctrineRecord
'type' => 'integer',
'default' => 0,
));
$this->hasColumn('discount_available', 'boolean', null, array(
'type' => 'boolean',
'default' => false,
));
}
public function setUp()
......
......@@ -222,19 +222,16 @@ class exchangeDeleteimageTask extends sfBaseTask
}
$error = array();
$countDel = 0;
if (count($allImageInDir) > 0 ) {
foreach ($allImageInDir as $item) {
if (file_exists($item)) {
chmod($item, 0777);
unlink($item);
$countDel++;
}else {
$error[] = 'file not found:' . $item;
}
foreach ($allImageInDir as $item) {
if (file_exists($item)) {
chmod($item, 0777);
unlink($item);
$countDel++;
}else {
$error[] = 'file not found:' . $item;
}
}
print_r($allImageInDir);
$this->log('Count delete image: ' . $countDel);
$this->log('Image delete done: [' . round((microtime(true) - $time_start) * 1000) . ' ms]');
......
<?php
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/discount/index')->
with('request')->begin()->
isParameter('module', 'discount')->
isParameter('action', 'index')->
end()->
with('response')->begin()->
isStatusCode(200)->
checkElement('body', '!/This is a temporary page/')->
end()
;
<?php
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/discount_phone/index')->
with('request')->begin()->
isParameter('module', 'discount_phone')->
isParameter('action', 'index')->
end()->
with('response')->begin()->
isStatusCode(200)->
checkElement('body', '!/This is a temporary page/')->
end()
;
<?php
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/discount/index')->
with('request')->begin()->
isParameter('module', 'discount')->
isParameter('action', 'index')->
end()->
with('response')->begin()->
isStatusCode(200)->
checkElement('body', '!/This is a temporary page/')->
end()
;
<?php
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('arm', 'dev', true);
$configuration = ProjectConfiguration::getApplicationConfiguration('arm', 'prod', false);
sfContext::createInstance($configuration)->dispatch();
......@@ -399,41 +399,6 @@
font-family: 'robotoregular';
}
.product_offer table tr.discount::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
left: -5px;
top: 5px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/percent_colored.svg);
}
.header_mobile.mobile.discount::after {
content: '';
width: 61px;
height: 137px;
position: absolute;
background-repeat: no-repeat;
background-size: contain;
right: 6px;
top: 96px;
z-index: -1;
}
.header_mobile.mobile.discount.d3::after {
background-image: url(/i/d3.svg);
}
.header_mobile.mobile.discount.d5::after {
background-image: url(/i/d5.svg);
}
.header_mobile.mobile.discount.d7::after {
background-image: url(/i/d7.svg);
}
.header_mobile.mobile.discount.d10::after {
background-image: url(/i/d10.svg);
}
.product__advantages__info__link {
font-size: 20px;
}
......@@ -478,7 +443,7 @@
height: auto;
}
.video {
height: 62vw !important;
height: 62vw;
}
.article_wrap {
......@@ -709,7 +674,6 @@
}
.footer_table_main {
padding: 20px 0 20px;
border-top: 1px solid #ececec;
}
.footer_table_main__policy {
font-style: normal;
......@@ -767,62 +731,8 @@
max-height: 10000px;
}
.overlay_discount__item {
height: 100%;
max-height: 510px;
}
.image_discount {
display: none;
}
.form_discount {
width: 100%;
max-height: 510px;
height: 100%;
}
.discount_available {
left: 13px !important;
}
.discount_available.show .discount_available_desc{
max-height: 100px;
padding: 5px 5px;
width: 100%;
}
.discount_available.show .discount_available_title {
border-radius: 0 0 4px 4px;
}
.discount_available.show:before {
background-image: url(/i/white_angle.svg);
transition: all 0s ease-in-out;
}
.basket_refresh {
position: relative;
overflow: visible;
z-index: 1;
}
.discount_form__title {
font-size: 21px;
}
}
@media (min-width: 650px){
.catalog_category_child_item:hover .discount_available_desc{
max-height: 100px;
padding: 5px 5px;
width: 100%;
}
.catalog_category_child_item:hover .discount_available_title {
border-radius: 0 0 4px 4px;
}
.catalog_category_child_item:hover .discount_available:before {
background-image: url(/i/white_angle.svg);
transition: all 0s ease-in-out;
}
}
@media (min-width: 1100px) and (max-width: 1200px) {
.top_menu__elem{
......
......@@ -230,56 +230,22 @@
margin-bottom: 5px;
margin-top: 8px;
}
.basket_btn::before {
content: '';
background-image: url(/i/basket.svg);
width: 23px;
height: 25px;
display: inline-block;
position: absolute;
top: 50%;
left: 20px;
margin-top: -12px;
background-size: cover;
background-position: 100% 0;
transition: background-image 0.1s ease-in-out;
}
.basket_btn:not(.basket_btn_disabled):hover::before {
background-image: url(/i/basket-green.svg);
}
.top_right.discount::after {
width: 65px;
height: 148px;
background-size: contain;
background-repeat: no-repeat;
content: "";
position: absolute;
top: 75px;
right: 0;
z-index: -1;
}
.top_right.discount.d3::after {
background-image: url(/i/d3.svg);
}
.top_right.discount.d5::after {
background-image: url(/i/d5.svg);
}
.top_right.discount.d7::after {
background-image: url(/i/d7.svg);
}
.top_right.discount.d10::after {
background-image: url(/i/d10.svg);
}
.top_right.discount_basket::after {
.basket_btn::before {
content: '';
width: 30px;
height: 30px;
background-size: contain;
background-repeat: no-repeat;
background-image: url(/i/basket.svg);
width: 23px;
height: 25px;
display: inline-block;
position: absolute;
top: 5px;
right: -10px;
background-image: url(/i/percent_white.svg);
top: 50%;
left: 20px;
margin-top: -12px;
background-size: cover;
background-position: 100% 0;
transition: background-image 0.1s ease-in-out;
}
.basket_btn:not(.basket_btn_disabled):hover::before {
background-image: url(/i/basket-green.svg);
}
.swicher_lang {
background-image: url(/i/switch-lang.svg);
......@@ -601,18 +567,7 @@
color: var(--green-color-text);
}
.product_offer table td {
padding: 12px 0 11px 10px;
}
.product_offer table tr.discount::after {
content: '';
position: absolute;
width: 16px;
height: 16px;
left: -20px;
top: 5px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/percent_colored.svg);
padding: 12px 10px 11px;
}
.product_offer table td:first-child {
padding-left: 0;
......@@ -773,58 +728,6 @@
display: inline-block;
margin: 0 8px 30px;
}
.catalog_category_child_item.discount {
}
.catalog_category_child_item .discount_available {
position: absolute;
color: #FFFFFF;
width: 150px;
left: 21px;
top: -5px;
z-index: 100;
}
.discount_available .discount_available_desc {
background-color: #FFFFFF;
color: #6a6a6a;
overflow: hidden;
max-height: 0px;
font-family: 'robotolight';
font-size: 12px;
padding: 0 5px;
box-shadow: 0 0 14px rgba(0,0,0,0.2);
transition: all 0.3s ease-in-out;
}
.discount_available .discount_available_title {
background-color: #fb8100;
color: #FFFFFF;
width: 150px;
border-radius: 0 4px 4px 4px;
padding: 7px 7px 7px 10px;
z-index: 100;
text-transform: uppercase;
font-family: 'robotobold';
font-size: 11px;
}
.catalog_category_child_item .discount_available::before {
content: '';
width: 14px;
height: 6px;
position: absolute;
background-size: contain;
background-repeat: no-repeat;
background-image: url(/i/orange_angle.svg);
left: -12px;
top: 0;
transition: all 0.48s ease-in-out;
}
.lending_product_area .catalog_category_child_item:nth-child(n+9) {
display: none;
}
......@@ -1010,7 +913,6 @@
background-image: url(/i/combined-shape-minus.svg);
outline: none;
padding: 0;
border-radius: 0;
}
.product_counter_val {
width: 45px;
......@@ -1031,7 +933,6 @@
height: 29px;
vertical-align: top;
float: left;
border-radius: 0px !important;
}
.product_counter_plus {
width: 23px;
......@@ -1062,7 +963,6 @@
background-image: url(/i/combined-shape-plus.svg);
outline: none;
padding: 0;
border-radius: 0;
}
.product_price_trigger {
padding: 0;
......@@ -1825,18 +1725,6 @@ label.custom_checkbox input:checked + .after_checkbox {
background-position: center;
border: 1px solid #ececec;
}
.basket_img.discount::after {
content: '';
position: absolute;
width: 30px;
height: 30px;
top: -10px;
right: -10px;
background-image: url(/i/percent_colored.svg);
background-repeat: no-repeat;
background-size: contain;
z-index: 100;
}
.basket_img__item{
width:100%;
height:100%;
......@@ -1947,8 +1835,7 @@ label.custom_checkbox input:checked + .after_checkbox {
.basket_get{
margin-bottom: 40px;
}
.basket_buyer__item {
position: relative;
.basket_buyer__item{
display: inline-block;
vertical-align: top;
}
......@@ -2273,6 +2160,7 @@ h2{
display: inline-block;
text-align: center;
vertical-align: middle;
width: calc(100% - 5px);
}
.review_file_overlay__item{
padding:20px;
......@@ -2352,13 +2240,11 @@ h2{
.search_active .search_overlay{
display: block;
}
.search_active .body_wrapper,
.overlay_discount_active .body_wrapper {
.search_active .body_wrapper{
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
filter: blur(10px);
opacity: 0.4;
transition: all 0.3s ease-in-out;
}
.search_overlay__line__btn{
margin-bottom: 0;
......@@ -2801,160 +2687,4 @@ h2{
.fotorama__stage__frame {
border: 1px solid #ececec !important;
}
.discount_form__checkbox {
max-width: 325px
}
.discount_form__checkbox label {
text-align: left;
}
.discount_form{
background: #fff;
margin: 0 auto;
border-radius: 0 2px 2px 0;
width: 100%;
max-width:400px;
margin: 0;
}
.discount_form input[type="text"]{
width:100%;
}
.discount_form__inp_wrap{
margin-bottom: 25px;
text-align:left;
}
.discount_form_done__title,
.discount_form_done .discount_form__process{
display:none;
}
.discount_form_done .discount_form_done__title{
display:block;
font-size: 20px;
color: var(--green-color-text);
font-family: 'robotolight';
}
.discount_form_done__title__base{
font-size:30px;
}
.discount_form__title{
font-size: 31px;
padding-bottom: 15px;
color: var(--green-color-text);
font-family: 'robotoregular';
}
.discount_form_head_text {
font-size: 18px;
font-family: 'robotoregular';
color: var(--green-color-text);
text-align: left;
padding: 25px 0 5px 0;
}
.discount_form_text {
font-size: 15px;
font-family: 'robotoregular';
text-align: left;
padding-bottom: 20px;
}
.discount_form__submit{
font-size: 15px;
font-size: 15px;
padding: 9px 23px;
cursor: pointer;
width: 100%;
}
.overlay_discount_active{
position: fixed;
background-image: url(/i/drops.png);
background-repeat: repeat;
background-size: cover;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1001;
text-align: center;
vertical-align: middle;
overflow-y: scroll;
}
.review_file_overlay{
z-index: 1001;
}
.overlay_discount{
display:none;
z-index:1002;
}
.overlay_discount_active {
display:block;
}
.video_overlay__close:hover{
opacity: 1;
}
.overlay_discount:after{
content: '';
display: inline-block;
height: 100%;
width: 0;
vertical-align: middle;
}
.overlay_discount__item{
display: inline-block;
text-align: center;
vertical-align: middle;
box-shadow: 0 0 35px rgba(0,0,0,0.3);
max-height: 400px;
}
.discount_error {
background-color: #FFFFFF;
padding: 35px 35px;
margin: 0 auto;
border-radius: 2px;
display: inline-block;
max-width: 400px;
width: 100%;
}
.image_discount {
width: 350px;
height: 400px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/discount-image.png);
display: inline-block;
border-radius: 2px 0 0 2px;
vertical-align: top;
}
.form_discount {
padding: 35px 40px;
width: 490px;
height: 100%;
vertical-align: top;
display: inline-block;
background-color: #FFFFFF;
border-radius: 0 2px 2px 0;
vertical-align: top;
max-height: 400px;
}
.phone_info {
position: absolute;
display: inherit;
margin-bottom: 10px;
font-size: 11px;
font-family: 'robotolight', Arial;
font-style: italic;
top: -17px;
left: 0;
}
.basket_discount {
display: block;
color: #979797;
font-size: 15px !important;
text-align: right;
position: absolute;
top: -15px;
right: 0;
}
.basket_item {
display: block;
text-align: right;
color: #074611;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="11px" height="5px" viewBox="0 0 11 5" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>Orange angle</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="discount/1-copy">
<g id="Orange-angle">
<path d="M5,1.77635684e-15 L5.19999981,0 C7.96142356,-5.07265313e-16 10.1999998,2.23857625 10.1999998,5 L0,5 C-3.38176876e-16,2.23857625 2.23857625,2.28362215e-15 5,1.77635684e-15 Z" id="Rectangle-4" fill="#AD5A05"></path>
<path d="M11,-1.13686838e-13 L11,5 L10.1999998,5 C10.1999998,2.23857625 7.96142356,-1.08865033e-13 5.19999981,-1.13686838e-13 L11,-1.13686838e-13 Z" id="Combined-Shape" fill="#FE8100"></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>icon/%_2 color</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="icon/%_2-color" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M10,4 L10,4 C13.3137085,4 16,6.6862915 16,10 L16,10 C16,13.3137085 13.3137085,16 10,16 L10,16 C6.6862915,16 4,13.3137085 4,10 L4,10 C4,6.6862915 6.6862915,4 10,4 Z" id="Rectangle" fill="#FFFFFF"></path>
<path d="M10,20 C15.5228475,20 20,15.5228475 20,10 C20,4.4771525 15.5228475,0 10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 Z M10.5665,12.086 C10.5665,11.7999986 10.6196661,11.5341679 10.726,11.2885 C10.8323339,11.0428321 10.9789991,10.8265009 11.166,10.6395 C11.3530009,10.4524991 11.5693321,10.3058339 11.815,10.1995 C12.0606679,10.0931661 12.3264986,10.04 12.6125,10.04 C12.8985014,10.04 13.1643321,10.0931661 13.41,10.1995 C13.6556679,10.3058339 13.8719991,10.4524991 14.059,10.6395 C14.2460009,10.8265009 14.3926661,11.0428321 14.499,11.2885 C14.6053339,11.5341679 14.6585,11.7999986 14.6585,12.086 C14.6585,12.3720014 14.6053339,12.6378321 14.499,12.8835 C14.3926661,13.1291679 14.2460009,13.3454991 14.059,13.5325 C13.8719991,13.7195009 13.6556679,13.8661661 13.41,13.9725 C13.1643321,14.0788339 12.8985014,14.132 12.6125,14.132 C12.3264986,14.132 12.0606679,14.0788339 11.815,13.9725 C11.5693321,13.8661661 11.3530009,13.7195009 11.166,13.5325 C10.9789991,13.3454991 10.8323339,13.1291679 10.726,12.8835 C10.6196661,12.6378321 10.5665,12.3720014 10.5665,12.086 Z M13.6025,12.086 C13.6025,11.8073319 13.5071676,11.5726676 13.3165,11.382 C13.1258324,11.1913324 12.8911681,11.096 12.6125,11.096 C12.3338319,11.096 12.0991676,11.1913324 11.9085,11.382 C11.7178324,11.5726676 11.6225,11.8073319 11.6225,12.086 C11.6225,12.3646681 11.7178324,12.5993324 11.9085,12.79 C12.0991676,12.9806676 12.3338319,13.076 12.6125,13.076 C12.8911681,13.076 13.1258324,12.9806676 13.3165,12.79 C13.5071676,12.5993324 13.6025,12.3646681 13.6025,12.086 Z M5.3415,8.126 C5.3415,7.83999857 5.39466614,7.57416789 5.501,7.3285 C5.60733387,7.0828321 5.75399907,6.86650093 5.941,6.6795 C6.12800094,6.49249906 6.34433211,6.34583386 6.59,6.2395 C6.8356679,6.13316613 7.10149857,6.08 7.3875,6.08 C7.67350143,6.08 7.93933211,6.13316613 8.185,6.2395 C8.4306679,6.34583386 8.64699907,6.49249906 8.834,6.6795 C9.02100094,6.86650093 9.16766614,7.0828321 9.274,7.3285 C9.38033387,7.57416789 9.4335,7.83999857 9.4335,8.126 C9.4335,8.41200143 9.38033387,8.6778321 9.274,8.9235 C9.16766614,9.16916789 9.02100094,9.38549906 8.834,9.5725 C8.64699907,9.75950093 8.4306679,9.90616613 8.185,10.0125 C7.93933211,10.1188339 7.67350143,10.172 7.3875,10.172 C7.10149857,10.172 6.8356679,10.1188339 6.59,10.0125 C6.34433211,9.90616613 6.12800094,9.75950093 5.941,9.5725 C5.75399907,9.38549906 5.60733387,9.16916789 5.501,8.9235 C5.39466614,8.6778321 5.3415,8.41200143 5.3415,8.126 Z M8.3775,8.126 C8.3775,7.84733194 8.28216762,7.61266762 8.0915,7.422 C7.90083238,7.23133238 7.66616806,7.136 7.3875,7.136 C7.10883194,7.136 6.87416762,7.23133238 6.6835,7.422 C6.49283238,7.61266762 6.3975,7.84733194 6.3975,8.126 C6.3975,8.40466806 6.49283238,8.63933238 6.6835,8.83 C6.87416762,9.02066762 7.10883194,9.116 7.3875,9.116 C7.66616806,9.116 7.90083238,9.02066762 8.0915,8.83 C8.28216762,8.63933238 8.3775,8.40466806 8.3775,8.126 Z M11.8425,5.86 L12.7555,6.278 L8.1795,14.352 L7.2665,13.934 L11.8425,5.86 Z" id="Oval-2" fill="#FE6E01"></path>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>%</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="New" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="700.1_Basket" transform="translate(-1530.000000, -57.000000)">
<g id="%" transform="translate(1530.000000, 57.000000)">
<path d="M12,24 C5.3833125,24 0,18.6166875 0,12 C0,5.3833125 5.3833125,0 12,0 C18.6166875,0 24,5.3833125 24,12 C24,18.6166875 18.6166875,24 12,24 Z" id="Shape" fill="#1B5E20" fill-rule="nonzero"></path>
<path d="M12,22 C6.48609375,22 2,17.5139062 2,12 C2,6.48609375 6.48609375,2 12,2 C17.5139062,2 22,6.48609375 22,12 C22,17.5139062 17.5139062,22 12,22 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
<g id="icon/%_2-copy" transform="translate(2.000000, 2.000000)" fill="#FFFFFF">
<path d="M10,20 C15.5228475,20 20,15.5228475 20,10 C20,4.4771525 15.5228475,0 10,0 C4.4771525,0 0,4.4771525 0,10 C0,15.5228475 4.4771525,20 10,20 Z M10.5995,11.943 C10.5995,11.6423318 10.6563328,11.3600013 10.77,11.096 C10.8836672,10.8319987 11.0376657,10.601001 11.232,10.403 C11.4263343,10.204999 11.6554987,10.0491672 11.9195,9.9355 C12.1835013,9.82183276 12.4658318,9.765 12.7665,9.765 C13.0671682,9.765 13.3494987,9.82183276 13.6135,9.9355 C13.8775013,10.0491672 14.1066657,10.204999 14.301,10.403 C14.4953343,10.601001 14.6493328,10.8319987 14.763,11.096 C14.8766672,11.3600013 14.9335,11.6423318 14.9335,11.943 C14.9335,12.2436682 14.8766672,12.527832 14.763,12.7955 C14.6493328,13.063168 14.4953343,13.295999 14.301,13.494 C14.1066657,13.692001 13.8775013,13.8478328 13.6135,13.9615 C13.3494987,14.0751672 13.0671682,14.132 12.7665,14.132 C12.4658318,14.132 12.1835013,14.0751672 11.9195,13.9615 C11.6554987,13.8478328 11.4263343,13.692001 11.232,13.494 C11.0376657,13.295999 10.8836672,13.063168 10.77,12.7955 C10.6563328,12.527832 10.5995,12.2436682 10.5995,11.943 Z M13.8115,11.943 C13.8115,11.6496652 13.7106677,11.4003344 13.509,11.195 C13.3073323,10.9896656 13.0598348,10.887 12.7665,10.887 C12.4731652,10.887 12.2256677,10.9896656 12.024,11.195 C11.8223323,11.4003344 11.7215,11.6496652 11.7215,11.943 C11.7215,12.2436682 11.8223323,12.4966656 12.024,12.702 C12.2256677,12.9073344 12.4731652,13.01 12.7665,13.01 C13.0598348,13.01 13.3073323,12.9073344 13.509,12.702 C13.7106677,12.4966656 13.8115,12.2436682 13.8115,11.943 Z M5.0665,8.258 C5.0665,7.95733183 5.12333277,7.67500132 5.237,7.411 C5.35066724,7.14699868 5.5046657,6.91600099 5.699,6.718 C5.89333431,6.51999901 6.12249868,6.36416723 6.3865,6.2505 C6.65050132,6.13683276 6.93283183,6.08 7.2335,6.08 C7.53416817,6.08 7.81649868,6.13683276 8.0805,6.2505 C8.34450132,6.36416723 8.5736657,6.51999901 8.768,6.718 C8.96233431,6.91600099 9.11633277,7.14699868 9.23,7.411 C9.34366724,7.67500132 9.4005,7.95733183 9.4005,8.258 C9.4005,8.55866817 9.34366724,8.84099868 9.23,9.105 C9.11633277,9.36900132 8.96233431,9.59999901 8.768,9.798 C8.5736657,9.99600099 8.34450132,10.1518328 8.0805,10.2655 C7.81649868,10.3791672 7.53416817,10.436 7.2335,10.436 C6.93283183,10.436 6.65050132,10.3791672 6.3865,10.2655 C6.12249868,10.1518328 5.89333431,9.99600099 5.699,9.798 C5.5046657,9.59999901 5.35066724,9.36900132 5.237,9.105 C5.12333277,8.84099868 5.0665,8.55866817 5.0665,8.258 Z M8.2785,8.258 C8.2785,7.9646652 8.17766768,7.71533436 7.976,7.51 C7.77433233,7.30466564 7.5268348,7.202 7.2335,7.202 C6.9401652,7.202 6.69266768,7.30466564 6.491,7.51 C6.28933233,7.71533436 6.1885,7.9646652 6.1885,8.258 C6.1885,8.5513348 6.28933233,8.80066564 6.491,9.006 C6.69266768,9.21133436 6.9401652,9.314 7.2335,9.314 C7.5268348,9.314 7.77433233,9.21133436 7.976,9.006 C8.17766768,8.80066564 8.2785,8.5513348 8.2785,8.258 Z M11.7765,5.86 L12.7005,6.377 L8.1575,14.352 L7.3215,13.879 L11.7765,5.86 Z" id="Oval-2"></path>
</g>
<path d="M12.533,14.083 C12.533,13.7823318 12.5898328,13.5000013 12.7035,13.236 C12.8171672,12.9719987 12.9711657,12.741001 13.1655,12.543 C13.3598343,12.344999 13.5889987,12.1891672 13.853,12.0755 C14.1170013,11.9618328 14.3993318,11.905 14.7,11.905 C15.0006682,11.905 15.2829987,11.9618328 15.547,12.0755 C15.8110013,12.1891672 16.0401657,12.344999 16.2345,12.543 C16.4288343,12.741001 16.5828328,12.9719987 16.6965,13.236 C16.8101672,13.5000013 16.867,13.7823318 16.867,14.083 C16.867,14.3836682 16.8101672,14.667832 16.6965,14.9355 C16.5828328,15.203168 16.4288343,15.435999 16.2345,15.634 C16.0401657,15.832001 15.8110013,15.9878328 15.547,16.1015 C15.2829987,16.2151672 15.0006682,16.272 14.7,16.272 C14.3993318,16.272 14.1170013,16.2151672 13.853,16.1015 C13.5889987,15.9878328 13.3598343,15.832001 13.1655,15.634 C12.9711657,15.435999 12.8171672,15.203168 12.7035,14.9355 C12.5898328,14.667832 12.533,14.3836682 12.533,14.083 Z M15.745,14.083 C15.745,13.7896652 15.6441677,13.5403344 15.4425,13.335 C15.2408323,13.1296656 14.9933348,13.027 14.7,13.027 C14.4066652,13.027 14.1591677,13.1296656 13.9575,13.335 C13.7558323,13.5403344 13.655,13.7896652 13.655,14.083 C13.655,14.3836682 13.7558323,14.6366656 13.9575,14.842 C14.1591677,15.0473344 14.4066652,15.15 14.7,15.15 C14.9933348,15.15 15.2408323,15.0473344 15.4425,14.842 C15.6441677,14.6366656 15.745,14.3836682 15.745,14.083 Z M7,10.398 C7,10.0973318 7.05683277,9.81500132 7.1705,9.551 C7.28416723,9.28699868 7.43816569,9.05600099 7.6325,8.858 C7.82683431,8.65999901 8.05599868,8.50416723 8.32,8.3905 C8.58400132,8.27683276 8.86633183,8.22 9.167,8.22 C9.46766817,8.22 9.74999868,8.27683276 10.014,8.3905 C10.2780013,8.50416723 10.5071657,8.65999901 10.7015,8.858 C10.8958343,9.05600099 11.0498328,9.28699868 11.1635,9.551 C11.2771672,9.81500132 11.334,10.0973318 11.334,10.398 C11.334,10.6986682 11.2771672,10.9809987 11.1635,11.245 C11.0498328,11.5090013 10.8958343,11.739999 10.7015,11.938 C10.5071657,12.136001 10.2780013,12.2918328 10.014,12.4055 C9.74999868,12.5191672 9.46766817,12.576 9.167,12.576 C8.86633183,12.576 8.58400132,12.5191672 8.32,12.4055 C8.05599868,12.2918328 7.82683431,12.136001 7.6325,11.938 C7.43816569,11.739999 7.28416723,11.5090013 7.1705,11.245 C7.05683277,10.9809987 7,10.6986682 7,10.398 Z M10.212,10.398 C10.212,10.1046652 10.1111677,9.85533436 9.9095,9.65 C9.70783232,9.44466564 9.4603348,9.342 9.167,9.342 C8.8736652,9.342 8.62616767,9.44466564 8.4245,9.65 C8.22283232,9.85533436 8.122,10.1046652 8.122,10.398 C8.122,10.6913348 8.22283232,10.9406656 8.4245,11.146 C8.62616767,11.3513344 8.8736652,11.454 9.167,11.454 C9.4603348,11.454 9.70783232,11.3513344 9.9095,11.146 C10.1111677,10.9406656 10.212,10.6913348 10.212,10.398 Z M13.71,8 L14.634,8.517 L10.091,16.492 L9.255,16.019 L13.71,8 Z" id="Combined-Shape" fill="#1B5E20"></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="11px" height="5px" viewBox="0 0 11 5" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>White angle</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="discount/1-copy" transform="translate(0.000000, -10.000000)">
<g id="White-angle" transform="translate(0.000000, 10.000000)">
<path d="M5,1.77635684e-15 L5.19999981,0 C7.96142356,-5.07265313e-16 10.1999998,2.23857625 10.1999998,5 L0,5 C-3.38176876e-16,2.23857625 2.23857625,2.28362215e-15 5,1.77635684e-15 Z" id="Rectangle-4" fill="#AD5A05"></path>
<path d="M11,-1.13686838e-13 L11,5 L10.1999998,5 C10.1999998,2.23857625 7.96142356,-1.08865033e-13 5.19999981,-1.13686838e-13 L11,-1.13686838e-13 Z" id="Combined-Shape" fill="#FFFFFF"></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
<?php
require_once(dirname(__FILE__) . '/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('www', 'dev', true);
$configuration = ProjectConfiguration::getApplicationConfiguration('www', 'prod', true);
sfContext::createInstance($configuration)->dispatch();
......@@ -2663,47 +2663,6 @@ var imgUpload = {
}
};
var discount = {
submit: function(form){
form = $(form);
$.post(form.attr('action'), form.serialize(), function (html) {
$('.overlay_discount__item').html(html);
if ($(window).width() < 650) {
$('.header_mobile').addClass('discount');
$('.header_mobile').addClass('d3');
} else {
$($('.top_right')[1]).addClass('discount');
$($('.top_right')[1]).addClass('d3');
}
});
},
open:function (_this) {
if (_this)
{
$('#discount_offer').show();
$('#discount').hide();
offer_id = $(_this).attr('data-offer-id');
$('#discount_offer_id').val(offer_id);
}else
{
$('#discount').show();
$('#discount_offer').hide();
$('#discount_offer_id').val('');
}
var discountForm = $('.discount_form');
discountForm.removeClass('discount_form_done');
$('.overlay_discount').addClass('overlay_discount_active');
$('body').addClass('scroll_hidden');
$('body').addClass('overlay_discount_active');
discountForm.find('input[type="text"]').eq(0).focus();
},
close: function(){
$('.overlay_discount').removeClass('overlay_discount_active');
$('body').removeClass('scroll_hidden');
$('body').removeClass('overlay_discount_active');
}
};
var callback = {
submit: function(form){
form = $(form);
......@@ -2849,24 +2808,9 @@ var form_validator = {
function setUrlHash(hash) {
if ('replaceState' in window.history && window.location.hash !== hash) window.history.replaceState('', '', hash);
}
$(document).ready(function () {
$.ajax({
url: '/check_discount_term/',
dataType: 'json',
type: 'post',
success: function (data) {
if (data.status == 'success' && data.active_discount != 0) {
console.log('123');
if ($(window).width() < 650) {
$('.header_mobile').addClass('discount');
$('.header_mobile').addClass('d' + data.active_discount);
} else {
$($('.top_right')[1]).addClass('discount');
$($('.top_right')[1]).addClass('d' + data.active_discount);
}
}
}
})
//slider.init();
if ($('.phone_mask').length > 0) {
$('.phone_mask').mask("+7 (999) 999-9999");
}
});
User-agent: *
Allow: /i/
Disallow: /js/
Disallow: /css/
Disallow: /a/
User-agent: Googlebot
Allow: /
User-agent: Yandex
Allow: /i/
Disallow: /js/
Disallow: /css/
Disallow: /a/
Host: idivbanu.ru
Sitemap: http://idivbanu.ru/sitemap.xml
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment