Commit 6d160f59 by Ruha

additional fixes

1 parent bd17719e
Pipeline #2604 for 6d160f59 skipped in 0 seconds
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="PublishConfigData"> <component name="PublishConfigData" autoUpload="Always" serverName="myjino.ru">
<serverData> <serverData>
<paths name="flux.loc"> <paths name="flux.loc">
<serverdata> <serverdata>
...@@ -45,5 +45,6 @@ ...@@ -45,5 +45,6 @@
</serverdata> </serverdata>
</paths> </paths>
</serverData> </serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component> </component>
</project> </project>
\ No newline at end of file \ No newline at end of file
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
.modal { .modal {
z-index: 5000; z-index: 5000;
width: 416px; width: 416px;
margin: 0 auto;
background: #fff; background: #fff;
position: fixed; position: fixed;
top:10%; left: 50%;
left: 40%; top: 50%;
padding: 0px 0 48px 0; transform: translate(-50%,-50%);
padding: 0 0 12px 0;
border-radius: 8px;
} }
.hidden { .hidden {
...@@ -35,8 +36,11 @@ ...@@ -35,8 +36,11 @@
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
margin: 0 auto; margin: 0 auto;
margin-top: 17px;
}
#callback-form .button {
margin-top:10px;
} }
.modal-head { .modal-head {
text-align: right; text-align: right;
height: 28px; height: 28px;
...@@ -48,6 +52,7 @@ ...@@ -48,6 +52,7 @@
padding: 18px; padding: 18px;
position: relative; position: relative;
background: url("/img/modal/close.svg") no-repeat 96% 15px; background: url("/img/modal/close.svg") no-repeat 96% 15px;
cursor:pointer;
} }
.modal-body-header { .modal-body-header {
...@@ -66,12 +71,30 @@ ...@@ -66,12 +71,30 @@
font-weight: bold; font-weight: bold;
margin:auto; margin:auto;
padding:0 40px; padding:0 40px;
margin-bottom: 2px;
}
#success .modal-body-header {
padding-top:36px;
}
#success small {
display: block;
padding-top:18px;
} }
.time { .time {
width:152px; width:152px;
display: inline-block; display: inline-block;
float:left; float:left;
} }
fieldset {
max-height: 89px;
min-height: 40px;
}
#order-form fieldset{
min-height:86px;
}
#order-form fieldset:last-of-type {
min-height: 94px;
}
.time .input {width:100%; display: inline-block} .time .input {width:100%; display: inline-block}
.tm {margin-left:40px;} .tm {margin-left:40px;}
.arrow-up{ .arrow-up{
...@@ -82,7 +105,7 @@ ...@@ -82,7 +105,7 @@
height: 30px; height: 30px;
width: 30px; width: 30px;
top: 30px; top: 30px;
right: -110px; right: -115px;
background-size: cover; background-size: cover;
margin-top: -32px; margin-top: -32px;
} }
...@@ -94,7 +117,7 @@ ...@@ -94,7 +117,7 @@
height: 30px; height: 30px;
width: 30px; width: 30px;
top: 50px; top: 50px;
right: -110px; right: -115px;
background-size: cover; background-size: cover;
margin-top: -32px; margin-top: -32px;
} }
...@@ -112,9 +135,38 @@ ...@@ -112,9 +135,38 @@
font-size: 15px; font-size: 15px;
color: #333; color: #333;
box-sizing: border-box; box-sizing: border-box;
padding: 16px; padding: 4px 16px;
}
.error { color: #ed1c24;}
label.error {
position: relative;
height:0;
top: -84px;
left: 148px;
display:inline-block;
width:55%;
text-align:right;
font-size:13px;
}
#footer-form label {
padding:0 0px;
}
input:disabled,
input[disabled]{
border: 1px solid #999999;
background-color: #EEEEEE!important;
color: #000!important;
cursor: not-allowed;
}
input.error {
border-color: #ed1c24!important;
} }
input.valid {
border-color: #18FF00!important;
}
.input input[type="text"] { .input input[type="text"] {
font-size: 15px; font-size: 15px;
color: #333; color: #333;
...@@ -124,3 +176,31 @@ ...@@ -124,3 +176,31 @@
width: 100%; width: 100%;
height: 46px; height: 46px;
} }
.last {padding-top:18px;}
@media (max-width: 480px) {
.modal {width:360px;}
.map-ct1 {padding-top:0px;}
#footer-form input{width:328px;}
.last {padding-top:18px;}
.modal-label {
}
#order-form label {
padding: 0 13px;
}
.time {
width: 42%;
display: inline-block;
}
.tm {margin-left:12px;}
}
@media (max-width: 769px) and (min-width:481px) {
.map-ct1 {padding-top:0px;}
#footer-form input{width:282px;}
#footer-form label.error { left: 127px}
}
...@@ -15,7 +15,6 @@ switch ($type) { ...@@ -15,7 +15,6 @@ switch ($type) {
$data = ['phone' => $phone, 'from' => $from, 'till' => $till]; $data = ['phone' => $phone, 'from' => $from, 'till' => $till];
$callback = new callback($data); $callback = new callback($data);
$callback->send($data); $callback->send($data);
echo json_encode(array('type'=>'success_send', 'text'=>'Ваша заявка успешно отправлена'));
break; break;
case 'order': case 'order':
...@@ -74,6 +73,20 @@ class callback extends Form { ...@@ -74,6 +73,20 @@ class callback extends Form {
$this->till = $data['till']; $this->till = $data['till'];
$this->from = $data['from']; $this->from = $data['from'];
} }
public function send(){
global $mailTo;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'From: Landing_Page <testmail@test.ru>';
$subject = "Заявка на франшизу";
$message = 'Телефон: '. $this->phone . '<br>';
$message .= 'Звонить с ' . $this->till . '<br>';
$message .= 'До ' . $this->from . '<br>';
if (mail($mailTo, $subject, $message, $headers)) {
echo json_encode(array('type'=>'success_send', 'text'=>'Ваша заявка успешно отправлена'));
}
}
} }
class order extends Form { class order extends Form {
...@@ -89,6 +102,20 @@ class order extends Form { ...@@ -89,6 +102,20 @@ class order extends Form {
$this->city = $data['city']; $this->city = $data['city'];
$this->email = Form::validate($data['email'], 'email'); $this->email = Form::validate($data['email'], 'email');
} }
public function send(){
global $mailTo;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'From: Landing_Page <testmail@test.ru>';
$subject = "Заявка на франшизу";
$message = 'Клиента зовут: '. $this->name . '<br>';
$message .= 'Почтовый ящик: ' . $this->email . '<br>';
$message .= 'Город: ' . $this->city . '<br>';
if (mail($mailTo, $subject, $message, $headers)) {
echo json_encode(array('type'=>'success_send', 'text'=>'Ваша заявка успешно отправлена'));
}
}
} }
......
...@@ -129,13 +129,14 @@ var overlay = $('#overlay'); ...@@ -129,13 +129,14 @@ var overlay = $('#overlay');
$(overlay).click(function () { $(overlay).click(function () {
closemodal('callback'); closemodal('callback');
closemodal('bid'); closemodal('bid');
closemodal('success');
}); });
$('.ord1').click(function (e) { $('.ord1').click(function (e) {
e.preventDefault(); e.preventDefault();
callmodal('callback'); callmodal('callback');
}); });
$('.ord2, .ord3').click(function (e) { $('.ord2, .ord3, .ord2-1').click(function (e) {
e.preventDefault(); e.preventDefault();
callmodal('bid'); callmodal('bid');
}); });
...@@ -180,16 +181,21 @@ function time(number, type) { ...@@ -180,16 +181,21 @@ function time(number, type) {
return d.toLocaleTimeString().substr(0, 5); return d.toLocaleTimeString().substr(0, 5);
} }
$('#callback-form').submit(function(e){ $('#callback-form').submit(function (e) {
e.preventDefault(); e.preventDefault();
send('callback-form'); send('callback-form');
}); });
$('#order-form').submit(function(e){ $('#order-form').submit(function (e) {
e.preventDefault(); e.preventDefault();
closemodal('bid');
send('order-form'); send('order-form');
}); });
$('#footer-form').submit(function (e) {
e.preventDefault();
send('footer-form');
});
function send(form){ function send(form) {
$.ajax({ $.ajax({
url: '/handler.php', url: '/handler.php',
type: "POST", type: "POST",
...@@ -197,20 +203,109 @@ function send(form){ ...@@ -197,20 +203,109 @@ function send(form){
data: $("#" + form).serialize(), data: $("#" + form).serialize(),
success: function (response) { success: function (response) {
if (response.type == 'success_send') { if (response.type == 'success_send') {
$('#'+form).find('input').prop("disabled", true); closemodal('callback');
alert(response.text) closemodal('bid');
closemodal('success');
$("#" + form).find('input').prop("disabled", true);
callmodal('success');
} }
if (response.type == 'error_name') { if (response.type == 'error_name') {
alert(response.text)
} }
if (response.type == 'error_email') { if (response.type == 'error_email') {
alert(response.text) alert('Почта не соответствует шаблону')
} }
if (response.type == 'error_phone') { if (response.type == 'error_phone') {
alert(response.text)
} }
} }
}); });
} }
$(document).ready(function () {
$("#order-form").validate({
rules: {
name: {
required: true,
minlength: 3,
maxlength: 40
},
email: {
email: true,
required: true,
minlength: 2,
maxlength: 50
}
},
messages: {
name: {
required: "Напишите имя",
minlength: "",
maxlength: "",
},
email: {
email : " Некорректный адрес",
required: "Введите email",
minlength: "Введите email",
}
}
});
$("#callback-form").validate({
rules: {
phone: {
digits:true,
required: true,
minlength: 3,
maxlength: 40
}
},
messages: {
phone: {
required: "Напишите номер",
minlength: "",
maxlength: "",
digits: "Только цифры"
}
}
});
$("#footer-form").validate({
rules: {
name: {
required: true,
minlength: 3,
maxlength: 40
},
email: {
email: true,
required: true,
minlength: 2,
maxlength: 50
}
},
messages: {
name: {
required: "Напишите имя",
minlength: "",
maxlength: "",
},
email: {
email : "Некорректный адрес",
required: "Введите email",
minlength: "Введите email"
}
}
})
});
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!