<?php require_once('Connections/conexionabm.php'); 

session_start();
set_time_limit(9000000);

error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set("memory_limit",'256M');   

date_default_timezone_set('UTC');

$_SESSION['por_codigo'] = 0;
$_SESSION['coddepart'] = '';
$_SESSION['codpos'] = '';
$edicion = 0;

if (!isset($_SESSION['sigla'])) {
	echo '<script language = javascript>
	self.location = "index"
	</script>';
}

if (!isset($_SESSION['nombreuser'])) {
	echo '<script language = javascript>
	self.location = "index"
	</script>';
}

if (!isset($_SESSION['niveluser'])) {
	echo '<script language = javascript>
	self.location = "index"
	</script>';
}
 
if (!isset($_GET['cedula'])) {
	$_SESSION['cedula'] = '';
	$_SESSION['cedula5'] = '';
	$_SESSION['CodigoEmpleado'] = '';
}
if (!isset($_GET['codigo'])) {
	$_SESSION['codigo'] = '';
	$_SESSION['codigo5'] = '';
	$_SESSION['CodigoEmpleado'] = '';
}

if (isset($_GET['cedula'])) {
	$cedula = $_GET['cedula'];
	$_SESSION['cedula'] = $_GET['cedula'];
	$_SESSION['cedula5'] = $_GET['cedula'];
	
	include('datos_personal.php');
	$FotoEmpl = $_SESSION['strimagen'];
	$codigoempl = $_SESSION['CodigoEmpleado'];	
}

if (isset($_GET['edicion'])) {
	$edicion = $_GET['edicion'];
}
/* 
if (isset($_GET['codigo'])) {
	$codigo = $_GET['codigo'];
	$_SESSION['codigo'] = $_GET['codigo'];
	$_SESSION['codigo5'] = $_GET['codigo'];
	
		include('datos_personal.php');
		$FotoEmpl = $_SESSION['strimagen'];
		$codigoempl = $_SESSION['CodigoEmpleado'];	
}
*/
 
if (isset($_GET['codigo'])) {
	$codigo = $_GET['codigo'];
	$_SESSION['codigo'] = $_GET['codigo'];
	$_SESSION['codigo5'] = $_GET['codigo'];

	$continuar = 1;
	if (isset($_SESSION['tipo']) && ($_SESSION['tipo'] == 'AC')) {
		$continuar = 0;
		$_SESSION['por_codigo'] = $codigo;
		echo '<script language = javascript>
			self.location = "solicitud_accion";
		</script>';
	}	
	
	if ($continuar == 1) {
		include('datos_personal.php');
		$FotoEmpl = $_SESSION['strimagen'];
		$codigoempl = $_SESSION['CodigoEmpleado'];	
	}
}

$Promocion = 0;
$strImagen = 'fotosilueta.jpg';
$_SESSION['tipo'] = 'CE';	// CONSULTA EMPLEADO

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
/* 
	$archivo = $_FILES["foto"]["tmp_name"];
	$tamanio = $_FILES["foto"]["size"];
	$tipo = $_FILES["foto"]["type"];
	$nombre = $_FILES["foto"]["name"];

    $fp = fopen($archivo, "rb");
    $contenido = fread($fp, $tamanio);
    $contenido = addslashes($contenido);
    fclose($fp);
	  	 
	$strImagen = 'fotosilueta.jpg';
*/	
	if ($edicion == '1') {
		$codigoempl	= $_POST['codigo'];
		$apellido 	= $_POST['apellido'];
		$nombre 	= $_POST['nombre'];
		$direccion	= $_POST['direccion'];
		$email 		= $_POST['email'];
		$cuentabanco = $_POST['cuentabanco'];
		$tiposangre	 = $_POST['tiposangre'];
		$celular	 = $_POST['celular'];
		$telefono 	= $_POST['telefono'];
		$codrango 	= $_POST['rango'];
		$coddepart 	= $_POST['depart'];
		$codpos 	= $_POST['posicion'];
	 	
		$sql = 'UPDATE Empleados SET Apellidos = (?), Nombres=(?), Direccion=(?), CorreoElectronico=(?), CuentaBancaria=(?), 
		TelefonoCelular=(?), TelefonoCasa=(?), TipoSangre=(?), CodigoRango=(?), CodigoDepartamento=(?), CodigoPosicion=(?) WHERE CodigoEmpleado = (?)';
		$params = array($apellido, $nombre, $direccion, $email, $cuentabanco, $celular, $telefono, $tiposangre, $codrango, $coddepart, $codpos, $codigoempl);
		$result = sqlsrv_query($conn, $sql, $params) or die(sqlsrv_errors());	
	
		$updateGoTo = "alerta_actualizado";
		if (isset($_SERVER['QUERY_STRING'])) {
			$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
			$updateGoTo .= $_SERVER['QUERY_STRING'];
		}
		header(sprintf("Location: %s", $updateGoTo));
	}
}
				
//------------------------------------------------
$Departamentos = sqlsrv_query($conn, "SELECT CodigoDepartamento, Departamento FROM Departamentos ORDER BY Departamento");	
$Posiciones = sqlsrv_query($conn, "SELECT CodigoPosicion, Posicion FROM Posiciones ORDER BY Posicion");	
$Rango = sqlsrv_query($conn, "SELECT CodigoRango, Rango FROM Rangos ORDER BY Rango");	

?>
<!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>Documento sin título</title>
<link href="SpryAssets/SpryTabbedPanels_empl1.css" rel="stylesheet" type="text/css" />
<script src="jquery-1.3.2.js" type="text/javascript"></script>
<script src="jquery.maskedinput-1.2.2.js" type="text/javascript"></script>
<script>
jQuery(function($){
$("#cedula").mask("999-9999999-9");
});
</script> 


<script type="text/javascript">
function localiza_empleado1() {	
	var cedula = document.getElementById("cedula").value;

	if (cedula != '___-_______-_') {
		window.location.href = 'localiza_empleado?cedula='+cedula;
	}
	//----------------------------------------------------------------------------------------------------
}
</script>

<script type="text/javascript">
function localiza_empleado2() {	
	var codigo = document.getElementById("codigo").value;

	//----------------------------------------------------------------------------------------------------
	if (codigo != '') {
		window.location.href = 'localiza_empleado?codigo='+codigo;
	}	
	//----------------------------------------------------------------------------------------------------
}
</script>

<script type="text/javascript">
function localiza_empleado3() {	
	var nombre = document.getElementById("txtnombre").value;
	var apellido = document.getElementById("txtapellido").value;

	//----------------------------------------------------------------------------------------------------
	if (apellido == '' && nombre != '') {
		window.location.href = 'impr_busca_empl?txtnombre='+nombre;
	}		
	//----------------------------------------------------------------------------------------------------
	if (apellido != '' && nombre == '') {
		window.location.href = 'impr_busca_empl?txtapellido='+apellido;
	}		
	//----------------------------------------------------------------------------------------------------
	if ( apellido != '' && nombre != '') {
		window.location.href = 'impr_busca_empl?txtapellido='+apellido+"&txtnombre="+nombre;
	}
}
</script>

<script type="text/javascript">
function localiza_empleado4() {	
	var codigo = document.getElementById("codigo").value;
	var edicion = 1;
	
	//----------------------------------------------------------------------------------------------------
	if (codigo != '') {
		window.location.href = 'localiza_empleado?codigo='+codigo+"&edicion="+edicion;
	}	
	//----------------------------------------------------------------------------------------------------
}
</script>

<script type="text/javascript">
function localiza_empleados() {	
	var cedula = document.getElementById("cedula").value;
	var codigo = document.getElementById("codigo").value;
	var nombre = document.getElementById("txtnombre").value;
	var apellido = document.getElementById("txtapellido").value;

	if (cedula != '___-_______-_') {
		window.location.href = 'localiza_empleado?cedula='+cedula;
	}
	//----------------------------------------------------------------------------------------------------
	if ((cedula == '___-_______-_' || cedula == '') && codigo != '') {
		window.location.href = 'localiza_empleado?codigo='+codigo;
	}	
	//----------------------------------------------------------------------------------------------------
	if ((cedula == '___-_______-_' || cedula == '') && codigo == '' && apellido == '' && nombre != '') {
		window.location.href = 'impr_busca_empl?txtnombre='+nombre;
	}		
	//----------------------------------------------------------------------------------------------------
	if ((cedula == '___-_______-_' || cedula == '') && codigo == '' && apellido != '' && nombre == '') {
		window.location.href = 'impr_busca_empl?txtapellido='+apellido;
	}		
	//----------------------------------------------------------------------------------------------------
	if ((cedula == '___-_______-_' || cedula == '') && codigo == '' && apellido != '' && nombre != '') {
		window.location.href = 'impr_busca_empl?txtapellido='+apellido+"&txtnombre="+nombre;
	}
}
</script>

<script language=javascript type=text/javascript>
	// SCRIP PARA QUE LA TECLA ENTER NO FUNCIONE, O NO ENVIE EL FORMULARIO
	function stopRKey(evt) {
	var evt = (evt) ? evt : ((event) ? event : null);
	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
	}
	
	document.onkeypress = stopRKey; 
</script>

<style type="text/css">
input[type="text"]:disabled {
/*    background: #EFF5FA; */
    background: #F0F0F0;
}

/*input:read-only {
    background-color: #F3F8FC;
}*/
input[type="text"]:read-only {
    background: #EEF5FB;
}
.select {font-family: Arial, Helvetica, sans-serif;
	background: #FFC;
	border: thin solid skyblue;	
	border-radius: 4px;
	color: #000;
	font-size: 12px;
	padding: 4px;
}

.desglose {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	text-align: center;
	color: #039;
}

.brillo:hover {
	font-weight: bold;
	color: #06C;
	background-color: #F4EA9F;
}

.Comic {
	font-family: "Comic Sans MS";
	font-weight: normal;
	font-size: 11px;
	color: #000;
}

.Comic10 {
	font-family: "Comic Sans MS";
	font-weight: normal;
	font-size: 10px;
	color: #000;
}

.Comic12 {
	font-family: "Comic Sans MS";
	font-weight: normal;
	font-size: 12px;
	color: #000;
}

.ComicNormal {
	font-family: "Comic Sans MS";
	font-weight: normal;
	font-size: 13px;
	color: #000;
}
.TitComic {
	font-family: "Comic Sans MS";
	font-weight: bold;
	font-size: 11px;
	color: #036;
}

.Boton {
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #B8A88F));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #B8A88F 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#B8A88F',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #B8A88F;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}

.Boton2 {
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #A8A8A8));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #A8A8A8 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#A8A8A8',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #A8A8A8;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}

.izqblanco {text-align: left;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            color: #fff;
            text-align: left;	
}
.titrepderec {            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            font-weight: bold;
            text-align: center;
            color: #fff;
}
#alfabetos {border-collapse:collapse; background:buttonface;}
#contEncCol {scrollbar-face-color:buttonface; scrollbar-highlight-color:buttonface; scrollbar-shadow-color:buttonface; scrollbar-arrow-color:buttonface; scrollbar-track-color:buttonface; scrollbar-base-color:buttonface; scrollbar-3dlight-color:buttonface; scrollbar-darkshadow-color:buttonface; }
#contEncCol2 {scrollbar-face-color:buttonface; scrollbar-highlight-color:buttonface; scrollbar-shadow-color:buttonface; scrollbar-arrow-color:buttonface; scrollbar-track-color:buttonface; scrollbar-base-color:buttonface; scrollbar-3dlight-color:buttonface; scrollbar-darkshadow-color:buttonface; }
#contEncCol3 {scrollbar-face-color:buttonface; scrollbar-highlight-color:buttonface; scrollbar-shadow-color:buttonface; scrollbar-arrow-color:buttonface; scrollbar-track-color:buttonface; scrollbar-base-color:buttonface; scrollbar-3dlight-color:buttonface; scrollbar-darkshadow-color:buttonface; }
#contEncFil {scrollbar-face-color:buttonface; scrollbar-highlight-color:buttonface; scrollbar-shadow-color:buttonface; scrollbar-arrow-color:buttonface; scrollbar-track-color:buttonface; scrollbar-base-color:buttonface; scrollbar-3dlight-color:buttonface; scrollbar-darkshadow-color:buttonface; }

#encCol {height:100%}
#encCol2 {height:100%}
#encCol3 {height:100%}
/*
#contenedor{
	overflow: auto;
	width: 400px;
	<?php// if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
		height: 200px;
	<?php// }?>
	<?php// if (!isset($_SESSION['CodigoEmpleado']) OR $_SESSION['CodigoEmpleado'] == '') {?>
		height: 50px;
	<?php//}?>	
	text-align: left;
} 
*/
#contenedor {
	overflow: auto;
	width: 820px;
	<?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
		height: 145px;
	<?php }?>
	<?php if (!isset($_SESSION['CodigoEmpleado']) OR $_SESSION['CodigoEmpleado'] == '') {?>
		height: 50px;
	<?php }?>
	text-align: left;
}

#contenedor2 {
	overflow: auto;
	width: 620px;
	<?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
		height: 145px;
	<?php }?>
	<?php if (!isset($_SESSION['CodigoEmpleado']) OR $_SESSION['CodigoEmpleado'] == '') {?>
		height: 50px;
	<?php }?>
	text-align: left;
}

#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol #encCol {
	color: #039;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol #encCol .Boton .Comic {
	color: #036;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol #encCol .Boton .Comic {
	color: #069;
	font-size: 10px;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contenedor table .brillo .Comic {
	font-size: 10px;
}
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol2 #encCol2 {
	color: #039;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol2 #encCol2 .Boton .Comic {
	color: #036;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol2 #encCol2 .Boton .Comic {
	color: #069;
	font-size: 10px;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contenedor table .brillo .Comic {
	font-size: 10px;
}
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol3 #encCol3 {
	color: #039;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol3 #encCol3 .Boton .Comic {
	color: #036;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contEncCol3 #encCol3 .Boton .Comic {
	color: #069;
	font-size: 10px;
}
#form1 table tr td #TabbedPanels1 .TabbedPanelsContentGroup .TabbedPanelsContent table tr th #alfabetos tr td #contenedor table .brillo .Comic {
	font-size: 11px;
}
/*------------------------------------------------------------------------------------------------------------------------------------------------*/

.Boton1 {	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #B8A88F));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #B8A88F 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#B8A88F',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #B8A88F;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.TitEstado {	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #FFF;
}
.TitEstado {	font-size: 11px;
	font-family: Arial, Helvetica, sans-serif;
}

.BotonBuscar {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonBuscar:hover {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #019ad2), color-stop(1, #daf2fa));
	background:-moz-linear-gradient(top, #019ad2 5%, #daf2fa 100%);
	background:-webkit-linear-gradient(top, #019ad2 5%, #daf2fa 100%);
	background:-o-linear-gradient(top, #019ad2 5%, #daf2fa 100%);
	background:-ms-linear-gradient(top, #019ad2 5%, #daf2fa 100%);
	background:linear-gradient(to bottom, #019ad2 5%, #daf2fa 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#019ad2', endColorstr='#daf2fa',GradientType=0);
	background-color:#019ad2;
}
.BotonBuscar1 {	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color:#050505;
	font-family:Arial;
	font-size:14px;
	padding:5px 16px;
	text-decoration:none;
}
.ComicAzul1 {
	color: #036;
	font-weight: bold;
}

input[type=text] {
	background: #FFFFFF;
	border: thin solid skyblue;	
	border-radius: 4px;
	color: #F60;
	font-size: 12px;
	height: 14px;
	padding: 4px;
}
.otrotexto {
	background: #FFFFFF;
	border: thin solid skyblue;	
	border-radius: 4px;
	color: #F60;
	font-size: 12px;
	height: 12px;
	padding: 4px;
}

.textbox {
    font-family: Arial, Helvetica, sans-serif;
	background: #FFFFFF;
	border: thin solid skyblue;	
	border-radius: 4px;
	color: #000;
	font-size: 12px;
	height: 12px;
	padding: 4px;
}

select {
  border: 0;
  outline: 0;
  background: transparent;
  background-color:transparent;
  border-bottom: 1px solid black;
  border-color:skyblue;
  color: #000;
  font-size: 11px;
}
.Boton3 {	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #B8A88F));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #B8A88F 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#B8A88F',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #B8A88F;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.Boton21 {	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #A8A8A8));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #A8A8A8 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#A8A8A8',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #A8A8A8;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.BotonBuscar11 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color:#050505;
	font-family:Arial;
	font-size:14px;
	padding:5px 16px;
	text-decoration:none;
}


.border_tabla {
	border-radius: 14px 14px 14px 14px;
	-moz-border-radius: 14px 14px 14px 14px;
	-webkit-border-radius: 14px 14px 14px 14px;
	border: 1px solid #CCC;
}

.border_tabla2 {
	border-radius: 10px 10px 10px 10px;
	-moz-border-radius: 10px 10px 10px 10px;
	-webkit-border-radius: 10px 10px 10px 10px;
	border: 1px solid #CCC;
}

.border_tabla3 {
	border: 1px solid #CCC;
}

.asteric {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}

.BotonForma {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #8fd6fc), color-stop(1, #0061a7));
	background:-moz-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-webkit-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-o-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-ms-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:linear-gradient(to bottom, #8fd6fc 5%, #0061a7 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8fd6fc', endColorstr='#0061a7',GradientType=0);
	background-color:#8fd6fc;
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	border-radius:3px;
	border:1px solid #124d77;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:Arial;
	font-size:13px;
	padding:6px 12px;
	text-decoration:none;
	text-shadow:1px 1px 0px #154682;
}
.BotonForma:hover {
	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0061a7), color-stop(1, #8fd6fc));
	background:-moz-linear-gradient(top, #0061a7 5%, #8fd6fc 100%);
	background:-webkit-linear-gradient(top, #0061a7 5%, #8fd6fc 100%);
	background:-o-linear-gradient(top, #0061a7 5%, #8fd6fc 100%);
	background:-ms-linear-gradient(top, #0061a7 5%, #8fd6fc 100%);
	background:linear-gradient(to bottom, #0061a7 5%, #8fd6fc 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0061a7', endColorstr='#8fd6fc',GradientType=0);
	background-color:#0061a7;
}

input#foto{
  color: transparent;
}
.BotonBuscar2 {	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonBuscar32 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonBuscar321 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
</style>
<link href="SpryAssets/SpryTabbedPanels_empl1.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.Boton4 {	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #B8A88F));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #B8A88F 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#B8A88F',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #B8A88F;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.Boton22 {	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #A8A8A8));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #A8A8A8 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#A8A8A8',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #A8A8A8;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.BotonBuscar322 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonBuscar3211 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonForma1 {	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #8fd6fc), color-stop(1, #0061a7));
	background:-moz-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-webkit-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-o-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-ms-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:linear-gradient(to bottom, #8fd6fc 5%, #0061a7 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8fd6fc', endColorstr='#0061a7',GradientType=0);
	background-color:#8fd6fc;
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	border-radius:3px;
	border:1px solid #124d77;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:Arial;
	font-size:13px;
	padding:6px 12px;
	text-decoration:none;
	text-shadow:1px 1px 0px #154682;
}
.BotonBuscar31 {background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #daf2fa), color-stop(1, #019ad2));
	background:-moz-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-webkit-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-o-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:-ms-linear-gradient(top, #daf2fa 5%, #019ad2 100%);
	background:linear-gradient(to bottom, #daf2fa 5%, #019ad2 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#daf2fa', endColorstr='#019ad2',GradientType=0);
	background-color:#daf2fa;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #057fd0;
	display:inline-block;
	cursor:pointer;
	color: #009;
	font-weight:bold;
	font-family:"Comic Sans MS";
	font-size:14px;
	padding: 2px 6px;
	text-decoration:none;
}
.BotonForma2 {	background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #8fd6fc), color-stop(1, #0061a7));
	background:-moz-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-webkit-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-o-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:-ms-linear-gradient(top, #8fd6fc 5%, #0061a7 100%);
	background:linear-gradient(to bottom, #8fd6fc 5%, #0061a7 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8fd6fc', endColorstr='#0061a7',GradientType=0);
	background-color:#8fd6fc;
	-moz-border-radius:3px;
	-webkit-border-radius:3px;
	border-radius:3px;
	border:1px solid #124d77;
	display:inline-block;
	cursor:pointer;
	color:#ffffff;
	font-family:Arial;
	font-size:13px;
	padding:6px 12px;
	text-decoration:none;
	text-shadow:1px 1px 0px #154682;
}
.Boton221 {background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #A8A8A8));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #A8A8A8 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #A8A8A8 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#A8A8A8',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #A8A8A8;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
.Boton41 {background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f7f7f7), color-stop(1, #B8A88F));
	background: -moz-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -webkit-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -o-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: -ms-linear-gradient(top, #f7f7f7 5%, #B8A88F 100%);
	background: linear-gradient(to bottom, #f7f7f7 5%, #B8A88F 100%);
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f7f7f7', endColorstr='#B8A88F',GradientType=0);
	background-color: #f7f7f7;
	border: 1px solid #B8A88F;
	font-family: Arial, Helvetica, sans-serif;
	color: #039;
}
</style>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
</head>

<body>
<table width="800" border="0" align="center" class="border_tabla3">
  <tr>
    <th scope="col"><form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
      <table width="800" border="0" align="center">
      <tr>        </tr>
      </table>
      <div id="TabbedPanels1" class="TabbedPanels">
        <ul class="TabbedPanelsTabGroup">
          <li class="TabbedPanelsTab" tabindex="0">Consulta por Codigo / Cedula</li>
          <li class="TabbedPanelsTab" tabindex="0">Consulta Por Nombre / Apellido</li>
        </ul>
        <div class="TabbedPanelsContentGroup">
          <div class="TabbedPanelsContent">
            <table width="800" border="0" align="center">
              <tr>
                <th scope="col"><table width="800" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: right;" bordercolor="#CCCCCC" align="center" bgcolor="#FFFFFF">
                  <tr>
                    <td align="center"><table width="830" align="center" bgcolor="#EEECE3" class="ComicNormal">
                      <tr valign="baseline" bgcolor="#000099">
                        <td width="122" height="19" align="right" valign="middle"><span class="TitEstado"><a href="index1" class="TitEstado">INICIO</a></span></td>
                        <td colspan="5" align="left" valign="middle"><span class="TitEstado">DATOS PERSONALES</span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap"><span class="ComicAzul1">Codigo</span> :</td>
                        <td valign="middle"><input name="codigo" id="codigo" type="text" style='text-transform:uppercase;' value="<?php echo $_SESSION['CodigoEmpleado']; ?>" size="3" <?php if ($edicion == '1') {?>readonly="readonly"<?php }?>/></td>
                        <td valign="middle"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)">
                          <input name="button" type="button" class="BotonBuscar322" id="button" value="Buscar" onclick="localiza_empleado2()"/>
                        </a></td>
                        <td valign="middle">&nbsp;</td>
                        <td width="145" valign="middle">&nbsp;</td>
                        <td width="106" rowspan="5" align="right" valign="top"><span class="style10"><img src="data:image/jpeg;base64,<?php echo base64_encode($FotoEmpl); ?>" alt="" width="100" height="120" border="1" align="top"/></span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap" class="ComicAzul1">Cedula  Empleado :</td>
                        <td width="145" valign="middle"><input name="cedula" type="text" id="cedula" value="<?php echo $_SESSION['cedula']; ?>" size="10" autofocus="autofocus" <?php if ($edicion == '1') {?>readonly="readonly"<?php }?>/>
                          <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)"></a></td>
                        <td width="228" valign="middle"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)">
                          <input name="button4" type="button" class="BotonBuscar3211" id="button4" value="Buscar" onclick="localiza_empleado1()"/>
                        </a></td>
                        <td valign="middle">&nbsp;</td>
                        <td valign="middle">&nbsp;</td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">&nbsp;</td>
                        <td width="145" colspan="4" valign="middle">&nbsp;</td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Apellido / Nombre :</td>
                        <td width="145" colspan="4" valign="middle">
                        <input name="apellido" id="apellido" type="text" value="<?php echo $_SESSION['apellido']; ?>" size="32" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">
                            <input name="nombre" id="nombre" type="text" value="<?php echo $_SESSION['nombre']; ?>" size="32" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                            *</span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Direccion :</td>
                        <td colspan="4" valign="middle"><input name="direccion" type="text" value="<?php echo $_SESSION['direccion']; ?>" size="71" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Salario :</td>
                        <td colspan="2" valign="middle"><input name="salario" type="text" id="salario" value="<?php echo number_format($_SESSION['salario'],2); ?>" 
                  size="8" readonly="readonly" style="text-align:right"/></td>
                        <td align="right" valign="middle" nowrap="nowrap">Rango :</td>
                        <td colspan="2" valign="top"><?php if ($edicion == '0') {?>
                          <input name="rango2" type="text" id="rango2" value="<?php echo $_SESSION['rango']; ?>" size="36" readonly="readonly" />
                          <?php }?>
						<?php if ($edicion == '1') {?>
                          <select required="required" name="rango" class="select" id="rango" style="width:250px">
                            <?php
								while ($row_Rango=sqlsrv_fetch_array($Rango)) {
							?>
                            <option value="<?php echo $row_Rango['CodigoRango']?>" <?php if (!(strcmp($row_Rango['CodigoRango'], $_SESSION['codrango']))) {echo "SELECTED";} ?>> <?php echo $row_Rango['Rango']?></option>
                            <?php } ?>
                          </select>
						<?php }?>
                          </td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Fecha Nacimiento :</td>
                        <td colspan="2" valign="middle"><input name="fechanac" type="text" value="<?php echo $_SESSION['fechanac'] ?>" size="8" readonly="readonly" />
                          Edad :
                          <input name="edad" type="text" value="<?php echo $_SESSION['edad']; ?>" size="4" readonly="readonly" /></td>
                        <td align="right" valign="middle" nowrap="nowrap">Luga de Nacimiento :</td>
                        <td colspan="2" valign="middle"><input name="lugarnac" type="text" value="<?php echo $_SESSION['lugarnac']; ?>" size="36" readonly="readonly" /></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Correo Electronico :</td>
                        <td colspan="2" valign="middle"><input name="email" type="text" value="<?php echo $_SESSION['email']; ?>" size="42" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                        <td align="right" valign="middle" nowrap="nowrap">Cuenta Banco :</td>
                        <td colspan="2" valign="middle"><input name="cuentabanco" type="text" id="cuentabanco" value="<?php echo $_SESSION['cuentabanco']; ?>" size="16" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Celular :</td>
                        <td colspan="2" valign="middle"><input name="celular" type="text" value="<?php echo $_SESSION['celular']; ?>" size="8" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                        <td align="right" valign="middle" nowrap="nowrap">Telefono Residencial :</td>
                        <td colspan="2" valign="middle"><input name="telefono" type="text" value="<?php echo $_SESSION['telefono']; ?>" size="10" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Fecha de Entrada :</td>
                        <td colspan="2" valign="middle"><input name="fechaentra2" type="text" value="<?php echo $_SESSION['fechaentra']; ?>" size="8" readonly="readonly" /></td>
                        <td align="right" valign="middle" nowrap="nowrap">Fecha de Salida :</td>
                        <td colspan="2" valign="middle"><input name="fechasal2" type="text" value="<?php echo $_SESSION['fechasal']; ?>" size="8" readonly="readonly" /></td>
                      </tr>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Provincia :</td>
                        <td colspan="2" valign="middle"><input name="provincia" type="text" id="provincia" value="<?php echo $_SESSION['DireccionProvincia']; ?>" size="42" readonly="readonly" /></td>
                        <td align="right" valign="middle" nowrap="nowrap">Municipio :</td>
                        <td colspan="2" valign="middle"><input name="municipio" type="text" id="municipio" value="<?php echo $_SESSION['DireccionMunicipio']; ?>" size="36" readonly="readonly" /></td>
                      </tr>
                      <?php if ($edicion == '1') {?>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Departamento  :</td>
                        <td colspan="2" valign="middle"><select required="required" name="depart" class="select" id="depart" style="width:288px">
                        <?php if ($edicion == '0') {?><option value="00" disabled selected="selected"></option> <?php }?>
                          <?php
								while ($row_Departamentos=sqlsrv_fetch_array($Departamentos)) {
							?>
                          <option value="<?php echo $row_Departamentos['CodigoDepartamento']?>" <?php if (!(strcmp($row_Departamentos['CodigoDepartamento'], $_SESSION['coddepart']))) {echo "SELECTED";} ?>> <?php echo $row_Departamentos['Departamento']?></option>
                          <?php
								}
								?>
                        </select></td>
                        <td align="right" valign="middle" nowrap="nowrap">Posicion :</td>
                        <td colspan="2" valign="middle"><select required="required" name="posicion" class="select" id="posicion" style="width:250px">
                        <?php if ($edicion == '0') {?><option value="00" disabled selected="selected"></option> <?php }?>
                          <?php
								while ($row_Posiciones=sqlsrv_fetch_array($Posiciones)) {
							?>
                          <option value="<?php echo $row_Posiciones['CodigoPosicion']?>" <?php if (!(strcmp($row_Posiciones['CodigoPosicion'], $_SESSION['codpos']))) {echo "SELECTED";} ?>> <?php echo $row_Posiciones['Posicion']?></option>
                          <?php
								}
								?>
                        </select></td>
                      </tr> <?php }?>
                      <?php if ($edicion == '0') {?>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">Departamento  :</td>
                        <td colspan="2" valign="middle"><input name="depart2" type="text" id="depart2" value="<?php echo $_SESSION['depart']; ?>" size="42" readonly="readonly" /></td>
                        <td align="right" valign="middle" nowrap="nowrap">Posicion :</td>
                        <td colspan="2" valign="middle"><input name="posicion2" type="text" id="posicion2" value="<?php echo $_SESSION['posicion']; ?>" size="36" readonly="readonly" /></td>
                      </tr>
                      <?php }?>
                      <tr valign="baseline">
                        <td align="right" valign="middle" nowrap="nowrap">&nbsp;</td>
                        <td colspan="2" valign="middle"><?php if ($edicion == '0') {?><input name="boton_edit" type="button" class="BotonForma" id="boton_edit" value="Editar Datos" onclick="localiza_empleado4()"/><?php }?>
                          <?php if ($edicion == '1') {?><input name="boton_act" type="submit" class="BotonForma" id="boton_act" value="Actualizar Datos" /><?php }?>
                          &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                          <input name="boton_salir" type="button" class="BotonForma" id="boton_salir" value="Salir" onclick="location='index1'"/></td>
                        <td align="right" valign="middle" nowrap="nowrap">Tipo de Sangre :</td>
                        <td colspan="2" valign="middle"><input name="tiposangre" type="text" value="<?php echo $_SESSION['tiposangre']; ?>" size="4" <?php if ($edicion == '0') {?>readonly="readonly"<?php }?> />
                          <span class="asteric">*</span></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></th>
              </tr>
              <tr>
                <td align="left" valign="top"><div id="TabbedPanels2" class="TabbedPanels">
                  <ul class="TabbedPanelsTabGroup">
                    <li class="TabbedPanelsTab" tabindex="0">Nomina</li>
                    <li class="TabbedPanelsTab" tabindex="0">Descuentos</li>
                    <li class="TabbedPanelsTab" tabindex="0">Otros Pagos</li>
                    <li class="TabbedPanelsTab" tabindex="0">Acciones Salarios</li>
                    <li class="TabbedPanelsTab" tabindex="0">Vacaciones - Licencias - Permisos</li>
                    <li class="TabbedPanelsTab" tabindex="0">Estudios Realizados</li>
                  </ul>
                  <div class="TabbedPanelsContentGroup">
                    <div class="TabbedPanelsContent">
                      <table width="800" height="90" id="alfabetos">
                        <tr>
                          <td height="38" align="left" valign="top" bgcolor="#FFFFFF"><div id="contEncCol">
                            <table width="800" id="encCol" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton221">
                                <th width="50"  height="20" align="center" class="TitComic" scope="col">TIPO</th>
                                <th width="80" class="TitComic" scope="col">FECHA</th>
                                <th width="65" align="right" class="TitComic" scope="col">SALARIO</th>
                                <th width="65" align="right" class="TitComic" scope="col">OTROS INGRESOS</th>
                                <th width="65" align="right" class="TitComic" scope="col">ISR</th>
                                <th width="65" align="right" class="TitComic" scope="col">SFS</th>
                                <th width="65" align="right" class="TitComic" scope="col">PENSION</th>
                                <th width="65" align="right" class="TitComic" scope="col">INAVI</th>
                                <th width="65" align="right" class="TitComic" scope="col">SEG. MED</th>
                                <th width="65" align="right" class="TitComic" scope="col">DESC.CAF</th>
                                <th width="65" align="right" class="TitComic" style="text-align: right" scope="col">TOT DESC</th>
                                <th width="65" align="right" class="TitComic" style="text-align: right" scope="col">NETO</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="800" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						$codigoempl = $_SESSION['CodigoEmpleado'];
						if(($Salario = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
							FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '101' AND (DAY(FechaNomina) = 25 OR DAY(FechaNomina) = 15))
							ORDER BY FechaNomina DESC, CodigoNomina")) !== false){					
							while ($row_Salario=sqlsrv_fetch_array($Salario)) {	
								$OtrosIngr = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
								$fecha_nom = $row_Salario['FechaNomina']->format('Y-m-d');
								$salario = $row_Salario['Valor'];
								
								if(($DescISR = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '201' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescISR=sqlsrv_fetch_array($DescISR)) {	
										$isr = $isr + $row_DescISR['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSFS = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '202' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSFS=sqlsrv_fetch_array($DescSFS)) {	
										$sfs = $sfs + $row_DescSFS['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescPENSION = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '203' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescPENSION=sqlsrv_fetch_array($DescPENSION)) {	
										$pension = $pension+ $row_DescPENSION['Valor'];
									}
								}								
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescINAVI = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '204' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescINAVI=sqlsrv_fetch_array($DescINAVI)) {	
										$inavi = $inavi+ $row_DescINAVI['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSEGMED = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '309' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSEGMED=sqlsrv_fetch_array($DescSEGMED)) {	
										$seg_med = $seg_med + $row_DescSEGMED['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescCAF = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '328' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescCAF=sqlsrv_fetch_array($DescCAF)) {	
										$caf = $caf + $row_DescCAF['Valor'];
									}
								}																	
								//--------------------------------------------------------------------------------------------------------------------

								$descuent = $isr + $sfs + $pension + $inavi + $seg_med + $caf;
								$neto = $salario - $descuent;
				 	 ?>
                              <tr class="brillo">
                                <td width="50" align="center" class="Comic"><?php echo $row_Salario['TipoNomina']?></td>
                                <td width="80" align="center" class="Comic"><?php echo $row_Salario['FechaNomina']->format('d-m-Y')?></td>
                                <td width="65" height="17" align="right" class="Comic"><?php echo number_format($row_Salario['Valor'],2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($OtrosIngr,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($isr,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($sfs,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($pension,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($inavi,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($seg_med,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($caf,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($descuent,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($neto,2)?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                    <div class="TabbedPanelsContent">
                      <table width="800" height="90" id="alfabetos3">
                        <tr>
                          <td height="38" align="left" valign="top" bgcolor="#FFFFFF"><div id="contEncCol3">
                            <table width="605" id="encCol3" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton41">
                                <th width="50"  height="25" align="center" class="TitComic" scope="col">TIPO</th>
                                <th width="80" class="TitComic" scope="col">FECHA</th>
                                <th width="65" align="right" class="TitComic" scope="col">ISR</th>
                                <th width="65" align="right" class="TitComic" scope="col">SFS</th>
                                <th width="65" align="right" class="TitComic" scope="col">PENSION</th>
                                <th width="65" align="right" class="TitComic" scope="col">INAVI</th>
                                <th width="65" align="right" class="TitComic" scope="col">SEG. MED</th>
                                <th width="65" align="right" class="TitComic" scope="col">DESC.CAF</th>
                                <th width="65" align="right" class="TitComic" style="text-align: right" scope="col">TOT DESC</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="605" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						if(($Salario = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
							FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '101' AND DAY(FechaNomina) = 25)
							ORDER BY FechaNomina DESC, CodigoNomina")) !== false){					
							while ($row_Salario=sqlsrv_fetch_array($Salario)) {	
								$OtrosIngr = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
								$fecha_nom = $row_Salario['FechaNomina']->format('Y-m-d');
								$salario = $row_Salario['Valor'];
								
								if(($DescISR = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '201' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescISR=sqlsrv_fetch_array($DescISR)) {	
										$isr = $isr + $row_DescISR['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSFS = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '202' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSFS=sqlsrv_fetch_array($DescSFS)) {	
										$sfs = $sfs + $row_DescSFS['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescPENSION = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '203' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescPENSION=sqlsrv_fetch_array($DescPENSION)) {	
										$pension = $pension+ $row_DescPENSION['Valor'];
									}
								}								
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescINAVI = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '204' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescINAVI=sqlsrv_fetch_array($DescINAVI)) {	
										$inavi = $inavi+ $row_DescINAVI['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSEGMED = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '309' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSEGMED=sqlsrv_fetch_array($DescSEGMED)) {	
										$seg_med = $seg_med + $row_DescSEGMED['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescCAF = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '328' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescCAF=sqlsrv_fetch_array($DescCAF)) {	
										$caf = $caf + $row_DescCAF['Valor'];
									}
								}																	
								//--------------------------------------------------------------------------------------------------------------------

								$descuent = $isr + $sfs + $pension + $inavi + $seg_med + $caf;
								$neto = $salario - $descuent;
				 	 ?>
                              <tr class="brillo">
                                <td width="50" height="17" align="center" class="Comic"><?php echo $row_Salario['TipoNomina']?></td>
                                <td width="80" align="center" class="Comic"><?php echo $row_Salario['FechaNomina']->format('d-m-Y')?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($isr,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($sfs,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($pension,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($inavi,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($seg_med,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($caf,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($descuent,2)?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                    <div class="TabbedPanelsContent">
                      <table width="800" height="90" id="alfabetos2">
                        <tr>
                          <td height="38" align="left" valign="top" bgcolor="#FFFFFF"><div id="contEncCol2">
                            <table width="800" id="encCol2" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton221">
                                <th width="50"  height="20" align="center" class="TitComic" scope="col">TIPO</th>
                                <th width="80" class="TitComic" scope="col">FECHA</th>
                                <th width="65" align="right" class="TitComic" scope="col">SALARIO</th>
                                <th width="65" align="right" class="TitComic" scope="col">OTROS INGRESOS</th>
                                <th width="65" align="right" class="TitComic" scope="col">ISR</th>
                                <th width="65" align="right" class="TitComic" scope="col">SFS</th>
                                <th width="65" align="right" class="TitComic" scope="col">PENSION</th>
                                <th width="65" align="right" class="TitComic" scope="col">INAVI</th>
                                <th width="65" align="right" class="TitComic" scope="col">SEG. MED</th>
                                <th width="65" align="right" class="TitComic" scope="col">DESC.CAF</th>
                                <th width="65" align="right" class="TitComic" style="text-align: right" scope="col">TOT DESC</th>
                                <th width="65" align="right" class="TitComic" style="text-align: right" scope="col">NETO</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="800" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						if(($Salario = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
							FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '101' AND (DAY(FechaNomina) != 25 AND DAY(FechaNomina) != 15))
							ORDER BY FechaNomina DESC, CodigoNomina")) !== false){					
							while ($row_Salario=sqlsrv_fetch_array($Salario)) {	
								$OtrosIngr = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
								$fecha_nom = $row_Salario['FechaNomina']->format('Y-m-d');
								$salario = $row_Salario['Valor'];
								
								if(($DescISR = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '201' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescISR=sqlsrv_fetch_array($DescISR)) {	
										$isr = $isr + $row_DescISR['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSFS = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '202' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSFS=sqlsrv_fetch_array($DescSFS)) {	
										$sfs = $sfs + $row_DescSFS['Valor'];
									}
								}
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescPENSION = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '203' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescPENSION=sqlsrv_fetch_array($DescPENSION)) {	
										$pension = $pension+ $row_DescPENSION['Valor'];
									}
								}								
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescINAVI = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '204' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescINAVI=sqlsrv_fetch_array($DescINAVI)) {	
										$inavi = $inavi+ $row_DescINAVI['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescSEGMED = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '309' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescSEGMED=sqlsrv_fetch_array($DescSEGMED)) {	
										$seg_med = $seg_med + $row_DescSEGMED['Valor'];
									}
								}	
								//--------------------------------------------------------------------------------------------------------------------
								if(($DescCAF = sqlsrv_query($conn, "SELECT CodigoEmpleado, FechaNomina, CodigoNomina, Secuencia, TipoNomina, Valor
									FROM NominaDetalle WHERE (CodigoEmpleado = '$codigoempl' AND CodigoNomina = '328' AND FechaNomina = '$fecha_nom')")) !== false){					
									while ($row_DescCAF=sqlsrv_fetch_array($DescCAF)) {	
										$caf = $caf + $row_DescCAF['Valor'];
									}
								}																	
								//--------------------------------------------------------------------------------------------------------------------

								$descuent = $isr + $sfs + $pension + $inavi + $seg_med + $caf;
								$neto = $salario - $descuent;
				 	 ?>
                              <tr class="brillo">
                                <td width="50" align="center" class="Comic"><?php echo $row_Salario['TipoNomina']?></td>
                                <td width="80" align="center" class="Comic"><?php echo $row_Salario['FechaNomina']->format('d-m-Y')?></td>
                                <td width="65" height="17" align="right" class="Comic"><?php echo number_format($row_Salario['Valor'],2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($OtrosIngr,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($isr,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($sfs,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($pension,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($inavi,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($seg_med,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($caf,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($descuent,2)?></td>
                                <td width="65" align="right" class="Comic"><?php echo number_format($neto,2)?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                    <div class="TabbedPanelsContent">
                      <table width="600" height="90" id="alfabetos4">
                        <tr>
                          <td height="38" align="left" valign="top" bgcolor="#FFFFFF"><div id="contEncCol4">
                            <table width="600" id="encCol4" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; 
                      	font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton41">
                                <th width="200"  height="25" align="left" class="TitComic" scope="col">CONCEPTO</th>
                                <th width="100" class="TitComic" scope="col">FECHA CREA</th>
                                <th width="100" align="center" class="TitComic" scope="col">FECHA EFEC</th>
                                <th width="100" align="center" class="TitComic" scope="col">USUARIO</th>
                                <th width="100" align="right" class="TitComic" scope="col">SALARIO</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor2" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="600" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						if(($Promociones2 = sqlsrv_query($conn, "SELECT AccionesHistorico.CodigoEmpleado, AccionesHistorico.FechaEfectividad, 
							AccionesHistorico.CodigoRango, AccionesHistorico.CodigoCambio, AccionesHistorico.UsuarioRegistro,
							AccionesHistorico.Concepto, AccionesHistorico.FechaRegistro, AccionesHistorico.Salario, Cambios.Cambio
							FROM AccionesHistorico
							INNER JOIN Cambios ON AccionesHistorico.CodigoCambio = Cambios.CodigoCambio
							WHERE (AccionesHistorico.CodigoEmpleado = '$codigoempl') AND (AccionesHistorico.CodigoCambio = '04' 
							OR AccionesHistorico.CodigoCambio = '06' OR AccionesHistorico.CodigoCambio = '07' OR AccionesHistorico.CodigoCambio = '08' 
							 OR AccionesHistorico.CodigoCambio = '01') ORDER BY FechaEfectividad DESC")) !== false){					
							while ($row_Promociones2=sqlsrv_fetch_array($Promociones2)) {	
								$Promocion = $Promocion + 1;
				 	 ?>
                              <tr class="brillo">
                                <td width="200" height="17" align="left" class="ComicNormal"><?php echo $row_Promociones2['Cambio']?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['FechaRegistro']->format('d-m-Y')?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['FechaEfectividad']->format('d-m-Y')?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['UsuarioRegistro']?></td>
                                <td width="100" align="right" class="Comic"><?php echo number_format($row_Promociones2['Salario'],2)?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                    <div class="TabbedPanelsContent">
                      <table width="600" height="90" id="alfabetos5">
                        <tr>
                          <td height="38" align="left" valign="top" bgcolor="#FFFFFF"><div id="contEncCol5">
                            <table width="600" id="encCol5" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; 
                      	font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton221">
                                <th width="200"  height="25" align="left" class="TitComic" scope="col">CONCEPTO</th>
                                <th width="100" class="TitComic" scope="col">FECHA CREA</th>
                                <th width="100" align="center" class="TitComic" scope="col">FECHA EFEC</th>
                                <th width="100" align="center" class="TitComic" scope="col">USUARIO</th>
                                <th width="100" align="right" class="TitComic" scope="col">SALARIO</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor2" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="600" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						if(($Promociones2 = sqlsrv_query($conn, "SELECT AccionesHistorico.CodigoEmpleado, AccionesHistorico.FechaEfectividad, 
							AccionesHistorico.CodigoRango, AccionesHistorico.CodigoCambio, AccionesHistorico.UsuarioRegistro,
							AccionesHistorico.Concepto, AccionesHistorico.FechaRegistro, AccionesHistorico.Salario, Cambios.Cambio
							FROM AccionesHistorico
							INNER JOIN Cambios ON AccionesHistorico.CodigoCambio = Cambios.CodigoCambio
							WHERE (AccionesHistorico.CodigoEmpleado = '$codigoempl') AND (AccionesHistorico.CodigoCambio = '10' 
							OR AccionesHistorico.CodigoCambio = '11' OR AccionesHistorico.CodigoCambio = '12' OR AccionesHistorico.CodigoCambio = '13' 
							 OR AccionesHistorico.CodigoCambio = '14' OR AccionesHistorico.CodigoCambio = '15' OR AccionesHistorico.CodigoCambio = '16') 
							  OR AccionesHistorico.CodigoCambio = '44' ORDER BY FechaEfectividad DESC")) !== false){					
							while ($row_Promociones2=sqlsrv_fetch_array($Promociones2)) {	
								$Promocion = $Promocion + 1;
				 	 ?>
                              <tr class="brillo">
                                <td width="200" height="17" align="left" class=" ComicNormal"><?php echo $row_Promociones2['Cambio']?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['FechaRegistro']->format('d-m-Y')?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['FechaEfectividad']->format('d-m-Y')?></td>
                                <td width="100" align="center" class="Comic"><?php echo $row_Promociones2['UsuarioRegistro']?></td>
                                <td width="100" align="right" class="Comic"><?php echo number_format($row_Promociones2['Salario'],2)?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                    <div class="TabbedPanelsContent">
                      <table width="600" height="90" id="alfabetos6">
                        <tr>
                          <td height="38" align="center" valign="top" bgcolor="#FFFFFF"><div id="contEncCol6">
                            <table width="800" id="encCol6" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 10px; 
                      	font-size: 12px; color: #000; font-family: Arial, Helvetica, sans-serif;" bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <tr class="Boton41">
                                <th width="70" height="25" class="TitComic" scope="col">FECHA</th>
                                <th width="260" align="left" class="TitComic" scope="col">PROFESION</th>
                                <th width="200" align="left" class="TitComic" scope="col">GRADO</th>
                                <th width="270" align="left" class="TitComic" scope="col">INSTITUCION</th>
                              </tr>
                            </table>
                          </div></td>
                        </tr>
                        <tr>
                          <td height="42" align="left" valign="top" bgcolor="#FFFFFF"><div id="contenedor" onscroll="desplaza()">
                            <?php if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {?>
                            <table width="800" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-size: 12px;" 
                          bordercolor="#CCCCCC" align="left" bgcolor="#FFFFFF">
                              <?php 
					$codigoempl = $_SESSION['CodigoEmpleado'];
					$OtrosIngr = 0; $descuent = 0; $salario = 0; $isr = 0; $sfs = 0; $pension = 0; $inavi = 0; $seg_med = 0; $caf = 0;
					// 201-IMPUESTO SOBRE LA RENTA, 202-SFS (LEY 87-01), 203-Pension (LEY 87-01), 204-INAVI, 309-SEGURO MEDICO ARS HUMANO
					// 328-DESCUENTO CAFETERIA
					
					if (isset($_SESSION['CodigoEmpleado']) AND $_SESSION['CodigoEmpleado'] != '') {
						if(($Estudios = sqlsrv_query($conn, "SELECT EmpleadosEstudios.CodigoEmpleado, EmpleadosEstudios.Fecha, 
							EmpleadosEstudios.CodigoGrado, EmpleadosEstudios.CodigoProfesion, EmpleadosEstudios.InstitucionEstudio, 
							Profesiones.Profesion, Grados.Grado
							FROM EmpleadosEstudios
							INNER JOIN Grados 		ON EmpleadosEstudios.CodigoGrado 	 = Grados.CodigoGrado
							INNER JOIN Profesiones	ON EmpleadosEstudios.CodigoProfesion = Profesiones.CodigoProfesion							
							WHERE (EmpleadosEstudios.CodigoEmpleado = '$codigoempl') ORDER BY EmpleadosEstudios.Fecha DESC")) !== false){					
							while ($row_Estudios=sqlsrv_fetch_array($Estudios)) {	
								$Promocion = $Promocion + 1;
				 	 ?>
                              <tr class="brillo">
                                <td width="70" height="17" align="center" class="Comic"><?php echo $row_Estudios['Fecha']->format('d-m-Y')?></td>
                                <td width="260" align="left" class="Comic10"><?php echo $row_Estudios['Profesion']?></td>
                                <td width="200" align="left" class="Comic10"><?php echo $row_Estudios['Grado']?></td>
                                <td width="270" align="left" class="Comic10"><?php echo $row_Estudios['InstitucionEstudio']?></td>
                              </tr>
                              <?php }?>
                              <?php }?>
                              <?php }?>
                            </table>
                            <?php }?>
                          </div></td>
                        </tr>
                      </table>
                    </div>
                  </div>
                </div></td>
</tr>
              <tr>
                <td></td>
              </tr>
              <tr> </tr>
            </table>
          </div>
          <div class="TabbedPanelsContent">
            <table width="800" border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; padding-top: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: right;" bordercolor="#CCCCCC" align="center" bgcolor="#FFFFFF">
              <tr>
                <td align="center"><table width="830" align="center" bgcolor="#EEECE3" class="ComicNormal">
                  <tr valign="baseline" bgcolor="#000099">
                    <td width="122" height="19" align="right" valign="middle"><span class="TitEstado"><a href="index1" class="TitEstado">INICIO</a></span></td>
                    <td colspan="4" align="left" valign="middle"><span class="TitEstado">DATOS PERSONALES</span></td>
                  </tr>
                  <tr valign="baseline">
                    <td align="right" valign="middle" nowrap="nowrap" class="ComicAzul1">Apellido / Nombr Empleado :</td>
                    <td colspan="3" valign="middle"><input name="txtapellido" type="text" id="txtapellido" value="" size="26" placeholder="Seleccione Apellido"/>
                      <input name="txtnombre" type="text" id="txtnombre" value="" size="26" placeholder="Seleccione Nombre"/>
                      <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','boton_busca2.jpg',1)">
                        <input name="button5" type="button" class="BotonBuscar31" id="button5" value="Buscar" onclick="localiza_empleado3()"/>
                      </a></td>
                    <td width="106" align="right" valign="top">&nbsp;</td>
                  </tr>
                  <tr valign="baseline">
                    <td align="right" valign="middle" nowrap="nowrap">&nbsp;</td>
                    <td width="318" valign="middle">&nbsp;</td>
                    <td width="136" align="right" valign="middle" nowrap="nowrap">&nbsp;</td>
                    <td width="124" align="right" valign="top">&nbsp;</td>
                    <td width="106" align="right" valign="top">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table>
          </div>
        </div>
      </div>
      <input type="hidden" name="MM_update" value="form1"/>
    </form></th>
  </tr>
</table>
<table width="800" border="0" align="center">
  <tr>  </tr>
</table>
<script type="text/javascript">
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
</script>
</body>
</html>