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/public_html/acorreos/Visualizar_Mensajes_interno.php
<?php
global $dbi;
require_once("../Conectarse.php");



$resbuscad = mysql_query("SELECT id FROM archivos WHERE Identificacion = '" . $_GET[Identificacion]  . "' and  registro  = '" . $_GET[numra]  . "' ");
			if (!$resbuscad) {
				die('Invalid query: ' . mysql_error());
			} 
			
list($idarchivose) = mysql_fetch_row($resbuscad);


$result = mysql_query('SELECT Id,numradica,Identificacion,Referencia,Nombre_Completo,codigo_depen,Nombre_Elabora, Dia_Envio,Mes_Envio,Ano_Envio,Hora_Envio,Asunto,Mensaje,Quien_Expide,Notificar FROM correspondencias WHERE Id = "' . $_GET["Id"]  . '" and numradica ="' . $_GET["numra"]  . '"');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}


 $actnc = mysql_query('SELECT actuaciones_de_envio FROM notificaciones_correspondencia WHERE cedula= "'.$_GET["Identificacion"].'" and id_archivo ="'.$idarchivose.'"');
			if (!$actnc) {
				die('Invalid query: ' . mysql_error());
			}  
           list($actuacion) = mysql_fetch_row($actnc);	 


if($result) 
{

      /* if (mysql_num_rows($result)==0) 
       {
                echo "<script>alert('Número de Identificación no encontrado');</script>";
	            exit;
       }	*/		 
     list($Id, $numradica, $Identificacion, $Referencia, $Nombre_Completo, $codigo, $Nombre_Elaboro, $Dia_Envio, $Mes_Envio, $Ano_Envio, $Hora_Envio, $Asunto, $Mensaje, $Quien_Expide, $Notificar) = mysql_fetch_row($result);
	 
     if($codigo) 
     {
           //$dep= sql_query("select Nombre from Dependencias Where Codigo = $codigo",$dbi);

$ElID =$GET[Id];
		   
 $dep = mysql_query('SELECT  Nombre FROM Dependencias WHERE Codigo = "' ."$codigo". '" ');
			if (!$dep) {
				die('Invalid query: ' . mysql_error());
			}
           list($nombre_dep) = mysql_fetch_row($dep);
	 }	   
	 
	 
	 
	 else {
		 
		 
		 $result = mysql_query('SELECT  Id, numradica, Identificacion, Referencia, Nombre_Completo, codigo_depen, Nombre_Elabora, Dia_Envio, Mes_Envio,  Ano_Envio,  Hora_Envio,  Asunto,  Mensaje,  Quien_Expide,  Notificar FROM controlmensajes WHERE Id = "' . $_GET["Id"]  . '" and numradica ="' . $_GET["numra"]  . '" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}

if($result) 
{

       if (mysql_num_rows($result)==0) 
       {
                echo "<script>alert('Número de Identificación no encontrado');</script>";
	            exit;
       }			 
     list($Id, $numradica, $Identificacion, $Referencia, $Nombre_Completo, $codigo, $Nombre_Elaboro, $Dia_Envio, $Mes_Envio, $Ano_Envio, $Hora_Envio, $Asunto, $Mensaje, $Quien_Expide, $Notificar) = mysql_fetch_row($result);
	 
     if($codigo) 
     {
           //$dep= sql_query("select Nombre from Dependencias Where Codigo = $codigo",$dbi);

$ElID =$_GET[Id];
		   
 $dep = mysql_query('SELECT  Nombre FROM Dependencias WHERE Codigo = "' ."$codigo". '" ');
			if (!$dep) {
				die('Invalid query: ' . mysql_error());
			}
           list($nombre_dep) = mysql_fetch_row($dep);
	 }	   
	 
	 
	 }
		 
		 
		 }
	 

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

{	 

$fecha_actual=date("Y/m/d");
$time=strftime( "%H-%M-%S", time() );

////////*****************CONSULTA ARCHIVO
$resbusc = mysql_query("SELECT id FROM archivos WHERE Identificacion = '" . $_POST[Identificacion]  . "' and  registro  = '" . $_POST[numradica]  . "' ");
			if (!$resbusc) {
				die('Invalid query: ' . mysql_error());
			} 
			
list($idarchivo) = mysql_fetch_row($resbusc);	

/*		
 $mssql18 = mysql_query("UPDATE notificaciones_correspondencia set actuaciones_de_envio = '".$_POST["mensaje"]."' WHERE id_archivo = '".$idarchivo."' AND cedula= '".$_POST["Identificacion"]."' " ); 					
			
				if (!$mssql18) { // esto es para que aparescan los errores
				die('Invalid query csqlsadsad: ' . mysql_error()); 
					}
					
			*/		
$mssql18 = mysql_query("INSERT INTO notificaciones_correspondencia (cedula,fecha,hora_descargue,radicado,id_archivo,
actuaciones_de_envio,
funcionario) VALUES ('".$_POST["Identificacion"]."','".$fecha_actual."','".$time."','".$_POST["numradica"]."','".$idarchivo."','".$_POST["mensaje"]."','".$_POST["Nombre_Elaboro"]."') "); 		
		 
		 if (!$mssql18) { // esto es para que aparescan los errores
				die('Invalid query csqlsadsad: ' . mysql_error()); 
					}	
	

	 echo "<script>alert('Los datos fueron Guardados');</script>";
	echo "<script languaje='javascript' type='text/javascript'>window.close();</script>";	
}
	 
?>
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=9; IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    
<style type="text/css">
	*{margin: 0;padding: 0;}
    body{background-color:#EAEAEA;font-family:Geneva, Arial, Helvetica, sans-serif;}
    header {background-color: #B7271F; text-align: center;}
	.cerrarsesion{width: auto;height: 20px;background-color: #DBD8C9;color: #000;font-size: 13px;position:absolute;top: 15px;right:10px;z-index:0;padding: 10px;border-radius: 10px;cursor: pointer;}
    .cerrarsesion:hover{background-color: #ffffff;color: #000;}
    
    .titulo{width: 100%;text-align: center;background-color: #dbd8c9;color: #b20606;padding: 6px 0;font-size: 18px;}
    table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
    .divirmenu{text-align: center;}
    .irmenu{width: 200px;background-color: #1c4fa0;color: #fff; padding: 2px;border-radius: 6px; border:2px solid #C0C0C0;}
    .irmenu:hover{background-color: #67a0d9; color: #000;}
    
    .fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
	td{border: #969696 solid 1px;}
    .tdizq{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: left;}
    .tdcen{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: center;}
    .tdder{background-color: #EEE; padding: 1px 10px;color: #00135F;font-size: 13px;font-weight: 600; text-align: right;}
	.exp{color:#8A0000; font-size:10px;}
	.boton1{width:200px;background-color: #FFF;color: #000; padding: 2px;border-radius: 6px; border:2px solid #7D0000;}
    .boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
    input[type=text], select{border-radius: 5px; padding: 3px;background-color: #fffef7;}
	.tdtitulo{background-color: #e3dec0; color: #b20606; padding: 2px; text-align: center; font-size: 12px; font-weight: 900}
    .tdfull{background-color: #fff; color: #000; padding: 1px; text-align: center; font-size: 12px;}
	
</style>


<script languaje="JavaScript">
function Mostrar_Fecha()
{
         var mydate=new Date()
         var year=mydate.getYear()
         if(year < 1000)		 
                 year+=1900
                 var day=mydate.getDay()
                 var month=mydate.getMonth()
                 var daym=mydate.getDate()
                 if (daym < 10)
                    daym="0"+daym
                    var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
                    var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
                    document.write("<b><font face='Arial, Helvetica, sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></b>")
}					
</script>

</head>

<body>

<header>
    <img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">DATOS DE LA RESPUESTA ENVIADA</h3>
<!--<form method="post" name="formulario" action="Mostrar_Texto.php"> -->
<form method="post" name="frm" onSubmit="return Verificar()">
<table width="726" align="center">

<tr>
	<td colspan="3">
          <script languaje="JavaScript">Mostrar_Fecha()</script>
    </td>
</tr>
  
<tr>
  	<td class="tdder">Número del Radicación : </td>
    <td class="tdizq"><input name="numradica" type="text" size="5" maxlength="5" value="<?php echo $numradica; ?>" readonly>
	<input name="Contador" type="hidden" size="5" maxlength="5" value="<?php echo $Id; ?>" readonly></td> 
</tr>
  
<tr>
    <td class="tdder">Digitar Número <span class="Estilo14">(Cédula, Código Militar o NIT ) :</span></div></td>
    <td class="tdizq"><input name="Identificacion" type="text" size="15" maxlength="15" value="<?php echo "$Identificacion"; ?>" readonly></td>
</tr>
  
<tr>
 	<td class="tdder">Referencia <span class="Estilo13">(Señor o Señora):</span></td>
    <td class="tdizq"><input name="Referencia" type="text" size="4" maxlength="4" value="<?php echo "$Referencia"; ?>" readonly></td>
</tr>

<tr>
	<td class="tdder">Apellidos - Nombres <span class="exp">(Afiliado, Beneficiario o Persona Natural ) : </span></td>
    <td class="tdizq"><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo "$Nombre_Completo"; ?>" readonly></td>
</tr>
  
<tr>
	<td class="tdder">Dependencia que envió el mensaje :</td>
    <td class="tdizq"><input name="nombre_dep" type="text" id="nombre_dep" value="<?php echo $nombre_dep ?>" size="50" maxlength="50" readonly></td>
</tr>
  
<tr>
    <td class="tdder">Nombre Funcionario que Elaboró el Documento :</td>
    <td class="tdizq"><input name="Nombre_Elaboro" type="text" size="50" maxlength="50" value="<?php echo "$Nombre_Elaboro"; ?>" readonly></td>
</tr>
  
<tr>
    <td class="tdder">Fecha de Envio del Documento : </td>
    <td class="tdizq"><input name="Dia_Envio" type="text" size="2" maxlength="2" value="<?php echo "$Dia_Envio"; ?>" readonly>      <input name="Mes_Envio" type="text" size="2" maxlength="2" value="<?php echo "$Mes_Envio"; ?>" readonly>      <input name="Ano_Envio" type="text" value="<?php echo "$Ano_Envio"; ?>" size="4" maxlength="4" readonly></td>
</tr>

<tr>
    <td class="tdder">Hora de Env&iacute;o del Documento : </td>
    <td class="tdizq"><input name="Hora_Envio" type="text" size="11" maxlength="11" value="<?php echo "$Hora_Envio"; ?>" readonly></td>
</tr>

<tr>
    <td class="tdder">Asunto :</td>
    <td class="tdizq"><input name="Asunto" type="text" size="50" maxlength="50" value="<?php echo "$Asunto"; ?>" readonly></td>
</tr>

<tr>
    <td class="titulo" colspan="2">Visualizaci&oacute;n del contenido de la Respuesta : </td>
</tr>
  
<tr>
 	<td colspan="2"><p align="center">	<?php
	echo "<textarea name='Contenido' cols='85' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
    echo htmlspecialchars($Mensaje)."\n";
    echo "</textarea>";	?></p></td>
    </tr>
    
    
   <!-- <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Actuaciones De Envio: </span></div></td>
    <td colspan="2">&nbsp;</td>
    
     <tr bgcolor="#ECE9D8">
  <td colspan="2">
  
  <textarea name="mensaje" cols="100" rows="5" ><?php echo $actuacion; ?></textarea> <br><br>
 
    </tr>
  </tr> 
 -->
  <tr bgcolor="#ECE9D8">
    <td colspan="3">
    
     <center> <input name="guardar" type="submit" class="boton1" id="guardar" value="Guardar Actuacion" />   
	
<?php
global $dbi;


$fecha = $Dia_Envio."-".$Mes_Envio."-".$Ano_Envio;

//$query_Recordset1 = "SELECT * FROM archivos where Identificacion = $Identificacion and registro = $Id";
//$Recordset1 = mysql_query($query_Recordset1, $dbi) or die(mysql_error());

$LaIdentificacion = $_GET[Identificacion];
$ElID = $_GET[Id];
//$res = mysql_query('SELECT * FROM archivos WHERE Identificacion = "' . $HTTP_GET_VARS[Identificacion] . '" and  registro = "' . $HTTP_GET_VARS[Id] . '"');
$res = mysql_query("SELECT * FROM archivos WHERE Identificacion = '" . $_GET[Identificacion]  . "' and  registro  = '" . $_GET[numra]  . "' ");
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			} 


if ((mysql_num_rows($res)!=0))  
{


       printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");

       printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
            <tr bgcolor='#FFFFCC'>
              <th colspan='5' scope='col'><span class='Estilo5'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
             </tr>
            <tr bgcolor='#FFFFCC'>
			       <th scope='col'><span class='Estilo5'>ID</span></th>
                   <th scope='col'><span class='Estilo5'>NOMBRE</span></th>
                   <th scope='col'><span class='Estilo5'>FECHA ENVIO</span></th>				   
                   <th scope='col'><span class='Estilo5'>HORA ENVIO</span></th>				   				   
                   <th scope='col'><span class='Estilo5'>TIPO DE ARCHIVO</span></th>				   				   
		    </tr>");
			
			//$Filas = mysql_fetch_row($res);
			while($Filas = mysql_fetch_row($res))
            {
                    printf("<tr><td><div align='center'><a href='descargar_archivos.php?Id=" . $Filas[0] . "' class='Estilo5 Estilo6'>Descargar</a></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[1]."</span></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[2]."</span></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[3]."</span></div></td>						
                        <td><div align='center'><span class='Estilo7'>".$Filas[5]."</span></div></td></tr>");
            }
	                   echo "</table>"; 
                      mysql_free_result($res);  
	  
}


else

{

$res = mysql_query("SELECT * FROM archivos_nuevos WHERE Identificacion = '" . $_GET[Identificacion]  . "' and  registro  = '" . $_GET[numra]  . "' ");
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			} 


if ((mysql_num_rows($res)!=0)) 
{


       printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");

       printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
            <tr bgcolor='#FFFFCC'>
              <th colspan='5' scope='col'><span class='Estilo5'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
             </tr>
            <tr bgcolor='#FFFFCC'>
			       <th scope='col'><span class='Estilo5'>ID</span></th>
                   <th scope='col'><span class='Estilo5'>NOMBRE</span></th>
                   <th scope='col'><span class='Estilo5'>FECHA ENVIO</span></th>				   
                   <th scope='col'><span class='Estilo5'>HORA ENVIO</span></th>				   				   
                   <th scope='col'><span class='Estilo5'>TIPO DE ARCHIVO</span></th>				   				   
		    </tr>");
			
			//$Filas = mysql_fetch_row($res);
			while($Filas = mysql_fetch_row($res))
            {
                    printf("<tr><td><div align='center'><a href='descargar_archivos.php?Id=" . $Filas[0] . "' class='Estilo5 Estilo6'>Descargar</a></div></td>
                        <td><div align='center'><span class='Estilo7'>" . $Filas[1] . "</span></div></td>
                        <td><div align='center'><span class='Estilo7'>" . $Filas[2] . "</span></div></td>
                        <td><div align='center'><span class='Estilo7'>". $Filas[3] . "</span></div></td>						
                        <td><div align='center'><span class='Estilo7'>" .$Filas[5] . "</span></div></td></tr>");
            }
	                   echo "</table>"; 
                      mysql_free_result($res);  
					  
				}
			 }
		}
else

{
$result = mysql_query('SELECT  Id, numradica, Identificacion, Referencia, Nombre_Completo,  codigo_depen, Nombre_Elabora, Dia_Envio, Mes_Envio,  Ano_Envio,  Hora_Envio,  Asunto,  Mensaje,  Quien_Expide,  Notificar FROM controlmensajes WHERE Id = "' . $_GET["Id"]  . '" ');
			if (!$result) {
				die('Invalid query: ' . mysql_error());
			}

if($result) 
{

       if (mysql_num_rows($result)==0) 
       {
                echo "<script>alert('Número de Identificación no encontrado');</script>";
	            exit;
       }			 
     list($Id, $numradica, $Identificacion, $Referencia, $Nombre_Completo,  $codigo, $Nombre_Elaboro, $Dia_Envio, $Mes_Envio, $Ano_Envio, $Hora_Envio, $Asunto, $Mensaje, $Quien_Expide, $Notificar) = mysql_fetch_row($result);
	 
     if($codigo) 
     {
           //$dep= sql_query("select Nombre from Dependencias Where Codigo = $codigo",$dbi);

$ElID =$_GET[Id];
		   
 $dep = mysql_query('SELECT  Nombre FROM Dependencias WHERE Codigo = "' . $_POST["codigo"] . '" ');
			if (!$dep) {
				die('Invalid query: ' . mysql_error());
			}
           list($nombre_dep) = mysql_fetch_row($dep);
		 }	  
	 }
	
	
	
	
	
	
	$res = mysql_query("SELECT * FROM controlmensajes WHERE Identificacion = '" . $_GET[Identificacion]  . "' and  numradica  = '" . $_GET[numra]  . "' ");
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			} 


if ((mysql_num_rows($res)!=0)) 
{


       printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");

       printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
            <tr bgcolor='#FFFFCC'>
              <th colspan='5' scope='col'><span class='Estilo5'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
             </tr>
            <tr bgcolor='#FFFFCC'>
			       <th scope='col'><span class='Estilo5'>ID</span></th>
                   <th scope='col'><span class='Estilo5'>NOMBRE</span></th>
                   <th scope='col'><span class='Estilo5'>FECHA ENVIO</span></th>				   
                   <th scope='col'><span class='Estilo5'>HORA ENVIO</span></th>				   				   
                   <th scope='col'><span class='Estilo5'>TIPO DE ARCHIVO</span></th>				   				   
		    </tr>");
			
			//$Filas = mysql_fetch_row($res);
			while($Filas = mysql_fetch_row($res))
            {
                    printf("<tr><td><div align='center'><a href='descargar_archivos.php?Id=".$Filas[0]."' class='Estilo5 Estilo6'>Descargar</a></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[1]."</span></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[2]."</span></div></td>
                        <td><div align='center'><span class='Estilo7'>".$Filas[3]."</span></div></td>						
                        <td><div align='center'><span class='Estilo7'>".$Filas[5]."</span></div></td></tr>");
    	        }
	                   echo "</table>"; 
                      mysql_free_result($res);  
			}

else

{

$res = mysql_query("SELECT * FROM archivos_nuevos WHERE Identificacion = '" . $_GET[Identificacion]  . "' and  registro  = '" . $_GET[numra]  . "' ");
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			} 


if ((mysql_num_rows($res)!=0)) 
{


       printf("<style type='text/css'><!--.Estilo5 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #000066; }--></style>");

       printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
            <tr bgcolor='#FFFFCC'>
              <th colspan='5' scope='col'><span class='Estilo5'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
             </tr>
            <tr bgcolor='#FFFFCC'>
			       <th scope='col'><span class='Estilo5'>ID</span></th>
                   <th scope='col'><span class='Estilo5'>NOMBRE</span></th>
                   <th scope='col'><span class='Estilo5'>FECHA ENVIO</span></th>				   
                   <th scope='col'><span class='Estilo5'>HORA ENVIO</span></th>				   				   
                   <th scope='col'><span class='Estilo5'>TIPO DE ARCHIVO</span></th>				   				   
		    </tr>");
			
			//$Filas = mysql_fetch_row($res);
			while($Filas = mysql_fetch_row($res))
            {
                    printf("<tr><td><div align='center'><a href='descargar_archivos.php?Id=" . $Filas[0] . "' class='Estilo5 Estilo6'>Descargar</a></div></td>
                        <td><div align='center'><span class='Estilo7'>" . $Filas[1] . "</span></div></td>
                        <td><div align='center'><span class='Estilo7'>" . $Filas[2] . "</span></div></td>
                        <td><div align='center'><span class='Estilo7'>". $Filas[3] . "</span></div></td>						
                        <td><div align='center'><span class='Estilo7'>" .$Filas[5] . "</span></div></td></tr>");
            }
	                   echo "</table>"; 
                      mysql_free_result($res);  
					  
	}
				  
}
	
 	 echo "<script>alert('Número de radicación no encontrado');<script>";
}	 
?>   
</td>


  </tr>

</table>
</form>
</body>
</html>