Commit c0b31b0cd739260ca543b49eee5e26119c862403

Authored by Eugeny Galkovskiy
1 parent c5f5d11e

submit

blocks/footer_endhtml.php
@@ -202,7 +202,7 @@ _________________________________________________________ --> @@ -202,7 +202,7 @@ _________________________________________________________ -->
202 <script src="/js/start-swipe.js"></script> 202 <script src="/js/start-swipe.js"></script>
203 <!-- owl carousel --> 203 <!-- owl carousel -->
204 <script src="js/owl.carousel.min.js"></script> 204 <script src="js/owl.carousel.min.js"></script>
205 -<script src="/js/submit.js"></script> 205 + <script src="/js/submit.js"></script>
206 206
207 </body> 207 </body>
208 </html> 208 </html>
209 \ No newline at end of file 209 \ No newline at end of file
@@ -60,36 +60,36 @@ @@ -60,36 +60,36 @@
60 <label>Выберите страницы</label> 60 <label>Выберите страницы</label>
61 <div class="style input-wr"> 61 <div class="style input-wr">
62 <!--<div class="style radio_custom"> 62 <!--<div class="style radio_custom">
63 - <input type="checkbox" id="type_pg1" name="page" value="главная"> 63 + <input type="checkbox" id="type_pg1" name="page[]" value="главная">
64 <label for="type_pg1">главная</label> 64 <label for="type_pg1">главная</label>
65 </div>--> 65 </div>-->
66 <div class="style radio_custom"> 66 <div class="style radio_custom">
67 - <input type="checkbox" id="type_pg2" name="page" value="блог"> 67 + <input type="checkbox" id="type_pg2" name="page[]" value="блог">
68 <label for="type_pg2">блог</label> 68 <label for="type_pg2">блог</label>
69 </div> 69 </div>
70 <div class="style radio_custom"> 70 <div class="style radio_custom">
71 - <input type="checkbox" id="type_pg3" name="page" value="портфолио"> 71 + <input type="checkbox" id="type_pg3" name="page[]" value="портфолио">
72 <label for="type_pg3">портфолио</label> 72 <label for="type_pg3">портфолио</label>
73 </div> 73 </div>
74 <div class="style radio_custom"> 74 <div class="style radio_custom">
75 - <input type="checkbox" id="type_pg4" name="page" value="текстовая"> 75 + <input type="checkbox" id="type_pg4" name="page[]" value="текстовая">
76 <label for="type_pg4">текстовая</label> 76 <label for="type_pg4">текстовая</label>
77 </div> 77 </div>
78 <div class="style radio_custom"> 78 <div class="style radio_custom">
79 - <input type="checkbox" id="type_pg5" name="page" value="галерея"> 79 + <input type="checkbox" id="type_pg5" name="page[]" value="галерея">
80 <label for="type_pg5">галерея</label> 80 <label for="type_pg5">галерея</label>
81 </div> 81 </div>
82 <div class="style radio_custom"> 82 <div class="style radio_custom">
83 - <input type="checkbox" id="type_pg6" name="page" value="прайс">  
84 - <label for="type_pg5">прайс</label> 83 + <input type="checkbox" id="type_pg6" name="page[]" value="прайс">
  84 + <label for="type_pg6">прайс</label>
85 </div> 85 </div>
86 <div class="style radio_custom"> 86 <div class="style radio_custom">
87 - <input type="checkbox" id="type_pg7" name="page" value="команда">  
88 - <label for="type_pg5">команда</label> 87 + <input type="checkbox" id="type_pg7" name="page[]" value="команда">
  88 + <label for="type_pg7">команда</label>
89 </div> 89 </div>
90 <!--<div class="style radio_custom"> 90 <!--<div class="style radio_custom">
91 - <input type="checkbox" id="type_pg8" name="page" value="контакты">  
92 - <label for="type_pg5">контакты</label> 91 + <input type="checkbox" id="type_pg8" name="page[]" value="контакты">
  92 + <label for="type_pg8">контакты</label>
93 </div>--> 93 </div>-->
94 </div> 94 </div>
95 </div> 95 </div>
@@ -16,11 +16,11 @@ $( @@ -16,11 +16,11 @@ $(
16 if (validate(dataArray)) { 16 if (validate(dataArray)) {
17 $.ajax( 17 $.ajax(
18 { 18 {
19 - url: 'http://artbox.net.ua/en/feedback', 19 + url: 'submit.php',
20 type: "POST", 20 type: "POST",
21 data: dataArray, 21 data: dataArray,
22 success: function(data) { 22 success: function(data) {
23 - if (data.status) { 23 + //if (data.status) {
24 form.reset(); 24 form.reset();
25 var pos = ($(window) 25 var pos = ($(window)
26 .scrollTop() + 30 + 50); 26 .scrollTop() + 30 + 50);
@@ -43,7 +43,7 @@ $( @@ -43,7 +43,7 @@ $(
43 top: pos 43 top: pos
44 }, 200 44 }, 200
45 ); 45 );
46 - } 46 + //}
47 } 47 }
48 } 48 }
49 ); 49 );
submit.php 0 → 100644
  1 +<?php
  2 + header('Content-Type: text/plain');
  3 + if(isset($_POST)){
  4 + if(isset($_POST['name'])) $name = $_POST['name'];
  5 + if(isset($_POST['email'])) $email = $_POST['email'];
  6 + if(isset($_POST['phone'])) $phone = $_POST['phone'];
  7 + if(isset($_POST['message'])) $message = $_POST['message'];
  8 +
  9 + if(isset($_POST['site'])){
  10 + $site = 'Выбранный сайт: '.$_POST['site'].'.';
  11 + }
  12 + if(isset($_POST['page'])){
  13 + $page = 'Выбранные страницы:';
  14 + foreach($_POST['page'] as $pages){
  15 + $page .=', '.$pages;
  16 + }
  17 + $page .= '.';
  18 + $page = str_replace(":, ",": ",$page);
  19 + }
  20 +
  21 + $message .= "\r\n\r\n".$site."\r\n".$page;
  22 +
  23 + $url = "http://artbox.net.ua/en/feedback";
  24 + $params = array(
  25 + 'name' => $name,
  26 + 'email' => $email,
  27 + 'phone' => $phone,
  28 + 'message' => $message
  29 + );
  30 + $result = file_get_contents($url, false, stream_context_create(array(
  31 + 'http' => array(
  32 + 'method' => 'POST',
  33 + 'header' => 'Content-type: application/x-www-form-urlencoded',
  34 + 'content' => http_build_query($params)
  35 + )
  36 + )));
  37 + }
0 \ No newline at end of file 38 \ No newline at end of file