157 lines
6.4 KiB
PHP
157 lines
6.4 KiB
PHP
<?php
|
|
if (\S::get('action') == 'home_form_acc_demo') {
|
|
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|
$recaptchaSecret = '6Le9GhEqAAAAAKUCOPR9QGXs4G81OGZ2CxUOu7rW';
|
|
$recaptchaResponse = $_POST['g-recaptcha-response'];
|
|
|
|
// Verify reCAPTCHA
|
|
$response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$recaptchaSecret}&response={$recaptchaResponse}");
|
|
$responseKeys = json_decode($response, true);
|
|
|
|
if ($responseKeys["success"]) {
|
|
$hubspot_url = "https://api.hsforms.com/submissions/v3/integration/submit/7094950/61a39ae1-e740-4ee3-bf09-987df5f9c279";
|
|
$hubspotutk = isset($_COOKIE['hubspotutk']) ? $_COOKIE['hubspotutk'] : null;
|
|
|
|
$postData = [
|
|
'fields' => [
|
|
[
|
|
'name' => 'firstname',
|
|
'value' => $_POST['name']
|
|
],
|
|
// [
|
|
// 'name' => 'lastname',
|
|
// 'value' => ''
|
|
// ],
|
|
[
|
|
'name' => 'email',
|
|
'value' => $_POST['email'],
|
|
],
|
|
[
|
|
'name' => 'phone',
|
|
'value' => $_POST['phone'],
|
|
],
|
|
[
|
|
'name' => 'strona_www_firmy',
|
|
'value' => $_POST['www_firmy']
|
|
], [
|
|
'name' => 'LEGAL_CONSENT.subscription_type_8488293',
|
|
'value' => $_POST['checkbox-1'] ? 'true' : 'false'
|
|
], [
|
|
'name' => 'LEGAL_CONSENT.processing',
|
|
'value' => $_POST['checkbox-2'] ? 'true' : 'false'
|
|
]
|
|
],
|
|
'context' => [
|
|
'hutk' => $hubspotutk,
|
|
'pageUri' => 'https://zaufane.pl/',
|
|
'pageName' => 'zaufane.pl'
|
|
],
|
|
'legalConsentOptions' => [
|
|
'consent' => [
|
|
'content' => 'By submitting this form, you agree that we may use the data you provide to contact you with information related to your request/submission and the relevant LinkedIn product. If you are a LinkedIn member, you can control the messages you receive from LinkedIn in your settings. If you are a guest, you can unsubscribe from LinkedIn marketing emails at any time by clicking the unsubscribe link in the email. To learn more, see LinkedIn\'s Privacy Policy.',
|
|
'consentToProcess' => true,
|
|
'text' => 'I agree to the processing of my personal data by LinkedIn.',
|
|
'communications' => [
|
|
[
|
|
'value' => true,
|
|
'subscriptionTypeId' => 7094950,
|
|
'text' => 'I agree to receive marketing communications from LinkedIn.'
|
|
]
|
|
]
|
|
]
|
|
]
|
|
];
|
|
|
|
$jsonData = json_encode($postData);
|
|
|
|
// Initialize cURL
|
|
$ch = curl_init($hubspot_url);
|
|
|
|
// Set cURL options
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
|
|
curl_setopt($ch, CURLOPT_POST, true);
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
|
|
|
// Execute cURL request
|
|
$response = curl_exec($ch);
|
|
|
|
// Check for errors
|
|
if ($response === false) {
|
|
$error = curl_error($ch);
|
|
echo "cURL Error: $error";
|
|
} else {
|
|
// Decode response
|
|
$responseData = json_decode($response, true);
|
|
if (isset($responseData['inlineMessage'])) {
|
|
echo "<div id='form-acc-demo-response'><p>" . $responseData['inlineMessage'] . '</p></div>';
|
|
} else {
|
|
echo "<div id='form-acc-demo-response'><p>" . $response . '</p></div>';
|
|
}
|
|
}
|
|
|
|
// Close cURL session
|
|
curl_close($ch);
|
|
|
|
header("Location: /demo-thanks");
|
|
exit();
|
|
?>
|
|
<script class="footer">
|
|
$(document).ready(function() {
|
|
$('#form-acc-demo').remove()
|
|
})
|
|
</script>
|
|
<?php
|
|
} else {
|
|
// echo 'Please complete the CAPTCHA';
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
|
|
<form method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>" id="form-acc-demo">
|
|
<input type="hidden" name="action" value="home_form_acc_demo">
|
|
|
|
<h2>Załóż konto DEMO</h2>
|
|
|
|
<div class="f-row">
|
|
<div class="tile">
|
|
<input type="text" name="name" id="form-name" placeholder="" required>
|
|
<label for="form-name">Imię i nazwisko</label>
|
|
</div>
|
|
<div class="tile">
|
|
<input type="email" name="email" id="form-email" placeholder="" required>
|
|
<label for="form-email">Adres e-mail</label>
|
|
</div>
|
|
<div class="tile">
|
|
<input type="text" name="phone" id="form-phone" placeholder="" required>
|
|
<label for="form-phone">Nr telefonu</label>
|
|
</div>
|
|
<div class="tile">
|
|
<input type="text" name="www_firmy" id="form-www" placeholder="" required>
|
|
<label for="form-www">Adres Twojej strony www</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="checkbox-row">
|
|
<input type="checkbox" name="" id="checkbox-1" required>
|
|
<label for="checkbox-1">Potwierdzam zapoznanie się i akceptację <a href="https://app-na1.hubspotdocuments.com/documents/7094950/view/1181544052?accessId=5c9343" rel="noopener">OWU </a>oraz <a href="https://app-na1.hubspotdocuments.com/documents/7094950/view/836952327?accessId=08d062" rel="noopener">Umowy Powierzenia Danych Osobowych</a> zgodnej z art. 28 RODO: OWU, RODO.<span class="hs-form-required">*</span></label>
|
|
</div>
|
|
|
|
<div class="checkbox-row">
|
|
<input type="checkbox" name="" id="checkbox-2" required>
|
|
<label for="checkbox-2">Przesyłając formularz wyrażam zgodę na przechowywanie i przetwarzanie moich danych osobowych przez Zaufane.pl.<span class="hs-form-required">*</span></label>
|
|
</div>
|
|
|
|
<div class="tile small">Użytkownik może zrezygnować z subskrypcji tych wiadomości w dowolnym momencie. Aby uzyskać więcej informacji na temat sposobu rezygnacji z subskrypcji, naszych praktyk w zakresie prywatności oraz naszego zaangażowania w ochronę i poszanowanie prywatności użytkownika, należy zapoznać się z naszą <a href="https://app-na1.hubspotdocuments.com/documents/7094950/view/836952327?accessId=08d062" rel="noopener">Polityką prywatności.</a></div>
|
|
|
|
|
|
<div class="btn-row">
|
|
<div class="g-recaptcha" data-sitekey="6Le9GhEqAAAAAASXQqtDHPWmC1qJyLocYLZD2KAR"></div>
|
|
<button type="submit" class="btn">Zarejestruj swoje konto</button>
|
|
</div>
|
|
|
|
<img class="star star-1" src="/upload/filemanager/Pages/home-new/solar_star-bold.svg" alt="">
|
|
<img class="star star-2" src="/upload/filemanager/Pages/home-new/solar_star-bold.svg" alt="">
|
|
<img class="star star-3" src="/upload/filemanager/Pages/home-new/solar_star-bold.svg" alt="">
|
|
</form>
|