<?

	include("../adm/conexao_e_agenda.php");

	include("../adm/funcoes.php");

	//include("/mostradata.php");

//...............................





    $sql="select * from visitas where id='1'";

	$result=mysqli_query($conexao,$sql);

	$linha_visita=mysqli_fetch_array($result);

	$visitas = $linha_visita['atual'];



	$media_3 = 0;

	$sql_cm="SELECT contador as media FROM visitas_dia ORDER BY id DESC LIMIT 3";

	$result_cm=mysqli_query($conexao,$sql_cm) or die (mysqli_error($conexao));

	while($linha_cm=mysqli_fetch_array($result_cm)){

	$media_3 = $media_3 + $linha_cm['media'];	

	}

	$mediavisitas_aam = round($media_3/3,2);		

	

	$media_seman = 0;

	$sql_cms="SELECT contador as media FROM visitas_dia ORDER BY id DESC LIMIT 7";

	$result_cms=mysqli_query($conexao,$sql_cms) or die (mysqli_error($conexao));

	while($linha_cms=mysqli_fetch_array($result_cms)){

	$media_seman = $media_seman + $linha_cms['media'];	

	}

	$mediavisitas_aam_seman = round($media_seman/7,2);	

	

	$media_mes = 0;

	$sql_cmm="SELECT contador as media FROM visitas_dia ORDER BY id DESC LIMIT 30";

	$result_cmm=mysqli_query($conexao,$sql_cmm) or die (mysqli_error($conexao));

	while($linha_cmm=mysqli_fetch_array($result_cmm)){

	$media_mes = $media_mes + $linha_cmm['media'];	

	}

	$mediavisitas_aam_mes = round($media_mes/30,2);			



	$media_semes = 0;

	$sql_cms="SELECT contador as media FROM visitas_dia ORDER BY id DESC LIMIT 180";

	$result_cms=mysqli_query($conexao,$sql_cms) or die (mysqli_error($conexao));

	while($linha_cms=mysqli_fetch_array($result_cms)){

	$media_semes = $media_semes + $linha_cms['media'];	

	}

	$mediavisitas_aam_semes = round($media_semes/180,2);		



	$media_ano = 0;

	$sql_cma="SELECT contador as media FROM visitas_dia ORDER BY id DESC LIMIT 365";

	$result_cma=mysqli_query($conexao,$sql_cma) or die (mysqli_error($conexao));

	while($linha_cma=mysqli_fetch_array($result_cma)){

	$media_ano = $media_ano + $linha_cma['media'];	

	}

	$mediavisitas_aam_ano = round($media_ano/365,2);	



	$sql_UV="SELECT * FROM visitas_dia ORDER BY id DESC LIMIT 0,3";

	$result_UV=mysqli_query($conexao,$sql_UV) or die (mysqli_error($conexao));

	

	$sql_UVip="SELECT * FROM usuariosonline ORDER BY time DESC LIMIT 0,3";

	$result_UVip=mysqli_query($conexao,$sql_UVip) or die (mysqli_error($conexao));	

		

	$sql_mens="select * from mensagem";

    $result_mens=mysqli_query($conexao,$sql_mens) or die (mysqli_error($conexao));		  

    $mensagens=mysqli_num_rows($result_mens);



	$sql_cit="select * from imoveis where situacao='d'";

    $result_cit=mysqli_query($conexao,$sql_cit) or die (mysqli_error($conexao));		  

    $imoveistotal=mysqli_num_rows($result_cit);

	

	$sql_ci="select * from imoveis where situacao='d' and objetivo='1'";

    $result_ci=mysqli_query($conexao,$sql_ci) or die (mysqli_error($conexao));		  

    $imoveisadesao=mysqli_num_rows($result_ci);

	

	$sql_c="select * from imoveis where situacao='d' and objetivo='2'";

    $result_c=mysqli_query($conexao,$sql_c) or die (mysqli_error($conexao));		  

    $imoveisvenda=mysqli_num_rows($result_c);

	

	$sql_cm="SELECT AVG(contador) as media FROM visitas_dia";

	$result_cm=mysqli_query($conexao,$sql_cm) or die (mysqli_error($conexao));

	$linha_cm=mysqli_fetch_array($result_cm);

	$mediavisitas = $linha_cm['media'];	

?>

<!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=iso-8859-1" />

<title>Adriano Souto Imóveis - Mobile</title>

 <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1;">-->

 <meta name="viewport" content="width=320, initial-scale=-1">

		<!-- CSS

  	================================================== -->

	<link rel="stylesheet" href="css/base.css">

	<link rel="stylesheet" href="css/grid.css">

	<link rel="stylesheet" href="css/mobile.css">

    

	<!-- Ícones

	================================================== -->

		

    <!-- JS

  	================================================== -->

	<script src="js/jquery_002.js"></script>

	<script src="js/jquery-migrate.js"></script>

	<script src="js/jquery.js"></script>

    <script src="js/selectivizr.js"></script>  

    <script src="js/functions.js"></script>



    <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>

     <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>    

    <script type="text/javascript" src="js/spinners/spinners.min.js"></script>

    <script type="text/javascript" src="js/lightview/lightview.js"></script>



    <link rel="stylesheet" type="text/css" href="css/lightview/lightview.css" /> 

		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>

	<![endif]-->



              <script src="js/jquery-1.7.2.min.js"></script>

       <script src="js/lightbox.js"></script>



       <link href="css/lightbox.css" rel="stylesheet" />



       <script type="text/javascript">

           $(function () {

               $('#gallery a').lightBox();

           });

        </script>



    <!-- jQuery lightBox plugin - Gallery style */ -->

    <style type="text/css">

	#gallery {

		background-color: #fff;

		padding: 10px;

		width: auto;

	}

	#gallery ul { list-style: none; }

	#gallery ul li { display: inline; }

	#gallery ul img {

		border: 5px solid #444444;

		border-width: 5px 5px 20px;

	}

	#gallery ul a:hover img {

		border: 5px solid #fff;

		border-width: 5px 5px 20px;

		color: #fff;

	}

	#gallery ul a:hover { color: #fff; }

	</style>	



<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>

<script type="text/javascript" src="js/jquery.cycle.all.js"></script>

<style type="text/css">

.slideshow_ { height: 332px; width: 332px; margin: auto }

.slideshow_ img { padding: 5px; border: 1px solid #ccc; background-color: #eee; }

</style>

<script type="text/javascript">

$(document).ready(function() {

    $('.slideshow_').cycle({

		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...

		delay:   -4000

	});

});

</script> 

       

</head>

<body>

<? //include("menu_iniciar.php"); ?>

	

	<div class="cols full" id="logo">

		<img src="logo_adriano_creci_nabase_la224_adm.png" width="322">	</div>    

<div class="full" id="content">

		

		<div class="container" id="home">           

			<h1><br />

		    <img src="label_imoveis_detalhes_estatistica.png" width="310" height="34" /></h1>

            

<div class="full cols">

                <script type="text/javascript" src="js/pesquisa.js"></script>

                <script type="text/javascript">

                    var valorbus = '';

                    var valorcod = '33';

                    var valorneg = '';

                    var valortip = '';

                    var valormin = '';

                    var valormax = '';

                    var valorest = '';

                    var valorcid = '';

                    var valorbai = '';

                    var valormap = '';

                </script>



      <div class="c5 cols">

<!--inicio-->  

           

                         

      <!--fim-->      

</div>

<!--inicio-->

                   <div class="c25 cols">

						<label for="b_valor_min">VISITAS :</label>

	<input name="nome" type="text" class="form2" id="nome" size="62" maxlength="60" value="<? echo $visitas; ?>">

					</div>                   

                   <div class="c25 cols">

						<label for="b_cidade">MÉDIA ÚLTIMOS 3 DIAS:</label>

	    <input name='estado' type='text' class="form2" id="estado" size=5 maxlength='80' value="<? echo $mediavisitas_aam; ?>">    



					</div>

                     <div class="c25 cols">

						<label for="b_cidade">MÉDIA ÚLTIMOS 7 DIAS:</label>

	    <input name='estado' type='text' class="form2" id="estado" size=5 maxlength='80' value="<? echo $mediavisitas_aam_seman; ?>">    



					</div>

                     <div class="c25 cols">

						<label for="b_cidade">MÉDIA ÚLTIMOS 30 DIAS:</label>

	    <input name='estado' type='text' class="form2" id="estado" size=5 maxlength='80' value="<? echo $mediavisitas_aam_mes; ?>">    



					</div> 

                      <div class="c25 cols">

						<label for="b_cidade">MÉDIA ÚLTIMO 6 MESES:</label>

	    <input name='estado' type='text' class="form2" id="estado" size=5 maxlength='80' value="<? echo $mediavisitas_aam_semes; ?>">    



					</div>                     

                     <div class="c25 cols">

						<label for="b_cidade">MÉDIA ÚLTIMO ANO:</label>

	    <input name='estado' type='text' class="form2" id="estado" size=5 maxlength='80' value="<? echo $mediavisitas_aam_ano; ?>">    



					</div>    

                    <div class="c5 cols">

						<label for="b_valor_min">ON-LINE :</label>

	 <input name="cidade" type="text" class="form2" id="cidade" size="62" maxlength="60" value="<? include("usuariosonline_site_index_qtd.php"); ?>">



					</div>                      

                    <div class="c25 cols">

                    <label for="b_cidade">ÚLTIMAS VISITAS:</label>

               <? while($linha_UV=mysqli_fetch_array($result_UV)){ ?> 						

	    <input name='ultimavisita' type='text' class="form2" id="ultimavisita" size=5 maxlength='80' value="<? echo datapadrao_data($linha_UV["data_dia"])." | ".$linha_UV["contador"]; ?>">    

               <? } ?>

					</div>

<div class="c25 cols">

                    <label for="b_cidade">ÚLTIMOS IPs:</label>

               <? while($linha_UVip=mysqli_fetch_array($result_UVip)){ ?> 						

	    <input name='ultimavisita' type='text' class="form2" id="ultimavisita" size=5 maxlength='80' value="<? echo $linha_UVip["ip"]; ?>">    

               <? } ?>

					</div>    

       <div class="c5 cols">

						<label for="b_valor_min">IMÓVEIS EM GERAL :</label>

	<input name="email" type="text" class="form2" id="email" size="62" maxlength="60" value="<? echo $imoveistotal; ?>">



					</div>  

                    

       <div class="c5 cols">

						<label for="b_valor_min">IMÓVEIS PARA ADESĂO :</label>

	<input name="email" type="text" class="form2" id="email" size="62" maxlength="60" value="<? echo $imoveisadesao; ?>">



					</div>                    

                   <div class="c5 cols">

						<label for="b_valor_min">IMÓVEIS PARA VENDA :</label>

	<input name="telefone" type="text" class="form2" id="telefone" size="40" maxlength="60" value="<? echo $imoveisvenda; ?>">



					</div>

<div class="c5 cols">

						<label for="b_valor_min">MENSAGENS :</label>

	<input name="telefone2" type="text" class="form2" id="telefone2" size="40" maxlength="60" value="<? echo $mensagens; ?>">



					</div>

                                                                                                  

              <div class="cols c5 fist">

						<label>&nbsp;</label>                    	

                    </div>  

<!--fim-->

      <div class="c5 cols">

<!--inicio-->  

       <label>&nbsp;</label>    

                         

      <!--fim-->      

</div>

<!--inicio-->

<!--fim-->



            </div>

		</div>

</div>

    

		<div class="full" id="footer">    

    

    	<div class="container">



			<p class="address imobiliaria">

                <strong>Adriano Theodoro Imóveis</strong>

                <!--Rua Roberto Rikle, 1250, apto 401 Bloco 07, <br />CEP 85856-440

    Jardim S&atilde;o Paulo II -  Foz do Igua&ccedil;u-PR-->

            </p>

           

<span class="copyright">Adriano Theodoro Imóveis © 2016. <br>

            	Todos os direitos reservados.

            </span>

                        

        </div>

        

	</div>        



</body></html>

