<?php
	session_start();
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	include("phpmnu_fun.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
	//-------------------------	+++++
	$StrGT="";
	$VP_RegXPag=10;
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";
	$LStrPag=V($_POST['TxtPag']);
	$LStrTR=gn("count(*)","usuarios","");
	include("usuarios_fun.php");
	//++
	$IdUsu=$_SESSION['SYS_USER_ID'];
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Usuarios</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/usuarios.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"  />
<style type="text/css">
.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>
<script>
$(document).ready(function(){  
   Inicializar();
});
</script>
</head>

<body  <?php echo $LStrMsg;?>>
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
//$HTM=file_get_contents("http://inversionessounduniversal.com/ventas/phpmnu.php?USER_ID=$IdUsu");
echo GEN_MENU(vbval(V($_SESSION['SYS_USER_ID'])));
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" action="usuarios.php" 
autocomplete="off" 
style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">
<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="img/Cargos2.png" class="iT" />
<div class="tT">USUARIOS</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left: 35px; top: 117px; width: 134px;">
NOMBRE DE USUARIO</div>
<input name="TxtNom" type="text" id="TxtNom" 
class="lt" style="position: absolute; left: 35px; top: 134px; width: 133px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $StrNom;?>" maxlength="15" />

<div class="s1" style="left: 176px; top: 117px; width: 134px;">
PASSWORD</div>
<input name="TxtPass" type="password" id="TxtPass" 
class="lt" style="position: absolute; left: 178px; top: 134px; width: 133px;"
tabindex="<?php echo ++$TI;?>" 
value="<?php echo $StrPass;?>" maxlength="10" />

<div class="s1" style="left: 318px; top: 117px; width: 133px;">
PASSWORD</div>
<input name="TxtPass2" type="password" id="TxtPass2" 
class="lt" style="position: absolute; left: 319px; top: 134px; width: 133px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $StrPass2;?>" maxlength="10" />



<div class="s1" style="left: 464px; top: 117px; width: 425px;">
NOMBRES Y APELLIDOS</div>
<input name="TxtFull" type="text" id="TxtFull" 
class="lt" style="position: absolute; left: 463px; top: 134px; width: 449px;"
tabindex="<?php echo ++$TI;?>" 
value="<?php echo $StrFull;?>" maxlength="100" />

<div class="s1" style="position: absolute; left: 922px; top: 117px; width: 82px;">
HABILITADO</div>
<select name="CboHab" id="CboHab" 
class="lt" style="position: absolute; left: 920px; top: 134px; width: 81px;"
tabindex="<?php echo ++$TI;?>">
<?php
if($StrHab=="SI"){
echo "<option value=\"SI\" selected=\"selected\">SI</option>";
echo "<option value=\"NO\">NO</option>";
}else{
echo "<option value=\"SI\">SI</option>";
echo "<option value=\"NO\" selected=\"selected\">NO</option>";
}
?>
</select>

<div class="s1" style="left: 35px; top: 169px; width: 425px;">
<b>PERMISOS</b></div>

<?php if(strlen($InvEli)==0)$InvEli="NO";?>
<div class="s1" style="left:35px; top: 190px; width: 82px;"> ELIMINAR INVOICE
</div>
<select name="InvEli" id="InvEli" 
class="lt" style="left: 35px; top: 226px; width: 71px"
tabindex="<?php echo ++$TI;?>">
<?php 
echo FCBO_("aux_nom","auxiliar","aux_des='SN'",$InvEli,"","S");
?>
</select>

<?php if(strlen($InvEdi)==0)$InvEdi="NO";?>
<div class="s1" style="left:120px; top: 190px; width: 82px;">
EDITAR INVOICE
</div>
<select name="InvEdi" id="InvEdi" 
class="lt" style="left: 120px; top: 226px; width: 71px"
tabindex="<?php echo ++$TI;?>">
<?php 
echo FCBO_("aux_nom","auxiliar","aux_des='SN'",$InvEdi,"","S");
?>
</select>


<input name="CH_EV" type="checkbox"  
class="lt" id="CH_EV" value="1" style="position: absolute; left: 33px; top: 180px; display:none"
<?php if($Str_EV=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 202px; top: 182px; width: 119px; display:none">
<label for="CH_MV">MODIFICAR VENTA</label></div>
<input name="CH_MV" type="checkbox" 
class="lt" id="CH_MV" value="1" style="position: absolute; left: 178px; top: 180px; display:none" 
<?php if($Str_MV=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 350px; top: 182px; width: 108px; display:none">
<label for="CH_AV">ANULAR VENTA</label></div>
<input name="CH_AV" type="checkbox" 
class="lt" id="CH_AV" value="1" style="position: absolute; left: 328px; top: 180px; display:none"  
<?php if($Str_AV=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 486px; top: 182px; width: 191px; display:none">
<label for="CH_MP">MODIFICAR PRECIO DE VENTA</label></div>
<input name="CH_MP" type="checkbox" 
class="lt" id="CH_MP" value="1" style="position: absolute; left: 464px; top: 180px;display:none" 
<?php if($Str_MP=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 711px; top: 182px; width: 134px;display:none">
<label for="CH_AT">ACTIVAR ATAJOS</label></div>
<input name="CH_AT" type="checkbox"
class="lt" id="CH_AT" value="1" style="position: absolute; left: 688px; top: 180px;display:none" 
<?php if($CH_AT=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 871px; top: 182px; width: 213px;display:none">
<label for="CH_OPC">OCULTAR PRECIO DE COMPRA</label></div>
<input name="CH_OPC" type="checkbox"
class="lt" id="CH_OPC" value="1" style="position: absolute; left: 850px; top: 180px;display:none" 
<?php if($CH_OPC=="1"){echo "checked=\"checked\"";}	?>
tabindex="<?php echo ++$TI;?>"/>

<!--INI_BOTONES-------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 35px; top: 71px; width:1000px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm" 
<?php GOM($StrId);?>
onclick="fGuardar();"  
tabindex="<?php echo ++$TI;?>"/>
<script>
function flCancelar(){
	SM("L");
}
</script>
<input name="CmdB" type="button" id="CmdC"  class="btm" 
value="Nuevo" onClick="flCancelar();"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdZ" class="btm" 
value="Menu" onClick="fBuscar('menu.php');"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!--FIN_BOTONES-------------------------------->
    
<div class="datagrid" style="position: absolute; left: 35px; top: 261px; width: 1175px; height: 301px;">
<table width="100%">
<thead>
<tr>
<td colspan="10" height="18" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>
<tr>
<th width="31%">NOMBRE</th>
<th width="63%">NOM. Y APE.</th>
<th width="3%">HAB</th>
<th width="3%">&nbsp;</th>
</tr>
</thead>
<tbody>

<?php
	$s="SELECT id_usuario,nom,id_alm,nomape,hab,ev,mv,av,mp,opc ".
	   "FROM usuarios ".
	   "WHERE id_usuario> 0 ORDER BY nom ";		  				
	$rs=grs($s);
	while($r=$rs->fetch_assoc()){		
		?>
        <tr onDblClick="fActivar(<?php echo $r['id_usuario'];?>);">
        <!----------------------------------------------->
        <td ><?php echo $r['nom'];?></td>
        <td ><?php echo $r['nomape'];?></td>
        <td ><?php echo $r['hab'];?></td>
        <!----------------------------------------------->
        <td align="center">
        <a href="javascript:void(0)" onClick="fActivar(<?php echo $r['id_usuario'];?>);">
        <img src="img/b_edit.png"  border="0"/></a></td>
        </tr>
		<?php	
	}

?>		  
  
          
</tbody>
</table>
</div>

<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<!--FIN_OCULTOS-------------------------------->


<input type="button" name="CmdLoad" 
id="CmdLoad" value="Configurar menu" 
onclick="fMenuConfig();" tabindex="7" 
style="position: absolute; left: 1019px; top: 134px; width: 189px;"
<?php
if(strlen($StrId)==0 || $StrId==0){
echo " disabled=\"disabled\"	";
}
?>
>
    

</form>
</div>
</div>
</body>
</html>
