<?php
error_reporting(0);
   session_start();
   require($_SERVER['DOCUMENT_ROOT'].'/'.'shine/configuracion/'.'config.php');
   include_once($_SERVER['DOCUMENT_ROOT'].'/shine/model/estadoCuenta.php');
   $objEstadoCuenta = new estadoCuenta();
   $reg = $objEstadoCuenta->MET_fillTable($_SESSION['num_identificacion'], $_GET['docentry'], $_GET['opcion'], $_GET['filtrar']) ;
   //	print_r($reg);
   //print_r($_SESSION);
   $header = '
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />		
          <style type="text/css">
           
          .td-redondo {
    border: solid 2px #12418b!important;
    border-radius: 8px!important;
    padding-left: 10px;
    padding-right: 10px;
}

.h2, h2 {
    font-size: 15px!important;
}
          
              table{
                  width:100%;
                  border: 1px solid #CCC;
                  cellspacing:0;
                  cellpadding:0;
                  rules:all;
              }
              body { 
                  font: 100%/1.4 "Arimo", sans-serif;
                  font-family: "Arimo", sans-serif;	 
              }
              .header_consulta{
                  font-weight:bold;
                  text-align:center;
                  vertical-align:middle;
                  background-color:#12418b;
                  width:100%;
   			color:#FFFFFF
              }
              .filapar_consulta{
                  font-weight:normal;
                  text-align:left;
                  vertical-align:middle;
                  background-color:#FFF;
              }
              .filaimpar_consulta{
                  font-weight:normal;
                  text-align:left;
                  vertical-align:middle;
                  background-color:#CCC;
              }
              
              .logo{
                  width: 200px!important;
              }
          </style>
          <title>Consulta</title>
          </head>
          <body>
          <center>
          <table>
   	
   		<tr><td colspan="12" align="center"><img class="logo" width="200px" src="'.$CONF_logo.'"></td></tr>
   	
   	<tr>
   	<td colspan="12" align="center" ><h4 style="font-size:20px!important;">Estado de Cuenta</h4></td> 
   	</tr>
   	<tr><td colspan="10" align="left">Firma: '.$_SESSION['nombalmacen'].'</td></tr>
   	<tr><td colspan="10" align="left">Dicose: '.$_SESSION['dicose'].'</td></tr>
   	<tr><td colspan="10" align="left">Ubicación: '.$_SESSION['nom_director'].'</td></tr>
   	<tr><td colspan="10" align="left">Negocios: '.$_SESSION['nom_director'].'</td></tr>	<tr><td colspan="10" align="left">Fecha inicio inversión: '.$_SESSION['fechainversion'].'</td></tr>
          		<tr>		<td colspan="1" align="left">					<input name="txt_filtrar" type="text" class="txt_textbox" id="txt_filtrar" value="'.$_GET['filtrar'].'" style="width:200px" />						</td>				<td colspan="2" align="left">						<input name="btn_filtrar" type="button" class="txt_textbox" id="btn_filtrar" value="Filtrar" 				style="width:70px" onClick="filtrarData();" />						</td>				</tr>		
   	<tr class="header_consulta" >
          ';			echo ' <script type="text/javascript">						function MM_openBrWindow(theURL,winName,features) {				window.open(theURL,winName,features);			};						function filtrarData(){				var inputVal = document.getElementById("txt_filtrar").value;								MM_openBrWindow("/shine/form/estadoCuenta.php?filtrar="+inputVal+"&opcion=2&docentry='.$_GET['docentry'].'","winConsSolicitudes","status=yes,scrollbars=yes,resizable=yes,width=750,height=550");			};							</script>						';	
   echo $header;       	
   echo '<td class="td-redondo">Cliente</td>';
   echo '<td class="td-redondo">Tipo de operacion</td>';
   echo '<td class="td-redondo">Categoria</td>';
   echo '<td class="td-redondo">Cabezas</td>';	
   echo '<td class="td-redondo">Fecha</td>';
   echo '<td class="td-redondo">Nro factura</td>';
   echo '<td class="td-redondo">Flete</td>';
   echo '<td class="td-redondo">Peso</td>';
   echo '<td class="td-redondo">Total inversion</td>';
   echo '<td class="td-redondo">Cobra DC</td>';
   echo '<td class="td-redondo">A cobrar cliente</td>';
   echo '<td class="td-redondo">Fecha cobro</td>';
   echo '</tr>';
   echo $reg;
   echo '</table></body></html>';
   ?>