Mini Shell

Direktori : /home/kasaimoveis/www/pages/
Upload File :
Current File : /home/kasaimoveis/www/pages/contato.php

<?php
if($_POST['cmd'] == "enviar")
{
    $nome = $_POST['nome'];
    $telefone = $_POST['telefone'];
    $email = $_POST['email'];
    $mensagem = addslashes($_POST['mensagem']);
    
    ini_set ('mail_filter', '0');
    
    $corpo = '<!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>Kasa Imóveis</title>
            <style type="text/css">
            td {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: #494949;}
            .bordasimples {border-collapse: collapse;}
            .bordasimples {border:1px solid #d0d0d0;}
            </style>
            </head>
            <body>
            <table width="651" border="0" align="center" cellpadding="0" cellspacing="0" class="bordasimples">
                <tr>
                    <td>
                        <table width="93%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                                <td>Dados do contato<br /></td>
                            </tr>
                        </table>
                        <br />
                        <table width="93%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr><td height="30"></td></tr>
                            <tr><td height="30" valign="top">Nome: '.$nome.'</td></tr>
                            <tr><td height="30" valign="top">Telefone: '.$telefone.'</td></tr>
                            <tr><td height="30" valign="top">Email: '.$email.'</td></tr>
                            <tr><td height="30" valign="top">Mensagem: '.nl2br(stripslashes($mensagem)).'</td></tr>
                        </table>
                        <br />
                    </td>
                </tr>
            </table>
            </body>
        </html>';

    require 'PHPMailer/class.phpmailer.php';
    
    $PHPMailer = new PHPMailer();
     
    // define que será usado SMTP
    $PHPMailer->IsSMTP();
     
    // codificação UTF-8, a codificação mais usada recentemente
    $PHPMailer->Charset = 'UTF-8';
     
    // Configurações do SMTP
    $PHPMailer->SMTPAuth = true;
    $PHPMailer->SMTPSecure = 'tls';
    $PHPMailer->Host = 'smtp.gmail.com';
    $PHPMailer->Port = 587;
    $PHPMailer->Username = 'contato@kasaimoveis.com';
    $PHPMailer->Password = 'kasa2013';
     
    // E-Mail do remetente (deve ser o mesmo de quem fez a autenticação
    // nesse caso seu_login@gmail.com)
    $PHPMailer->From = 'contato@kasaimoveis.com';
     
    // Nome do rementente
    $PHPMailer->FromName = utf8_decode('Kasa Imóveis');
     
    // assunto da mensagem
    $PHPMailer->Subject = utf8_decode('Contato - Kasa Imóveis');
     
    // corpo da mensagem
    $PHPMailer->Body = $corpo;
     
    // corpo da mensagem em modo texto
    $PHPMailer->AltBody = '';

    $PHPMailer->IsHTML(true);

    $PHPMailer->AddAddress('contato@kasaimoveis.com');
            
    if(!$PHPMailer->Send())
        msg("Email não enviado");
    else
        msg("Email enviado com sucesso");

    redireciona("?pg=contato");
}
?>

<script>
function envio_contato()
{
    if(document.form.nome.value == "")
    {
        alert("Informe seu nome");
        document.form.nome.focus();
        return false;
    }

    if(document.form.telefone.value == "")
    {
        alert("Informe seu telefone");
        document.form.telefone.focus();
        return false;
    }

    if(check_email(document.form.email.value) == "")
    {
        alert("Informe um email válido");
        document.form.email.focus();
        return false;
    }

    if(document.form.mensagem.value == "")
    {
        alert("Informe a mensagem");
        document.form.mensagem.focus();
        return false;
    }

    document.form.submit();
}
</script>

<!-- RESULTADOS -->
<div class="container results">
    <div class="row">
        <div class="col-sm-9 col-xs-12">
            <h3>Contato</h3>
            <form class="form-horizontal" name="form" id="form" method="post">
                <input type="hidden" name="cmd" id="cmd" value="enviar">
                <fieldset>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="nome">Nome</label>  
                        <div class="col-md-9">
                            <input id="nome" name="nome" type="text" placeholder="" class="form-control input-md">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="telefone">Telefone</label>  
                        <div class="col-md-9">
                            <input id="telefone" name="telefone" type="text" placeholder="" class="form-control input-md">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="email">Email</label>  
                        <div class="col-md-9">
                            <input id="email" name="email" type="text" placeholder="" class="form-control input-md">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="mensagem">Mensagem</label>
                        <div class="col-md-9">                     
                            <textarea class="form-control" id="mensagem" name="mensagem" rows="5"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label" for="enviar"></label>
                        <div class="col-md-9">
                            <button id="enviar" name="enviar" class="btn btn-warning btn-block" onclick="javascript: return envio_contato();">Enviar</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
        <div class="col-sm-3 col-xs-12">
            <br><br>
            <address>
                <strong>Endereço</strong><br>
                Rua da Grécia, 132, Santa Luíza<br>
                Vitória/ES - CEP 29045-225
            </address>
            <address>
                <strong>Telefones</strong><br>
                +55 27 3314.4001<br>
                +55 27 3225.4798<br>
                +55 27 9.9959.1249
            </address>          
            <address>
                <strong>Horário de Atendimento</strong><br>
                Segunda à sexta:<br>
                Das 08:30h às 18:00h
            </address>
        </div>
    </div>
</div>

<!-- INCLUDE DO BANNER -->
<?php include("includes/banner.php"); ?>

Zerion Mini Shell 1.0