<?php
 
session_start();
include("DMMYSQLG.php");
$fecha = isset($dt_empres['fec_alta'])?$dt_empres['fec_alta']:"";
//echo $fecha;
$fechareal=date('Y-m-d');
?>
<table width="1050" border="0" id="data-table">
    <tr>
		<th nowrap><div align="center">FOLIO</div></th>       
		<th nowrap><div align="center">ENTRADA</div></th>
		<th nowrap><div align="center">SALIDA</div></th> 
		<th width="50"  nowrap><div align="center">PAX</div></th>
		<th width="50"  nowrap><div align="center">HAB</div></th>
		<th width="50"  nowrap><div align="center">#VOUCHER O RECIBO</div></th>
		<th width="50"  nowrap><div align="center">CONCEPTO</div></th>
		<th width="50"  nowrap><div align="center">SUBTOTAL</div></th>
		<th width="50"  nowrap><div align="center">IVA</div></th>
		<th width="50"  nowrap><div align="center">3%</div></th>
		<th width="50"  nowrap><div align="center">NO GRAVABLE</div></th>
		<th width="50"  nowrap><div align="center">TOTAL</div></th>
		<?php
			$conceptos_abono = mysqli_query($con ,"select n_reg, descripcion from valeryus09 where pmontomax='ABONO' ORDER BY descripcion");
			$conceptos = array();
			echo mysqli_error($con);
			while($concepto = mysqli_fetch_array($conceptos_abono))
				$conceptos[] = array("n_reg" => $concepto['n_reg'], "descripcion" => $concepto['descripcion']);
			foreach($conceptos as $concepto)
				echo '<th width="50"  nowrap><div align="center">'.$concepto['descripcion'].'</div></th>';
		?>
		<th width="50"  nowrap><div align="center">TOTAL ABONOS</div></th>
    </tr>
	
<?php

if($_POST['tbus3'] != ""){
	@$where = " WHERE v.n_reg like '%".$_POST['tbus3']."%'  and v.cancelado='0' AND v.status = 'HISTORICO' ORDER BY v.n_reg";
	echo '<input name="txt_bus" type="hidden" value="'.$_POST['tbus'].'">';
}elseif($