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/Enviar_Respuestas_correo_afiliados.php
<?PHP
require_once("mainfile.php");
include ("config.php");
global $dbi;
require_once("Conectarse.php");
	
//$sql= sql_query("select Id from correspondencias ORDER BY Id DESC LIMIT 1",$dbi)

$res = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
			if (!$res) {
				die('Invalid query: ' . mysql_error());
			}
list($Conta) = mysql_fetch_row($res);
  

$rest = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE Cedula = "' . $_POST[cedula] . '" ');
			if (!$rest) {
				die('Invalid query: ' . mysql_error());
			}  
if($rest){list($Nom) = mysql_fetch_row($rest);    }



$resta = mysql_query('SELECT * FROM  Dependencias ORDER BY Nombre ');
			if (!$resta) {
				die('Invalid query: ' . mysql_error());
			} 
$row_Recordset1 = mysql_fetch_assoc($resta);
$totalRows_Recordset1 = mysql_num_rows($resta);




// esto lo cambie yo

	 $contr = mysql_query('SELECT Id, numradica, Identificacion, Nombre_Completo, Dia_Recibe, Mes_Recibe, Ano_Recibe, Hora_Recibe, funcinario_recibe, tipo  FROM correspondencias  WHERE Identificacion = "' . $_GET["cedula"] . '" and id = "' .$_GET["id"] . '" and numradica = "'.$_GET["radica"] . '"  ');
		  if (!$contr) {
				die('Invalid query 1: ' . mysql_error());
			}
	list($id, $radica, $iden, $nom, $di, $me, $an, $horare, $funre, $tipo) = mysql_fetch_row($contr); 
	
		 $contrw = mysql_query('SELECT Nombre_Completo FROM Usuarios WHERE codigo = "'.$funre.'" ');
		  if (!$contrw) {
				die('Invalid query 1: ' . mysql_error());
			}
	list($funre) = mysql_fetch_row($contrw); 
	
	$recibo = $di."-".$me."-".$an;

$datosamostrar = mysql_query('SELECT cedula, nombre, direccion, telefono, celular, ciudad, email FROM cartera_serviasjudinet  WHERE cedula = "' . $HTTP_GET_VARS["cedula"] . '" ');
			if (!$datosamostrar) {
				die('Invalid query: ' . mysql_error());
			}  
if($datosamostrar){
	list($lacedula, $elnombre, $dire, $eltelefonofijo, $celular, $ciudad, $email) = mysql_fetch_row($datosamostrar);    
}


//--------------------  Aca es para traer el consecutivo que sigue
$datosconsecutivo = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
			if (!$datosconsecutivo) {
				die('Invalid query: ' . mysql_error());
			}  
if($datosconsecutivo){list($elId) = mysql_fetch_row($datosconsecutivo);    }


?>   

<html>
<head>
<title>Enviar Respuesta Correspondencia</title>
<META HTTP-EQUIV="refresh" content="URL=http://www.asjudinet.com/Enviar_Respuestas.php/">
<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>
<style type="text/css">  
<!--
.Estilo1 {
	color: #000099;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}

.EstiloNOT1 {
	color: #CC0033;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}

.Estilo7 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.Estilo8 {font-size: 14px}
.Estilo13 {font-size: 10px; color: #990000; }
.Estilo14 {color: #990000}
.Estilo15 {font-size: 10px}
.Estilo16 {
	font-family: Arial, Helvetica, sans-serif;
	color: #CC0000;
	font-weight: bold;
}
-->
</style>
<script Language="JavaScript">
<!--
function Valida_Fecha(formulario)
{
  if (formulario.Identificacion.value == "")
  {
    alert("Por favor llenar el campo número de identificación");
    formulario.Identificacion.focus();
    return (false);
  }

  if (formulario.codigo.value == "")
  {
    alert("Por favor seleccoine el nombre de la dependencia");
    formulario.codigo.focus();
    return (false);
  }
  

  if (formulario.Nombre_Completo.value == "")
  {
    alert("Por favor llenar el campo con Apellidos y Nombre del Afiliado");
    formulario.Nombre_Completo.focus();
    return (false);
  }

  if (formulario.Asunto.value == "")
  {
    alert("Por favor llenar el campo Asunto");
    formulario.Asunto.focus();
    return (false);
  }
  
    if (formulario.tipo.value == "" || formulario.tipo.value == "0" )
  {
    alert("Por favor Ingrese el tipo");
    formulario.tipo.focus();
    return (false);
  }
   

/*  if (formulario.Contenido.value == "")
  {
    alert("Por favor llenar el campo Respuesta o Contenido del Mensaje");
    formulario.Contenido.focus();
    return (false);
  }
  */

  if (formulario.Quien_Expide.value == "")
  {
    alert("Por favor llenar el campo Quien Expide el Documento");
    formulario.Quien_Expide.focus();
    return (false);
  }

 /* if (envio.archivito.value == "")
  {
    alert("Por Favor Seleccione Un Archivo");
    envio.archivito.focus();
    return (false);
  }
  
  if (envio.archivito3.value == "")
  {
    alert("Por Favor Seleccione Archivo De Notificacion");
    envio.archivito3.focus();
    return (false);
  } */


  if (confirm("Es correcta está información"))
  {   
    return (true);
  }
  else
  {
   return (false);
   }

  return (true);
}
//--></script>

<SCRIPT LANGUAGE="JavaScript">
var timerID = null;
var timerRunning = false; 
var id,pause=0,position=0; 
function stopclock () 
{
    if(timerRunning) 
        clearTimeout(timerID); 
    timerRunning = false;
}
function showtime ()
{ 
    var now = new Date();
    var hours = now.getHours(); 
    var minutes = now.getMinutes(); 
    var seconds = now.getSeconds() 
    var timeValue = "" + ((hours >12) ? hours -12 :hours)
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue += (hours >= 12) ? " P.M." : " A.M." 
    document.formulario.hora_envio.value = timeValue;
    timerID = setTimeout("showtime()",1000);
    timerRunning = true; 
}
function startclock ()
{ 
    stopclock ();
    showtime ();
}
//--> </SCRIPT> 
<script language="JavaScript">
function update(envio)
{ 
   envio.iden.value = formulario.Iden.value
   envio.identificacion.value = formulario.Identificacion.value
   envio.contador.value = formulario.radica.value      
   envio.hora_envio.value = formulario.hora_envio.value;   
}
</script>
</head>
<body OnLoad="startclock()">
<form action="inserts1.php" method="post" name="formulario" onSubmit="return Valida_Fecha(this)">
<table width="698" border="0" align="center" cellpadding="1" cellspacing="0">
  <tr bgcolor="#0099FF">
    <td colspan="3"><div align="center" class="Estilo1">ENVIAR RESPUESTA CORRESPONDENCIA</div></td>
  </tr>
  <tr bgcolor="#FFFFCC">
    <td colspan="3"><div align="center">
          <script languaje="JavaScript">Mostrar_Fecha()</script>
    </div></td>
    </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="360" colspan="2">&nbsp;</td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td width="383"><div align="right"><span class="Estilo7">Digite el n&uacute;mero de radicaci&oacute;n: </span></div></td>
 <td colspan="2">RADICACION <input name="numradica" type="text" size="5" maxlength="5" value="<?php echo $radica ?>" readonly>-ID 
 <input name="Iden" type="text" size="5" maxlength="5" value="<?php echo $id ?>" readonly ></td> 
   </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Digitar N&uacute;mero <span class="Estilo14">(<span class="Estilo15">C&eacute;dula, C&oacute;digo Militar o NIT</span>):</span></span></div></td>
    <td colspan="2"><input name='Identificacion' id='Identificacion' type='text' size='15' maxlength='15' value="<?php echo $lacedula; ?>"></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Referencia <span class="Estilo13">(Se&ntilde;or o Se&ntilde;ora):</span></span></div></td>
    <td colspan="2"><select name="Referencia">
              <option value="Sr." selected>Sr.</option>
              <option value="Sra.">Sra.</option>
            </select></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Apellidos - Nombres <span class="Estilo13">(Afiliado, Beneficiario o Persona Natural ) : </span></span></div></td>
    <td colspan="2"><input name="Nombre_Completo" type="text" size="50" maxlength="50" value="<?php echo $elnombre; ?>"></td>
  </tr>
 
  <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Celular</span></td>
    <td colspan="2"><input name='celular' id='celular' type='text' size='15' maxlength='15' value="<?php echo $celular; ?>"></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Tel&eacute;fono Fijo<span class="Estilo13"> </span></span></td>
    <td colspan="2"><input name='telefonofijo' id='telefonofijo' type='text' size='15' maxlength='15' value="<?php echo $eltelefonofijo; ?>"></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Ciudad</span></td>
    <td colspan="2"><input name='ciudad' id='ciudad' type='text' size='15' maxlength='15' value="<?php echo $ciudad; ?>"></td>
  </tr>
    <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Direccion</span></td>
    <td colspan="2"><input name='direcc' id='direcc' type='text' size='50' maxlength='50' value="<?php echo $dire; ?>"></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Email</span></td>
    <td colspan="2"><input name='email' id='email' type='text' size='50' maxlength='50' value="<?php echo $email; ?>"></td>
  </tr>
    <tr bgcolor="#ECE9D8">
    <td colspan="2"><div align="right"><span class="Estilo7">Funcionario que Recibe: </span></div></td>
    <td ><input name="recibo" type="text" size="50" maxlength="50" value="<?php echo $funre; ?>" readonly></td>
    </tr>
    <tr bgcolor="#ECE9D8">
    <td colspan="2"><div align="right"><span class="Estilo7">Fecha y Hora de Recibo Correspondencia: </span></div></td>
    <td ><input name="recibo" type="text" size="12" maxlength="12" value="<?php echo $recibo; ?>" readonly>-<input name="horare" type="text" size="12" maxlength="12" value="<?php echo $horare; ?>" readonly> </td>
    </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Dependencia que env&iacute;a:</span></div></td>
    <td colspan="2"><SELECT NAME="codigo">
      <OPTION value="">--SELECCIONE NOMBRE DEPENDENCIA ENVIA--</OPTION>
      <?php
do {  
?>
      <option value="<?php echo $row_Recordset1['Codigo']?>"><?php echo $row_Recordset1['Nombre']?></option>
      <?php
} while ($row_Recordset1 = mysql_fetch_assoc($resta));
  $rows = mysql_num_rows($resta);
  if($rows > 0) {
      mysql_data_seek($resta, 0);
	  $row_Recordset1 = mysql_fetch_assoc($resta);
  }
  
  //--------------------  Aca es para traer el consecutivo que sigue
$datosconsecutivo = mysql_query('SELECT Id FROM correspondencias ORDER BY Id DESC LIMIT 1');
			if (!$datosconsecutivo) {
				die('Invalid query: ' . mysql_error());
			}  
if($datosconsecutivo){list($elId) = mysql_fetch_row($datosconsecutivo);    }
  
?>
    </SELECT></td>
  </tr>
  <tr bgcolor="#ECE9D8">
   <td><div align="right"><span class="Estilo7">Funcionario que elabor&oacute; el Documento:</span></div></td>
   <td colspan="2"><input name="Nombre_Elabora"  value="" type="text" size="50" maxlength="50"></td>
  </tr>

  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Fecha de Envio de la Correspondencia: </span></div></td>
    <td colspan="2"><input name="Dia_Envio" type="text" size="2" maxlength="2" value="<?php echo date("d"); ?>" readonly>      <input name="Mes_Envio" type="text" size="2" maxlength="2" value="<?php echo date("m"); ?>" readonly>      <input name="Ano_Envio" type="text" value="<?php echo date("Y"); ?>" size="4" maxlength="4" readonly></td>
    </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Hora de Env&iacute;o: </span></div></td>
    <td colspan="2"><input name="hora_envio" type="text" size="11" maxlength="11"></td>
  </tr>
  
    <tr bgcolor="#ECE9D8">
    <td align="right"><span class="Estilo7">Tipo</span></td>
    <td colspan="2"> <input name='tipo' id='tipo' type='text' size='3' maxlength='3' value="<?php echo $tipo; ?>"></td>
  
  </tr>
  
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo7">Asunto:</span></div></td>
    <td colspan="2"><input name="Asunto" type="text" size="50" maxlength="50"></td>
  </tr>
  <tr bgcolor="#7897DD">
    <td colspan="3"><div align="left"><span class="Estilo7">Emita una instrucci&oacute;n y acciones a seguir del archivo adjunto: </span></div></td>
    </tr>
  <tr bgcolor="#ECE9D8">
    <td colspan="3"><p align="right">
       <textarea name="Contenido" cols="85" rows="4"></textarea>
</p>      </td>
    </tr>
  <tr bgcolor="#ECE9D8">
    <td><div align="right"><span class="Estilo8"><span class="Estilo7">Funcionario que Firma el documento: </span></span></div></td>
    <td colspan="2"><input name="Quien_Expide" type="text" size="50" maxlength="50"></td>
  </tr>
  <tr bgcolor="#ECE9D8">
    <td colspan="3"><div align="left"></div></td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">
      <input type="submit" name="Submit" value="Enviar Correspondencia" style="font-family: Verdana; font-size: 8 pt; color: #000080; background-color: #C0C0C0; border-style: solid">
      <input name="button" type="button" style="font-family: Verdana; font-size: 8 pt; color: #FF0000; background-color: #FFFFCC; border-style: solid" onClick="window.location.href='menu_admin.php'" value="VOLVER AL MENU">
</div></td>
  </tr>
</table>
</form>
</body>
</html>

<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
-->
</style>
</head>
<body>
<form enctype="multipart/form-data" action="guardar_archivos.php" method="post" name="envio">


  <table width="518" border="0" align="center" cellpadding="3" cellspacing="3">
    <tr bgcolor="#0099FF">
      <th colspan="2" scope="row">FORMULARIO PARA SUBIR EL ARCHIVO A ENVIAR </th>
    </tr>
    <tr bgcolor="#FFFFCC">
      <th colspan="2" scope="row"><div align="right"></div></th>
    </tr>
    <tr bgcolor="#FFFFCC">
      <th scope="row"></th>
      <td><input name="iden" type="hidden" size="15" maxlength="15" value="<?php echo $Iden; ?>">
	  <input name="identificacion" type="hidden" size="15" maxlength="15" value="<?php echo $Identificacion; ?>">
      <input name="contador" type="hidden" size="11" maxlength="11" value="<?php echo $radica; ?>"></td>
      <input name="hora_envio" type="hidden" size="11" maxlength="11" value="<?php echo $hora_envio; ?>"></td>			  
    </tr>
    <tr bgcolor="#FFFFCC">
      <th width="248" scope="row"><div align="right"><span class="Estilo1">SUBIR ARCHIVO CARA 1: </span></div></th>
      <td width="249"><input type="file" name="archivito" size="35" maxlength="35"></td>
    </tr>
    
    </tr>
    <tr bgcolor="#FFFFCC">
      <th width="248" scope="row"><div align="right"><span class="Estilo1">SUBIR ARCHIVO CARA 2 : </span></div></th>
      <td width="249"><input type="file" name="archivito2" size="35" maxlength="35"></td>
    </tr>
    
   <tr bgcolor="#FFFFCC">
      <th width="248" scope="row"><div align="right"><span class="EstiloNOT1">SUBIR ARCHIVO NOTIFICACION: </span></div></th>
      <td width="249"><input type="file" name="archivito3" size="35" maxlength="35"></td>
    </tr> 
    
    <tr bgcolor="#FFFFCC">
      <th colspan="2" scope="row"><input name="submit" type="submit" value="Adjuntar archivo" onClick="update(this.form)"></th>
    </tr>
    
  </table>
</form>
</body>
</html>