<?php

	require_once('config.php');
	require_once('sysclub_class/grid.php');
	require_once('sysclub_class/mensagem.php');
	require_once('sysclub_class/clientewebservice.php');
	require_once('sysclub_class/clientewebservice.php');
	require_once('sysclub_functions/functions.php');
	require_once('seguranca.php');

	switch ($action) 
	{
		default : index();
	}

	function index()
	{
		global $CLUBE, $TITULO_SITE;
		
		try
		{
			$factory = new WebService();
			$result = $factory->GetDadosFinanceiroMensal($_SESSION["CODIGO"]);
		}
		catch (Exception $e) 
		{
			$mensagem = new Mensagem();
			$conteudo = $mensagem->Make('Servi&ccedil;o de Boleto ON-LINE n&atilde;o esta dispon&iacute;vel...');
			include("view/template.php");
			exit;
		}
				
		$conteudo = "
					
		<div class='row'>
			<div class='col-md-10'><h2>Extrato resumido</h2></div>
			<div class='col-md-2'></div>
		</div>

		<div class='row'>
			<div class='col-md-12'>

					<table class=\"table table-striped table-bordered\" id=\"listing\">
						<thead>
							<tr>
								<th class='col-md-7'>M&ecirc;s/Ano</th>
								<th class='col-md-3'>Total M&ecirc;s</th>
								<th class='col-md-2'>#</th>
							</tr>
						<thead>
						<tbody>";

						foreach($result as $row)
						{

		$conteudo .= "
						<tr>
							<td>". $row['MESANO'] ."</td>
							<td><span class='pull-right'>". number_format($row['TOTAL_LANCAMENTO'], 2, '.', ',') ."</span></td>
							<td><a href='extratoperiododetalhado.php?codigo=". $row['CODIGO'] ."&mesano=". $row['MESANO'] ."' class='btn btn-xs btn-primary'>Extrato Detalhado</a></td>
						</tr>";

					}

		$conteudo .= "
						</tbody>
					</table>
			</div>
		</div>";

		include("view/template.php");
	}

?>