<!--	METAS		-->
<?php
	$dir = $_SERVER['DOCUMENT_ROOT']."/".substr(substr($_SERVER['REQUEST_URI'], 1), 0, strpos(substr($_SERVER['REQUEST_URI'], 1), '/'))."/phone_gap/";
	require_once($dir."/classes/Dados.class.php");
	require_once($dir."/dao/ConfigDAO.class.php");
	$dados = new Dados();
	
	echo '<script src="metas/metas.js?ver='.$dados->getVersao().'"></script>';
?>
<div data-role="page" data-theme="b" data-control-title="Metas" id="metas" class="loading-show loading-hide mobipicker-month verifica-login">
	<div  data-role="header" data-position="fixed">
		<h3>
			Metas
		</h3>
		<a href="#home" id="botaovoltarmetas" data-role="button" data-direction="reverse" data-transition="slide" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-back">
			Voltar
		</a>
	</div>
	<div data-role="content" class="conteudo">
		<?php
			$configdao = new ConfigDAO();
			$periodo_especifico = $configdao->getDisponibilizar()->getPeriodo_especifico();
			if ($periodo_especifico)
				echo '<div data-role="fieldcontain" data-controltype="selectmenu">
						<label for="filtroperiodometas">Período: </label>
						<select id="filtroperiodometas" name="" class="filtro"></select>
					  </div>';
			else
				echo '<div data-role="fieldcontain" data-controltype="dateinput">
						<label for="periodometa">Período: </label>
						<input class="mobipick-month" id="periodometa" value='.date('Y-m').' type="text">
					  </div>'; 
		?>		
		
		<div data-role="fieldcontain" data-controltype="selectmenu">
			<label for="filtrogerentemetas">Gerente: </label>
			<select id="filtrogerentemetas" name="" class="filtro" ></select>
		</div>
		<div data-role="fieldcontain" data-controltype="selectmenu">
			<label for="filtrosupervisormetas">Supervisor: </label>
			<select id="filtrosupervisormetas" name="" class="filtro" ></select>
		</div>
		<div data-role="fieldcontain" data-controltype="selectmenu">
			<label for="filtrovendedormetas">Vendedor: </label>
			<select id="filtrovendedormetas" name="" class="filtro"></select>
		</div>
		
		<div data-role="fieldcontain" data-controltype="selectmenu">
			<label for="filtrotipometa">Tipo: </label>
			<select id="filtrotipometa" name="" class="filtro">
				<option value="">Todos</option>
				<option value="E">Geral</option>
				<option value="F">Famílias</option>
				<option value="M">Marcas</option>
				<option value="G">Grupos</option>
				<option value="S">Subgrupos</option>
				<option value="P">Produtos</option>
				<option value="U">Unificada</option>
				<option value="F">Fornecedores</option>
			</select>
		</div>
		
		<div data-role="fieldcontain" data-controltype="selectmenu">
			<label for="filtrometapor">Meta por: </label>
			<select id="filtrometapor" name="" class="filtro">
				<option value="0">Todos</option>
				<option value="1">Clientes Novos</option>
				<option value="2">% Clientes sobre Base</option>
				<option value="3">Efetividade</option>
				<option value="4">Positivação</option>
				<option value="5">Qtde</option>
				<option value="6">Qtde de Pedidos</option>				
				<option value="7">Sellout</option>
				<option value="8">Trocas</option>
				<option value="9">Valor</option>
				<option value="10">Visitas</option>
				<option value="11">Mix Produtos</option>
				<option value="12">Positivação Geral</option>
				<option value="13">Qtde Master</option>
				<option value="14">Peso Bruto</option>
				<option value="15">Peso Líquido</option>
			</select>
		</div>
		
		<a id="botaovisualizarmetas" data-role="button" data-transition="slide"  data-icon="arrow-r" data-iconpos="right" href="#relmetas">
			Visualizar
		</a>
	</div>
</div>

<!-- RELATORIO -->
<div data-role="page" data-theme="b" data-control-title="Home"  id="relmetas" class="verifica-login">
	<div  data-role="header" data-position="fixed" data-position="fixed">
		<h3 class="ui-title" role="heading" aria-level="1" id="titulometas">
			Metas
		</h3>
		<a href="#metas" data-role="button" data-direction="reverse"  data-transition="slide" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-back" id="voltarrelmetas">
			Voltar
		</a>
	</div>
	<div data-role="content" id="divtabelametas" class="conteudo">
		<table data-role="table" id="tabelarelmetas" data-mode="columntoggle" class="ui-body-d ui-shadow table-stripe ui-responsive" data-column-btn-theme="b" data-column-btn-text="Colunas" data-column-popup-theme="b" style="text-align: center;" >
			<thead>
			  <tr class="ui-bar-d">
				<th>Tipo da Meta</th>
				<th data-priority="1">Meta</th>
				<th data-priority="1">Alcancado</th>
				<th data-priority="4">Saldo</th>
				<th data-priority="4">M/H/D</th>
				<th data-priority="5">Dias Trab</th>
				<th data-priority="3">Tendencia</th>
				<th data-priority="2">N/H/D</th>
				<th data-priority="5">Dias Faltantes</th>
			  </tr>
			</thead>
			<tbody>
			</tbody>
		</table>
	</div>
</div>