File: /home/asjudine/www/consultorio_juridico_control_soldados_reliquidacion_director.php
<?php
require_once("mainfile.php");
include ("config.php");
require_once("Conectarse.php");
$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (cargo = "CONTROL SOLDADOS") and estado = 1 ');
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$Recordset2 = mysql_query('SELECT * FROM Usuarios WHERE (cargo = "SECRETARIA CONTROL SOLDADOS" || cargo = "SECRETARIO CONTROL SOLDADOS") and estado = 1 ORDER BY Nombre_Completo');
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
$tipoproce=$_GET["proceso"];
if ($tipoproce="1")
{
$tipoproce="RELIQUIDACION RETIRO";
}
$control = mysql_query('SELECT apellidos, nombres, cedula, lugar_expedicion, celular, celular_personal, email, grado, estado_civil, unidad, direccion_residencia, ciudad_residencia, actuaciones, correo_alterno FROM control_programa_soldados WHERE cedula = "'.$_GET["cedula"].'" ');
if (!$control) {
die('Invalid query 1: ' . mysql_error());
}
$numeroFilas=mysql_num_rows($control);
list($ape,$nom,$cedu,$expedicion,$celular,$celularalt,$email,$grado,$ecivil,$unidad,$dirresidencia,$ciuresidencia,$actuaciones,$correoalt) = mysql_fetch_row($control);
//Si existe Trae datos de UNIFICADO
if($numeroFilas != 0){
//CONTROL CARPETA
$controlcontroles = mysql_query('SELECT cod_sustanciador,sustanciador,veinte_por_ciento, subsidio_soldados, reliquidacion_pension, prima_actividad, activoOpensionado, ejercitoOarmada FROM control_programa_soldados_reliquidacion WHERE cedula = "'.$_GET["cedula"].'"');
if (!$controlcontroles) {
die('Invalid query 1: ' . mysql_error());
}
list($cod_sustanciador,$sustanciador,$veintex, $soldadosx, $reliquidacionx, $primax, $estadopersona, $estadofuerza) = mysql_fetch_row($controlcontroles);
$controlusuario = mysql_query('SELECT codigo FROM Usuarios WHERE cedula = "'.$_GET["cedula"].'" ');
if (!$controlusuario) {
die('Invalid query 1: ' . mysql_error());
}
list($codigousuario) = mysql_fetch_row($controlusuario);
$controlcar = mysql_query('SELECT celular,email,direccion,ciudad,telefono FROM cartera_serviasjudinet WHERE cedula = "'.$_GET["cedula"].'"');
if (!$controlcar) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($controlcar);
list($celularalt,$correoalt,$dirresidencia,$ciuresidencia,$telefonofijo) = mysql_fetch_row($controlcar);
}
//Trae datos de cartera para los que no estan en soldados unificados
else{
$controla = mysql_query('SELECT cedula,nombre,numerocontrato,tipocontrato,celular,email,direccion,ciudad,telefono, unidad_descuento,grado,tipo_proceso,fecha_afiliacion FROM cartera_serviasjudinet WHERE cedula = "'.$_GET["cedula"].'"');
list($cedu,$ape,$numerocotr,$tipocontr,$celular,$email,$dirresidencia,$ciuresidencia,$telefonofijo,$unidad,$grado,$proceso,$fecha_afiliacion) = mysql_fetch_row($controla);
}
?>
<html>
<head>
<title>Registro de Formulario Juridico</title>
<style type="text/css">
<!--
img {border: 0}
body,td {font-family: Verdana,Arial; font-size: 8pt; color: #000000}
input,select {font-family: Verdana,Arial; font-size: 7.5pt}
a:link, a:visited {text-decoration: none; color: #2030F0}
a:hover, a:active {text-decoration: underline; color: #D02010}
body table tr td table tr td form table {
font-size: 14px;
font-family: Georgia, "Times New Roman", Times, serif;
}
body table tr td table tr td form table tr td div strong {
font-size: 10pt;
}
body table tr td table tr td form table tr td div strong {
font-size: 9pt;
}
body table tr td table tr td form table tr td b {
font-size: 9pt;
}
body table tr td table tr td form table tr td div {
font-size: 7pt;
}
.polici {background-color: #FFCC66; font-size: 14px; font-family: Arial; color: #000099; width:10px display: block;}
.roja{color:#CE040A;}
.azul{color:#044AB3;}
.bazul{color:#044AB3; background-color:#FAF8D3;}
-->
</style>
<script>
function Verificar() {
if(document.frm.apellidos.value == "") {
alert("Por Favor Escriba Los Apellidos");
document.frm.apellidos.focus();
return false;
}
if(document.frm.nombre.value == "") {
alert("Por Favor Escriba El Nombre");
document.frm.nombre.focus();
return false;
}
if(document.frm.ced.value == "") {
alert("Por Favor Escriba El Numero De Cedula");
document.frm.ced.focus();
return false;
}
if(document.frm.ecivil.value == "") {
alert("Por Favor Escriba El Estado Civil");
document.frm.ecivil.focus();
return false;
}
if(document.frm.funcionario.value == "") {
alert("Por Favor Seleccione el sustanciador");
document.frm.funcionario.focus();
return false;
}
if(document.frm.carpeta.value == "") {
alert("Por Favor escriba numero de carpeta");
document.frm.carpeta.focus();
return false;
}
if(document.frm.mensaje.value == "") {
alert("Por Favor escriba una actuacion");
document.frm.mensaje.focus();
return false;
}
return true;
}
</script>
</head>
<body bgcolor="#EFEFEF" text="#000000" topmargin="0" leftmargin="0">
<br>
<center> <img src="ELEMENTOS\CABEZOTE SERVIASJUDINET.jpg" WIDTH=60% > </center>
<br>
<table width="100%" height="75%" bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="10" valign="top">
<table width="70%" border="0" cellspacing="0" cellpadding="0">
</table>
</td>
</tr>
<tr>
<td align="center">
<table width="44%" bgcolor="#EFEFEF" align="center" border="5" cellspacing="0" cellpadding="6">
<tr>
<td align="center" bgcolor="#306090"><big style="color:#FFFFFF"><b>CONSULTA CONTROL PROGRAMA RELIQUIDACION ASIGNACION RETIRO</b></big></td>
</tr>
<tr>
<td align="center" colspan="2">
<form method="post" name="frm" onSubmit="return Verificar()">
<table border="0" bgcolor="#EFEFEF" cellspacing="5">
<p><marquee style="color:#AAA317;">LOS CAMPOS SON OBLIGATORIOS</marquee></p>
<tr>
<td align="right"><b>Apellidos:</b></td>
<td><input type="text" name="apellidos" value="<? echo $ape?>"size="50" maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Nombres:</b></td>
<td><input type="text" name="nombre" value="<? echo $nom?>"size="50" maxlength="40" ></td>
</tr>
<tr>
<td align="right"><b>Cedula de Ciudadania:</b></td>
<td><input type="text" name="ced" value="<? echo $cedu?>"size="50" maxlength="40" readonly></td>
</tr>
<tr>
<td align="right"><b>Lugar De Expedicion:</b></td>
<td><input type="text" name="expedicion" value="<? echo $expedicion ?>"size="50" maxlength="40"></td>
</tr>
<tr>
<td align="right"><b>Celular Institucional:</b></td>
<td><input type="text" name="celu" value="<? echo $celular ?>" size="15" maxlength="15" ></td>
</tr>
<tr>
<td align="right"><b>Celular Personal:</b></td>
<td><input type="text" name="celular" value="<? echo $celularalt ?>" size="15" maxlength="15" readonly></td>
</tr>
<tr>
<td align="right"><b>Telefono Fijo:</b></td>
<td><input type="text" name="fijo" value="<? echo $telefonofijo ?>" size="15" maxlength="15" ></td>
</tr>
<tr>
<td align="right"><b>Correo Institucional:</b></td>
<td><input type="text" name="email" value="<? echo $email?>" size="50"></td>
</tr>
<tr>
<td align="right"><b>Correo Personal:</b></td>
<td><input type="text" name="emailalt" value="<? echo $correoalt?>" size="50" readonly></td>
</tr>
<tr>
<td align="right"><b>Grado:</b></td>
<td><input type="text" name="grado" value="<? echo $grado ?>" size="10" readonly></td>
</tr>
<tr>
<td align="right"><b>Estado Civil:</b></td>
<td><input type="text" name="ecivil" value="<? echo $ecivil ?>" size="10"></td>
</tr>
<tr>
<td align="right"><b>Unidad:</b></td>
<td><input type="text" name="unidad" value="<? echo $unidad ?>" size="10" ></td>
</tr>
<!--
<tr>
<td class="roja" align="right"><b>Sustanciador Asignado:</b></td>
<td><input type="text" name="usuario" value="<? echo $sustanciador ?>" size="50" readonly></td>
</tr>
-->
<tr>
<td align="right"><b>Sustanciador Asignado:</b></td>
<td><SELECT NAME="funcionario">
<OPTION value="">--Nombre Funcionario--</OPTION>
<?php
do {
?>
<option value="<?php echo $row_Recordset1['codigo']?>"><?php echo $row_Recordset1['Nombre_Completo']?></option>
<?php
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
$rows = mysql_num_rows($Recordset1);
if($rows > 0) {
mysql_data_seek($Recordset1, 0);
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
}
?>
</SELECT></td>
</tr>
<tr>
<td align="right"><b>SECRETARIA:</b></td>
<td>
<SELECT NAME="asignador">
<!--<OPTION value="">--Nombre Funcionario--</OPTION>-->
<?php
do {
?>
<option value="<?php echo $row_Recordset2['codigo']?>"><?php echo $row_Recordset2['Nombre_Completo']?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</SELECT>
</td>
</tr>
<tr>
<td class="roja" align="right"><b>Numero Carpeta:</b></td>
<td><input type="text" name="carpeta" value="<? echo $carpeta ?>" size="10"></td>
</tr>
<tr>
<td align="right"><b>Direccion Residencia:</b></td>
<td><input type="text" name="dirresidencia" value="<? echo $dirresidencia ?>"size="50" readonly></td>
</tr>
<tr>
<td align="right"><b>Ciudad Residencia:</b></td>
<td><input type="text" name="ciuresidencia" value="<? echo $ciuresidencia ?>"size="50" readonly></td>
</tr>
<tr>
<td align="right"><b>Esposa:</b></td>
<td><input type="text" name="esposa" value=""size="4" ></td>
</tr>
<tr>
<td align="right"><b>Hijos:</b></td>
<td><input type="text" name="hijos" value=""size="4" ></td>
</tr>
<tr>
<td align="right"><b>Hijastros:</b></td>
<td><input type="text" name="hijastros" value=""size="4" ></td>
</tr>
<tr>
<td colspan="2" class="bazul" align="center">PROCESOS</td>
</tr>
<!--
<tr>
<td align="right"><b>Seleccione Los Procesos</b></td>
<td><input type="checkbox" name="cveinte" id="cveinte" value="SI"><label for="cveinte">Veinte Por Ciento</label></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" name="cveinte" id="cveinte" value="SI"><label for="cveinte">Veinte Por Ciento</label></td>
</tr>
<tr>
<td align="right" class="roja"><b>Estado:</b></td>
<td><input type="text" name="personaestado" id="personaestado" value="<? echo $estadopersona ?>" size="10" readonly></td>
</tr>
-->
<tr>
<td align="right"><b>Seleccione:</b></td>
<td class="roja">
<!--<input type="radio" value="ACTIVO" name="rad" id="ratio1" onKeyUp="verificar();">ACTIVO -->
<input type="radio" value="PENSIONADO" name="rad" id="ratio2" onKeyUp="verificar();">PENSIONADO</td>
</tr>
<!--
<tr>
<td align="right" class="roja"><b>Fuerza Militar:</b></td>
<td><input type="text" name="peronaestado" value="<? echo $estadofuerza ?>"size="10" readonly></td>
</tr>
-->
<tr>
<td align="right"><b>Seleccione:</b></td>
<td class="roja">
<input type="radio" value="EJERCITO" name="fuerza" id="fuerza1">EJERCITO
<input type="radio" value="ARMADA" name="fuerza" id="fuerza2">ARMADA</td>
</tr>
</table><br>
<b>DESCRIBA DE MANERA CLARA Y PRECISA EL TIPO DE ACCIONES <br> JURIDICAS A RECLAMAR POR CADA UNA</b><br>
<textarea name="mensaje" cols="100" rows="10"></textarea><br><br>
<input name="guardar" type="submit" class="Estilo53" id="guardar" value="GUARDAR" />
</form>
</td>
</tr>
</table><br>
</td>
</tr>
<td height="22" colspan="2" bgcolor="#EFEFEF" class="fecha"><div align="center">
<input name="button" type="button" onClick="javascript:window.close()" value="REGRESAR AL LISTADO">
</div></td>
<br>
<tr>
<td height="60" align="center" bgcolor="#000052"><b style="font-size:7.5p;color:#FFFFFF">VERIFICACION ACTUACIONES</b></td>
</tr>
</table>
</body>
</html>
<?php
echo $codigousuario;
$estadoratio = $_POST['rad'];
$estadofuerza = $_POST['fuerza'];
if(isset($_POST["guardar"]))
{
$fechast = date("y").'-'.date("m").'-'.date("d");
//if ($_GET["funcionario"]!="");
//{
$controlusua = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$_POST["funcionario"].'" ');
if (!$controlusua) {
die('Invalid query 1: ' . mysql_error());
}
$num=mysql_num_rows($controlusua);
list($nombreusuar) = mysql_fetch_row($controlusua);
/*Control Asignador*/
$controlasignador = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$_POST["asignador"].'" ');
if (!$controlasignador) {
die('Invalid query 1: ' . mysql_error());
}
$recorre=mysql_num_rows($controlasignador);
list($nombreasig) = mysql_fetch_row($controlasignador);
/////////////////////
if ($cedu==$_GET["cedula"]);
$control = mysql_query('SELECT cedula FROM control_programa_soldados_reliquidacion WHERE cedula = "'.$_POST["ced"].'" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
$fil = mysql_num_rows($control);
list($cantipro) = mysql_fetch_row($control);
echo $cantipro;
if($estadoratio == "" || $estadoratio == NULL){
echo "<script>alert('Seleccione Si es activo o Pensionado');</script>";
exit();
}
if($estadofuerza == "" || $estadofuerza == NULL){
echo "<script>alert('Seleccione Si es Ejercito O Armada');</script>";
exit();
}
if($_POST["mensaje"]=="" || $_POST["mensaje"]==NULL){
echo "<script>alert('Escriba la Actuacion del Proceso');</script>";
exit();
}
if ($fil == 0)
{
$csql6 = mysql_query("INSERT INTO control_programa_soldados_reliquidacion (apellidos,nombres,cedula,lugar_expedicion ,celular,celular_personal, email, grado, estado_civil, unidad, direccion_residencia, ciudad_residencia, actuaciones, estado, correo_alterno, carpeta, tipo_proceso, esposa, hijos, hijastros, cod_sustanciador, sustanciador,veinte_por_ciento, subsidio_soldados, prima_actividad, reliquidacion_pension, activoOpensionado, ejercitoOarmada) VALUES ('" . $_POST["apellidos"] . "','" .$_POST["nombre"]. "','".$_POST["ced"]. "','".$_POST["expedicion"]."' ,'".$_POST["celu"]."','".$_POST["celular"]."', '" .$_POST["email"]. "','" .$_POST["grado"]. "','" .$_POST["ecivil"]. "', '" .$_POST["unidad"]. "', '" .$_POST["dirresidencia"]. "', '".$_POST["ciuresidencia"]."','".$_POST["mensaje"]."','0','".$_POST["emailalt"]."', '".$_POST["carpeta"]."', 'RELIQUIDACION RETIRO','".$_POST["esposa"]."','".$_POST["hijos"]."','".$_POST["hijastros"]."', '".$_POST['funcionario']."','".$nombreusuar."','".$veintex."', '".$soldadosx."', '".$primaacti."', '".$reliquipen."', '".$estadoratio."', '".$estadofuerza."')");
if (!$csql6) {
die('Invalid query: ' . mysql_error());
}
//COMPRUEBA QUE NO ESTE EN CONSULTORIO RELIQUIDACION RETIRO SI NO LO AGREGA
$control_consultorio = mysql_query('SELECT cedula FROM consultorio_soldados_reliquidacion WHERE cedula = "'.$_POST["ced"].'" ');
if (!$control) {
die('Invalid query: ' . mysql_error());
}
$filas = mysql_num_rows($control_consultorio);
if($filas == 0)
{
$inserta_consultorio = mysql_query("INSERT INTO consultorio_soldados_reliquidacion (apellidos,nombres,cedula,lugar_expedicion ,celular,celular_personal, email, grado, estado_civil, unidad, direccion_residencia, ciudad_residencia, actuaciones, estado, correo_alterno, exportado, telefono, tipo_proceso) VALUES ('" . $_POST["apellidos"] . "','" .$_POST["nombre"]. "','".$_POST["ced"]. "','".$_POST["expedicion"]."' ,'".$_POST["celu"]."','".$_POST["celular"]."', '" .$_POST["email"]. "','" .$_POST["grado"]. "','" .$_POST["ecivil"]. "', '" .$_POST["unidad"]. "', '" .$_POST["dirresidencia"]. "', '".$_POST["ciuresidencia"]."','".$_POST["mensaje"]."','6','".$_POST["emailalt"]."', 'exportado', '".$_POST["fijo"]."', 'RELIQUIDACION RETIRO')");
if (!$inserta_consultorio) {
die('Invalid query consultorio reliquidacion retiro: ' . mysql_error());
}
} //fin de agregar a consultorio cuando no esta en control ni tampoco en consultorio
$csqle1 = mysql_query("INSERT INTO actuaciones_consultorio_control_soldados_reliquidacion (cedula,actuaciones,fecha,funcionario,codigo_funcionario, estado) VALUES ('".$_POST[ced]."','".$_POST[mensaje]."','".$fechast."','".$nombreasig."', '".$_POST["asignador"]."','0')");
$mssql18 = mysql_query("UPDATE consultorio_soldados_reliquidacion set exportado = 'exportado' WHERE cedula = '".$_POST["ced"]. "' " );
if (!$csqle1) { // esto es para que aparescan los errores
die('Invalid query csql: ' . mysql_error());
}
echo "<script>alert('Los datos fueron Guardados');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
else {
/*$mssql3 = mysql_query("UPDATE control_programa_soldados_reliquidacion set apellidos = '".$_POST[apellidos]."',nombres = '".$_POST[nombre]."', cedula = '".$_POST[ced]."',lugar_expedicion = '".$_POST["expedicion"]."',celular = '".$_POST[celu]."' , celular_personal= '".$_POST[celular]."', email = '".$_POST[email]."', grado = '".$_POST[grado]."', unidad = '". $_POST[unidad]."', direccion_residencia= '".$_POST[dirresidencia]."',ciudad_residencia= '".$_POST[ciuresidencia]."', actuaciones= '".$_POST[mensaje]."', estado= '0', carpeta='".$_POST["carpeta"]."', esposa='".$_POST["esposa"]."', hijos='".$_POST["hijos"]."',hijastros='".$_POST["hijastros"]."', cod_sustanciador='".$_POST['funcionario']."', sustanciador='".$nombreusuar."' WHERE cedula = '".$_GET["cedula"]."' " );
if (!$mssql3) {
die('Invalid query cartera_serviasjudinet MODIFICARDA: ' . mysql_error());
} */
echo "<script>alert('EL afiliado ya se encontraba en la Base de Datos De Control, Por Favor Verifique Los Procesos Del Afiliado ');</script>";
echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";
}
/*$actcarti = mysql_query("UPDATE cartera_serviasjudinet set exportado = 'exportado' WHERE cedula = '".$_POST["ced"]. "' and tipo_proceso = 'VEINTE POR CIENTO'" );
if (!$actcarti) { // esto es para que aparescan los errores
die('Invalid query csql: ' . mysql_error());
} */
//}
}
?>
<?php
$result= mysql_query('SELECT id,actuaciones,fecha,funcionario,codigo_funcionario FROM actuaciones_consultorio_control_soldados_reliquidacion WHERE cedula = "'.$_GET["cedula"].'" order by fecha ');
if (!$result) {
die('Error de consulta: ' . mysql_error());
}
if(mysql_num_rows($result) != 0)
{
echo "<table width=750 border=16 align=center cellpadding=1 cellspacing=1>
<tr align=center>
<td width='400' class=polici>Actuación</td>
<td width='75' class=polici>Fecha</td>
<td width='65' class=polici>Funcionario</td>
<td width='65' class=polici>Codigo Funcionario</td>
</tr>";
while(list($id, $actuacion, $fecha, $funcionario, $codigofun) = mysql_fetch_row($result))
{
echo "<tr class=lista><td align=center>$actuacion</td>
<td align=center>$fecha</td>
<td align=center>$funcionario</td>
<td align=center>$codigofun</td></tr>";
}
}
?>
</table>