diff --git a/plugins/special-actions-middle.php b/plugins/special-actions-middle.php index e235325..c366ae4 100644 --- a/plugins/special-actions-middle.php +++ b/plugins/special-actions-middle.php @@ -462,4 +462,72 @@ if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S:: } header( 'Location: ' . $_SERVER['REQUEST_URI'] ); exit; +} + +if ( \S::get('action') == 'send-partner-form-new' and \S::get( 'token' ) == \S::get_session( 'partner-form-token' ) and !\S::get( 'website' ) ) +{ + if(isset($_POST['g-recaptcha-response'])){ + $captcha=$_POST['g-recaptcha-response']; + } + if(!$captcha){ + \S::alert( "Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie." ); + header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + exit; + } + $secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4"; + $ip = $_SERVER['REMOTE_ADDR']; + // post request to server + $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($captcha); + $response = file_get_contents($url); + $responseKeys = json_decode($response,true); + // should return JSON with success as true + + if($responseKeys["success"]) { + if ( + strposa( \S::get( 'company' ), $spam_words ) === false + and + \S::get( 'company_address' ) + and + \S::get( 'phone' ) + and + \S::get( 'email' ) + and + strposa( \S::get( 'name' ), $spam_words ) === false + and + strposa( \S::get( 'surname' ), $spam_words ) === false + ){ + $aggrement1 = \S::get('aggrement1') === 'on' ? 'Tak' : 'Nie'; + $aggrement2 = \S::get('aggrement2') === 'on' ? 'Tak' : 'Nie'; + + $text = '

Rodzaj Partnera biznesowego: ' . \S::get('partner-type') . '

'; + $text .= '

Nazwa Firmy: ' . \S::get('company') . '

'; + $text .= '

Adres firmy: ' . \S::get('company_address') . '

'; + $text .= '

Telefon: ' . \S::get('phone') . '

'; + $text .= '

Adres e-mail: ' . \S::get('email') . '

'; + $text .= '

Imię: ' . \S::get('name') . '

'; + $text .= '

Nazwisko: ' . \S::get('surname') . '

'; + $text .= '

Interesują mnie: ' . \S::get('interesting-me') . '

'; + $text .= '

Wyrażam zgodę na przetwarzanie moich danych osobowych podanych przeze mnie powyżej w celu przygotowania stosownej oferty: ' . $aggrement1 . '

'; + $text .= '

Wyrażam zgodę na przetwarzanie moich danych osobowych podanych przeze mnie powyżej w celu otrzymywania materiałów reklamowych: ' . $aggrement2 . '

'; + $text .= '

Wysłano: ' . date( 'Y-m-d H:i:s' ) . '

'; + + if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) + { + // send copy to k.zarzyczny@vidok.com + \S::send_email( 'k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); + \S::send_email( 'arkuszevidok@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); + \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); + header('Location: ' . $_SERVER['REQUEST_URI'] . '?form_sent=1'); + exit; + } + else + \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + } + else + \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + } else { + \S::alert( "Jesteś robotem!" ); + } + header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + exit; } \ No newline at end of file diff --git a/templates_user/pages/strefa-partnera.php b/templates_user/pages/strefa-partnera.php index ff57f6a..530d6ec 100644 --- a/templates_user/pages/strefa-partnera.php +++ b/templates_user/pages/strefa-partnera.php @@ -1,3 +1,5 @@ + +
@@ -247,7 +265,6 @@
+ +
- @@ -322,35 +350,35 @@
- +
- +
- +
- +
- +
- +
- @@ -381,26 +409,43 @@ -
- +
+
-
- +
+
-
+ +
+ +
+ +
+ '; + echo htmlspecialchars($alert); + echo '
'; + + $_SESSION['alert'] = null; + $_SESSION['alert-class'] = null; + unset($_SESSION['alert'], $_SESSION['alert-class']); + } + ?> +