<?php
function process_form()
{
    if (!isset($_POST['flood-contact-form'])) {
        return;
    }
    if ($_POST['flood-contact-form'] !== "endive-flood-form") {
        return;
    }
    if (empty($_POST['name'])) {
        return;
    }
    if (empty($_POST['email'])) {
        return;
    }
    if (strpos($_POST['email'], '@') === false) {
        return;
    }
    if (empty($_POST['message'])) {
        return;
    }

    mail('ria@witloof.ca', 'Flood Contact Form Received', "
    Name: {$_POST['name']}
    Email: {$_POST['email']}
    Message: {$_POST['message']}
    ");
    header("Location: /contact.php?form-submitted=true");
    exit;
}
process_form();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Van Eekelen Enterprises Ltd.</title>
    <link href="/contact.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
        <!--
        function MM_swapImgRestore() { //v3.0
            var i, x, a = document.MM_sr;
            for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
        }

        function MM_preloadImages() { //v3.0
            var d = document;
            if (d.images) {
                if (!d.MM_p) d.MM_p = new Array();
                var i, j = d.MM_p.length,
                    a = MM_preloadImages.arguments;
                for (i = 0; i < a.length; i++)
                    if (a[i].indexOf("#") != 0) {
                        d.MM_p[j] = new Image;
                        d.MM_p[j++].src = a[i];
                    }
            }
        }

        function MM_findObj(n, d) { //v4.01
            var p, i, x;
            if (!d) d = document;
            if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
                d = parent.frames[n.substring(p + 1)].document;
                n = n.substring(0, p);
            }
            if (!(x = d[n]) && d.all) x = d.all[n];
            for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
            for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
            if (!x && d.getElementById) x = d.getElementById(n);
            return x;
        }

        function MM_swapImage() { //v3.0
            var i, j = 0,
                x, a = MM_swapImage.arguments;
            document.MM_sr = new Array;
            for (i = 0; i < (a.length - 2); i += 3)
                if ((x = MM_findObj(a[i])) != null) {
                    document.MM_sr[j++] = x;
                    if (!x.oSrc) x.oSrc = x.src;
                    x.src = a[i + 2];
                }
        }
        //
        -->
    </script>
    <style type="text/css">
        <!--
        .style1 {
            color: #59A633;
            font-weight: bold;
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 16px;
        }
        -->
    </style>
    <script language="JavaScript" fptype="dynamicanimation">
        <!--
        function dynAnimation() {}

        function clickSwapImg() {}
        //
        -->
    </script>
    <script language="JavaScript1.2" fptype="dynamicanimation" src="animate.js">
    </script>
</head>

<body bgcolor="#59A633" onload="MM_preloadImages('images/company-over.gif','images/what-over.gif','images/products-over.gif','images/gallery-over.gif','images/recepies-over.gif','images/links-over.gif','images/contact-over.gif','images/line.gif')" language="Javascript1.2">
    <table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="4" rowspan="3" bgcolor="#777777">&nbsp;</td>
            <td colspan="2"><a href="index.php"><img src="images/header.gif" width="893" height="165" border="0" /><br />
                    <img src="images/subheader.gif" alt="Van Eekelen Enterprises Ltd." width="893" height="32" border="0" /></a>
            </td>
            <td width="4" rowspan="3" bgcolor="#777777">&nbsp;</td>
        </tr>
        <tr bgcolor="#FFFFFF">
            <td width="146" valign="top" bgcolor="#6F6F6F">
                <p class="style1"><a href="company.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('company','','images/company-over.gif',1)"><img src="images/company.gif" alt="Company Profile" name="company" width="146" height="27" border="0" id="company" /></a><a href="what.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('what','','images/what-over.gif',1)"><img src="images/what.gif" alt="What is Witloof" name="what" width="146" height="27" border="0" id="what" /></a><a href="products.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('products','','images/products-over.gif',1)"><img src="images/products.gif" alt="Products" name="products" width="146" height="27" border="0" id="products" /></a><a href="recipes.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Recepies','','images/recepies-over.gif',1)"><img src="images/recepies.gif" alt="Recepies" name="Recepies" width="146" height="27" border="0" id="Recepies" /></a><a href="links.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('links','','images/links-over.gif',1)"><img src="images/links.gif" alt="Links" name="links" width="146" height="27" border="0" id="links" /></a><a href="contact.php" onmouseout="document['fpAnimswapImgFP2'].src=document['fpAnimswapImgFP2'].imgRolln" onmouseover="var img=document['fpAnimswapImgFP2'];img.imgRolln=img.src;img.src=img.lowsrc?img.lowsrc:img.getAttribute?img.getAttribute('lowsrc'):img.src;"><img src="images/contact.gif" alt="Contact" name="fpAnimswapImgFP2" width="146" height="27" border="0" id="fpAnimswapImgFP2" dynamicanimation="fpAnimswapImgFP2" lowsrc="images/contact-over.gif" /></a> <a href="http://www.endive.ca" target="_blank" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('endive','','images/endive-o.gif',1)"><img src="images/endive.gif" alt="Endive.ca" name="endive" width="146" height="27" border="0" id="contact" /><img src="images/line.gif" alt="" width="146" height="2" border="0" /><img src="images/spacer.gif" width="1" height="1" border="0" /></a><BR />
                </p>
            </td>
            <td width="757" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="30">
                    <tr>
                        <td>
                            <p class="style1">Contact<br>
                                &nbsp;</p>
                            <table border="0" width="100%">
                                <tr>
                                    <td width="271">
                                        <font face="Arial" size="2" color="#777777"><b>Mail To:<br>
                                                <br>
                                                Van Eekelen
                                                Enterprises Ltd.</b><br>
                                            38900 No.4 Road<br>
                                            Abbotsford, BC&nbsp; V3G 2G2<br>
                                            Canada</font>
                                    </td>
                                    <td width="39">&nbsp;</td>
                                    <td rowspan="3"><iframe width="360" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=38900+no.4+road+abbotsford+bc&amp;sll=28.22697,-73.916016&amp;sspn=55.045494,78.75&amp;ie=UTF8&amp;g=38900+no.4+road+abbotsford+bc&amp;t=h&amp;s=AARTsJp56MZnKCgIVIa8unEdtL0tVK-UKg&amp;ll=49.082636,-122.142906&amp;spn=0.019676,0.036478&amp;z=14&amp;iwloc=addr&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;hl=en&amp;geocode=&amp;q=38900+no.4+road+abbotsford+bc&amp;sll=28.22697,-73.916016&amp;sspn=55.045494,78.75&amp;ie=UTF8&amp;g=38900+no.4+road+abbotsford+bc&amp;t=h&amp;ll=49.082636,-122.142906&amp;spn=0.019676,0.036478&amp;z=14&amp;iwloc=addr&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></a></small></td>
                                </tr>
                                <tr>
                                    <td width="271">
                                        <hr>
                                    </td>
                                    <td width="39">&nbsp;</td>
                                </tr>
                                <tr>
                                    <td width="271">
                                        <table border="0" width="100%">
                                            <tr>
                                                <td width="99"><b>
                                                        <font size="2" face="Arial" color="#777777">Phone</font>
                                                    </b></td>
                                                <td width="15">&nbsp;</td>
                                                <td>
                                                    <font size="2" face="Arial" color="#777777">
                                                        604.852.4009</font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="99"><b>
                                                        <font size="2" face="Arial" color="#777777">Fax</font>
                                                    </b></td>
                                                <td width="15">&nbsp;</td>
                                                <td>
                                                    <font size="2" face="Arial" color="#777777">
                                                        604.852.4090</font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="99"><b>
                                                        <font size="2" face="Arial" color="#777777">Office Email</font>
                                                    </b></td>
                                                <td width="15">&nbsp;</td>
                                                <td>
                                                    <font size="2" face="Arial" color="#777777">
                                                        <a href="mailto:vee@witloof.ca">vee@witloof.ca</a>
                                                    </font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="99"><b>
                                                        <font face="Arial" size="2" color="#777777">Ria Email</font>
                                                    </b></td>
                                                <td width="15">&nbsp;</td>
                                                <td><a href="mailto:ria@witloof.ca">
                                                        <font face="Arial" size="2">ria</font>
                                                    </a>
                                                    <font size="2" face="Arial" color="#777777"><a href="mailto:ria@witloof.ca">@witloof.ca</a></font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="99"><b>
                                                        <font face="Arial" size="2" color="#777777">Marinus Email</font>
                                                    </b></td>
                                                <td width="15">&nbsp;</td>
                                                <td><a href="mailto:marinus@witloof.ca">
                                                        <font face="Arial" size="2">marinus</font>
                                                    </a>
                                                    <font size="2" face="Arial" color="#777777"><a href="mailto:marinus@witloof.ca">@witloof.ca</a></font>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="3">
                                                    <div class="full-container">
                                                        <div class="flood-banner">
                                                            <h2 class="title">We thank everyone for their concerns about the recent flooding at our facility. The water was around 4 ft deep (Nov 19th), then dropped to 2 ft (Nov 26). We are currently (Dec 15th) in the process of cleaning up and repairing equipment. We currently have no produce. If you want to help or have questions, please leave your contact information below and we will be in touch.</h2>

                                                        </div>
                                                        <div class="img-banner">
                                                            <img src="/images/flood-1.jpg" alt="" />
                                                            <img src="/images/flood-2.jpg" alt="" />
                                                            <img src="/images/flood-3.jpg" alt="" />
                                                            <img src="/images/flood-4.jpg" alt="" />
                                                        </div>
                                                        <?php $is_current_form = (isset($_POST['flood-contact-form'])) && ($_POST['flood-contact-form'] === "endive-flood-form"); ?>

                                                        <?php if (empty($_GET['form-submitted'])) : ?>
                                                            <form method="POST" action="/contact.php">
                                                                <input class="input" type="hidden" name="flood-contact-form" value="endive-flood-form" />
                                                                <div class="form-field">
                                                                    <label for="flood-contact-name">

                                                                    </label>
                                                                    <input class="input" placeholder="Name" required name="name" id="flood-contact-name" type="text" />
                                                                    <?php if ($is_current_form && empty($_POST['name'])) {

                                                                        echo ('error');
                                                                    }
                                                                    ?>
                                                                </div>
                                                                <div class="form-field">
                                                                    <label for="flood-contact-email">

                                                                    </label>
                                                                    <input class="input" placeholder="Email" required name="email" id="flood-contact-email" type="email" />
                                                                    <?php if ($is_current_form && (empty($_POST['email']) || (strpos($_POST['email'], '@') === false))) {
                                                                        echo ('error');
                                                                    }
                                                                    ?>
                                                                </div>
                                                                <div class="form-field">
                                                                    <label for="flood-contact-message">

                                                                    </label>
                                                                    <textarea class="input message" placeholder="Message" required name="message" id="flood-contact-message"></textarea>
                                                                    <?php if ($is_current_form && empty($_POST['message'])) {

                                                                        echo ('error');
                                                                    }
                                                                    ?>
                                                                </div>
                                                                <div class="form-field submit">
                                                                    <input type="submit" value="submit" />

                                                                </div>
                                                            </form>
                                                        <?php else : ?>
                                                            <p class="submit">Thank you for contacting us!</p>
                                                        <?php endif; ?>
                                                    </div>
                                                </td>
                                            </tr>
                                        </table>

                                    </td>
                                    <td width="39">&nbsp;</td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2"><img src="images/footer.gif" width="893" height="20" /></td>
        </tr>
    </table>
    <div align="center">
        <table cellSpacing="0" cellPadding="0" width="797" border="0">
            <tr>
                <td align="right" height="25">
                    <p align="center">
                        <font face="Tahoma" color="#FFFFFF" size="1">copyright ©
                            2008 Van Eekelen Enterprises Ltd.&nbsp; | &nbsp;all rights
                            reserved</font>
                </td>
            </tr>
        </table>
    </div>
</body>

</html>