<link rel="stylesheet" type="text/css" href="../src/bootstrap.min.css">


<link rel="stylesheet" type="text/css" href="../src/datatable.css">
<link rel="stylesheet" type="text/css" href="../src/bootstrap-theme.css">
<div class="container-fluid">
<?php
include("../php/config.php");

$cliente = $_GET["cliente"];




echo "<h4 class='text-success'>PAGO A PRODUCTORES</h4>";
echo "<span class='text-danger h4'><b>".$cliente."</span></b>";
?>

<table border='1'>
	<th>No. transaccion</th>
	<th>Fecha</th>
	<th>Monto pagado</th>
	<th>Efectivo</th>
	<th>Cheque</th>
	<th>Concepto</th>
<?php
$a = mysql_query("SELECT * FROM egresos WHERE tipo='Produccion' and pagado_a='$cliente'") or die(mysql_error());
while($rs = mysql_fetch_array($a)){
	$c1++;
	$total1+=$rs["monto"];
?>
  <tr>
	<td><?php echo $rs["id"]?></td>
	<td><?php echo fecha($rs["fecha"])?></td>
	<td><?php echo @decimal($rs["monto"])?></td>
	<td><?php echo @decimal($rs["efectivo"])?></td>
	<td><?php echo @decimal($rs["cheque"])."(".$rs["numero_cheque"].")"?></td>
	<td class='text-primary'><?php echo $rs["concepto"]?></td>
	
  </tr>
<?php 

}?>
</table>
<?php  echo "<br>"."Cant. registros: ".$c1." | TOTAL: ".@decimal($total1)?>


<?php
echo "<h5 class='text-primary'>PAGOS DE CREDITO</h4>";

?>
<table border='1'>
	<th>No. transaccion</th>
	<th>Fecha</th>
	<th>Monto pagado</th>
	<th>Efectivo</th>
	<th>Cheque</th>
	<th>Concepto</th>
<?php
$a2 = mysql_query("SELECT * FROM ingresos WHERE tipo='Credito' and cliente='$cliente'") or die(mysql_error());
while($rs2 = mysql_fetch_array($a2)){
	$c2++;
	$total2+=$rs2["monto"];
?>
  <tr>
	<td><?php echo $rs2["id"]?></td>
	<td><?php echo fecha($rs2["fecha"])?></td>
	<td><?php echo @decimal($rs2["monto"])?></td>
	<td><?php echo @decimal($rs2["efectivo"])?></td>
	<td><?php echo @decimal($rs2["cheque"])."(".$rs2["numero_cheque"].")"?></td>
	<td class='text-success'><?php echo $rs2["concepto"]?></td>
	
  </tr>
<?php }?>



</table>
<?php  echo "<br>"."Cant. registros: ".$c2." | TOTAL: ".@decimal($total2)?>
</div>