<?php
session_start();
include("cls_conexion.php");
$CNN=new ClsMySQL();
include("conexion23.php");
//+++++++++++
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//++++++++
$HW=V($_SESSION['SYS_HW']);
$IdUsu=vbval(V($_SESSION['SYS_USER_ID']));
//
$StrGT="";
$SYS_MSG="";
$SYS_FOC="";
$OK=1;
$SYS_PAG="";
$PAGADO="NO";
$CANCELADO=0;
//
$MOD=V($_GET['MOD']);
$KEY=V($_GET['KEY']);
if(strlen($KEY)==0){
	$KEY=V($_POST['KEY']);
	$MOD=V($_POST['MOD']);
}
$KEY=vbval($KEY);
$MOD=vbval($MOD);
//
include("ges_facturas_fechas_fun.php");
//if(strlen($PAGADO)==0)$PAGADO="NO";
/*
$VP_RegXPag=100;
$LStrTR=gn("count(*)","ges_empresas","id_emp>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
*/
$TI=0;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Factura - Asignar fecha programada</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones28.js"></script>
<script type="text/javascript" src="ja/ges_facturas_fecha1.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />

<link rel="stylesheet" type="text/css" href="tcal.css" />
<script type="text/javascript" src="tcal.js"></script> 

<style type="text/css">
.cF {height:800px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

.tableFixHead          { overflow-y: auto; overflow:auto; border:solid 1px #363636;position: absolute; }
.tableFixHead thead th { position: sticky; top: 0; }
table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#A0A0A0}
</style>
<script>
function FUN_INI(){
  Inicializar();
  //
  SYS_LOAD();
  var pag=gv("SYS_PAG");
  if(pag=="OK"){
	  //alert("Pago registrado");
	  window.opener.POP_ACT();
	  window.close();
	  return;
  }
  if(gv("PAGADO")=="NO"){
  	  document.getElementById("CuoFec").style.backgroundColor="#FFF";
  }else{
	  document.getElementById("CuoFec").style.backgroundColor="#CCC";
  }
}
</script>
</head>

<body onLoad="FUN_INI()" >
<div align="center">



<div Id="DivFRM"  class="cF" style="background-color:#FFC; width:520px; height:250px">
<form id="Frm" name="Frm" method="post" autocomplete="off"
action="ges_facturas_fecha.php" enctype="multipart/form-data" 
style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<input name="KEY" id="KEY" type="hidden" value="<?php echo $KEY;?>">
<input name="MOD" id="MOD" type="hidden" value="<?php echo $MOD;?>">
<input name="TxtAc" id="TxtAc" type="hidden" value="">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" style="width: 520px" >
<img src="png/compras.png"  class="iT" />
<div class="tT" style="width:350px">FACTURA - ASIGNAR FECHA PROGRAMADA</div>
</div>
<!--FIN_TITULO--------------------------------->


<div class="s1" style="left: 101px; top: 76px; width: 126px;">
Para deshacer una asignacion puede asignar vacio</div>


<?php
$DIS="";
if($PAGADO=="SI"){
	$DIS=" disabled ";
}
?>

<div class="s1" style="left: 238px; top: 71px; width: 126px;">
FECHA (dd-mm-yyyy)</div>
<input name="CuoFec"  type="text" id="CuoFec"
class="fez tcal" style="left: 238px; top: 88px; width: 143px" 
value="<?php echo $CuoFec;?>"  <?php echo $DIS; ?>   
tabindex="<?php echo ++$TI;?>"/>


<input type="button" name="CmdX" id="CmdX" 
value="X" tabindex="<?php echo ++$TI;?>"
onClick="fxPagarX()" <?php echo $DIS; ?>   
style="position: absolute; left: 387px; top: 88px; width: 32px;"
/>
<script>
function fxPagarX(){
	sv("CuoFec","");
}
</script>
<input type="button" name="CmdAddCuo" id="CmdAddCuo" 
value="Asignar" tabindex="<?php echo ++$TI;?>"
onClick="fxPagar()" <?php echo $DIS; ?>   
style="position: absolute; left: 238px; top: 120px; width: 181px;"
/>


<!--INI_OCULTOS-------------------------------->
<input name="PAGADO" type="hidden" id="PAGADO" value="<?php echo $PAGADO;?>" />

<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>" />
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>" />
<input name="SYS_PAG" type="hidden" id="SYS_PAG" value="<?php echo $SYS_PAG;?>" />
</form>
</div>
</div>
</body>
</html>
