<?php
		session_start();

		include('../conexion.php');
		
		 
		if($_SESSION['tipo_usu']=='a' or $_SESSION['tipo_usu']=='s'  ){
		}else{
			header('location:acceso_denegado.php');
		}
		


$codusu=$_GET["codusu"];


$consulta = "SELECT * FROM usuarios WHERE codusu='$codusu'";
$resultado = $mysqli->query($consulta);
$row = $resultado->fetch_array();
 
 	$estado = $row["estado"]; 
	$tipo1  = $row["tipo"];
?>

<html>
	<head>
		<title>Principal</title>
		<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../funciones/validar.js"></script>
		<script language="javascript">
		
		function aceptar() {
			location.href="index.php";
		}
		
		var cursor;
		if (document.all) {
		// Está utilizando EXPLORER
		cursor='hand';
		} else {
		// Está utilizando MOZILLA/NETSCAPE
		cursor='pointer';
		}
		
		</script>
<body  onLoad="nobackbutton();">
		<div id="">
			<div background="../Fondo/fondo.jpg" id="zonaContenido">
			  <div align="center">
				  
				  <div id="tituloForm" class="header">Ver Usuario </div>
				 <p>&nbsp;</p>
		          <div id="frmBusqueda" class="contenidoCliente"> 

                                    <table class="fuente8" width="91%" cellspacing=0 cellpadding=3 border=0>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td colspan="3">&nbsp;</td>
                        </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td width="22%">&nbsp;</td>
                        <td width="30%">&nbsp;</td>
                        </tr>
                      <tr>
                        <td width="2%">&nbsp;</td>
                        <td width="17%">Codigo</td>
                        <td width="29%"><?php echo  $row["codusu"] ?></td>
                        <td>Cedula</td>
                        <td><input id="cedula" type="text" class="cajaMedia" name="Acedula" maxlength="15" value="<?php echo  $row["ced"]?>"  onFocus="siguienteCampo ='Acelular';" disabled></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>Nombre  Completo</td>
                        <td width="29%"><input name="ANombreCompleto" type="text" class="cajaGrande" id="NombreCompleto" 
							value="<?php echo  $row["nomcomusu"] ?>" size="55" maxlength="55" onFocus="siguienteCampo ='ANombreCorto';" disabled></td>
                        <td>Celular </td>
                        <td><input id="celular" name="Acelular" type="text" class="cajaMedia" maxlength="14" value="<?php echo  $row["telusu"] ?>"  onFocus="siguienteCampo ='AClave';" disabled></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>Nombre Corto</td>
                        <td width="29%"><input id="NombreCorto" type="text" class="cajaMedia" NAME="ANombreCorto" maxlength="15" value="<?php echo  $row["usu"] ?>"  onFocus="siguienteCampo ='Acedula';" disabled></td>
                        <td>Estado</td>
                        			                <?php
					        $estusu= $row["estado"];
                            $query_estcli = "SELECT * FROM  estatus ORDER BY nomest ASC";
                            $result = $mysqli->query($query_estcli);
					  ?>
					  
                        <td><select id="comboestatus" name="comboestatus" class="comboMedio"  onFocus="siguienteCampo ='combotipousuario';">
                            <?php
					 
								while ($fila = $result->fetch_assoc()) { 
									if ($estusu ==  $fila["estlog"]) { ?>
                            <option value="<?php echo  $fila["estlog"]?>" selected="selected"><?php echo  $fila["nomest"]?></option>
                            <?php } else { ?>
                            <option value="<?php echo  $fila["estlog"]?>"><?php echo  $fila["nomest"]?></option>
                            <?php } ;
								} ?>
                        </select></td>
                      </tr>
                      
                      <tr>
                        <td>&nbsp;</td>
                        <td>Clave</td>
                        <td width="29%"><input id="Clave" name="AClave" type="password" class="cajaMedia" style='text-align:center;' maxlength="8" value="<?php echo $row["con"] ?>"  onFocus="siguienteCampo ='ANombreCompleto';"></td>
                        						  
					                 <?php
					        $tipusu= $row["tipo"];
                            $query_estatus="SELECT * FROM tipousuario ORDER BY nomtipusu DESC";
                            $result2 = $mysqli->query($query_estatus);
					  ?>
                        <td>Tipo de Usuario</td>
                        <td><select id="combotipousuario" name="combotipousuario" class="comboMedio"  onFocus="siguienteCampo ='ANombreCompleto';">
						        <?php
			
					 
								while ($fila2 = $result2->fetch_assoc()) { 
									if ($tipusu ==  $fila2["codlog"]) { ?>
                            <option value="<?php echo  $fila2["codlog"]?>" selected="selected"><?php echo  $fila2["nomtipusu"]?></option>
                            <?php } else { ?>
                            <option value="<?php echo  $fila2["codlog"]?>"><?php echo  $fila2["nomtipusu"]?></option>
                            <?php } ;
								} ?>
                        </select></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>

  </table>
                       <table class="fuente8" width="100%" cellspacing=0 cellpadding=3 border=0>
<tr>
 <td>&nbsp;</td>
 <td>&nbsp;</td>
    <td colspan="4">
     
        <div align="center" class="fuente10">
          <div align="center">
              <input type="checkbox" name="MarcarTodos" id="MarcarTodos"   value="1" onClick=""> 
            Privilegios Usuario </div>
        </div>    </td>
		
		 <td>&nbsp;</td>
		
		   <td>&nbsp;</td>
		   
    </tr>
	  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><div align="center"><strong>INVENTARIO</strong></div></td>
    <td>&nbsp;</td>
    <td colspan="2"><div align="center"><strong>CLIENTES</strong></div></td>
    <td><div align="left"><strong>PROFORMAS</strong></div></td>
    <td colspan="2">&nbsp;</td>
    <td> </td>
  </tr>
  <tr>
    <td width="9%">&nbsp;</td>
      <?php  $permodinv=$row["permodinv"] ;
        if($permodinv==1){?>
        <td width="3%"><input type="checkbox" name="permodinv" id="permodinv"  checked value="1"></td>
    
 <?php  }else{  ?>
  
        
    <td width="3%"><input type="checkbox" name="permodinv" id="permodinv"  value="1"></td>
   
   <?php  }  ?>
   
   <td >Modifica Inventario</td>
   
        <?php  $permodlim=$row["permodlim"] ;
        if($permodlim==1){?> 
        <td width="3%"><input type="checkbox" name="permodlim" id="permodlim"  checked value="1"></td>
 
 		<?php  }else{  ?>  
    <td width="3%"><input type="checkbox" name="permodlim" id="permodlim"   value="1"></td>
   
    <?php  }   ?> 
	
	 <td >Modifica límite de crédito</td>
       <?php    $perprouti=$row["perprouti"] ;
        if($perprouti==1){?> 
        <td width="3%"><input type="checkbox" name="perprouti" id="perprouti"  checked value="1"></td>

 		<?php  }else{  ?>  
        <td width="3%"><input type="checkbox" name="perprouti" id="perprouti"   value="1"></td>
      
    <?php  }  ?>
	 <td >Permite Ver Utilidad</td>
  </tr>
  <tr>
    <td width="9%" height="28">&nbsp;</td>
       <?php  
        $perajuinv=$row["perajuinv"] ;
        if($perajuinv==1){?>  
    <td><input type="checkbox" name="perajuinv" id="perajuinv"  checked value="1"></td>
  
  <?php  }else{  ?>
    <td><input type="checkbox" name="perajuinv" id="perajuinv"   value="1"></td>
  
  <?php  }  ?>
     <td>Ajusta  Inventario</td>
       <?php  $permodpla=$row["permodpla"] ;
        if($permodpla==1){?>
    <td><input type="checkbox" name="permodpla" id="permodpla"  checked value="1"></td>
   
      <?php  }else{  ?>
    <td><input type="checkbox" name="permodpla" id="permodpla"   value="1"></td>
  
    <?php  }  ?> 
	
	 <td>Modifica  plazo de crédito</td>
    
        <?php  $perconfac=$row["perconfac"] ;
        if($perconfac==1){?> 
        <td width="3%"><input type="checkbox" name="perconfac" id="perconfac"  checked value="1"></td>
   
 		<?php  }else{  ?>  
    <td width="3%"><input type="checkbox" name="perconfac" id="perconfac"   value="1"></td>
   
    <?php  }  ?>
	 <td >Permite Convertir a Factura </td>
  </tr>
  
  <tr>
    <td width="9%" height="28">&nbsp;</td>
       <?php  
        $perfacneg=$row["perfacneg"] ;
        if($perfacneg==1){?>  
    <td><input type="checkbox" name="perfacneg" id="perfacneg"  checked value="1"></td>
  
  <?php  }else{  ?>
    <td><input type="checkbox" name="perfacneg" id="perfacneg"   value="1"></td>
  
  <?php  }  ?>
     <td>Factura Negativa </td>
      	       <?php  $perverven=$row["perverven"] ;
        if($perverven==1){?>
    <td> <input type="checkbox" name="perverven" id="perverven"  checked value="1"></td>
   
      <?php  }else{  ?>
    <td> <input type="checkbox" name="perverven" id="perverven"   value="1"></td>
  
    <?php  }  ?> 
	
	 <td>Verifica Vencimiento </td>
    
        <?php  $perconfac=$row["perconfac"] ;
        if($perconfac==1){?> 
        <td width="3%"></td>
   
 		<?php  }else{  ?>  
    <td width="3%"></td>
   
    <?php  }  ?>
	 <td >&nbsp;</td>
  </tr>
    </table> 
			   
                

			    <span class="contenido"><img src="../img/Undo_48x48-32.png" width="48" height="48" onClick="aceptar()" border="0" onMouseOver="style.cursor=cursor" title="Salir"></span></div>
		  </div>

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