Commit b48ef851d58d997de1478e8a4ba63940b25c4c1a
Merge remote-tracking branch 'origin/popup_handler' into popup_evgen
# Conflicts: # src/app/frontend/views/index.php
Showing
7 changed files
with
582 additions
and
1 deletions
Show diff stats
src/app/frontend/controllers/MenuController.php
@@ -1249,4 +1249,35 @@ class MenuController extends \controllers\ControllerBase | @@ -1249,4 +1249,35 @@ class MenuController extends \controllers\ControllerBase | ||
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | /////////////////////////////////////////////////////////////////////////// | 1251 | /////////////////////////////////////////////////////////////////////////// |
1252 | + | ||
1253 | + public function popupAction() { | ||
1254 | + | ||
1255 | + if( $this->request->isPost() ) | ||
1256 | + { | ||
1257 | + $data['name'] = $this->request->getPost('username', 'string', NULL ); | ||
1258 | + $email = $this->request->getPost('email', 'string', NULL ); | ||
1259 | + $data['email'] = filter_var( $email, FILTER_VALIDATE_EMAIL ); | ||
1260 | + | ||
1261 | + if( !empty( $data['name'] ) && !empty( $data['email'] ) ) | ||
1262 | + { | ||
1263 | + $check = $this->models->getSubscribe()->getOneDataByEmail($data['email']); | ||
1264 | + if (!empty($check)) { | ||
1265 | + setcookie("popup", '1', 0, '/'); | ||
1266 | + } | ||
1267 | + elseif( empty($check) && $this->models->getSubscribe()->addData($data) ) { | ||
1268 | + $this->sendmail->sendSubscribe( $data ); | ||
1269 | + | ||
1270 | + setcookie("popup", '1', 0, '/'); | ||
1271 | + | ||
1272 | + return $this->response->redirect([ 'for' => 'homepage', 'language' => $this->lang_name ]); | ||
1273 | + } | ||
1274 | + } | ||
1275 | + } | ||
1276 | + | ||
1277 | + $this->view->setVars([ | ||
1278 | + 'no_robots' => 1 | ||
1279 | + ]); | ||
1280 | + | ||
1281 | + return $this->response->redirect([ 'for' => 'homepage', 'language' => $this->lang_name ]); | ||
1282 | + } | ||
1252 | } | 1283 | } |
1253 | \ No newline at end of file | 1284 | \ No newline at end of file |
src/app/frontend/views/index.php
@@ -255,7 +255,7 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : ''; | @@ -255,7 +255,7 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : ''; | ||
255 | </div> | 255 | </div> |
256 | <div class="text-down"> | 256 | <div class="text-down"> |
257 | <p class="up-text"><?= $t->_("popup-main2")?></p> | 257 | <p class="up-text"><?= $t->_("popup-main2")?></p> |
258 | - <form method="post" class="deliver-form"> | 258 | + <form method="post" class="deliver-form" action="./popup/"> |
259 | <input type="text" name="username" placeholder="<?= $t->_("popup-main3")?>"> | 259 | <input type="text" name="username" placeholder="<?= $t->_("popup-main3")?>"> |
260 | <input type="email" name="email" placeholder="Email"> | 260 | <input type="email" name="email" placeholder="Email"> |
261 | <button type="submit" class="submit-delivery-but"><?= $t->_("popup-main4")?></button> | 261 | <button type="submit" class="submit-delivery-but"><?= $t->_("popup-main4")?></button> |
@@ -266,6 +266,37 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : ''; | @@ -266,6 +266,37 @@ $page_title = isset( $page_title ) && !empty( $page_title ) ? $page_title : ''; | ||
266 | </div> | 266 | </div> |
267 | </div> | 267 | </div> |
268 | 268 | ||
269 | +<script> | ||
270 | + $(document).ready(function(){ | ||
271 | + function getCookie(a) { | ||
272 | + var b = new RegExp(a+'=([^;]){1,}'); | ||
273 | + var c = b.exec(document.cookie); | ||
274 | + if(c) c = c[0].split('='); | ||
275 | + else return false; | ||
276 | + return c[1] ? c[1] : false; | ||
277 | + } | ||
278 | + var cookie = getCookie('popup'); | ||
279 | + if (cookie !== '1') { | ||
280 | + setTimeout(function(){$(".open-delivery-modal").show();},1000); | ||
281 | + } | ||
282 | + else { | ||
283 | + $(".open-delivery-modal").hide(); | ||
284 | + } | ||
285 | + }); | ||
286 | + $(".open-delivery-modal div img").click(function(){ | ||
287 | + $(".delivery-form-par").show(); | ||
288 | + $(".delivery-form-par").animate({opacity: "1"}, 500, function() {}); | ||
289 | + $(".delivery-form-par .popup-main-delivery").animate({opacity: "1",top: "15%"}, 300, function() {}); | ||
290 | + }); | ||
291 | + $(".delivery-form-par .close-white").click(function(){ | ||
292 | + $(".delivery-form-par .popup-main-delivery").animate({opacity: "0",top: "-50%"}, 300, function() {}); | ||
293 | + $(".delivery-form-par").animate({opacity: "0"}, 500, function() {}); | ||
294 | + setTimeout(function(){$(".delivery-form-par").hide();}, 600); | ||
295 | + }); | ||
296 | + $(".modal_close").click(function(){ | ||
297 | + $(".open-delivery-modal").hide(); | ||
298 | + }); | ||
299 | +</script> | ||
269 | <?php | 300 | <?php |
270 | if( !IS_PRODUCTION ) | 301 | if( !IS_PRODUCTION ) |
271 | { | 302 | { |
1 | +<!DOCTYPE HTML> | ||
2 | +<html><head> | ||
3 | + <meta charset="utf-8"> | ||
4 | + <style> | ||
5 | + a, a.img{ | ||
6 | + border:none; | ||
7 | + } | ||
8 | + </style> | ||
9 | +</head> | ||
10 | +<body> | ||
11 | +<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#f0f0f0"><tr><td align="center"> | ||
12 | + <table border="0" cellpadding="0" cellspacing="0" width="100%"> | ||
13 | + <tr> | ||
14 | + <td bgcolor="#67b73e" width="100%" height="30" align="center" valign="top"> | ||
15 | + <table border="0" cellpadding="0" cellspacing="0" width="660"> | ||
16 | + <tr> | ||
17 | + <td align="left" valign="middle" height="30"><a href="http://semena.in.ua/news-actions?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="color:white;font-family:Calibri;font-size:13px;font-style:Italic;">Заманчивые предложения</a></td> | ||
18 | + <td align="right" valign="middle" height="30"><a href="#" style="color:white;font-family:Calibri;font-size:13px;font-style:Italic;">Загрузить картинки</a></td> | ||
19 | + </tr> | ||
20 | + </table> | ||
21 | + </td> | ||
22 | + </tr> | ||
23 | + <tr> | ||
24 | + <td align="center" valign="top" style="background: url('http://semena.in.ua/images/fon_header.png');background-repeat-y: no-repeat;"> | ||
25 | + <table border="0" cellpadding="0" cellspacing="0" width="660" height="157"> | ||
26 | + <tr> | ||
27 | + <td align="center" valign="top"> | ||
28 | + <table border="0" cellpadding="0" cellspacing="0" width="660"> | ||
29 | + <tr><td height="23" valign="top"></td></tr> | ||
30 | + <tr> | ||
31 | + <td width="203px" height="70" align="left" background="http://semena.in.ua/images/logo.png" style="background-position:left 10px;background-repeat:no-repeat;" valign="top"><a href="http://semena.in.ua?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="border:none;"><img src="http://semena.in.ua/images/link.png" border="none" height="50" width="174"></a></td> | ||
32 | + <td width="308" align="center" height="70" background="http://semena.in.ua/images/tel_all.png" style="background-position-y: 7px;background-repeat:no-repeat;"></td> | ||
33 | + <td align="right" valign="top"> | ||
34 | + <table border="0" cellpadding="0" cellspacing="0"> | ||
35 | + <tr> | ||
36 | + <td background="http://semena.in.ua/images/ico-6.png" height="26" style="background-repeat:no-repeat;background-position: left 7px;padding-left: 20px;"><a href="http://semena.in.ua/callback/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="color:#4a4a4a;font-size:13px;font-family:Calibri;font-style:italic;">Обратная связь</a></td> | ||
37 | + </tr> | ||
38 | + <tr> | ||
39 | + <td background="http://semena.in.ua/images/ico-7.png" height="26" style="background-repeat:no-repeat;background-position: left 8px;padding-left: 20px;"><a href="http://semena.in.ua/video/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="color:#4a4a4a;font-size:13px;font-family:Calibri;font-style:italic;">Видеообзоры</a></td> | ||
40 | + </tr> | ||
41 | + </table> | ||
42 | + </td> | ||
43 | + </tr> | ||
44 | + </table> | ||
45 | + </td> | ||
46 | + </tr> | ||
47 | + <tr><td height="2"></td></tr> | ||
48 | + <tr> | ||
49 | + <td align="center"> | ||
50 | + <table border="0" cellpadding="0" cellspacing="0"> | ||
51 | + <tr> | ||
52 | + <td background="http://semena.in.ua/images/menu01.png" width="142" height="36" style="background-position:top center; background-repeat:no-repeat;text-align:center;" align="center"><a target="_blank" href="http://semena.in.ua/o-kompanii-1/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="font-family: Calibri;text-decoration: none;text-align: center;color: white;font-size: 14px;font-weight: bold;">О КОМПАНИИ</a> | ||
53 | + </td> | ||
54 | + <td background="http://semena.in.ua/images/menu02.png" width="183" height="36" style="background-position:top center; background-repeat:no-repeat;text-align:center;" align="center"><a target="_blank" href="http://semena.in.ua/dostavka-i-oplata-2/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="font-family: Calibri;text-decoration: none;text-align: center;color: white;font-size: 14px;font-weight: bold;">ДОСТАВКА И ОПЛАТА</a></td> | ||
55 | + <td background="http://semena.in.ua/images/menu03.png" width="96" height="36" style="background-position:top center; background-repeat:no-repeat;text-align:center;" align="center"><a target="_blank" href="http://semena.in.ua/news-actions/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="font-family: Calibri;text-decoration: none;text-align: center;color: white;font-size: 14px;font-weight: bold;">АКЦИИ</a></td> | ||
56 | + <td background="http://semena.in.ua/images/menu04.png" width="233" height="36" style="background-position:top center; background-repeat:no-repeat;text-align:center;" align="center"><a target="_blank" href="http://semena.in.ua/prof_tips/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" style="font-family: Calibri;text-decoration: none;text-align: center;color: white;font-size: 14px;font-weight: bold;">СОВЕТЫ ПРОФЕССИОНАЛОВ</a></td> | ||
57 | + </tr> | ||
58 | + </table> | ||
59 | + </td> | ||
60 | + </tr> | ||
61 | + </table> | ||
62 | + </td> | ||
63 | + </tr> | ||
64 | + <tr><td height="18"></td></tr> | ||
65 | + <tr> | ||
66 | + <td align="center"> | ||
67 | + <table cellspacing="0" cellpadding="0" border="0" width="660"> | ||
68 | + <tr> | ||
69 | + <td width="65" height="65" background="http://semena.in.ua/images/f-1.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
70 | + <a href="http://semena.in.ua/semena_ovoshchey_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a> | ||
71 | + </td> | ||
72 | + <td width="20" valign="top"></td> | ||
73 | + <td width="65" height="65" background="http://semena.in.ua/images/f-2.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
74 | + <a href="http://semena.in.ua/semena_tsvetov_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
75 | + <td width="20" valign="top"></td> | ||
76 | + <td width="65" height="65" background="http://semena.in.ua/images/f-3.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
77 | + <a href="http://semena.in.ua/udobrenija_i_sredstva_zashchity_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
78 | + <td width="20" valign="top"></td> | ||
79 | + <td width="65" height="65" background="http://semena.in.ua/images/f-4.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
80 | + <a href="http://semena.in.ua/gazonnye_travy_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
81 | + <td width="20" valign="top"></td> | ||
82 | + <td width="65" height="65" background="http://semena.in.ua/images/f-5.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
83 | + <a href="http://semena.in.ua/sadjenci_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
84 | + <td width="20" valign="top"></td> | ||
85 | + <td width="65" height="65" background="http://semena.in.ua/images/f-6.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
86 | + <a href="http://semena.in.ua/tovary_dlja_sada_i_ogoroda_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
87 | + <td width="20" valign="top"></td> | ||
88 | + <td width="65" height="65" background="http://semena.in.ua/images/f-7.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
89 | + <a href="http://semena.in.ua/zootovari_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
90 | + <td width="20" valign="top"></td> | ||
91 | + <td width="65" height="65" background="http://semena.in.ua/images/f-8.jpg" style="background-position:center center;background-repeat:no-repeat;"> | ||
92 | + <a href="http://semena.in.ua/biopreparati_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank"><img width="65" height="65" valign="top" align="left" src="http://semena.in.ua/images/link.png" border="none"></a></td> | ||
93 | + </tr> | ||
94 | + <tr><td height="10px"></td></tr> | ||
95 | + <tr> | ||
96 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#53a726;text-transform:uppercase;"> | ||
97 | + <a href="http://semena.in.ua/semena_ovoshchey_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#53a726;">Семена<br>овощей</a> | ||
98 | + </td> | ||
99 | + <td width="20" valign="top"></td> | ||
100 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#b22b2c;text-transform:uppercase;"> | ||
101 | + <a href="http://semena.in.ua/semena_tsvetov_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#b22b2c;">Семена<br>цветов</a> | ||
102 | + </td> | ||
103 | + <td width="20" valign="top"></td> | ||
104 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#f36c00;text-transform:uppercase;"> | ||
105 | + <a href="http://semena.in.ua/udobrenija_i_sredstva_zashchity_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#f36c00;">Удобрения<br>и средства<br>защиты</a> | ||
106 | + </td> | ||
107 | + <td width="20" valign="top"></td> | ||
108 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#1b7981;text-transform:uppercase;"> | ||
109 | + <a href="http://semena.in.ua/gazonnye_travy_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#1b7981;">Газонные<br>травы</a> | ||
110 | + </td> | ||
111 | + <td width="20" valign="top"></td> | ||
112 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#935927;text-transform:uppercase;"> | ||
113 | + <a href="http://semena.in.ua/sadjenci_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#935927;">Саженцы</a> | ||
114 | + </td> | ||
115 | + <td width="20" valign="top"></td> | ||
116 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#b1873f;text-transform:uppercase;"> | ||
117 | + <a href="http://semena.in.ua/tovary_dlja_sada_i_ogoroda_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#b1873f;">Товары<br>для сада<br>и огорода</a> | ||
118 | + </td> | ||
119 | + <td width="20" valign="top"></td> | ||
120 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#5b4a42;text-transform:uppercase;"> | ||
121 | + <a href="http://semena.in.ua/zootovari_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#5b4a42;">Зоотовары</a> | ||
122 | + </td> | ||
123 | + <td width="20" valign="top"></td> | ||
124 | + <td height="50" width="65" valign="top" align="center" style="line-height: 1.3;font-family:Calibri;font-weight:bold;font-size:13px;color:#00a3de;text-transform:uppercase;"> | ||
125 | + <a href="http://semena.in.ua/biopreparati_1c_20/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color:#00a3de;">Био-препараты</a> | ||
126 | + </td> | ||
127 | + </tr> | ||
128 | + </table> | ||
129 | + </td> | ||
130 | + </tr> | ||
131 | + <tr><td height="10"></td></tr> | ||
132 | + <tr> | ||
133 | + <td align="center" valign="top" width="100%"> | ||
134 | + <table border="0" cellpadding="0" cellspacing="0" width="682"> | ||
135 | + <tr><td background="http://semena.in.ua/images/top_white.png" width="100%" height="30" align="center" valign="top"> | ||
136 | + | ||
137 | + </td></tr> | ||
138 | + <tr> | ||
139 | + <td align="center" background="http://semena.in.ua/images/center_white.png"> | ||
140 | + | ||
141 | + <table border="0" cellpadding="0" cellspacing="0" width="620px"> | ||
142 | + <tr><td align="center"> | ||
143 | + <table border="0" cellpadding="0" cellspacing="0" width="620px"> | ||
144 | + <tr><td height="10px"></td></tr> | ||
145 | + <tr> | ||
146 | + <td align="center" style="font-family:Calibri;font-size:25px;line-height: 26px;font-weight:bold;color:#333333;">Благодарим за подписку!</td> | ||
147 | + </tr> | ||
148 | + <tr> | ||
149 | + <td style="color: #333333;font-family: Calibri;font-size: 16px;line-height: 18px;letter-spacing: -0.2px;"><br /> | ||
150 | + Спасибо, что Вы выбираете ТМ «Професійне насіння». Как и обещали, мы дарим Вам промокод на единоразовое использование скидки при покупке товаров на нашем <a href="http://semena.in.ua/ru?utm_source=newsletter&utm_campaign=welcome&utm_medium=email" target="_blank" style="text-decoration:none;color: #00aeef;">сайте</a>. А также Вы получите бонус из 14 статей с практическими советами о выращивании овощей и цветов.<br /><br /> | ||
151 | + </td> | ||
152 | + </tr> | ||
153 | + <tr> | ||
154 | + <td style="text-align:center;color: #333333;font-family: Calibri;font-size: 16px;line-height: 18px;letter-spacing: -0.2px;"> | ||
155 | + Ваш персональный промокод со скидкой <b>-7%</b> на покупку товаров в мини-упаковке:<br /> | ||
156 | + </td></tr> | ||
157 | + <tr><td height="10px"></td></tr> | ||
158 | + <tr> | ||
159 | + <td align="center"> | ||
160 | + <table border="0" cellpadding="0" cellspacing="0" background="http://semena.in.ua/images/buy_but.png" width="127px" height="39px" style="background-position:center center;background-repeat:no-repeat;"> | ||
161 | + <tr><td align="center" style="font-weight:bold;text-align:center;color: #fff;font-family: Calibri;font-size: 20px;line-height: 18px;letter-spacing: -0.2px;">9672076</td></tr> | ||
162 | + </table> | ||
163 | + </td> | ||
164 | + </tr> | ||
165 | + | ||
166 | + <tr> | ||
167 | + <td style="text-align:center;color: #333333;font-family: Calibri;font-size: 16px;line-height: 18px;letter-spacing: -0.2px;"><br /><br /> | ||
168 | + Ваш персональный промокод со скидкой <b>-3%</b> на покупку товаров в профессиональной упаковке:<br /> | ||
169 | + </td></tr> | ||
170 | + <tr><td height="10px"></td></tr> | ||
171 | + <tr> | ||
172 | + <td align="center"> | ||
173 | + <table border="0" cellpadding="0" cellspacing="0" background="http://semena.in.ua/images/buy_but.png" width="127px" height="39px" style="background-position:center center;background-repeat:no-repeat;"> | ||
174 | + <tr><td align="center" style="font-weight:bold;text-align:center;color: #fff;font-family: Calibri;font-size: 20px;line-height: 18px;letter-spacing: -0.2px;">1045969</td></tr> | ||
175 | + </table> | ||
176 | + </td> | ||
177 | + </tr> | ||
178 | + <tr><td height="10px"></td></tr> | ||
179 | + <tr> | ||
180 | + <td style="color: #333333;font-family: Calibri;font-size: 11px;line-height: 13px;letter-spacing: -0.2px;"><br />Обратите внимание! Для того чтобы воспользоваться промокодом, необходимо зарегистрироваться на нашем сайте. После этого выберите товары, которые желаете приобрести и, при оформлении заказа, введите промокод в соответствующее поле «Промокод», нажмите кнопку «Применить». Скидка на Ваш заказ применится автоматически.<br /><br /> | ||
181 | + </td> | ||
182 | + </tr> | ||
183 | + <tr> | ||
184 | + <td style="color: #333333;font-family: Calibri;font-size: 16px;line-height: 18px;letter-spacing: -0.2px;"> | ||
185 | + Удачных покупок и хорошего урожая!<br /><br /></td> | ||
186 | + </tr> | ||
187 | + </table> | ||
188 | + </tr></tr></table> | ||
189 | + </td> | ||
190 | + </tr> | ||
191 | + <tr> | ||
192 | + <td background="http://semena.in.ua/images/bottom_white.png" width="100%" style="background-position: bottom center;" align="center" valign="top"> | ||
193 | + <table border="0" cellpadding="0" cellspacing="0" width="620px"> | ||
194 | + | ||
195 | + <tr><td height="30px"></td> | ||
196 | + </tr> | ||
197 | + </table> | ||
198 | + </td> | ||
199 | + </tr> | ||
200 | + <tr><td height="7px"></td></tr> | ||
201 | + </table> | ||
202 | + </td> | ||
203 | + </tr> | ||
204 | + </table> | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + <table border="0" cellpadding="0" cellspacing="0" width="100%"><tr> | ||
209 | + <td> | ||
210 | + <table cellpadding="0" cellspacing="0" border="0" width="100%" height="236" background="http://semena.in.ua/images/bg-2.jpg"> | ||
211 | + <tr> | ||
212 | + <td align="center"> | ||
213 | + <table cellspacing="0" border="0" cellpadding="0" width="660"> | ||
214 | + <tr> | ||
215 | + <td> | ||
216 | + <table cellpadding="0" cellspacing="0" border="0" height="236"> | ||
217 | + <tr> | ||
218 | + <td height="90"><a target="_blank" href="http://semena.in.ua/ru"><img src="http://semena.in.ua/images/logo.png" border="0" alt="semena.in.ua"></a></td> | ||
219 | + </tr> | ||
220 | + <tr> | ||
221 | + <td valign="top" height="60" style="color: #4a4a4a; font-size: 15px; font-family: calibri; font-weight: normal;">Адрес центрального офиса:<br> | ||
222 | + <span style="font-weight: bold;">Киев, ул. Садовая, 95</span></td> | ||
223 | + </tr> | ||
224 | + </table> | ||
225 | + </td> | ||
226 | + <td align="center"> | ||
227 | + <table cellspacing="0" cellpadding="0" border="0"> | ||
228 | + <tr><td background="http://semena.in.ua/images/tel01.png" width="150" height="29" title="(044) 581-67-15" style="background-position: top left; background-repeat:no-repeat;"></td></tr> | ||
229 | + <tr><td background="http://semena.in.ua/images/tel02.png" width="150" height="29" title="(044) 451-48-59" style="background-position: top left; background-repeat:no-repeat;"></td></tr> | ||
230 | + <tr><td background="http://semena.in.ua/images/tel03.png" width="150" height="29" title="(050) 464-48-49" style="background-position: top left; background-repeat:no-repeat;"></td></tr> | ||
231 | + <tr><td background="http://semena.in.ua/images/tel04.png" width="150" height="29" title="(067) 464-48-59" style="background-position: top left; background-repeat:no-repeat;"></td></tr> | ||
232 | + <tr><td background="http://semena.in.ua/images/tel05.png" width="150" height="29" title="(093) 026-86-64" style="background-position: top left; background-repeat:no-repeat;"></td></tr> | ||
233 | + </table> | ||
234 | + </td> | ||
235 | + <td align="right"> | ||
236 | + <table cellpadding="0" cellspacing="0" border="0"> | ||
237 | + <tr> | ||
238 | + <td> | ||
239 | + <table cellspacing="0" cellpadding="0" border="0" width="168" style="text-align: right"> | ||
240 | + <tr> | ||
241 | + <td><a target="_blank" href="https://www.facebook.com/Professionalseeds"><img src="http://semena.in.ua/images/fb.png" width="48" height="48" border="0" alt=""></a></td> | ||
242 | + <td><a target="_blank" href="https://www.youtube.com/channel/UCMnG-NxtoprcTxKcPouwWdQ"><img src="http://semena.in.ua/images/youtube.png" width="48" height="48" border="0" alt=""></a></td> | ||
243 | + <td><a target="_blank" href="https://vk.com/public116774284"><img src="http://semena.in.ua/images/vk.png" width="48" height="48" border="0" alt=""></a></td> | ||
244 | + </tr> | ||
245 | + </table> | ||
246 | + </td> | ||
247 | + </tr> | ||
248 | + </table> | ||
249 | + </td> | ||
250 | + </tr> | ||
251 | + </table> | ||
252 | + </td> | ||
253 | + </tr> | ||
254 | + </table> | ||
255 | + </td> | ||
256 | + </tr> | ||
257 | + </table> | ||
258 | + | ||
259 | + </td></tr></table> | ||
260 | + | ||
261 | +</body></html> | ||
0 | \ No newline at end of file | 262 | \ No newline at end of file |
src/lib/models.php
@@ -586,6 +586,25 @@ namespace | @@ -586,6 +586,25 @@ namespace | ||
586 | return $this->_discount; | 586 | return $this->_discount; |
587 | } | 587 | } |
588 | 588 | ||
589 | + /** | ||
590 | + * models::getSubscribe | ||
591 | + * | ||
592 | + * @author Alex Savenko | ||
593 | + * @version 0.1.20140507 | ||
594 | + * | ||
595 | + * @return \models\subscribe | ||
596 | + */ | ||
597 | + public function getSubscribe() | ||
598 | + { | ||
599 | + if( empty($this->_subscribe) ) | ||
600 | + { | ||
601 | + $this->_subscribe = new \models\subscribe(); | ||
602 | + $this->_subscribe->setDi( $this->getDi() ); | ||
603 | + } | ||
604 | + | ||
605 | + return $this->_subscribe; | ||
606 | + } | ||
607 | + | ||
589 | public function getPayment() | 608 | public function getPayment() |
590 | { | 609 | { |
591 | if( empty($this->_payment) ) | 610 | if( empty($this->_payment) ) |
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: Alex Savenko | ||
5 | + * Date: 01.12.2016 | ||
6 | + * Time: 18:35 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace models; | ||
10 | + | ||
11 | + | ||
12 | +class subscribe extends \db | ||
13 | +{ | ||
14 | + public function getAllData() | ||
15 | + { | ||
16 | + | ||
17 | + return $this->get( | ||
18 | + ' | ||
19 | + SELECT subscribe.* FROM | ||
20 | + public.subscribe | ||
21 | + ORDER BY | ||
22 | + date ASC | ||
23 | + ' | ||
24 | + , | ||
25 | + [ | ||
26 | + ], | ||
27 | + -1 | ||
28 | + ); | ||
29 | + } | ||
30 | + | ||
31 | + public function getOneData($id) | ||
32 | + { | ||
33 | + return $this->get( | ||
34 | + ' | ||
35 | + SELECT * | ||
36 | + FROM public.subscribe | ||
37 | + WHERE | ||
38 | + id = :id | ||
39 | + ', | ||
40 | + [ | ||
41 | + 'id' => $id | ||
42 | + ], | ||
43 | + -1 | ||
44 | + ); | ||
45 | + } | ||
46 | + | ||
47 | + public function getOneDataByEmail($email) | ||
48 | + { | ||
49 | + | ||
50 | + return $this->get( | ||
51 | + ' | ||
52 | + SELECT * FROM | ||
53 | + public.subscribe | ||
54 | + WHERE | ||
55 | + email = :email | ||
56 | + ', | ||
57 | + [ | ||
58 | + 'email' => $email | ||
59 | + ], | ||
60 | + -1 | ||
61 | + ); | ||
62 | + } | ||
63 | + | ||
64 | + public function deleteData($id){ | ||
65 | + return $this->exec( | ||
66 | + ' DELETE | ||
67 | + FROM | ||
68 | + public.subscribe | ||
69 | + WHERE | ||
70 | + id = :id | ||
71 | + ', | ||
72 | + [ | ||
73 | + 'id' => $id | ||
74 | + ] | ||
75 | + ); | ||
76 | + } | ||
77 | + | ||
78 | + public function addData($data) | ||
79 | + { | ||
80 | + | ||
81 | + return $this->get( | ||
82 | + ' | ||
83 | + INSERT INTO | ||
84 | + public.subscribe | ||
85 | + ( | ||
86 | + name, | ||
87 | + email, | ||
88 | + date | ||
89 | + | ||
90 | + ) | ||
91 | + VALUES | ||
92 | + ( | ||
93 | + :name, | ||
94 | + :email, | ||
95 | + CURRENT_TIMESTAMP | ||
96 | + ) | ||
97 | + RETURNING id | ||
98 | + ', | ||
99 | + [ | ||
100 | + 'name' => $data['name'], | ||
101 | + 'email' => $data['email'] | ||
102 | + ], | ||
103 | + -1 | ||
104 | + ); | ||
105 | + } | ||
106 | + | ||
107 | + public function updateData($data,$id) | ||
108 | + { | ||
109 | + | ||
110 | + return $this->exec( | ||
111 | + ' | ||
112 | + UPDATE | ||
113 | + public.subscribe | ||
114 | + SET | ||
115 | + name = :name, | ||
116 | + email = :email | ||
117 | + greeting = :greeting | ||
118 | + WHERE | ||
119 | + id = :id | ||
120 | + ', | ||
121 | + [ | ||
122 | + 'name' => $data['name'], | ||
123 | + 'email' => $data['email'], | ||
124 | + 'greeting' => $data['greeting'], | ||
125 | + 'id' => $id | ||
126 | + ] | ||
127 | + ); | ||
128 | + } | ||
129 | + | ||
130 | + public function updateGreetingStatus($id) | ||
131 | + { | ||
132 | + | ||
133 | + return $this->exec( | ||
134 | + ' | ||
135 | + UPDATE | ||
136 | + public.subscribe | ||
137 | + SET | ||
138 | + greeting = 1 | ||
139 | + WHERE | ||
140 | + id = :id | ||
141 | + ', | ||
142 | + [ | ||
143 | + 'id' => $id | ||
144 | + ] | ||
145 | + ); | ||
146 | + } | ||
147 | + | ||
148 | + public function countData( ) | ||
149 | + { | ||
150 | + return $this->get( | ||
151 | + ' | ||
152 | + SELECT | ||
153 | + COUNT(id) AS total | ||
154 | + FROM | ||
155 | + public.subscribe | ||
156 | + ', | ||
157 | + [ | ||
158 | + | ||
159 | + ], | ||
160 | + -1 | ||
161 | + ); | ||
162 | + } | ||
163 | +} | ||
0 | \ No newline at end of file | 164 | \ No newline at end of file |
src/lib/sendmail.php
@@ -135,6 +135,17 @@ namespace | @@ -135,6 +135,17 @@ namespace | ||
135 | ]; | 135 | ]; |
136 | 136 | ||
137 | break; | 137 | break; |
138 | + case 10: //popup | ||
139 | + | ||
140 | + $data_base = | ||
141 | + [ | ||
142 | + 'email_to' => $data['email'], | ||
143 | + 'email_reply' => $data['name'].' <'.$data['email'].'>', | ||
144 | + 'subject' => 'Благодарим за подписку на сайте: '.\config::get( 'global#title' ), | ||
145 | + 'message_body' => $view->getContent() | ||
146 | + ]; | ||
147 | + | ||
148 | + break; | ||
138 | 149 | ||
139 | default: | 150 | default: |
140 | return false; | 151 | return false; |
@@ -213,6 +224,61 @@ namespace | @@ -213,6 +224,61 @@ namespace | ||
213 | } | 224 | } |
214 | 225 | ||
215 | ///////////////////////////////////////////////////////////////////////////// | 226 | ///////////////////////////////////////////////////////////////////////////// |
227 | + | ||
228 | + public function sendSubscribe($data) { | ||
229 | + | ||
230 | + $view = new \Phalcon\Mvc\View(); | ||
231 | + $view->setViewsDir( ROOT_PATH.config::get( 'dirs/viewsDir' ) ); | ||
232 | + | ||
233 | + $view->start(); | ||
234 | + | ||
235 | + $view->setVar( 'data', $data ); | ||
236 | + $view->render( 'sendmail', 'message_10' ); | ||
237 | + | ||
238 | + $view->finish(); | ||
239 | + $message_body = $view->getContent(); | ||
240 | + | ||
241 | + $mail = new PHPMailer; | ||
242 | + //Tell PHPMailer to use SMTP | ||
243 | + $mail->isSMTP(); | ||
244 | + //Enable SMTP debugging | ||
245 | + // 0 = off (for production use) | ||
246 | + // 1 = client messages | ||
247 | + // 2 = client and server messages | ||
248 | + $mail->SMTPDebug = 0; | ||
249 | + //Ask for HTML-friendly debug output | ||
250 | + $mail->Debugoutput = 'html'; | ||
251 | + //Set the hostname of the mail server | ||
252 | + $mail->Host = 'smtp.gmail.com'; | ||
253 | + $mail->CharSet = 'UTF-8'; | ||
254 | + // use | ||
255 | + // $mail->Host = gethostbyname('smtp.gmail.com'); | ||
256 | + // if your network does not support SMTP over IPv6 | ||
257 | + //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission | ||
258 | + $mail->Port = 587; | ||
259 | + //Set the encryption system to use - ssl (deprecated) or tls | ||
260 | + $mail->SMTPSecure = 'tls'; | ||
261 | + //Whether to use SMTP authentication | ||
262 | + $mail->SMTPAuth = true; | ||
263 | + //Username to use for SMTP authentication - use full email address for gmail | ||
264 | + $mail->Username = "arctic.semenainua@gmail.com"; | ||
265 | + //Password to use for SMTP authentication | ||
266 | + $mail->Password = "arctic0411"; | ||
267 | + | ||
268 | + //Set who the message is to be sent from | ||
269 | + $mail->setFrom('semena@hs.kiev.ua', 'semena.in.ua'); | ||
270 | + //Set who the message is to be sent to | ||
271 | + $mail->addAddress($data['email'], $data['name']); | ||
272 | + //Set the subject line | ||
273 | + $mail->Subject = 'Благодарим за подписку!'; | ||
274 | + //Read an HTML message body from an external file, convert referenced images to embedded, | ||
275 | + //convert HTML into a basic plain-text alternative body | ||
276 | + | ||
277 | + $mail->msgHTML($message_body); | ||
278 | + $mail->send(); | ||
279 | + } | ||
280 | + | ||
281 | + ///////////////////////////////////////////////////////////////////////////// | ||
216 | } | 282 | } |
217 | } | 283 | } |
218 | 284 |
www/index.php
@@ -831,6 +831,16 @@ try | @@ -831,6 +831,16 @@ try | ||
831 | ->setName( 'get_offices' ); | 831 | ->setName( 'get_offices' ); |
832 | 832 | ||
833 | $router->add | 833 | $router->add |
834 | + ( | ||
835 | + '/popup{language:([/][a-z]{2})?}', | ||
836 | + [ | ||
837 | + 'controller' => 'menu', | ||
838 | + 'action' => 'popup', | ||
839 | + ] | ||
840 | + ) | ||
841 | + ->setName( 'callback' ); | ||
842 | + | ||
843 | + $router->add | ||
834 | ( | 844 | ( |
835 | '/ajax/get_items{language:([/][a-z]{2})?}', | 845 | '/ajax/get_items{language:([/][a-z]{2})?}', |
836 | [ | 846 | [ |