


PAGINA PRINCIPAL
_______________________________________--
<html>
<head>
***<title>Practica 7 - Principal</title>
</head>
<body bgcolor= #F5F5DC>
<?php
include ("conectarse2.php");
$link = abrir();
?>
<table border="4", width ="63%", align="center">
<tr>
<td colspan="6" width="20%" height="125" background="baner2.jpg">
</tr>
<tr>
<td colspan="4" width="80%" height="300" background= "reporte.jpg" >
</tr>
</tr>
<tr>
<td><b><i><center><font size="4"><a href="http://localhost/pru/alta.php/" target="_top">Alta Novedades</a></font></center></b></i></</td>
<td><b><i><center><font size="4"><a href="http://localhost/pru/modificar.php/" target="_top">Modificar Novedades</a></font></font></center></b></i></</td>
<td><b><i><center><font size="4"><a href="http://localhost/pru/baja.php/" target="_top">Bajas Novedades</a></font></font></center></b></i></</td>
<td><b><i><center><font size="4"><a href="http://localhost/pru/consultar.php/" target="_top">Consultar Novedades</a></font></font></center></b></i></</td>
</tr>
</table>
<?php
mysql_close($link);
?>
</body>
</html>
___________________________________________
PAGINA ALTAS
__________________________________
<html>
<head>
***<title>Practica 7 - Altas</title>
<script languaje='javascript' src="popcalendar.js"></script>
</head>
<body bgcolor= #F5F5DC>
<FORM ACTION="agregar.php" METHOD="GET">
<?php
include ("conectarse2.php");
$link = abrir();
$result=mysql_query("select cve_centro,nombre from centros",$link);
?>
<table border="4", width ="50%", align="center">
<td colspan="8"><b><i><center><font size="6">Alta Novedades</font></center></b></i></td>
<tr>
</table>
<table border="4", width ="50%", align="center">
<td><B>RPE:</B> <td><INPUT TYPE="text" NAME="rpe"><BR><BR><tr>
<td><B>FALLA:</B> <td><INPUT TYPE="text" value: : NAME="falla"><BR><BR><tr>
<td><B>CENTRO:</B><td>
<?php
echo '<select name="centro">';
while ($row = mysql_fetch_array($result))
{
$valor = $row['cve_centro'];
$texto = $valor.' -> '.$row['nombre'];
printf('<option value="%s">%s</option>',$valor,$texto);
}
echo '</select>';
?>
<tr>
<td><B>FECHA:</B> <td><form name="form" metod="post"> <INPUT TYPE="text" NAME="fecha" id="dateArrival" onClick="popUpCalendar(this, form.dateArrival, 'yyyy-mm-dd');" size="10"><BR><BR><tr>
<td><B>HORA:</B> <td><INPUT TYPE="text" NAME="hora"><BR><BR><tr>
<td><B>PRIORIDAD:</B><td>
<input type="radio" checked name="prioridad" value="ALTA">Alta
<input type="radio" checked name="prioridad" value="MEDIA" >Media
<input type="radio" checked name="prioridad" value="BAJA">Baja<br><tr>
<td><B>OBSERVACIONES:</B> <td><TEXTAREA TYPE="textarea_novedad" NAME="observacion" rows="5" cols="65"></textarea><BR><BR>
<td>
<tr><tr>
<td colspan="6">
<center><INPUT TYPE="submit" NAME="accion" VALUE="Grabar"> </center><center><br><br>
<center><a href="http://localhost/pru/principal.php"/> Pagina Principal <a></center>
<tr>
</table>
<?php
mysql_free_result($result);
mysql_close($link);
?>
</FORM>
</body>
</html>
_______________________________
CARGA DATOS A LA BD DESDE LA PAGINA ALTAS
_______________________________________________
<?php
include ("conectarse2.php");
$link = abrir();
$falla=$_GET['falla'];
$cve_centro=$_GET['centro'];
$rpe=$_GET['rpe'];
$fecha=$_GET['fecha'];
$hora=$_GET['hora'];
$prioridad=$_GET['prioridad'];
$observacion=$_GET['observacion'];
mysql_query("insert into novedades (falla, cve_centro, rpe, fecha, hora, prioridad, observacion) values ('$falla', '$cve_centro', '$rpe', '$fecha', '$hora', '$prioridad', '$observacion')",$link);
header("Location: alta.php");
?>
_______________________________________________
CONECTA A LA B.D
_____________________
<html>
<head>
<title>Ejemplo de PHP</title>
</head>
<body>
<?php
function abrir()
{
if (!($link=mysql_connect("localhost","root","")))
{
echo "Error conectando a la base de datos.";
exit();
}
if (!mysql_select_db("final_9ekd9",$link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}
?>
_____________________