<?php
///////////////////////////////////////////////// inicio del programa ////////////////////////////////////////////////////////////////
session_start();
//RESTRICCIÓN DE ACCESO A TRABAJADOR (ACCESO INDIVIDUAL)
if (isset($_SESSION['tipousuario']))
		{if ($_SESSION['tipousuario']=='1')
		header ('location:menu_personal.php');
		}
if  (trim($_SESSION['nombre_validar'])=='') header ('location:index.php');
require('fphp.php');
$enlace=cargar_conexion();

$consulta=mysqli_query($enlace,"select * from periodo where id='".$_SESSION['id_validar']."' order by nomina,periodo desc limit 1");
if (mysqli_num_rows($consulta)!=0){
	$row=mysqli_fetch_array($consulta);
	$per=mostrar_fecha($row['desde']).' al '.mostrar_fecha($row['hasta'])." (Nom:".$row['nomina'].")";
} else $per='';
?>
<html>
	<head><script language='javascript' src='fscript.js'></script>
	<link rel='stylesheet' type='text/css' href='styles.css' />
	</head>
	<body>
		<?
		menu();
		?>
		<br><table border=0 cellpadding=0 cellspacing=0 width='100%'>
			<tr>
				<td  width='100%' align='left'><font size=2 color='black' face='verdana'>Empresa: <b><?echo $_SESSION['empresa_validar'];?></b>  - Per&iacute;odo: <b><font color=red><?echo $per;?></font></b>  -  Usuario: <b><?echo $_SESSION['nombre_validar'];?></b></font></td>
			</tr>
		</table><hr>
<?
$entra=0;
echo "<h2>M&oacute;dulo de Par&aacute;metros del Sistema</h2>";

///////////////////////////////////////////////// graba registros  ////////////////////////////////////////////////////////////////
if ($_POST['graba']==1 ) {
	$query = "update empresa set cesta1='".$_POST['cesta1']."',cesta2='".$_POST['cesta2']."',cesta3='".$_POST['cesta3']."',cesta4='".$_POST['cesta4']."',contrato='".$_POST['contrato']."',constante01='".$_POST['constante01']."',constante02='".$_POST['constante02']."',constante03='".$_POST['constante03']."',constante04='".$_POST['constante04']."',concepto05='".$_POST['concepto05']."',concepto06='".$_POST['concepto06']."',concepto03='".$_POST['concepto03']."',concepto04='".$_POST['concepto04']."',concepto01='".$_POST['concepto01']."',concepto02='".$_POST['concepto02']."', prestamo='".$_POST['prestamo']."',email1='".$_POST['email1']."',ciudad='".$_POST['ciudad']."',encabeza='".$_POST['encabeza']."',pie='".$_POST['pie']."',c1='".$_POST['c1']."',c2='".$_POST['c2']."',c3='".$_POST['c3']."',c4='".$_POST['c4']."',c5='".$_POST['c5']."',c7='".$_POST['c7']."',c8='".$_POST['c8']."',c6='".$_POST['c6']."' where id='".$_SESSION['id_validar']."' ";
	$consulta = mysqli_query($enlace,$query) or die ($query.mysqli_error($enlace));
}

/*
///////////////////////////////////////////////// graba logo  ////////////////////////////////////////////////////////////////
############################################ se movió a Datos de Empresa (master_empresa_actual.php) ########################

if ($_POST['bandera']==5) {
        // obtenemos los datos del archivo
        $tamano = $_FILES["archivo"]['size'];
        $tipo = $_FILES["archivo"]['type'];
        $archivo = $_FILES["archivo"]['name'];
        $prefijo = substr(md5(uniqid(rand())),0,6);

        if ($archivo != "") {
            // guardamos el archivo a la carpeta files
            $destino =  "images/logo_".$_SESSION['id_validar'].".jpg";
            if (copy($_FILES['archivo']['tmp_name'],$destino)) {
                $status = "Archivo subido: <b>".$archivo."</b>";
            } else {
                $status = "Error al subir el archivo";
            }
        } else {
            $status = "Error al subir archivo";
        }
		echo "<font color='red' >".$status."</font>";
}
*/

///////////////////////////////////////////////// pantalla inicial  ////////////////////////////////////////////////////////////////
		$consulta="select * from empresa where id='".$_SESSION['id_validar']."' ";
		$resultado = mysqli_query($enlace,$consulta) or die('verificaci&oacute; del c&oacute;digo fall&oacute;: ' . mysqli_error($enlace));
		$num_rows = mysqli_num_rows($resultado);

		$row=mysqli_fetch_array($resultado);
		echo "<form name = 'entrada' action = '".$_SERVER['PHP_SELF']."' method = 'POST'  enctype='multipart/form-data'>";
		echo "<input type = 'hidden' name = 'graba' value = '1'>";
		echo "<table align ='center'>";

		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros Generales</b></font></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align = 'right1'> Rif de Empresa: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'encabeza' size = '100' maxlength = '100' value = '".$row['encabeza']."' ></td>";
		echo "</tr>";

		echo "<tr>";
			echo "<td align = 'right1'> Pie de Pagina de Reportes: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'pie' size = '100' maxlength = '100' value = '".$row['pie']."' ></td>";
		echo "</tr>";

		echo "<tr>";
			echo "<td align = 'right1'> Ciudad de Origen: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'ciudad' size = '100' maxlength = '100' value = '".$row['ciudad']."' ></td>";
		echo "</tr>";

		echo "<tr>";
			echo "<td align = 'right1'> Pr&oacute;ximo No. de Deducci&oacute;n / Asignaci&oacute;n: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'prestamo' size = '8' maxlength = '8' value = '".$row['prestamo']."' ></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align = 'right1'> Pr&oacute;ximo No. de Contrato: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'contrato' size = '8' maxlength = '8' value = '".$row['contrato']."' ></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align = 'right1'> Email Administrativo: </td>";
			echo "<td align = 'left'> <input type = 'text' name = 'email1' size = '30' maxlength = '50' value = '".$row['email1']."' ></td>";
		echo "</tr>";

		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'><br> </td>";
		echo "</tr>";

		//=============================================================== conceptos para estadisticas
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros de C&oacute;digos de N&oacute;mina para Estad&iacute;sticas</b></font></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=red> 1. C&oacute;digo del Concepto del Permiso: </td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c1'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c1']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=red> 2. C&oacute;digo del Concepto del Reposo SSO (66,66%): </td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c2'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c2']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=red>3. C&oacute;digo del Concepto de Reposo No validado por SSO: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c3'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c3']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=red>4. C&oacute;digo del Concepto de Dias no Trabajados Injustificadamente: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c4'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c4']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>5. C&oacute;digo del Concepto Dias Asusencia No Remunerada: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c5'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c5']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>6. C&oacute;digo del Concepto Dias de Permiso No Remunerado: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c6'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c6']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>7. C&oacute;digo del Concepto Dias No laborados por fec ingreso: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c7'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c7']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>8. C&oacute;digo del Concepto Dias No laborados por fec Egreso: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'c8'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['c8']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'><br> </td>";
		echo "</tr>";

		//=============================================================== conceptos para reportes especiales
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros de C&oacute;digos de N&oacute;mina Para Reportes Especiales</b></font></td>";
		echo "</tr>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>1. C&oacute;digo del Concepto Asignaci&oacute;n (1): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto01'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto01']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>2. C&oacute;digo del Concepto Asignaci&oacute;n (2): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto03'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto03']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>3. C&oacute;digo del Concepto Asignaci&oacute;n (3): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto05'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto05']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";

		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>4. C&oacute;digo del Concepto Deducci&oacute;n (1): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto02'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto02']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>5. C&oacute;digo del Concepto Deducci&oacute;n (2): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto04'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto04']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=blue>6. C&oacute;digo del Concepto Deducci&oacute;n (3): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'concepto06'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['concepto06']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'><br> </td>";
		echo "</tr>";

		//=============================================================== conceptos para cesta tickets
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros de C&oacute;digos de N&oacute;mina Para Dias Trabajados para Cesta Tickets</b></font></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=brown>1. C&oacute;digo del Concepto (1) Asig: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'cesta1'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['cesta1']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
			echo "</select></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=brown>1. C&oacute;digo del Concepto (2) Asig: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'cesta2'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['cesta2']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
			echo "</select></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=brown>1. C&oacute;digo del Concepto (1) Deduc: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'cesta3'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['cesta3']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
			echo "</select></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=brown>1. C&oacute;digo del Concepto (2) Deduc: </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'cesta4'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['cesta4']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
			echo "</select></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'><br> </td>";
		echo "</tr>";

		//=============================================================== conceptos para liquidaciones
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros de C&oacute;digos de N&oacute;mina Para Sueldo Neto (Liquidaci&oacute;n)</b></font></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from constante where id='".$_SESSION['id_validar']."' and fijo=1 order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=green>1. C&oacute;digo de la Constante (1): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'constante01'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['constante01']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			$query = "select * from constante where id='".$_SESSION['id_validar']."' and fijo=1 order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=green>2. C&oacute;digo de la Constante (2): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'constante02'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['constante02']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'><br> </td>";
		echo "</tr>";


		//=============================================================== conceptos para liquidaciones acumuladas
		echo "<tr>";
			echo "<td align = 'left'> </td>";
			echo "<td align = 'left'> <b><font color=red>Par&aacute;metros de C&oacute;digos de N&oacute;mina Para Sueldo Acumulado (Liquidaci&oacute;n)</b></font></td>";
		echo "</tr>";
		echo "<tr>";
			$query = "select * from concepto where id='".$_SESSION['id_validar']."' order by codigo";
			$consultax = mysqli_query($enlace,$query) or die ("no se pudo realizar la consulta...");
			$resultadox = mysqli_num_rows($consultax);
			echo "<td align = 'left'><font color=brown>1. C&oacute;digo del Concepto (1): </font></td>";
			echo "<td align = 'left'> <select style='width:300px;' name = 'constante03'><option>";
				while ($rowx = mysqli_fetch_array($consultax))
				echo "<option value='".$rowx['codigo']."' ".($rowx['codigo']==$row['constante03']?'selected':'').">".$rowx['codigo']." - ".$rowx['detalle'];
		echo "</select></td>";
		echo "<tr>";
			echo "<td align = 'left'><font color=brown>2. Inicial del C&oacute;digo del Concepto (2): </font></td>";
			echo "<td align = 'left'> <input type = 'text' name = 'constante04' size = '10' maxlength = '2' value = '".$row['constante04']."' ></td>";
			echo "</td>";

		//echo "</table>";
		//echo "<table align ='center'>";
		//echo "<tr><td><input type = 'submit' value = 'Guardar Cambios'></td></form>";
		echo "<tr>";
			echo "<td align = 'left'></td>";
			echo "<td align = 'left'> <input type = 'submit' value = 'Guardar Cambios'></td>";
		echo "</tr>";
		echo "	<script language='javascript' type='text/javascript'>";
		echo "		document.entrada.encabeza.focus()";
		echo "	</script></table>";

		/*
	///////////////////////////////////////////////// bajar logo ////////////////////////////////////////////////////////////////
	/////////////////////////////////////// SE MOVIO A DATOS DE EMPRESA (master_empresa_actual.php) /////////////////////////

		echo "<table align ='center'>";
		echo "<tr>";
			echo "<td align=center> <h2>Cargar Imagen de Logo a: ".$_SESSION['empresa_validar']."</h2></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align=center><img src='images/logo_".$_SESSION['id_validar'].".jpg' width='300' height='300' style='border-width: 1px; border-color: 75263C;border-style: solid;'></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align=center><form name = 'entrada4' action = '".$_SERVER['PHP_SELF']."' target='_blank' method = 'POST'  enctype='multipart/form-data'></td>";
		echo "</tr>";
		//echo "<h2>Cargar Imagen de Logo a: ".$_SESSION['empresa_validar']."</h2>";
		//echo "<img src='images/logo_".$_SESSION['id_validar'].".jpg' width='300' height='300' style='border-width: 1px; border-color: 75263C;border-style: solid;'>";
		//echo "<form name = 'entrada4' action = '".$_SERVER['PHP_SELF']."' target='_blank' method = 'POST'  enctype='multipart/form-data'>";
		echo "<input type = 'hidden' name = 'bandera' value = '5'>";
		//echo "<table cellpadding=2 cellspacing=0 >";
		echo "<tr>";
			echo "<td align=center> Nombre de Archivo (Imagen formato: JPG):</td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align=center> <input name='archivo' type='file' size='35' /></td>";
		echo "</tr>";
		echo "<tr>";
			echo "<td align=center colspan=2><input name='contrato' type = 'submit' value = 'Cargar Imagen'></td>";
		echo "</tr>";
		echo "</table>";
		*/ //////////////////
		echo"</form><br><hr>";



echo "<br><br><br></font></body>";
echo "</html>";
?>
