diff --git a/plugins/special-actions-middle.php b/plugins/special-actions-middle.php index ce5fc35..e845353 100644 --- a/plugins/special-actions-middle.php +++ b/plugins/special-actions-middle.php @@ -1,68 +1,242 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - $contactData = array( - 'Name' => str_replace( [ '\'', '"' ], '', $name ), - 'Email' => str_replace( [ '\'', '"' ], '', $email ), - 'Phone' => str_replace( [ '\'', '"' ], '', $phone ), - 'Message' => str_replace( [ "\n", "\r\n", "\r" ], ' ', str_replace( [ '\'', '"' ], '', $message ) ), - 'Zip_code' => str_replace( [ '\'', '"' ], '', $zip ), - 'Topic' => str_replace( [ '\'', '"' ], '', $title ), - 'Company' => str_replace( [ '\'', '"' ], '', $company ), - 'Invoice_number' => str_replace( [ '\'', '"' ], '', $invoiceNumber ), - 'Address' => str_replace( [ '\'', '"' ], '', $address ), - 'Timestamp' => date('Y-m-d H:i:s', time()), - 'Form_id' => str_replace( [ '\'', '"' ], '', $formId ), - ); + // Przygotowanie danych + $data = [ + 'form_id' => str_replace(['\'', '"'], '', $formId), + 'name' => str_replace(['\'', '"'], '', $name), + 'email' => str_replace(['\'', '"'], '', $email), + 'phone' => str_replace(['\'', '"'], '', $phone), + 'message' => str_replace(["\n", "\r\n", "\r"], ' ', str_replace(['\'', '"'], '', $message)), + 'zip_code' => str_replace(['\'', '"'], '', $zip), + 'topic' => str_replace(['\'', '"'], '', $title), + 'company' => str_replace(['\'', '"'], '', $company), + 'invoice_number' => str_replace(['\'', '"'], '', $invoiceNumber), + 'address' => str_replace(['\'', '"'], '', $address), + // Nowe pola + 'voivodeship' => str_replace(['\'', '"'], '', $voivodeship), + 'client_type' => str_replace(['\'', '"'], '', $clientType), + 'consent_offer' => (int)$consentOffer, + 'consent_marketing' => (int)$consentMarketing, + 'created_at' => date('Y-m-d H:i:s') + ]; - if (!file_exists($contactHistoryFile)) { - $header = array_keys($contactData); - $history = array($header); - } else { - $history = array_map('str_getcsv', file($contactHistoryFile)); + // Zaktualizowane zapytanie SQL + $sql = "INSERT INTO contact_messages + (form_id, name, email, phone, message, zip_code, topic, company, invoice_number, address, voivodeship, client_type, consent_offer, consent_marketing, created_at) + VALUES + (:form_id, :name, :email, :phone, :message, :zip_code, :topic, :company, :invoice_number, :address, :voivodeship, :client_type, :consent_offer, :consent_marketing, :created_at)"; + + $stmt = $pdo->prepare($sql); + $stmt->execute($data); } - $history[] = $contactData; - $csvContent = fopen($contactHistoryFile, 'w'); - foreach ($history as $row) { - fputcsv($csvContent, $row); + catch (PDOException $e) + { + error_log("Błąd zapisu do bazy danych: " . $e->getMessage()); } - fclose($csvContent); } -if ( \S::get( 'action' ) == 'send-contact' and \S::get( 'token' ) == \S::get_session( 'send-contact-token' ) and !\S::get( 'website' ) ) +if ( \S::get('action') == 'send-contact' and \S::get('token') == \S::get_session('send-contact-token') and !\S::get('website') ) { - if(isset($_POST['g-recaptcha-response'])){ - $captcha=$_POST['g-recaptcha-response']; + 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'] ); + if (!$captcha) + { + \S::alert("Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie."); + header('Location: ' . $_SERVER['REQUEST_URI']); exit; } $secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4"; @@ -70,72 +244,49 @@ if ( \S::get( 'action' ) == 'send-contact' and \S::get( 'token' ) == \S::get_ses // 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); + $responseKeys = json_decode($response, true); // should return JSON with success as true - if($responseKeys["success"]) { - if ( - \S::get( 'inputTitle' ) - and - \S::get( 'inputName' ) - and - \S::get( 'inputEmail' ) - and - \S::get( 'message' ) - and - strposa( \S::get( 'inputTitle' ), $spam_words ) === false - and - strposa( \S::get( 'inputName' ), $spam_words ) === false - and - strposa( \S::get( 'inputEmail' ), $spam_words ) === false - and - \S::get( 'message' ) ) + if ($responseKeys["success"]) + { + if ( \S::get('inputTitle') and \S::get('inputName') and \S::get('inputEmail') and \S::get('message') and strposa(\S::get('inputTitle'), $spam_words) === false and strposa(\S::get('inputName'), $spam_words) === false and strposa(\S::get('inputEmail'), $spam_words) === false and \S::get('message') ) { - $text = '

Temat: ' . \S::get( 'inputTitle' ) . '

'; - $text .= '

Imię i nazwisko: ' . \S::get( 'inputName' ) . '

'; - $text .= '

Email: ' . \S::get( 'inputEmail' ) . '

'; + $text = '

Temat: ' . \S::get('inputTitle') . '

'; + $text .= '

Imię i nazwisko: ' . \S::get('inputName') . '

'; + $text .= '

Email: ' . \S::get('inputEmail') . '

'; $text .= '

Wiadomość: ' . nl2br(\S::get('message')) . '

'; - $text .= '

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

'; + $text .= '

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

'; - saveContactData( - \S::get( 'inputName' ), - \S::get( 'inputEmail' ), - '', - \S::get('message'), - '', - \S::get( 'inputTitle' ), - '', - '', - '', - 'contact' - ); + saveContactData( \S::get('inputName'), \S::get('inputEmail'), '', \S::get('message'), '', \S::get('inputTitle'), '', '', '', 'contact' ); - if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) + 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@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::alert( \S::lang( 'wiadomosc-zostala-wyslana' ) ); + \S::send_email('k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email('arkuszevidok@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::alert(\S::lang('wiadomosc-zostala-wyslana')); } else - \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } else { - \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } - } else { - \S::alert( "Jesteś robotem!" ); } - header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + else + { + \S::alert("Jesteś robotem!"); + } + header('Location: ' . $_SERVER['REQUEST_URI']); exit; } -if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get_session( 'modal-token' ) and !\S::get( 'website' ) ) +if ( \S::get('action') == 'send-contact-modal' and \S::get('token') == \S::get_session('modal-token') and !\S::get('website') ) { $captcha = $_POST['g-recaptcha-response'] ?? null; - - if (!$captcha) { + if (!$captcha) + { \S::alert("Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie."); header('Location: ' . $_SERVER['REQUEST_URI']); exit; @@ -146,10 +297,11 @@ if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get $response = file_get_contents($url); $responseKeys = json_decode($response, true); - if (!$responseKeys['success']) { - \S::alert("Jesteś robotem!"); - header('Location: ' . $_SERVER['REQUEST_URI']); - exit; + if (!$responseKeys['success']) + { + \S::alert("Jesteś robotem!"); + header('Location: ' . $_SERVER['REQUEST_URI']); + exit; } @@ -157,33 +309,14 @@ if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get for ($i = 0; $i < $countfiles; $i++) { $filename = $_FILES['files']['name'][$i]; - if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' ) + if ($filename and pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION) != 'php') { move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename); $files_to_send[] = 'temp/' . $filename; } } - if ( - \S::get( 'name' ) - and - \S::get( 'email' ) - and - \S::get( 'address' ) - and - \S::get( 'phone' ) - and - \S::get( 'information' ) - and - strposa( \S::get( 'name' ), $spam_words ) === false - and - strposa( \S::get( 'email' ), $spam_words ) === false - and - strposa( \S::get( 'address' ), $spam_words ) === false - and - strposa( \S::get( 'phone' ), $spam_words ) === false - and - strposa( \S::get( 'information' ), $spam_words ) === false ) + if ( \S::get( 'name' ) and \S::get( 'email' ) and \S::get( 'address' ) and \S::get( 'phone' ) and strposa( \S::get( 'name' ), $spam_words ) === false and strposa( \S::get( 'email' ), $spam_words ) === false and strposa( \S::get( 'address' ), $spam_words ) === false and strposa( \S::get( 'phone' ), $spam_words ) === false and strposa( \S::get( 'information' ), $spam_words ) === false ) { $text = '

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

'; $text .= '

Email: ' . \S::get('email') . '

'; @@ -191,190 +324,125 @@ if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get $text .= '

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

'; $text .= '

Wiadomość: ' . nl2br(\S::get('information')) . '

'; $text .= '

wymiary swojej stolarki: ' . nl2br(\S::get('wymiaryStolarki')) . '

'; - $text .= '

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

'; + $text .= '

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

'; - saveContactData( - \S::get('name'), - \S::get('email'), - \S::get('phone'), - \S::get('information'), - \S::get('address'), - '', - '', - '', - '', - 'modal-contact-form' - ); + $zgoda1 = (\S::get('acceptance-323') == 1) ? 1 : 0; + $zgoda2 = (\S::get('acceptance-324') == 1) ? 1 : 0; + + $fullMessage = \S::get('information'); + if (\S::get('wymiaryStolarki')) { + $fullMessage .= "\n\n--- Wymiary stolarki ---\n" . \S::get('wymiaryStolarki'); + } + + saveContactData( \S::get('name'), \S::get('email'), \S::get('phone'), $fullMessage, \S::get('address'), '', '', '', '', 'modal-contact-form', '', '', $zgoda1, $zgoda2 ); 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@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); + \S::send_email('k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email('arkuszevidok@gmail.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'] . '?modal_form_sent=1'); } else - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } else - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); header('Location: ' . $_SERVER['REQUEST_URI']); exit; } -if ( \S::get( 'action' ) == 'send-services' and \S::get( 'token' ) == \S::get_session( 'form-token' ) and !\S::get( 'website' ) ) +if (\S::get('action') == 'send-services' and \S::get('token') == \S::get_session('form-token') and !\S::get('website')) { - if ( - \S::get( 'inputName' ) - and - \S::get( 'inputEmail' ) - and - \S::get( 'inputContactNumber' ) - and - \S::get( 'inputInvoiceNumber' ) - and - \S::get( 'inputAdres' ) - and - \S::get( 'message' ) - and - strposa( \S::get( 'inputName' ), $spam_words ) === false - and - strposa( \S::get( 'inputEmail' ), $spam_words ) === false - and - strposa( \S::get( 'inputContactNumber' ), $spam_words ) === false - and - strposa( \S::get( 'inputInvoiceNumber' ), $spam_words ) === false - and - strposa( \S::get( 'inputAdres' ), $spam_words ) === false - and - strposa( \S::get( 'message' ), $spam_words ) === false - ) + if ( \S::get('inputName') and \S::get('inputEmail') and \S::get('inputContactNumber') and \S::get('inputInvoiceNumber') and \S::get('inputAdres') and \S::get('message') and strposa(\S::get('inputName'), $spam_words) === false and strposa(\S::get('inputEmail'), $spam_words) === false and strposa(\S::get('inputContactNumber'), $spam_words) === false and strposa(\S::get('inputInvoiceNumber'), $spam_words) === false and strposa(\S::get('inputAdres'), $spam_words) === false and strposa(\S::get('message'), $spam_words) === false ) { - $text .= '

Nazwa firmy: ' . \S::get( 'inputCompanyName' ) . '

'; - $text .= '

Imię i nazwisko: ' . \S::get( 'inputName' ) . '

'; - $text .= '

Numer faktury sprzedażowej: ' . \S::get( 'inputInvoiceNumber' ) . '

'; - $text .= '

Numer kontaktowy: ' . \S::get( 'inputContactNumber' ) . '

'; - $text .= '

Email: ' . \S::get( 'inputEmail' ) . '

'; - $text .= '

Adres zgłoszenia: ' . \S::get( 'inputAdres' ) . '

'; + $text .= '

Nazwa firmy: ' . \S::get('inputCompanyName') . '

'; + $text .= '

Imię i nazwisko: ' . \S::get('inputName') . '

'; + $text .= '

Numer faktury sprzedażowej: ' . \S::get('inputInvoiceNumber') . '

'; + $text .= '

Numer kontaktowy: ' . \S::get('inputContactNumber') . '

'; + $text .= '

Email: ' . \S::get('inputEmail') . '

'; + $text .= '

Adres zgłoszenia: ' . \S::get('inputAdres') . '

'; $text .= '

Opis zgłoszenia: ' . nl2br(\S::get('message')) . '

'; - $text .= '

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

'; + $text .= '

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

'; $msg = '

Dziękujemy za kontakt z działem Serwisu i Reklamacji VIDOK.

Zgłoszenie ma obecnie status „rozpoczęte” i zostało zarejestrowane w naszej bazie danych. W przeciągu 5 dni roboczych, pracownik działu serwisu skontaktuje się z Państwem w celu informacji o statusie zgłoszenia.

'; - saveContactData( - \S::get( 'inputName' ), - \S::get( 'inputEmail' ), - \S::get( 'inputContactNumber' ), - \S::get('message'), - '', - '', - \S::get( 'inputCompanyName' ), - \S::get( 'inputInvoiceNumber' ), - \S::get( 'inputAdres' ), - 'services form' - ); + saveContactData( \S::get('inputName'), \S::get('inputEmail'), \S::get('inputContactNumber'), \S::get('message'), '', '', \S::get('inputCompanyName'), \S::get('inputInvoiceNumber'), \S::get('inputAdres'), 'services-form', '', '', 1, 1 ); - if ( \S::send_email( 'zgloszenia@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) + if (\S::send_email('zgloszenia@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send)) { - \S::send_email( 'serwis@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::send_email( \S::get( 'inputEmail' ), 'Wiadomość ze strony vidok.com',$msg, ); - \S::alert( \S::lang( 'wiadomosc-zostala-wyslana' ) ); + \S::send_email('serwis@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email(\S::get('inputEmail'), 'Wiadomość ze strony vidok.com', $msg,); + \S::alert(\S::lang('wiadomosc-zostala-wyslana')); } else - \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } else - \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); - header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + header('Location: ' . $_SERVER['REQUEST_URI']); exit; } -if ( \S::get('action') == 'send-contact-landing' and \S::get( 'token' ) == \S::get_session( 'landing-token' ) and !\S::get( 'website' ) ) +if (\S::get('action') == 'send-contact-landing' and \S::get('token') == \S::get_session('landing-token') and !\S::get('website')) { $countfiles = count($_FILES['files']['name']); for ($i = 0; $i < $countfiles; $i++) { $filename = $_FILES['files']['name'][$i]; - if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' ) + if ($filename and pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION) != 'php') { move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename); $files_to_send[] = 'temp/' . $filename; } } - if ( - \S::get( 'name' ) - and - \S::get( 'email' ) - and - \S::get( 'address' ) - and - \S::get( 'phone' ) - and - \S::get( 'information' ) - and - strposa( \S::get( 'name' ), $spam_words ) === false - and - strposa( \S::get( 'email' ), $spam_words ) === false - and - strposa( \S::get( 'address' ), $spam_words ) === false - and - strposa( \S::get( 'phone' ), $spam_words ) === false - and - strposa( \S::get( 'information' ), $spam_words ) === false - ) + if ( \S::get('name') and \S::get('email') and \S::get('address') and \S::get('phone') and \S::get('information') and strposa(\S::get('name'), $spam_words) === false and strposa(\S::get('email'), $spam_words) === false and strposa(\S::get('address'), $spam_words) === false and strposa(\S::get('phone'), $spam_words) === false and strposa(\S::get('information'), $spam_words) === false + ) { $text = '

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

'; $text .= '

Email: ' . \S::get('email') . '

'; $text .= '

Kod pocztowy: ' . \S::get('address') . '

'; $text .= '

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

'; $text .= '

Wiadomość: ' . nl2br(\S::get('information')) . '

'; - $text .= '

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

'; + $text .= '

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

'; - saveContactData( - \S::get('name'), - \S::get('email'), - \S::get('phone'), - \S::get('information'), - \S::get('address'), - '', - '', - '', - '', - 'landing form' - ); + saveContactData( \S::get('name'), \S::get('email'), \S::get('phone'), \S::get('information'), \S::get('address'), '', '', '', '', 'landing-form', '', '', 1, 1 ); - if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) + 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@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); + \S::send_email('k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email('arkuszevidok@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::alert(\S::lang('wiadomosc-zostala-wyslana')); } - else{ - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + else + { + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } } else - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); - \S::set_session( 'landing-sended', true ); + \S::set_session('landing-sended', true); header('Location: ' . $_SERVER['REQUEST_URI']); exit; } -if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S::get_session( 'contact-form-token' ) and !\S::get( 'website' ) ) +if (\S::get('action') == 'send-contact-form-new' and \S::get('token') == \S::get_session('contact-form-token') and !\S::get('website')) { - if(isset($_POST['g-recaptcha-response'])){ - $captcha=$_POST['g-recaptcha-response']; + 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'] ); + if (!$captcha) + { + \S::alert("Weryfikacja reCaptcha nie powiodła się. Proszę spróbować ponownie."); + header('Location: ' . $_SERVER['REQUEST_URI']); exit; } $secretKey = "6LfaovglAAAAAAz84QLdbONodP1yJUpSOVTnFMt4"; @@ -382,15 +450,16 @@ if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S:: // 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); + $responseKeys = json_decode($response, true); // should return JSON with success as true - if($responseKeys["success"]) { + if ($responseKeys["success"]) + { $countfiles = count($_FILES['files']['name']); for ($i = 0; $i < $countfiles; $i++) { $filename = $_FILES['files']['name'][$i]; - if ($filename and pathinfo( $_FILES['files']['name'][$i], PATHINFO_EXTENSION ) != 'php' ) + if ($filename and pathinfo($_FILES['files']['name'][$i], PATHINFO_EXTENSION) != 'php') { move_uploaded_file($_FILES['files']['tmp_name'][$i], 'temp/' . $filename); $files_to_send[] = 'temp/' . $filename; @@ -398,28 +467,9 @@ if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S:: } - if ( - \S::get( 'name' ) - and - \S::get( 'email' ) - and - \S::get( 'postal_code' ) - and - \S::get( 'phone' ) - and - \S::get( 'voivodeship' ) - and - \S::get( 'client' ) - and - strposa( \S::get( 'name' ), $spam_words ) === false - and - strposa( \S::get( 'email' ), $spam_words ) === false - and - strposa( \S::get( 'postal_code' ), $spam_words ) === false - and - strposa( \S::get( 'phone' ), $spam_words ) === false - and - strposa( \S::get( 'message' ), $spam_words ) === false ) + if ( \S::get('name') and \S::get('email') and \S::get('postal_code') and \S::get('phone') and \S::get('voivodeship') and \S::get('client') and strposa(\S::get('name'), $spam_words) === false and strposa(\S::get('email'), $spam_words) === false and + strposa(\S::get('postal_code'), $spam_words) === false and strposa(\S::get('phone'), $spam_words) === false and strposa(\S::get('message'), $spam_words) === false + ) { $text = '

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

'; $text .= '

Email: ' . \S::get('email') . '

'; @@ -428,74 +478,62 @@ if ( \S::get('action') == 'send-contact-form-new' and \S::get( 'token' ) == \S:: $text .= '

Klient: ' . \S::get('client') . '

'; $text .= '

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

'; $text .= '

Wiadomość: ' . nl2br(\S::get('message')) . '

'; - $text .= '

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

'; + $text .= '

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

'; - saveContactData( - \S::get('name'), - \S::get('email'), - \S::get('phone'), - \S::get('message'), - \S::get('postal_code'), - '', - '', - '', - '', - 'contact-form' - ); + $zgoda1 = (\S::get('zgoda_1') == 'on' || \S::get('zgoda_1') == 1) ? 1 : 0; + $zgoda2 = (\S::get('zgoda_2') == 'on' || \S::get('zgoda_2') == 1) ? 1 : 0; - if ( \S::send_email( 'marketing@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) + saveContactData( \S::get('name'), \S::get('email'), \S::get('phone'), \S::get('message'), \S::get('postal_code'), '', '', '', '', 'contact-form-new', \S::get('voivodeship'), \S::get('client'), $zgoda1, $zgoda2 ); + + 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@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); + \S::send_email('k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email('arkuszevidok@gmail.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' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } else - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); - } else { - \S::alert( "Jesteś robotem!" ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } - header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + else + { + \S::alert("Jesteś robotem!"); + } + 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 (\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 (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'] ); + + 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); + $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 - ){ + 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'; @@ -509,25 +547,35 @@ if ( \S::get('action') == 'send-partner-form-new' and \S::get( 'token' ) == \S:: $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' ) . '

'; + $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 ) ) + $fullName = \S::get('name') . ' ' . \S::get('surname'); + $zgoda1 = (\S::get('aggrement1') == 'on') ? 1 : 0; + $zgoda2 = (\S::get('aggrement2') == 'on') ? 1 : 0; + + $messageContent = 'Interesują mnie: ' . \S::get('interesting-me'); + + saveContactData( $fullName, \S::get('email'), \S::get('phone'), $messageContent, '', \S::get('interesting-me'), \S::get('company'), '', \S::get('company_address'), 'partner-form-new', '', \S::get('partner-type'), $zgoda1, $zgoda2 ); + + 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@gmail.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ); - \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); + \S::send_email('k.zarzyczny@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send); + \S::send_email('arkuszevidok@gmail.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' ) ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } else - \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); - } else { - \S::alert( "Jesteś robotem!" ); + \S::alert(\S::lang('wiadomosc-niezostala-wyslana')); } - header( 'Location: ' . $_SERVER['REQUEST_URI'] ); + else + { + \S::alert("Jesteś robotem!"); + } + header('Location: ' . $_SERVER['REQUEST_URI']); exit; -} \ No newline at end of file +} diff --git a/templates_user/page-contact-v3.php b/templates_user/page-contact-v3.php deleted file mode 100644 index 11ad53a..0000000 --- a/templates_user/page-contact-v3.php +++ /dev/null @@ -1,1573 +0,0 @@ - - - -
-
-
-
- -
-
-
-
-
-
-
-

Kontakt

-
- VIDOK SP. Z O.O.
- 36-054 Rudna Mała 75 -
-
- KRS Nr. 0000191980
- REGON: 690379060
- NIP: PL8131086710 -
-
- -
- ING BANK ŚLĄSKI S.A.
- SWIFT INGBPLPW -
- -
- EUR: PL 84 1050 1562 1000 0090 3034 4213
- PLN: PL 31 1050 1562 1000 0090 3034 4197 -
-
- -
-
- SEKRETARIAT -
- - -
- SERWIS -
- -
- MARKETING -
- -
- - -
-
-
-
-

Masz pytania dotyczące naszych produktów lub chcesz otrzymać wycenę?

-

Wypełnij poniższy formularz kontaktowy- nasz specjalista skontaktuje się z Tobą
i odpowie na wszystkie pytania.

-
-
-
- - - - -
- - -
-
- - -
-
-
- -
- -
-
- - -
-
- - -
-
-
-
- -
-
Chcesz przesłać nam wizualizacje, projekt lub inne materiały? Skorzystaj z pola poniżej i dodaj plik do wiadomości.
-
- - -
-
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    Obsługa klientów indywidualnych
    - - -
    Obsługa klientów instytucjonalnych
    - - -
    OBSŁUGA PARTNERÓW HANDLOWYCH POLSKA
    - - -
    Obsługa partnerów handlowych EXPORT
    - -
    -
    -
    - -
    -
    -
    ZNAJDŹ SALON
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -

    VIDOK spółka z ograniczoną odpowiedzialnością z siedzibą w Rudnej Małej, Rudna Mała 75, 36-054 Rudna Mała, wpisana do rejestru przedsiębiorców KRS pod numerem: 0000191980, Sąd Rejonowy w Rzeszowie XII Wydział Krajowego Rejestru Sądowego NIP: 8131086710 REGON: 690379060 o kapitale zakładowym w wysokości 11.606.000,00 zł oświadcza, iż posiada status dużego przedsiębiorcy w rozumieniu przepisów ustawy z dnia 8 marca 2013 r. o przeciwdziałaniu nadmiernym opóźnieniom w transakcjach handlowych (Dz.U. z 2020 r. poz. 935 z późn. zm.).

    -
    -
    -
    -
    -
    -
    -
    - - - - - - - \ No newline at end of file diff --git a/templates_user/page-contact-v4.php b/templates_user/page-contact-v4.php deleted file mode 100644 index 35ac2e2..0000000 --- a/templates_user/page-contact-v4.php +++ /dev/null @@ -1,722 +0,0 @@ - - 'PODKARPACKIE, ŚWIĘTOKRZYSKIE, MAŁOPOLSKIE, LUBELSKIE, MAZOWIECKIE', - 'position' => 'Doradca ds. Kluczowych Klientów', - 'name' => 'Łukasz Cieślachowski', - 'phones' => [ - [ - 'label' => 'tel.', - 'value' => '+48 602 374 711' - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'l.cieslachowski@vidok.com' - ] - ] - ] -]; - -$partnerzy_handlowi_export = [ - [ - 'title' => 'NIEMCY | DE
    AUSTRIA | AU', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+48 880 914 179', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'anfrage@vidok.com', - ] - ], - ], - [ - 'title' => 'WIELKA BRYTANIA | UK', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+48 882 399 733', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'enquiries@vidok.com', - ] - ], - ], - [ - 'title' => 'IRLANDIA | IR
    USA | US
    KANADA | CA
    AUSTRALIA | AU
    ', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+48 17 853 92 46', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'sales@vidok.com', - ] - ], - ], - [ - 'title' => 'FRANCJA | FR
    BELGIA | BE
    HISZPANIA | ES
    SZWAJCARIA | CH
    WĘGRY | HU', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+48 17 85 95 663', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'contact@vidok.com', - ] - ], - ], - [ - 'title' => 'WŁOCHY | IT', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+48 17 859 56 72', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'ufficio@vidok.com', - ] - ] - ], - [ - 'title' => 'SŁOWACJA | SK
    CZECHY | CZ', - 'phones' => [ - [ - 'label' => 'tel.:', - 'value' => '+421 901 732 575', - ] - ], - 'emails' => [ - [ - 'label' => 'e-mail:', - 'value' => 'vidok.sk@gmail.com', - ] - ], - ], -]; -?> - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    -

    Siedziba firmy

    - -
    -

    VIDOK SP. Z O. O.

    -

    36-054 Rudna Mała 75

    -
    - -
    -

    KRS Nr. 0000191980

    -

    REGON: 690379060

    -

    NIP: 8131086710

    -
    -

    +48 17 859 56 60

    -

    sekretariat@vidok.com

    -

    pon. - pt. 7:00 - 15:00

    -
    - -
    - -
    - ING BANK ŚLĄSKI S.A.
    - SWIFT INGBPLPW -
    - -
    - PLN: PL 31 1050 1562 1000 0090 3034 4197
    - EUR: PL 84 1050 1562 1000 0090 3034 4213 -
    -
    - - -
    -
    -
    -
    -
    -

    Masz pytania dotyczące naszych produktów lub chcesz otrzymać wycenę?

    -

    Wypełnij poniższy formularz kontaktowy- nasz specjalista skontaktuje się z Tobą
    i odpowie na wszystkie pytania.

    -
    -
    -
    - - - - -
    - - -
    -
    - - -
    -
    -
    - -
    - -
    -
    - - -
    -
    - - -
    -
    -
    -
    - -
    -
    Chcesz przesłać nam wizualizacje, projekt lub inne materiały? Skorzystaj z pola poniżej i dodaj plik do wiadomości.
    -
    - - -
    -
      -
      -
      -
      -
      - - -
      -
      -
      -
      - - -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      -
      - -
      -
      -
      - - -
      - -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - - -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - - -
      -
      -
      - -
      -
      -

      WOJEWÓDZTWA

      -

      -
      -
      -

      -

      -
      -
      - - - - - - - - - - - -
      -
      - -
      -
      -
      - - -
      -
      -
      - -
      -
      -

      - -

      -
      -
      - - - - - - - - - - - -
      -
      - -
      -
      -
      -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      -

      LOGISTYKA

      - -
      -
      -

      KSIĘGOWOŚĆ

      - -
      -
      -

      MARKETING

      - -
      -
      -

      SERWIS

      - -
      -
      -
      -
      -
      -
      -
      - - - - - - - \ No newline at end of file diff --git a/templates_user/page-contact.php b/templates_user/page-contact.php deleted file mode 100644 index 0e6058b..0000000 --- a/templates_user/page-contact.php +++ /dev/null @@ -1,1140 +0,0 @@ - - -
      -
      -
      -
      - -
      -
      -

      Kontakt

      -
      -
      VIDOK Sp. z o.o.
      -
      -
      - -
      -
      - 36-054 MROWLA Rudna Mała 75
      - NIP: 813-10-86-710
      - ING Bank Śląski S.A.
      - 31 1050 1562 1000 0090 3034 4197 -
      -
      -
      -
      - -
      - -
      -
      Siedziba firmy
      - -
      -
      - -
      - -
      -
      -
      -
      -

      Skontaktuj się z nami

      -
      Masz pytania dotyczące naszych produktów lub chcesz otrzymać wycenę? Wypełnij poniższy formularz kontaktowy - nasz specjalista skontaktuje się z Tobą i odpowie na wszystkie pytania.
      -
      - - - - -
      - - -
      -
      - - -
      -
      - -
      -
      -
      - - -
      -
      - - -
      -
      -
      - -
      -
      Chcesz przesłać nam wizualizacje, projekt lub inne materiały? Skorzystaj z pola poniżej i dodaj plik do wiadomości.
      -
      - - -
      -
        -
        -
        -
        -
        - Wyrażam zgodę na przetwarzanie moich danych osobowych podanych przeze mnie powyżej w celu przygotowania stosownej oferty. -
        -
        -
        -
        - Wyrażam zgodę na przetwarzanie moich danych osobowych podanych przeze mnie powyżej w celu otrzymywania materiałów reklamowych. -
        -
        -
        - -
        -
        -
        -
        - -
        -
        VIDOK spółka z ograniczoną odpowiedzialnością z siedzibą w Rudnej Małej, Rudna Mała 75, 36-054 Mrowla, wpisana do rejestru przedsiębiorców KRS pod numerem: 0000191980, Sąd Rejonowy w Rzeszowie XII Wydział Krajowego Rejestru Sądowego NIP: 8131086710 REGON: 690379060 o kapitale zakładowym w wysokości 11.606.000,00 zł oświadcza, iż posiada status dużego przedsiębiorcy w rozumieniu przepisów ustawy z dnia 8 marca 2013 r. o przeciwdziałaniu nadmiernym opóźnieniom w transakcjach handlowych (Dz.U. z 2020 r. poz. 935 z późn. zm.).
        -
        -
        -
        Obsługa klientów indywidualnych
        - - -
        Obsługa klientów instytucjonalnych
        - - -
        POLSKA OBSŁUGA PARTNERÓW HANDLOWYCH
        - - -
        EXPORT Obsługa partnerów handlowych
        - - -
        MARKETING
        - - -
        SERWIS
        - -
        - -
        -
        Wybierz sprawdzonego producenta
        -
        Firma VIDOK powstała w 1993 roku. Najpierw specjalizowała się w pośrednictwie w sprzedaży okien PVC, jednak już rok później rozpoczęła własną produkcję. W naszej ofercie znajdowały się wówczas okna PVC, ale już niebawem pojawiły się również okna aluminiowe i okna drewniane. W kolejnych latach nastąpił dynamiczny rozwój firmy, która zyskała kilkadziesiąt punktów handlowych oraz zaczęła importować produkty do krajów Unii Europejskiej. Zmodernizowaliśmy produkcję, uruchamiając nowoczesne hale produkcyjno-magazynowe oraz wdrażając technologie oparte na robotach najnowszej generacji łączących w idealną całość nasze okna.
        -
        Firma VIDOK powstała w 1993 roku. Najpierw specjalizowała się w pośrednictwie w sprzedaży okien PVC, jednak już rok później rozpoczęła własną produkcję. W naszej ofercie znajdowały się wówczas okna PVC, ale już niebawem pojawiły się również okna aluminiowe i okna drewniane. W kolejnych latach nastąpił dynamiczny rozwój firmy, która zyskała kilkadziesiąt punktów handlowych oraz zaczęła importować produkty do krajów Unii Europejskiej. Zmodernizowaliśmy produkcję, uruchamiając nowoczesne hale produkcyjno-magazynowe oraz wdrażając technologie oparte na robotach najnowszej generacji łączących w idealną całość nasze okna.
        - Czytaj więcej -
        -
        -
        -
        -
        - - - - - \ No newline at end of file diff --git a/templates_user/service.php b/templates_user/service.php index 3031328..859c8fd 100644 --- a/templates_user/service.php +++ b/templates_user/service.php @@ -48,27 +48,6 @@

        Polityka prywatnosci

        -