<?php

$xml=simplexml_load_file("config/config.xml");
include('config/controller.php');
include('config/config.php');
include_once('jcart/jcart.php');
include('include/head.php');
session_start();

if (isset($_POST['nome'])){
	$cad = new Control();
	$cad->Contato($_POST['nome'], $_POST['email'], $_POST['assunto'], $_POST['mensagem'], ID);
}
?>
<body>
<div id="wrapper-outer" >
    <div id="wrapper">
        <div id="wrapper-inner">
			<?php
				include('include/header.php');
	
				include('include/menu.php');
			?>
            <div id="content">
				<div class="container">
    				<div>
        				<div id="main">
            				<div class="list-your-property-form">
    							<h2 class="page-header"><a href="index.php">Home</a> << Entre em contato com o <?=NOME?></h2>
    							<div class="content">
    								<?php
    								if($_GET['vi'] == 'send'){
    								?>
									<div class="alert alert-success">
										<button type="button" class="close" data-dismiss="alert">×</button>
										<strong>Obrigado <?=$_GET['nome']?>!</strong> Seu email foi enviado com sucesso. Logo entraremos com sucesso!
									</div>
    								<?php
    								}
    								?>									    							
							        <div class="row">							        
							            <div class="span8">
							                <p>
							                    <?=TEXTCONTATO?>
							                </p>
							            </div><!-- /.span8 -->
							        </div><!-- /.row -->
							        <form id="contato" method="POST" action="contato.php" enctype="multipart/form-data">
							            <div class="row">
							                <div class="span4">
							                    <h3><strong>1.</strong> <span>Informação pessoal</span></h3>
							                    <div class="control-group">
							                        <label class="control-label" for="nome">
							                            Nome
							                            <span class="form-required" title="Este campo é obrigatório.">*</span>
							                        </label>
							                        <div class="controls">
							                            <input type="text" id="nome" name="nome">
							                        </div><!-- /.controls -->
							                    </div><!-- /.control-group -->							
							                    <div class="control-group">
							                        <label class="control-label" for="email">
							                            Email
							                            <span class="form-required" title="Este campo é obrigatório.">*</span>
							                        </label>
							                        <div class="controls">
							                            <input type="text" id="email" name="email">
							                        </div><!-- /.controls -->
							                    </div><!-- /.control-group -->
							                    <div class="control-group">
							                        <label class="control-label" for="assunto">
							                            Assunto
							                        </label>
							                        <div class="controls">
							                            <input type="text" id="assunto" name="assunto">
							                        </div><!-- /.controls -->
							                    </div><!-- /.control-group -->							                                     
							                </div><!-- /.span4 -->
							
							                <div class="span4">
							                    <h3><strong>2.</strong> <span>Mensagem</span></h3>
							                    <div class="control-group">
							                        <label class="control-label" for="mensagem">
							                            Mensagem
							                            <span class="form-required" title="This field is required.">*</span>
							                        </label>
							                        <div class="controls">
							                            <textarea id="mensagem" name="mensagem"></textarea>
							                        </div><!-- /.controls -->
							                    </div><!-- /.control-group -->						                    							   														
							                </div><!-- /.span4 -->
							                <div class="span4">
							                    <h3><strong>3.</strong> <span>Enviar cadastro</span></h3>
							
							                    <div class="control-group">
							                        <div class="controls">
														<input type="submit" class="btn btn-primary btn-large" style="margin: 70px; width: 195px; height: 100px;"></a>
							                        </div><!-- /.controls -->
							                    </div><!-- /.control-group -->
							                </div><!-- /.span4 -->
							            </div><!-- /.row -->
							        </form>
    							</div><!-- /.content -->
							</div><!-- /.list-your-property-form -->        
						</div>
    				</div>
				</div>
    		</div><!-- /#content -->
		</div><!-- /#wrapper-inner -->
	<?php
		include('include/footer.php');
		include('include/configuracao.php');
	?>
<script type="text/javascript" src="assets/js/jquery.js"></script>
<script type="text/javascript" src="assets/js/jquery.ezmark.js"></script>
<script type="text/javascript" src="assets/js/jquery.currency.js"></script>
<script type="text/javascript" src="assets/js/jquery.cookie.js"></script>
<script type="text/javascript" src="assets/js/retina.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/js/carousel.js"></script>
<script type="text/javascript" src="assets/js/gmap3.min.js"></script>
<script type="text/javascript" src="assets/js/gmap3.infobox.min.js"></script>
<script type="text/javascript" src="assets/libraries/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.min.js"></script>
<script type="text/javascript" src="assets/libraries/chosen/chosen.jquery.min.js"></script>
<script type="text/javascript" src="assets/libraries/iosslider/_src/jquery.iosslider.min.js"></script>
<script type="text/javascript" src="assets/libraries/bootstrap-fileupload/bootstrap-fileupload.js"></script>
<script type="text/javascript" src="assets/js/realia.js"></script>
<script src="assets/js/password_strength_plugin.js"></script>
<script src="assets/js/jquery.maskedinput.js"></script>
<script src="assets/js/jquery.validate.js" type="text/javascript"></script>
<script src="assets/js/validate.methods.js" type="text/javascript"></script>
<!--
password strength
-->
<script>
	$(document).ready( function() {
		$(".password_test").passStrength({
			userid:	"#pass_bar"
		});
	});
</script>


<script>
function passwordStrength(password)
{
	var desc = new Array();
	desc[0] = "Muito fraco";
	desc[1] = "Fraco";
	desc[2] = "Médio";
	desc[3] = "Médio forte";
	desc[4] = "Forte";
	desc[5] = "Muito forte";

	var score   = 0;

	//if password bigger than 6 give 1 point
	if (password.length > 6) score++;

	//if password has both lower and uppercase characters give 1 point
	if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;

	//if password has at least one number give 1 point
	if (password.match(/\d+/)) score++;

	//if password has at least one special caracther give 1 point
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )	score++;

	//if password bigger than 12 give another 1 point
	if (password.length > 12) score++;

	 document.getElementById("passwordDescription").innerHTML = desc[score];
	 document.getElementById("passwordStrength").className = "strength" + score;
}
</script>


<script type="text/javascript">
	jQuery(function($){
		$("#cpf").mask("999.999.999-99");
		$("#tel").mask("(99)9999-9999");		
		$("#cel").mask("(99)9999-9999");				
	});
</script>

</body>
</html>