<?php
	require $_SERVER["DOCUMENT_ROOT"].'/inc/conexao.php';
	require $_SERVER["DOCUMENT_ROOT"].'/inc/functions.php';
	require $_SERVER["DOCUMENT_ROOT"].'/api/api.php';
	require $_SERVER["DOCUMENT_ROOT"].'/api/pages/caixa.php';
	requerPermissao('21:24');
?>

<style>

	* {
		font-family: Arial, Helvetica;
	}

	.f13 { font-size: 13px; }
	.f14 { font-size: 14px; }
	.f15 { font-size: 15px; }
	.f16 { font-size: 16px; }
	.f17 { font-size: 17px; }
	.f18 { font-size: 18px; }
	.f19 { font-size: 19px; }
	.f20 { font-size: 20px; }
	.margin0 { margin: 0; }

	.center {
		text-align: center;
	}

	.print_area {
		width: 100%;
		max-width: 7.9cm;
		margin: 10px auto;
	}

	.print_area h2 {
		margin: 8px 0;
	}

	.print_area .dashed {
		border-top: 1px dashed #000;
		height: 2px;
		margin: 5px 0;
		display: block;
	}

	.print_area .dashed10 { margin: 10px 0 !important; }

	.print_area .pull-right { float: right; }

	.print_area .event { border: 2px solid #000; font-weight: bold; padding: 5px 0; margin-bottom: 5px; }

</style>

<div class="print_area">
	<h2 class="center"><?php echo utf8_encode($_SESSION["configs"]["config_nome"]); ?></h2>
	<div class="tel center f14">Relatório de Caixa</div>
	<div class="dashed dashed10"></div>
	<div class="f14"><b>Data: </b> <span class="pull-right"><?php echo date('d/m/Y H:i:s'); ?></span></div>
	<div class="f14"><b>Emitido por: </b> <span class="pull-right"><?php echo $_SESSION["usuario"]["nome"]; ?></span></div>
	<div class="dashed dashed10"></div>
	<h4 class="center margin0"><?php if(isset($api['username_balance'])){ echo $api['username_balance']; } ?></h4>
	<div class="dashed dashed10"></div>
	<h6 class="center margin0"><?php echo $api['dates']; ?></h6>
	<div class="dashed dashed10"></div>

	<div class="item">
		<div>Entradas em aberto <span class="pull-right"><b>R$<?php echo $api["open_entries"]; ?></b></span></div>
		<div class="dashed"></div>
	</div>

	<div class="item">
		<div>Entradas <span class="pull-right"><b>R$<?php echo $api["entries"]; ?></b></span></div>
		<div class="dashed"></div>
	</div>

	<div class="item">
		<div>Saídas <span class="pull-right"><b>R$<?php echo $api["rewards"]; ?></b></span></div>
		<div class="dashed"></div>
	</div>

	<div class="item">
		<div>Lançamentos <span class="pull-right"><b>R$<?php echo $api["lanc"]; ?></b></span></div>
		<div class="dashed"></div>
	</div>

	<div class="item">
		<div>Total <span class="pull-right"><b>R$<?php echo $api["total"]; ?></b></span></div>
		<div class="dashed"></div>
	</div>

	<center><p>Sistema FBET</p></center>
</div>


<script> print(); </script>