<!--Cabecalho -->
<?php $this->load->view('commons/cabecalho'); ?>
<!--Header -->
<?php $this->load->view('commons/header'); ?>
<div class="row conteudo-acessar">
    <br>

    <h4 style="font-size: 30pt;" class="text-mobile"><b>Indique nosso site para um amigo</b></h4>

    <?php echo $this->session->flashdata('sucesso-indique'); ?>
    <?php echo $this->session->flashdata('erro-form-indique'); ?>
    <?php echo $this->session->flashdata('erro-indique'); ?>

    <form action="<?= base_url('indiqueamigo') ?>" method="POST" autocomplete="off">
        <div class="div-rest">
            <div class="input-field col s12 m6">
                <input type="text" name="nome-amigo" required="" placeholder="Nome do amigo"  value="">
                <label for="nome-amigo">Nome do amigo</label>
            </div>
            <div class="input-field col s12 m6">
                <input class="email" type="email"  onkeyup="maiuscula(this)" name="email-amigo" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" placeholder="Email do amigo" required="">
                <label for="email-amigo">Email do amigo</label>
            </div>

            <button class="btn waves-effect waves-light btn-curso btn-end btn-indique" type="submit" name="action">&nbsp;&nbsp;Enviar&nbsp;&nbsp;</button>
            <a href="#modalwpp" target="_blank" class="btn teal darken-1 modal-trigger">
                <img style="display: inline; height: 20pt; vertical-align: middle; margin: 0 2px; background-color: white; border-radius: 20pt;" class="responsive-img" src="https://www.formacaofacil.com.br/img/whatsapp.png"> Whatsapp
            </a>
            <a href="https://twitter.com/intent/tweet?url=<?= base_url() ?>" target="_blank" class="btn blue darken-2 twitter">
                <img style="display: inline; height: 20pt; vertical-align: middle; margin: 0 2px; background-color: white; border-radius: 20pt;" class="responsive-img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAFgElEQVRoge2ZW2xUVRSGv3XOTC8zLbdChQIaJUgt6oNcDC9CEWO8oBLjQMAYjQoSIDExRoyXYLyEBzUa7jGRmIDSiqJRiVGoPpAYkSZgFFuUKFBuAqXA9DYz+ywfikJnzpxLp8qD/I9rr/3v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ZgV4r1v2coZBPN35XieFdwBkVztOUEYKs0BCFLZpTHf+hm0tedvN6cZvdph7Z0cDFv7Uuz+ZDnr0MO3LTlBJBuKt0JHApKuvu0w9I9KR76vpvvTgYrh6/sTfP0bs+jrhsOpptijdnG3E28TBzZlNyowtJ8TKU2VBQJ4wZYTBpiMbMqws0V/hX5RLfy1O4U7x8IN/MAAhvdriJDH2imDLV4saaIGcPtwJdK7RlY/Vua5b+kORNim12EbiPWGBKxw9kNeTXYdefWgDyRr72qVLinKsLkCosbBlqMjAkDo4IAZ9LKgXZlT5tDw5+GL44YkpkC0l1lpZkTX+LWlH8S688MsdVu5tKfi08Z41SHPtSTGNiKqmvU/ylUF3pd+npmXs9Fq67rf1VBIavMnPIPvTx8S4eRskWgn/SfqMD4wlTGnvRz8q99CTEmVjYP2NofqgJB+NzE4glqxbfeBvudnikdpi1+H+jagsX5QlaZYfFZQW6moU8PHOdmo7KS/q9OJ1Bd5LfnsxH6QGMS5XUm6lSDrAa6w/Z3QTcqK42Y6rDiodBHvvqOkRHHWazCPGB0yN6HBDZkxFrl9oUNiv55Zl2mVrSmc6LBmS4qExQdJz2vlheeWYUWUdmn6K6eZ9ZYY388s17GZfzf8RfU4PMwfP7VwwAAAABJRU5ErkJggg=="> Twitter
            </a>
            <a href="http://www.facebook.com/sharer/sharer.php?u=<?= base_url() ?>" target="_blank" class="btn indigo darken-3 facebook">
                <img style="display: inline; height: 20pt; vertical-align: middle; margin: 0 2px; background-color: white; border-radius: 20pt;" class="responsive-img" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAD/UlEQVRoge2ZQWhcRRjHf9+8bbTJ9tKaapsm0IsJCLlsUA9mTdMcdE2oCSwVo9BDqZSk4LWIsKL0KmK3VIWeUrCJbJQ1C4LETUC0IQv1ZnszTWy1tkWbFpLdvPGQLYR9b3ffzG720vyOM9833/97896bmW9ghx2ebKQeg8Tjk87fhd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rIafLVDzUeMnXH0+3FQpqXGAUaDd0v4kw4ThustwiFYS6XLOSSKjea5EeR1T/ZulDOtm8tdxyzcoy6BsaFkWc2bnuq7l6XLPusMOTzv8z5ChKjVggmQAAAABJRU5ErkJggg=="> Facebook
            </a>
        </div>
    </form>
    <div id="modalwpp" class="modal" tabindex="0" style="height: 180px;">
        <div class="modal-content">
            <div class="input-field col s12">
                <i class="material-icons prefix">phone</i>
                <input id="fonewpp" type="tel" class="validate phone_with_ddd" minlength="15" maxlength="15" required="" autofocus="">
                <label for="fonewpp" data-error="Digite corretamente o celular" data-success="Correto!" class="active">Celular do seu amigo</label>
            </div>
        </div>
        <div class="modal-footer">
            <a class="modal-close waves-effect waves-green btn-flat">Fechar</a> <button type="submit" class="waves-effect waves-light btn green darken-2 btn-wpp"><span class="material-icons">check</span> Indicar</button>
        </div>
    </div>
</div>
<br><br>
<?php $this->load->view('commons/rodape'); ?>
<script>
$('.phone_with_ddd').mask('(00) 00000-0000');
$('body').delegate('.btn-wpp', 'click', function () {
    let celular = $("#fonewpp").val();
    let result = celular.replace("-", "");
    let result2 = result.replace(" ", "");
    let result3 = result2.replace(")", "");
    let result4 = result3.replace("(", "");
    let txt = "Olá, meu amigo! Conheça o Amazônia Cursos e acesse os conteúdos de qualquer computador, tablet ou celular conectado a internet.\n\nLogo após o pagamento já fica disponível o Certificado de Participação, sem burocracia. Basta preencher seu cadastro para que possamos fazer o registro em nossa base de dados.\n\nFaça o seu cadastro agora: <?= base_url() ?>";
    txt = window.encodeURIComponent(txt);
    let link = "https://api.whatsapp.com/send?phone=55"+result4+"&text="+txt;
    window.location.replace(link);
});
</script>