Commit 6d160f59 by Ruha

additional fixes

1 parent bd17719e
Pipeline #2604 for 6d160f59 skipped in 0 seconds
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData">
<component name="PublishConfigData" autoUpload="Always" serverName="myjino.ru">
<serverData>
<paths name="flux.loc">
<serverdata>
......@@ -45,5 +45,6 @@
</serverdata>
</paths>
</serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component>
</project>
\ No newline at end of file
......@@ -9,12 +9,13 @@
.modal {
z-index: 5000;
width: 416px;
margin: 0 auto;
background: #fff;
position: fixed;
top:10%;
left: 40%;
padding: 0px 0 48px 0;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
padding: 0 0 12px 0;
border-radius: 8px;
}
.hidden {
......@@ -35,8 +36,11 @@
font-size: 15px;
font-weight: 500;
margin: 0 auto;
margin-top: 17px;
}
#callback-form .button {
margin-top:10px;
}
.modal-head {
text-align: right;
height: 28px;
......@@ -48,6 +52,7 @@
padding: 18px;
position: relative;
background: url("/img/modal/close.svg") no-repeat 96% 15px;
cursor:pointer;
}
.modal-body-header {
......@@ -66,12 +71,30 @@
font-weight: bold;
margin:auto;
padding:0 40px;
margin-bottom: 2px;
}
#success .modal-body-header {
padding-top:36px;
}
#success small {
display: block;
padding-top:18px;
}
.time {
width:152px;
display: inline-block;
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}
.tm {margin-left:40px;}
.arrow-up{
......@@ -82,7 +105,7 @@
height: 30px;
width: 30px;
top: 30px;
right: -110px;
right: -115px;
background-size: cover;
margin-top: -32px;
}
......@@ -94,7 +117,7 @@
height: 30px;
width: 30px;
top: 50px;
right: -110px;
right: -115px;
background-size: cover;
margin-top: -32px;
}
......@@ -112,9 +135,38 @@
font-size: 15px;
color: #333;
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"] {
font-size: 15px;
color: #333;
......@@ -123,4 +175,32 @@
border: none;
width: 100%;
height: 46px;
}
\ No newline at end of file
}
.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) {
$data = ['phone' => $phone, 'from' => $from, 'till' => $till];
$callback = new callback($data);
$callback->send($data);
echo json_encode(array('type'=>'success_send', 'text'=>'Ваша заявка успешно отправлена'));
break;
case 'order':
......@@ -74,6 +73,20 @@ class callback extends Form {
$this->till = $data['till'];
$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 {
......@@ -89,6 +102,20 @@ class order extends Form {
$this->city = $data['city'];
$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');
$(overlay).click(function () {
closemodal('callback');
closemodal('bid');
closemodal('success');
});
$('.ord1').click(function (e) {
e.preventDefault();
callmodal('callback');
});
$('.ord2, .ord3').click(function (e) {
$('.ord2, .ord3, .ord2-1').click(function (e) {
e.preventDefault();
callmodal('bid');
});
......@@ -180,16 +181,21 @@ function time(number, type) {
return d.toLocaleTimeString().substr(0, 5);
}
$('#callback-form').submit(function(e){
$('#callback-form').submit(function (e) {
e.preventDefault();
send('callback-form');
});
$('#order-form').submit(function(e){
$('#order-form').submit(function (e) {
e.preventDefault();
closemodal('bid');
send('order-form');
});
$('#footer-form').submit(function (e) {
e.preventDefault();
send('footer-form');
});
function send(form){
function send(form) {
$.ajax({
url: '/handler.php',
type: "POST",
......@@ -197,20 +203,109 @@ function send(form){
data: $("#" + form).serialize(),
success: function (response) {
if (response.type == 'success_send') {
$('#'+form).find('input').prop("disabled", true);
alert(response.text)
closemodal('callback');
closemodal('bid');
closemodal('success');
$("#" + form).find('input').prop("disabled", true);
callmodal('success');
}
if (response.type == 'error_name') {
alert(response.text)
}
if (response.type == 'error_email') {
alert(response.text)
alert('Почта не соответствует шаблону')
}
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!