MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: /home/asjudine/www/consultorio_juridico_control2_bono_pensional.php
<?php 

  require_once("mainfile.php");
  include ("config.php");
  require_once("Conectarse.php");

$Recordset1 = mysql_query('SELECT * FROM Usuarios WHERE (codigo = 714) ORDER BY Nombre_Completo'); 
 
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$tipoproce=$_GET["proceso"];

if ($tipoproce="2")
{
	$tipoproce="BONO PENSIONAL";
	
	}

		
$control = mysql_query('SELECT apellidos,nombres,cedula,fecha_nacimiento,celular,email,grado,funcionario,
ano_cotizado,fondo_pensiones,fecha_ingreso,fecha_retiro,tiempo_servicio,direccion_residencia,ciudad_residencia,telefono,ciudad_telefono,actuaciones,tipo_proceso FROM  consultorio_bono_pensional WHERE cedula = "'.$_GET["cedula"].'" ');
		  if (!$control) {
				die('Invalid query 1: ' . mysql_error());
			}

$num=mysql_num_rows($control); 

list($ape,$nom,$cedu,$fecha_nacimiento,$celular,$email,$grado,$funcionario,$ano_cotizado,$fondo_pensiones,$fecha_ingreso,$fecha_retiro,$tiempo_servicio,$dirresidencia,$ciuresidencia,$telefono,$ciudad_telefono,$actuaciones,$tipo_proceso) = mysql_fetch_row($control);


?>

<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;}
-->
</style>

<script>
function Verificar() {
	
	
if(document.frm.funcionario.value == "") {
  alert("Por Favor Seleccione Funcionario");
  document.frm.funcionario.focus();
  return false;
 }	

// if(document.frm.nombre.value == "") {
//  alert("Por Favor Escriba El Nombre");
//  document.frm.nombre.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="65%" bgcolor="#EFEFEF" align="center" border="5" cellspacing="0" cellpadding="6">
 <tr>
   <td align="center" bgcolor="#306090"><big style="color:#FFFFFF"><b>CONSULTA CONTROL PROGRAMA BONO PENSIONAL</b></big></td>
  
 </tr>
 
 <tr>
   <td align="center" colspan="2">
 
<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 Funcionario");
  document.frm.funcionario.focus();
  return false;
 } 


 
 return true;
}
</script>
 
     <form method="post" name="frm" onSubmit="return Verificar()">
       <table border="0" bgcolor="#EFEFEF" cellspacing="5">
 <!--<td><div align="right"><strong> Fecha Registro</strong></div></td>
    <td><div align="left">
      <input name="dia2" type="text" id="dia2" value="<?php echo date("d"); ?>" size="2" maxlength="2" readonly>
      <input name="mes2" type="text" id="mes2" value="<?php echo date("m"); ?>" size="2" maxlength="2" readonly>
      <input name="ano2" type="text" id="ano2" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly>
    </div></td> 
  </tr>  -->
 
     <form method="post" name="frm" onSubmit="return Verificar()">
       <table border="2" bgcolor="#EFEFEF" cellspacing="5">
 
       
       
        <tr>
  <td width="147" align="right"><b>Apellidos:</b></td>
  <td width="382"><input type="text" name="apellidos" value="<? echo $ape?>"size="50" maxlength="40" readonly></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>Fecha Nacimiento:</b></td>
  <td><input type="text" name="fecha_nacimiento" value="<? echo $fecha_nacimiento?>"size="12" maxlength="12"></td>
       </tr>
  
  <tr>
  <td align="right"><b>Celular:</b></td>
  <td><input type="text" name="celular" value="<? echo $celular?>"size="15" maxlength="15" ></td>
       </tr>
 

       <tr>
  <td align="right"><b>Correo:</b></td>
  <td><input type="text" name="email"  value="<? echo $email?>"size="50" ></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>A&ntilde;o Cotizado:</b></td>
  <td><input type="text" name="ano_cotizado"  value="<? echo $ano_cotizado ?>"size="10" readonly></td>
       </tr>
       
       <tr>
  <td align="right"><b>Fondo De Pensiones:</b></td>
  <td><input type="text" name="fondo_pensiones"  value="<? echo $fondo_pensiones ?>"size="50" readonly></td>
       </tr>
       
         <tr>
  <td align="right"><b>Fecha Ingreso:</b></td>
  <td><input type="text" name="fecha_ingreso"  value="<? echo $fecha_ingreso ?>"size="10" readonly></td>
       </tr>
       
        <tr>
  <td align="right"><b>Fecha Retiro:</b></td>
  <td><input type="text" name="fecha_retiro"  value="<? echo $fecha_retiro?>"size="10" readonly></td>
       </tr>
          
          <tr>
  <td align="right"><b>Tiempo Servicio:</b></td>
  <td><input type="text" name="tiempo_servicio"  value="<? echo $tiempo_servicio?>"size="10" readonly></td>
       </tr> 
          
          
         <td align="right"><b>Funcionario:</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>
  <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>Telefono:</b></td>
  <td><input type="text" name="telefono"  value="<? echo $telefono ?> "size="12" ></td>
       </tr> 
       <tr>
  <td align="right"><b>Ciudad Telefono:</b></td>
  <td><input type="text" name="ciudad_telefono"  value="<? echo $ciudad_telefono?>"size="20" ></td>
       </tr> 
       
       <tr>
  <td align="right"><b>Tipo Proceso:</b></td>
  <td><input type="text" name="tipo_proceso"  value="<? echo $tipo_proceso?>"size="20" ></td>
       </tr> 
    
       
  
       
   </table><br>
 
     <b>Gestion Documentacion</b><br>
     <textarea name="mensaje" cols="80" rows="10"></textarea><br><br>
 	 
     
     
     <input name="guardar" type="submit" class="Estilo53" id="guardar" value="Actuacion" />    
   
   
     </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>

<?
		

if(isset($_POST["guardar"]))

{

$tipoproce=$_GET["proceso"];

if ($tipoproce=="2")
{
	$tipoproce="BONO PENSIONAL";
	
	}

echo $tipoproce;
echo $_POST["funcionario"];


$fechast = date("y").'-'.date("m").'-'.date("d");
	
if ($_POST["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);
	
echo $nombreusuar;

	$control = mysql_query('SELECT cedula FROM control_bono_pensional  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 ($fil == '0')
			{  

/// HH FGGSD  FGFSA

$csql6 = mysql_query("INSERT INTO control_bono_pensional  (apellidos,nombres,cedula,fecha_nacimiento,celular,email,
grado,ano_cotizado,fondo_pensiones,fecha_ingreso,fecha_retiro,tiempo_servicio,direccion_residencia,ciudad_residencia,telefono,ciudad_telefono,estado,actuaciones,tipo_proceso) VALUES ('".$_POST["apellidos"]."','" .$_POST["nombre"]."','".$_POST["ced"]."','".$_POST["fecha_nacimiento"]."','".$_POST["celular"]."','".$_POST["email"]."','".$_POST["grado"]."','" .$_POST["ano_cotizado"]."','".$_POST["fondo_pensiones"]."','".$_POST["fecha_ingreso"]."', '".$_POST["fecha_retiro"]."','".$_POST["tiempo_servicio"]."','".$_POST["dirresidencia"]."','".$_POST["ciuresidencia"]."','".$_POST["telefono"]."','".$_POST["ciudad_telefono"]."','985','".$_POST["mensaje"]."','".$tipoproce."')");	 

}	
		

else {	
	
$mssql3 = mysql_query("UPDATE control_bono_pensional set apellidos = '".$_POST[apellidos]."',nombres = '".$_POST[nombre]."', cedula = '".$_POST[ced]."',fecha_nacimiento = '".$_POST[fecha_nacimiento]."',celular = '".$_POST[celular]."' , email = '".$_POST[email]."', grado = '".$_POST[grado]."', ano_cotizado = '". $_POST[ano_cotizado]."', fondo_pensiones= '".$_POST[fondo_pensiones]."',fecha_ingreso= '".$_POST[fecha_ingreso]."',fecha_retiro= '".$_POST[fecha_retiro]."', tiempo_servicio= '".$_POST[tiempo_servicio]."', direccion_residencia= '".$_POST[direccion_residencia]."',ciudad_residencia= '".$_POST[ciudad_residencia]."',telefono= '".$_POST[telefono]."',ciudad_telefono= '".$_POST[ciudad_telefono]."', actuaciones= '".$_POST[mensaje]."',estado= '0' WHERE cedula =  '".$_GET["cedula"]."' " );     
           
            if (!$mssql3) {   
				die('Invalid query cartera_serviasjudinet MODIFICARDATOS: ' . mysql_error());
		}   
		
		}
			
$csqle1 = mysql_query("INSERT INTO actuaciones_consultorio_control_bono (cedula,actuaciones,fecha,funcionario,
codigo_funcionario) VALUES ('".$_POST[ced]."','".$_POST[mensaje]."','".$fechast."','".$nombreusuar."', '".$_POST[funcionario]."')");	 
				
				
 $mssql18 = mysql_query("UPDATE consultorio_bono_pensional 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>";

}	


?>