$name, 'Email' => $email, 'Phone' => $phone, 'Message' => $message, 'Address' => $address, 'Zip_code' => $zip, 'Company' => $company, 'Invoice_number' => $invoiceNumber, 'Timestamp' => date('Y-m-d H:i:s', time()) ); if (!file_exists($contactHistoryFile)) { $header = array_keys($contactData); $history = array($header); } else { $history = array_map('str_getcsv', file($contactHistoryFile)); } $history[] = $contactData; $csvContent = fopen($contactHistoryFile, 'w'); foreach ($history as $row) { fputcsv($csvContent, $row); } fclose($csvContent); } if ( \S::get( 'a' ) == 'send_contact_form' and \S::get( 'token' ) == \S::get_session( 'send-contact-token' ) ) { // $recaptchaSecret = "6Lcil-sqAAAAAIgSvF2GggrOCQsn0D96qH_0o5ue"; // $recaptchaResponse = \S::get('g-recaptcha-response'); // $verifyResponse = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$recaptchaSecret}&response={$recaptchaResponse}"); // $responseData = json_decode($verifyResponse); // if (!$responseData->success) { // echo json_encode(['status' => 'error', 'message' => 'Error reCAPTCHA', 'm' => $recaptchaResponse]); // exit; // } if ( \S::get( 'name' ) and \S::get( 'email' ) and strposa( \S::get( 'name' ), $spam_words ) === false and strposa( \S::get( 'email' ), $spam_words ) === false and strposa( \S::get( 'phone' ), $spam_words ) === false and strposa( \S::get( 'country' ), $spam_words ) === false and strposa( \S::get( 'message' ), $spam_words ) === false ) { $text = '

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

'; $text .= '

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

'; $text .= '

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

'; $text .= '

Kraj: ' . \S::get( 'country' ) . '

'; $text .= '

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

'; if ( \S::get( 'form_check' ) == 'true' ) $text .= '

Zgoda na przetwarzanie danych osobowych: Tak

'; else $text .= '

Zgoda na przetwarzanie danych osobowych: Nie

'; if ( \S::get( 'form_check2' ) == 'true' ) $text .= '

Zgoda na otrzymywanie materiałów reklamowych: Tak

'; else $text .= '

Zgoda na otrzymywanie materiałów reklamowych: Nie

'; $text .= '

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

'; $send_email = 'sales@vidok.com'; if ( \S::get( 'country' ) == 'UNITED KINGDOM' ) { $send_email = 'enquiries@vidok.com'; } if ( \S::send_email( $send_email, 'Wiadomość ze strony gb.vidok.com', $text, \S::get('email') ) ) { saveContactData( \S::get( 'name' ), \S::get( 'email' ), \S::get( 'phone' ), nl2br(\S::get('your_message')), '', \S::get( 'country' ), '', '' ); echo json_encode( [ 'status' => 'ok' ] ); } else { echo json_encode( [ 'status' => 'error' ] ); } } else echo json_encode( [ 'status' => 'error' ] ); exit; } if ( \S::get('action') == 'send-contact-modal' and \S::get( 'token' ) == \S::get_session( 'modal-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' ) { 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 ) { $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 .= '

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

'; $text .= '

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

'; if ( \S::send_email( 'l.paczkowska@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) { saveContactData( \S::get('name'), \S::get('email'), \S::get('phone'), nl2br(\S::get('information')), \S::get('address'), '', '', '', ); \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); } else { \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); } } else \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( '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 .= '

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

'; $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.

'; if ( \S::send_email( 'l.paczkowska@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, ); saveContactData( \S::get( 'inputName' ), \S::get( 'inputEmail' ), \S::get( 'inputContactNumber' ), nl2br(\S::get('message')), \S::get( 'inputAdres' ), '', \S::get( 'inputCompanyName' ), \S::get( 'inputInvoiceNumber' ), ); \S::alert( \S::lang( 'wiadomosc-zostala-wyslana' ) ); } else { \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); } } else \S::alert( \S::lang( 'wiadomosc-niezostala-wyslana' ) ); 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' ) ) { $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' ) { 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 ) { $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' ) . '

'; if ( \S::send_email( 'l.paczkowska@vidok.com', 'Wiadomość ze strony vidok.com', $text, \S::get('email'), $files_to_send ) ) { saveContactData( \S::get('name'), \S::get('email'), \S::get('phone'), nl2br(\S::get('information')), \S::get('address'), '', '', '' ); \S::alert( \S::lang('wiadomosc-zostala-wyslana' ) ); } else { \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); } } else \S::alert( \S::lang('wiadomosc-niezostala-wyslana' ) ); \S::set_session( 'landing-sended', true ); header('Location: ' . $_SERVER['REQUEST_URI']); exit; }