<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>NOTAS DE PRENSA</title>
<link rel="stylesheet" type="text/css" media="all" href="../jscalendar/skins/aqua/theme.css" title="Aqua" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-blue.css" title="winter" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-blue2.css" title="blue" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-brown.css" title="summer" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-green.css" title="green" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-win2k-1.css" title="win2k-1" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-win2k-2.css" title="win2k-2" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />
<link rel="alternate stylesheet" type="text/css" media="all" href="../jscalendar/calendar-win2k-cold-2.css" title="win2k-cold-2" />
<link rel="stylesheet" type="text/css" href="../css/admin.css"/>
<link rel="alternate stylesheet" type="text/css" media="all" href="calendar-system.css" title="system" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="../jscalendar/calendar.js"></script>
<script type="text/javascript" src="../jscalendar/lang/calendar-es.js"></script>
<script src="../css/jquery.js" type="text/javascript"></script>
<script src="prueba.js" type="text/javascript"></script>
<script type="text/javascript">
var oldLink = null;
function setActiveStyleSheet(link, title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
if (oldLink) oldLink.style.fontWeight = 'normal';
oldLink = link;
link.style.fontWeight = 'bold';
return false;
}
function selected(cal, date) {
cal.sel.value = date;
if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
cal.callCloseHandler();
}
function closeHandler(cal) {
cal.hide();
_dynarch_popupCalendar = null;
}
function showCalendar(id, format, showsTime, showsOtherMonths) {
var el = document.getElementById(id);
if (_dynarch_popupCalendar != null) {
_dynarch_popupCalendar.hide();
} else {
var cal = new Calendar(1, null, selected, closeHandler);
if (typeof showsTime == "string") {
cal.showsTime = true;
cal.time24 = (showsTime == "24");
}
if (showsOtherMonths) {
cal.showsOtherMonths = true;
}
_dynarch_popupCalendar = cal;
cal.setRange(1900, 2070);
cal.create();
}
_dynarch_popupCalendar.setDateFormat(format);
_dynarch_popupCalendar.parseDate(el.value);
_dynarch_popupCalendar.sel = el;
_dynarch_popupCalendar.showAtElement(el.nextSibling, "Br");
return false;
}
var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;
function isDisabled(date) {
var today = new Date();
return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}
function flatSelected(cal, date) {
var el = document.getElementById("preview");
el.innerHTML = date;
}
function showFlatCalendar() {
var parent = document.getElementById("display");
var cal = new Calendar(0, null, flatSelected);
cal.weekNumbers = false;
cal.setDisabledHandler(isDisabled);
cal.setDateFormat("%A, %B %e");
cal.create(parent);
cal.show();
}
</script>
</head>
<?php
if (isset($_POST['submit'])) {
$ruta_destino = ".../.../fotos/";
$ruta_destino2 = "http://localhost/fotos/";
$namefinal= trim ($_FILES['fichero']['name']);
$uploadfile= $ruta_destino . $namefinal;
$uploadfile2= $ruta_destino2 . $namefinal;
if(move_uploaded_file($_FILES['fichero']['tmp_name'], $uploadfile)) { // se coloca en su lugar final
//conectamos a la base de datos para almacenar los datos y la ruta del archivo
$server="localhost";
$usuario="root";
$pass="";
$bd="bd";
$id = $_POST["id"];
$fecha = $_POST["fecha"];
$titulo = $_POST["titulo"];
$descripcion = $_POST["descripcion"];
$query = "INSERT INTO notas_prensa
VALUES ('$id','$fecha','$titulo','$descripcion', '".$uploadfile2."','".$uploadfile."')";
echo "<script languaje='javascript'>alert('Datos Guardados.')
document.location = ('../presentacion/frmnotas_prensag.php');
</script>";
}
}
}
//Formulario
?>
<body onload="showFlatCalendar()" bgcolor="#F9F9F9">
<script type="text/javascript">
setActiveStyleSheet(document.getElementById("defaultTheme"), "Aqua");
</script>
</div>
<form action="frmnotas_prensag.php" method="post" enctype="multipart/form-data">
<h1 align="center" class="titulo">NUEVA NOTA DE PRENSA</h1>
<table align="center" id="datos" >
<tr>
<th></th>
<td><input name="id" type="hidden" size="430"> </td>
</tr>
<tr>
<th>Imagen</th>
<td><input name="fichero" type="file" size="30" maxlength="150"></td>
</tr>
<tr>
<th>Fecha</th>
<td> <input type="text" name="fecha" id="sel4" size="30" ><input type="reset" value=" ... "
onclick="return showCalendar('sel4','%Y-%m-%d');"><div id="display" style="display:none"></div> </tr>
<tr>
<th>Titulo</th>
<td><input type="text" id="titulo" size="30" name="titulo"/>
<input type="button" id="chequeo" value="Verificar"/>
<br/>
<div id="resultado"></div></td>
</td>
</tr>
<tr>
<th>Descripcion</th>
<td ><textarea name="descripcion" cols="40" rows="10"></textarea> </td>
</tr>
<tr>
<td colspan="2" align="center"><input name="submit" type="submit" value="Guardar" id="button"></td>
</tr>
</table>
</form>
<div id="display" style="display:none"></div>
<p style="display:none"><small>
</body>
</html>