<?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;
}
//
	$STR_VAR="CLAVE_PRECIO";
	//-------------------------	
	$StrGT="";
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";
	//-------------------------
	$StrCmd=V($_POST['TxtAc']);
	$StrPas1=V($_POST['TxtPas1']);
	$StrPas2=V($_POST['TxtPas2']);
	$StrValorAct="";
	//-------------------------
	if(strlen($StrCmd)==0){
		$StrPas1=gs("valor","valores","dato='$STR_VAR'");
		$StrPas2=$StrPas1;
	}
	//FUNCIONES DE ACTUALIZACION
	if($StrCmd=="M"){		
		if(strlen($StrGT)==0){
			$s="UPDATE valores SET valor='$StrPas1' WHERE dato='$STR_VAR'";
			ejt($s);
			if($LStrMM=="S")	$LStrMsg="Datos actualizados";
			$LStrFoc="document.getElementById('TxtPas1').focus();";
			$LStrMsg="La clave ha sido actualizada";
			$LStrFoc="document.getElementById('TxtPas1').focus();";						
			$StrGT="S";
		}
	}	
	//////////////////////////////////
	if($StrGT=="S"){
		if(strlen($LStrMsg)>0){
			if(strlen($LStrFoc)==0){
				$LStrMsg="onload=\"alert('$LStrMsg');\"";
			}else{
				$LStrMsg="onload=\"alert('$LStrMsg');$LStrFoc;\"";
			}
		}else{
			if(strlen($LStrFoc)>0){
				$LStrMsg="onload=\"$LStrFoc;\"";
			}
		}
	}else{
		$LStrFoc="document.getElementById('TxtPas1').focus();";
		$LStrMsg="onload=\"$LStrFoc;\"";
	}
?>
<!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>Clave de autorizacion para precios de venta</title>
<script type="text/javascript" src="fe/funciones.js"></script>
<script type="text/javascript" src="fe/password.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:700px;
     height:600px;
     position:absolute;
     left:<?php echo "50%";?>;
     top:<?php echo "50%";?>;
	 background-color:#006699;
	 margin:<?php echo "-300px";?> 0 0 <?php echo "-350px";?>;
}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	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;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="password.php">
<center> 
<div Id="DivFRM"  class="centrarFrm" >

<div id="layer4" style="position:absolute; left: 60px; top: 85px; width: 442px; height: 26px;">
<div align="left" class="f2">
<input name="CmdB" type="button" id="CmdG" value="Modificar"	
onclick="fGuardar();" style="width:80px" tabindex="3"/>
<input name="CmdB" type="button" id="CmdZ" 
value="Menu" onclick="fBuscar('menu.php');"  tabindex="4"/>
</div>
</div>
<div id="layer" style="position:absolute; left: 116px; top: 21px; width: 528px; 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>CLAVE DE AUTORIZACION PARA  PRECIOS DE VENTA</strong></div>

</div>
<div style="position:absolute; left: 60px; top: 157px; width: 157px;">
<div align="left" class="f2">CLAVE</div>
</div>
<input name="TxtPas1" type="password" id="TxtPas1" style="position:absolute; left: 60px; top: 177px; width: 132px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'TxtPas2');" 
value="<?php echo $StrPas1;?>" maxlength="6" />

<div style="position:absolute; left:214px; top: 157px; width: 157px;">
<div align="left" class="f2">REPETIR CLAVE</div>
</div>
<input name="TxtPas2" type="password" id="TxtPas2" style="position:absolute; left:214px; top: 177px; width: 132px;" 
tabindex="2"  
onKeyDown="return SoloTextoEx(event,'CmdG');"
value="<?php echo $StrPas2;?>" maxlength="6" />


<div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
<div align="left" class="Estilo1"><img src="img/tcambio.png" width="56" height="52" /></div>
</div>
<div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 700px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
<div align="left" class="Estilo1">        
</div>
</div>
</div>
</center>	
</form>
</body>
</html>
