<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>SICA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="SHORTCUT ICON" HREF="../sivi.ico">
<LINK href="../general.css" type=text/css rel=stylesheet>
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="../bootstrap/js/bootstrap.min.js"></script>
<script language="JavaScript" type="text/javascript" src="frm_cliente.js"></script>

</head>

<BODY >
<?php
 @session_start();
  $vg_login=$_SESSION["usuario"];
  if($vg_login<>""){}
 else
  {echo "<script>";
   echo "window.location='../index.php';";
   echo "</script>";
  }	
include "../valida_permisos.php";
$vg_programa = F_programa();
include "../seguridad.php";
$ip=getenv("REMOTE_ADDR");

include "../conexion.php";
$id="";$nombre="";$estado="";$direccion="";$telefono="";$email="";$contacto="";

							  
if(isset($_REQUEST["oculto"]))
{ 
       	$id=$_REQUEST["id"];   		
		$nombre=$_REQUEST["nombre"];   
		$estado=$_REQUEST["estado"];  
}

if($_REQUEST["Obuscar"]==1)
{ $id=$_REQUEST["id"];
  $sql_datosrs=mysqli_query($conexion,"SELECT nombre,direccion,telefono,email,contacto,estado from proveedor
							where id='".$_REQUEST["id"]."'");
  while($datosrs= mysqli_fetch_row($sql_datosrs))
  { 
	 $nombre=$datosrs[0];
	 $direccion=$datosrs[1];
	 $telefono=$datosrs[2];
	 $email=$datosrs[3];
	 $contacto=$datosrs[4];
	 $estado=$datosrs[5];
  }
}



?>
<form name="parametros" method="post" action="" >
<div id="informes" class="container text-center" style="width:70%;">
    <div class="panel panel-default">
      <div class="panel-heading">CLIENTES</div>
      <div align="center">
  	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="texto" >
                    <tr> 
                      <td width="85" height="0"> <div align="center">Codigo                        </div></td>
                      <td width="274"><input name="id" type="text"   id="id" value="<?php echo $id; ?>"
                         class="form-control" data-placement="right"  style="width: 150px" 								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                      <td width="144"><div align="center">Nit </div></td>
                      <td width="610"><input name="nit" type="text"   id="nit" value="<?php echo $nit; ?>"
                         class="form-control" data-placement="right"  style="width: 150px" 								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr> 
                      <td height="0"><div align="center">Nombre                       </div></td>
                      <td height="0" colspan="3"><input name="nombre" type="text"   id="nombre" value="<?php echo $nombre; ?>" 
                       class="form-control" data-placement="right"  style="width: 350px" 
								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr> 
                      <td height="1"><div align="center">Direccion                        </div></td>
                      <td height="1" colspan="3"><input name="direccion" type="text"   id="direccion" value="<?php echo $direccion; ?>" 
                         class="form-control" data-placement="right"  style="width: 350px"  
								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr> 
                      <td height="1"><div align="center">Telefono                        </div></td>
                      <td height="1" colspan="3"><input name="telefono" type="text"   id="telefono" value="<?php echo $telefono; ?>"
                         class="form-control" data-placement="right"  style="width: 350px"  
								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr> 
                      <td height="0"><div align="center">Email                        </div></td>
                      <td height="0" colspan="3"><input name="email" type="text"   id="email" value="<?php echo $email; ?>" 
                         class="form-control" data-placement="right"  style="width: 350px"  
								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr>
                      <td height="1"><div align="center">Contacto                        </div></td>
                      <td height="1" colspan="3"><input name="contacto" type="text"   id="contacto" value="<?php echo $contacto; ?>"
                         class="form-control" data-placement="right"  style="width: 350px"  
								
								onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'"></td>
                    </tr>
                    <tr> 
                      <td height="3"> <div align="center">Estado                        </div></td>
                      <td height="3" colspan="3"><select name="estado" id="estado"
                         class="form-control" data-placement="right"  style="width: 150px" 
                         onFocus="this.style.background='#ccffff'" onBlur="this.style.background='#ffffff'" >
                        <?PHP
							  if($estado=="A"){echo "<option value='A' selected>Activo</option>";}
							  else {echo "<option value='A' >Activo</option>";}
							  if($estado=="I"){echo "<option value='I' selected>Inactivo</option>";}
							  else {echo "<option value='I' >Inactivo</option>";}
							?>
                      </select></td>
                    </tr>
                    <tr> 
                      <td colspan="4"><div align="center"> 
                          <input name="buscar" type="hidden" id="buscar" value="Busca" title="Clic para Buscar" class="btn" onClick="jq_busca_datos_parametros(document.parametros.id.value,'proveedor');" >
                          <input name="guardar" type="button" id="guardar" value="Guardar" title="Clic para Guardar"  class="btn btn-primary" onClick="return pregunta_guardar_parametros('proveedor');" >
                          <input name="modificar" type="button" id="modificar" value="Modificar" class="btn btn-primary" title="Clic para Modificar" onClick="return pregunta_modificar_parametros('proveedor'); ">
                          <input name="cancelar" type="button" id="cancelar" value="Cancelar" class="btn btn-primary" title="Clic para cancelar los datos" onClick="LimpiarCampos_parametros();valida_cancelar();">
                          <input name='rep' type='button'  id='rep' value='Reporte'   class="btn btn-primary" title="Clic para ver reporte"
						  onClick="javascript:window.open('frm_reporteparametros.php?tabla=proveedor','ReporteParametros','menubar=1,toolbar=0,location=0,directories=0,status=1,scrollbars=1,width=800,height=500');" >
                          <br>
                          <input name="oguardar" type="hidden" id="oguardar">
                          <input name="Obuscar" type="hidden" id="Obuscar">
                          <input name="omodificar" type="hidden" id="omodificar">
                          <input name="oreporte" type="hidden" id="oreporte">
                          <input name="obuscadato" type="hidden" id="obuscadato">
                          <input name="oculto" type="hidden" id="oculto">
                          <br>
                        </div></td>
                    </tr>
                  </table>
</div>
</div>
</div>                  
</form>
<div id="resultado"></div>
</body>
</html>
