File: /home/asjudine/public_html/modificar_correspondencia.php
<html>
<head>
<title>Enviar Comunicación</title>
<META HTTP-EQUIV="refresh" >
<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;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;}
.subtitulos{width: 100%;text-align: center;color: #b20606;padding: 2px 0;font-size: 14px;}
table{margin: 0 auto;border: 8px solid #bebebe; text-align: center;}
.divirmenu{text-align: center;}
.irmenu{width: 170px;background-color: #1c4fa0;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{}
.tdizq{background-color: #EEE; padding: 1px 5px;color: #00135F;font-size: 13px;font-weight: 300; text-align: left;}
.tdcen{background-color: #EEE; padding: 1px 5px;color: #00135F;font-size: 13px;font-weight: 300; text-align: center;}
.tdder{background-color: #EEE; padding: 1px 5px;color: #00135F;font-size: 13px;font-weight: 300; text-align: right;}
.tdroja{background-color: #EEE; padding: 1px 5px;color: #CC0005;font-size: 13px;font-weight: 600; text-align: right;}
.exp{color:#8A0000; font-size:10px;}
.fuerte{font-weight:400;}
.boton1{width:170px;background-color: #ffffff;color: #000;padding: 2px;border:2px solid #580000;border-radius:5px;}
.boton1:hover{background-color: #6f0000;color: #fff;cursor: pointer;}
input[type=text]{border-radius: 2px; padding: 3px;background-color: #FFFEF4;}
.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;}
.btncontrato{width:auto; padding: 2px 5px; background:#F5F1C2; color:#000;}
.btncontrato:hover{background-color:#716D04; color:#fff;}
</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>
<script Language="JavaScript">
function Valida_Fecha(formulario)
{
}
</script>
<script type="text/javascript">
window.onload=hora_minuta();
function hora_minuta()
{
fecha=new Date();
hora = fecha.getHours();
min = fecha.getMinutes();
seg = fecha.getSeconds();
if(hora>=12)
{
hora=hora-12;
FORM="PM";
}else
{
FORM="AM";
}
ACTUALIZAR=setTimeout('hora_minuta()',500);
document.getElementById("hora_envio").value = hora + ":"+min+":"+seg+" "+FORM;
}
</script>
</head>
<body OnLoad="startclock()">
<header>
<img src="../ELEMENTS/bannerInterasjudinet.png" alt="" width=" 700" height="70">
</header>
<h3 class="titulo">ACTUALIZAR CORRESPONDENCIA</h3>
<form action="" method="post" name="formulario" enctype="multipart/form-data">
<table width="698" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td class="fecha" colspan="3">
<script languaje="JavaScript">Mostrar_Fecha()</script>
</td>
</tr>
<!--
<tr>
<td colspan="2">
<marquee bgcolor="#FFFFFF" width="100%" scrolldelay="80" scrollamount="5" direction="left" loop="infinite">Primero cargar el archivo en la parte inferior, despues llenar informacion parte superior.
</marquee></td>
</tr>-->
<tr>
<td class="tdder" width="383"> número de cedula: </td>
<td class="" ><input name="cedula" type="text" value="<?php echo $_GET['id']; ?>" ></td>
</tr>
<tr>
<td class="tdder" width="383"> número de radicación : </td>
<td class="" ><input name="numradica" type="text" value="<?php echo $_GET['rad']; ?>" ></td>
</tr>
<tr >
<td width="248" scope="row"><div align="right"><span class="Estilo1">UBICACION DEL ARCHIVO : </span></div></td>
<td><input type="file" name="archivito" size="35" maxlength="35"></td>
</tr>
<tr >
<td width="248" scope="row"><div align="right"><span class="Estilo1"> </span></div></td>
<td><input type="submit" name="enviar" value="ACTUALIZAR" style="width: height: 20px;"></td>
</tr>
</table>
</form>
</body>
</html>
<html>
<head>
<title>Documento sin tí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>
<script Language="JavaScript">
<!--
function update(envio)
{
}
//--></script>
</head>
<body >
</body>
</html>
<?php
require_once("Conectarse.php");
$dia = $_POST['Dia_Envio'];
$mes = $_POST['Mes_Envio'];
$ano = $_POST['Ano_Envio'];
$fecha = $dia."-".$mes."-".$ano;
if(isset($_POST["enviar"]))
{
$archivo = $_FILES["archivito"]["tmp_name"];
$tamanio = $_FILES["archivito"]["size"];
$tipo = $_FILES["archivito"]["type"];
$nombre = $_FILES["archivito"]["name"];
if ( $archivo != "none" )
{
$fp = fopen($archivo, "rb");
$contenido = fread($fp, $tamanio);
$contenido = addslashes($contenido);
fclose($fp);
$res = mysql_query("UPDATE archivos_nuevos SET nombre = '".$nombre."', contenido = '".$contenido."', tipo = '".$tipo."' WHERE Identificacion = '".$_POST["cedula"]."' AND registro = '".$_POST["numradica"]."' ");
if (!$res)
{
die('Invalid query ARCHIVOS : ' . mysql_error());
?>
<script>alert("NO se ha podido guardar el archivo en la base de datos.");</script>
<?php
}else{
?>
<script>alert("Correspondencia Modificada con exito");</script>
<?php
}
}
}
?>