<?php 
//Site Key: 6Le_z6sZAAAAAJRfl18nVN4Kvk0ETxhh5saXB8KV
//Secret Key: 6Le_z6sZAAAAAJfey5rFGb_PwGE2vWHY5uekk2Y2

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['recaptcha_response'])) {
    
    // Build POST request:
    $recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
    $recaptcha_secret = '6Le_z6sZAAAAAJfey5rFGb_PwGE2vWHY5uekk2Y2';
    $recaptcha_response = $_POST['recaptcha_response'];
    
    $recaptcha = file_get_contents($recaptcha_url . '?secret=' . $recaptcha_secret . '&response=' . $recaptcha_response);
    $recaptcha = json_decode($recaptcha);
    
    if ($recaptcha->score >= 0.5) {
        $headers = "From: Drink Submission <DrinkSubmission@drinkinthemagic.com.>\n" .
                      "MIME-Version: 1.0\n" .
                      "Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
                      "Content-Transfer-Encoding: 7bit";
    $firstname = trim($_POST['firstname']);
    $lastname = trim($_POST['lastname']);
    $email = trim($_POST['email']);
    $phone = trim($_POST['phone']);
    $address = trim($_POST['address']);
    $city = trim($_POST['city']);
    $state = trim($_POST['state']);
    $zip = trim($_POST['zip']);
        
    $comments = trim($_POST['comments']);  
    $response = $_POST['g-recaptcha-response'];
    $result = mail("consumeraffairs@citrusworld.com", "Drinkinthemagic.com Contact Form Submission", "The following contact form was submitted:\n\n First Name:". $firstname . "\n Last Name:" . $lastname . "\n Email:" .$email . "\n Phone:" .$phone. "\n Address:" .$address."\n City:" .$city."\n State:" .$state."\n Zip:" .$zip. "\n Comments:" .$comments . "\n", $headers);
    $thank_you = "Your comments have been received, you should receive a response shortly.";
    } else {
        $err_msg = 'Your comments have been received, you should receive a response shortly.';
    }
    
}
    

?>

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Disney Drinks</title>
        <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NW2NTZG');</script>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link href="https://fonts.googleapis.com/css?family=Londrina+Solid|Montserrat:700|Roboto&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="/css/reset.css"> <!-- CSS reset -->
        <link href="/css/lightbox.css" rel="stylesheet" />
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <link rel="apple-touch-icon" href="apple-touch-icon.png">

        <link href="https://fonts.googleapis.com/css?family=Raleway:400,100|Roboto+Condensed:700" rel="stylesheet" type="text/css">
        <link rel="stylesheet" href="/css/styles.css">

        <script src="/js/modernizr.js"></script> <!-- Modernizr -->
        
    </head>
    <body>
        <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NW2NTZG"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <nav class="navbar navbar-expand-lg navbar-light bg-light navbar-fixed-top">
    <div class="container">    
      <a class="navbar-brand" href="/"><img class="logo" alt="Disney" src="/img/logo.png"></a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNavDropdown">
        <ul class="navbar-nav ml-auto">
            <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              PRODUCTS
            </a>
                <?php
                    $hostname = getenv('HTTP_HOST');
                ?>
            <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
              <a class="dropdown-item" href="http://<?php echo $hostname; ?>//#slide01">Donald duck<br class="d-none d-lg-block"> orange juice</a>
              <a class="dropdown-item" href="http://<?php echo $hostname; ?>/#slide02">mickey mouse<br class="d-none d-lg-block"> fruit punch</a>
              <a class="dropdown-item" href="http://<?php echo $hostname; ?>/#slide03">goofy<br class="d-none d-lg-block"> tropical punch</a>
                <a class="dropdown-item" href="http://<?php echo $hostname; ?>/#slide04">Donald Duck<br class="d-none d-lg-block"> Apple Juice</a>
            </div>
          </li>
        <li class="nav-item">
            <a class="nav-link" href="/find/">FIND US</a>
          </li>    
          <li class="nav-item">
            <a class="nav-link" href="/contact/">CONTACT US</a>
          </li>
        </ul>
      </div>
    </div>
    </nav>

        <div class="firstContainer">

            <article id="intro" class="header-container fs">
                <div class="vertical-align">
                    <div class="container pb-5">
                        <div class="row">
                            <div class="col-md-12">
                                <h1 class="title"><img alt="Drink the Magic" src="/img/drinkTheMagic.png"></h1>
                                <p>Thank you for your interest in contacting CitrusWorld.</p>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-8 mx-auto purpleBackground">
                                <?php if (isset($thank_you) == false) { ?>
                                <p>We’ll be happy to answer any questions that you might have. Call us at 1-888-657-6600, or fill out our contact form below for a quick and easy way to ask questions or send us your comments and suggestions.
                                </p>
                                
                                <div class=""> 
                                <form id="contact-form" action="/contact/index.php" method="post" accept-charset="UTF-8"> 
                                    <div class="row">
                                        <div class="col-md-6">
                                            <label for="firstname">First Name *</label>
                                            <input type="text" class="form-control" id="firstname" name="firstname" placeholder="First Name" value="<?php echo $_POST['firstname']; ?>" required>
                                        </div>
                                        <div class="col-md-6">
                                            <label for="last">Last Name *</label>
                                            <input type="text" class="form-control" id="lastname" name="lastname" placeholder="Last Name" value="<?php echo $_POST['lastname']; ?>" required>
                                        </div>
                                    </div>
                                    <div class="row mt-3">
                                        <div class="col-md-6">
                                            <label for="email">Email *</label>
                                            <input type="email" class="form-control" id="email" name="email" aria-describedby="emailHelp" placeholder="Email" value="<?php echo $_POST['email']; ?>" required>
                                        </div>
                                        <div class="col-md-6">
                                            <label for="phone">Phone</label>
                                            <input type="text" class="form-control" id="phone" name="phone" placeholder="Phone" value="<?php echo $_POST['phone']; ?>">
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="row mt-3">
                                        <div class="col-md-6">
                                            <label for="address">Address</label>
                                            <input type="address" class="form-control" id="address" name="address" placeholder="Address" value="<?php echo $_POST['address']; ?>">
                                        </div>
                                        <div class="col-md-2">
                                            <label for="city">City</label>
                                            <input type="text" class="form-control" id="city" name="city" placeholder="City" value="<?php echo $_POST['city']; ?>">
                                        </div>
                                        <div class="col-md-2">
                                            <label for="state">State</label>
                                            <input type="text" class="form-control" id="state" name="state" placeholder="State" value="<?php echo $_POST['state']; ?>">
                                        </div>
                                        <div class="col-md-2">
                                            <label for="zip">Zip</label>
                                            <input type="text" class="form-control" id="zip" name="zip" placeholder="Zip" value="<?php echo $_POST['zip']; ?>">
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="row mt-3">
                                        <div class="col-md-12" >
                                            <label for="comments">Questions and Comments</label>
                                            <textarea rows="8" class="form-control" name="comments"><?php echo $_POST['comments']; ?></textarea>
                                        </div>
                                    </div>
                                    <div class="row mt-4">
                                        <div class="col-md-12 text-center">
                                            <input type="checkbox" id="over13" name="over13" value="over13" title="Must be 13 or older" required>
                                            Check here if you are over the age of 13. *
                                        </div>
                                    </div>
                                    
                                    <div class="row mt-3">
                                        <div class="col-md-12 text-center">
                                            <button type="submit" class="button purple g-recaptcha">Submit</button>
                                        </div>
                                    </div>
                                    <input type="hidden" name="recaptcha_response" id="recaptchaResponse">

                                </form>
                                </div>
                                <?php } else if(isset($err_msg)) { ?>
                                <p><?php echo $err_msg; ?></p>
                                <?php } else { ?>
                                <h2><?php echo $thank_you; ?></h2>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                </div>
            </article>
            
            

        </div> <!-- #main-container -->
          
        <div class="footer-container">
            <footer>
                <!--div class="container">
                    <div class="row">
                        <div class="col-12 text-center">
                            <a class="socialImg" target="_blank" href="https://www.facebook.com/drinkinthemagic/">
                                <img src="/img/footer/Facebook.png">
                            </a>
                            <a class="socialImg" target="_blank" href="https://www.instagram.com/drinkinthemagic/?hl=en">
                                <img src="/img/footer/insta.png">
                            </a>
                        </div>
                    </div>
                </div-->
                
                <div class="container">
                    <div class="legal">
                        <div class="row">
                            <div class="col-12 text-center">
                                <a target="_blank" href="/pdf/CWIPrivacyPolicy.pdf">Privacy Policy</a>
                                <img src="/img/footer/mickeyBullet.png">
                                <a target="_blank" href="/contact/">Feedback (for Grown-Ups)</a>
                            </div>
                        </div>
                        
                        <div class="row">
                            <div class="col-12 text-center mt-3">
                            &copy;Disney<br>
                            &copy;<?php echo date('Y'); ?> Citrus World, Inc. All Rights Reserved.
                            </div>
                        </div>
                    </div>    
                </div>
            </footer>
        </div>
         <div class="cookiesAgreement">
            <div class="container">
                <div class="row">
                    <div class="col-sm-2 text-right order-sm-2">
                        <span class="closeCookie"><img src="/img/closeButton.png"></span>
                    </div>
                    <div class="col-sm-10 order-sm-1">
                        <p>
                            We use cookies to analyze how visitors use our website and to help us provide the best possible experience for users.<br>
                            For more information, please view our <a class="white" target="_blank" href="/pdf/CWIPrivacyPolicy.pdf">Privacy Policy</a>.
                        </p>
                    </div>
                </div>
            </div>
        </div>
        
        <script src="https://www.google.com/recaptcha/api.js?render=6Le_z6sZAAAAAJRfl18nVN4Kvk0ETxhh5saXB8KV"></script>
        <script>
                grecaptcha.ready(function () {
                grecaptcha.execute('6Le_z6sZAAAAAJRfl18nVN4Kvk0ETxhh5saXB8KV', { action: 'contact' }).then(function (token) {
                    var recaptchaResponse = document.getElementById('recaptchaResponse');
                    recaptchaResponse.value = token;
                });
            });
        </script>
        
        

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>        <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
        <script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
        <script src="/js/jquery.cookie.js"></script>
        <script>
             $(document).ready(function () {
                if(typeof $.cookie('drinkinthemagicookie') === "undefined") {
                    $(".cookiesAgreement").show();
                 }
                 
                 $(".closeCookie").click(function(){
                     $.cookie('drinkinthemagicookie', '1', { expires: 7, path: '/' });
                     $(".cookiesAgreement").hide();
                 });
             });
        </script>

    </body>
</html>
