<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
	session_start();
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
		//
if(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
	JsDir("cerrar.php");	
	return;
}
//
	//-------------------------	
	$StrGT="";
	$VP_RegXPag=10;
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";
	$LStrPag=V($_POST['TxtPag']);
	//$LStrTR=gn("count(*)","marcas","");
	include("cobros_historial_fun.php");
	$StrHWND_PH=$_SESSION['SYS_HW']."_CH";
?>
<!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" />
<title>Proveedores - Estado de Cuenta</title>
<script type="text/javascript" src="fe/funciones.js"></script>
<script type="text/javascript" src="fe/cobros_historial.js"></script>
<style type="text/css">
<!--
body {
	background-color: #CCC;
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
	width:800px;
	height:600px;
	position:absolute;
	left:50%;
	top:50%;
	background-color:#006699;
	margin:-300px 0 0 -400px;
}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;	
	color: #FFFFFF;
}
.f2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.Estilo4 {color: #000099}
.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}
#Frm center #DivFRM #layer6 .f2 table tr td {
	color: #333;
	font-weight: normal;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="cobros_historial.php">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer5" style="position:absolute; left: 41px; top: 126px; width: 199px;">
      <div align="left" class="f2">CLIENTE</div>
    </div>


    <div id="layer4" style="position:absolute; left: 37px; top: 87px; width: 725px; height: 26px;">
      <div align="left" class="f2">
        
        <input name="CmdB" type="button" id="CmdZ" 
         value="Nuevo" onclick="fCancelar();"  tabindex="17"/> 
        <input name="CmdB" type="button" id="CmdZ" 
         value="Volver" onclick="fBuscar('proveedores_edc.php');"  tabindex="17"/>
         <input name="CmdB" type="button" id="CmdZ" 
         value="Menu" onclick="fBuscar('menu.php');"  tabindex="17"/>
         <input type="hidden" name="TxtIdPro" id="TxtIdPro" value="<?php echo $StrIdPro;?>"/>
      </div>
    </div>


    <div id="layer" style="position:absolute; left: 116px; top: 21px; width: 565px; height: 45px; z-index: 100;">
      <div align="left" class="Estilo1">
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
      <strong>CLIENTES - ESTADO DE CUENTA</strong></div>
  </div>

          <input name="TxtPro" type="text" id="TxtPro" 
          style="position:absolute; left: 38px; top: 143px; width: 316px;; background-color:#CCC" 
          value="<?php echo $StrPro;?>"  
          onKeyDown="return SoloTextoEx(event,'CmdSel');" 
          tabindex="2"  readonly="readonly"/>

    <div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
    <div align="left" class="Estilo1"><img src="img/estadodecuenta.png" width="64" height="64" /></div>
  </div>
    <div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 800px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
      <div align="left" class="Estilo1">        
      </div>
</div>
    <div id="layer9" style="position:absolute; left: 433px; top: 126px; width: 86px;">
      <div align="left" class="f2">MONEDA</div>
  </div>

<select name="CboMon" id="CboMon" style="position:absolute; left: 431px; top: 143px; width: 93px;" 
onkeydown="return SoloTextoEx(event,'CmdG');"
tabindex="5" >
<?php
$s="SELECT mon_nombre FROM monedas ORDER BY mon_nombre DESC";
$result = grs($s);
while ($row = $result->fetch_row()){
if($StrMon==$row[0]){
echo "<option value=\"$row[0]\" selected=\"selected\">$row[0]</option>";
}else{
echo "<option value=\"$row[0]\" >$row[0]</option>";
}
}
?>
</select>
    <div id="layer36" style="position:absolute; left: 363px; top: 143px; width: 69px; height: 25px;">
      <div align="left" class="f2">
<input type="button" name="CmdSel" id="CmdSel" value="..." 
onclick="OpenWin('clientes_edc_seleccionar.php',700,600)" 
style="width:30px" tabindex="3" 
<?php
if(strlen($StrId)>0){
	echo "disabled=\"disabled\"";
}
?>
/>
<input type="button" 
name="CmdCls" id="CmdCls"  style="width:30px"
value="X" 
onclick="fCls();" tabindex="4"
<?php
if(strlen($StrId)>0){
	echo "disabled=\"disabled\"";
}
?>
/>
      </div>
  </div>
    <?php
	if(strlen($StrId)>0  && $StrFdp!="EFECTIVO"){
	echo "<div class=\"f2\" align=\"left\"";
	echo "style=\"position:absolute; left: 37px; top: 241px; width: 108px;\">";
	echo "FECHA DE PAGO";
	echo "</div>";
	
	}
	?>

    <div id="layer3" style="position:absolute; left: 530px; top: 143px; width: 82px; height: 25px;">
      <div align="left" class="f2">
  <input name="CmdB" type="button" id="CmdG" value="Procesar"	

		onclick="fProcesar();" style="width:80px" tabindex="13"/ >
  </div>
</div>


    <div id="layer6" style="position:absolute; left: 42px; top: 188px; width: 718px; height: 493px;">
      <div align="left" class="f2">
        <table width="719" height="17" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="66" bgcolor="#999999"><span class="Estilo4"> <b>FECHA</b></span></td>
<td width="90" bgcolor="#999999"><span class="Estilo4"><b>DOCUMENTO</b></span></td>
<td width="70" bgcolor="#999999" align="left"><span class="Estilo4"><b>NUMERO</b></span></td>
<td width="291" bgcolor="#999999" align="left">
<span class="Estilo4"><b>DETALLE</b></span></td>
<td width="52" bgcolor="#999999" align="right"><span class="Estilo4"><b>TOTAL</b></span></td>
<td width="71" bgcolor="#999999" align="right">
<span class="Estilo4"><b>A CUENTA</b></span></td>
<td width="63" bgcolor="#999999" align="center"><span class="Estilo4"><b>SALDO</b></span></td>
</tr>
<?php
if($StrCmd=="Procesar"){
	$s="SELECT DATE_FORMAT(fec,'%d-%m-%y'),doc,num,obs,tot,acuenta,saldo
	FROM edc WHERE hwnd='$StrHWND_CH' ORDER BY fec,gi";
	$result = grs($s);
	while ($row = $result->fetch_row()){
	echo "<tr>";
	echo "<td bgcolor=\"#FFFFFF\">$row[0]</td>";
	echo "<td bgcolor=\"#FFFFFF\">$row[1]</td>";
	echo "<td bgcolor=\"#FFFFFF\" >$row[2]</td>";
	echo "<td bgcolor=\"#FFFFFF\" >$row[3]</td>";
	echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\" >$row[4]</td>";
	echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\" >$row[5]</td>";
	echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\" >$row[6]</td>";
	echo "</tr>";
	}
}
?>
        </table>
      </div>
    </div>
  </div>
</center>	
        </form>
</body>
</html>
