<?php $this->helper->startMultilang() ?>



<form id="contact" method="post" action="/ajax/send-request-info">

    <div class="inputs">

        <img src="/website/views/layouts/images/contactus.png" id="logo-mail" alt="mail-icone">

        <input id="name" type="text" placeholder="<?= $this->helper->input('form-nom') ?>" name="name">

        <input id="mail" type="text" placeholder="<?= $this->helper->input('form-mail') ?>" name="mail">

        <input id="agence" type="text" placeholder="<?= $this->helper->input('form-agence') ?>" name="agence">

        <select id="subject" name="subject">

            <option value="vide"><?= $this->helper->input('form-sujet') ?></option>

            <option value="Immo"><?= $this->helper->input('form-sujet-immo') ?></option>

            <option value="SEO"><?= $this->helper->input('form-sujet-seo') ?></option>

            <option value="autre"><?= $this->helper->input('form-sujet-autre') ?></option>

        </select>

        <select id="soft" name="soft">

            <option value="vide"><?= $this->helper->input('form-logiciel-txt') ?></option>

            <option value="Belgimmo/Activimmo">Belgimmo/Activimmo</option>

            <option value="Esimmo">Esimmo</option>

            <option value="Experimmo/Evalimmo">Experimmo/Evalimmo</option>

            <option value="HomeXplorer">HomeXplorer</option>

            <option value="ImmoAssist">ImmoAssist</option>

            <option value="Immowin">Immowin</option>

            <option value="Max-immo">Max-immo</option>

            <option value="Whise">Whise</option>

            <option value="Skarabee">Skarabee</option>

            <option value="Aucun"><?= $this->helper->input('form-logiciel-aucun') ?></option>

            <option value="autre"><?= $this->helper->input('form-logiciel-autre') ?></option>

        </select>

        <input id="soft-autre" type="text" placeholder="<?= $this->helper->input('form-logiciel-autre-nom') ?>" name="soft-autre">

        <input id="msg" type="text" placeholder="<?= $this->helper->input('form-logiciel-message') ?>" name="message">

        <label id="newsletter-label" for="newsletter">

            <input type="checkbox" checked="checked" value="1" id="newsletter" name="newsletter">

            <?= $this->helper->input('form-recevoir-mail') ?>

        </label>

        <input id="send-button" class="pull-right" type="submit" value="<?= $this->helper->input('form-envoyer') ?>" name="send">

    </div>

    <div class="result">

        <img src="/website/views/layouts/images/success.png" alt="">

        <p><?= $this->t('message-sent') ?></p>

    </div>

</form>

<div class="clear"></div>





<script>

    $("form#contact").submit(function(e){

        e.preventDefault();



        var form = e.target,

            fd = new FormData( form );



        $.ajax({

            url : form.action,

            type : 'POST',

            processData: false,

            contentType: false,

            data : fd,

            success : function(response){

                var r = JSON.parse(JSON.stringify(response));



                if (r.success) {

                   $('form#contact').addClass('success');



                }

                else{

                    $('#send-button').attr('value', 'Error');

                }

            }

        });



        return false;

    })

</script>



<?php $this->helper->endMultilang() ?>