Código PHP:
<?php
//Conexion con la base de datos
$link = @mysql_connect ("localhost","root","") or
die("Error de conexion: ".mysql_error());
@mysql_select_db("name",$link) or
die("Error de selección: ".mysql_error());
?>
<table width="600" align="center">
<tr>
<td align="left" height="25" valign="top" nowrap><div align="left"></div></td>
</tr>
<tr>
<td align="left" valign="top" height="25"><form name="form11" method="GET" onSubmit="" action="" id="form11">
<table width="496" height="21" align="center">
<tr bgcolor="#CCCCCC" class="Estilo1">
<td width="68" rowspan="2" bgcolor="#CCCCCC"><?php
$tarea = $_GET['combo'];
$result=mysql_query("select id_tabla, tarea from actividades order by tarea");
echo '<select name="combo" size="1" id="combo" onChange="javascript:document.form11.submit();">';
echo "<option value='0'>___</option>";
while ($row=mysql_fetch_array($result))
{
if ($row['id_tabla'] == $tarea){
echo "<option value='".$row['id_tabla']."' selected>".$row['tarea']."</option>";
}
else{
echo "<option value='".$row['id_tabla']."'>".$row['tarea']."</option>" ;
}
}
echo "</select>";
?></td>
<td width="253" rowspan="2" bgcolor="#FFFFFF"> </td>
<td width="159" rowspan="2" bgcolor="#FFFFFF"><div align="left"></div></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1"> </tr>
</table>
</form></td>
<?php
$qry="select * from actividades where id_tabla='".$tarea."'";
$result1=mysql_query($qry);
$num=mysql_num_rows($result1);
$row=mysql_fetch_array($result1);
?>
<?php
echo "<br>";
$mensaje=$_GET['mensaje'];if ($mensaje==1)
{
echo "<center>Registro Actualizado</center>";
}
?>
<table border="1" align="center">
<?php
include ("conexion.php");
conectar();
$consulta="select * from actividades";
$resultados= mysql_db_query ($mydb,$consulta) or die("error consulta: ".mysql_error());
if (!(@mysql_num_rows ($resultados) == 0))
{
while ($campo = mysql_fetch_array($resultados))
{
$dependencia=$campo['dependencia'];
$actividad=$campo['actividad'];
$f_i=$campo['f_i'];
$f_f=$campo['f_f'];
$f_f=$campo['f_f'];
$monto=$campo['monto'];
$unidad=$campo['unidad'];
$programado=$campo['programado'];
$tarea=$campo['tarea'];
$trimestre=$campo['trimestre'];
$calcular=$campo['calcular'];
$estimado=$campo['estimado'];
?>
<form name="form1" method="post" action="caseactividad.php">
<table width="533" border="0" align="center">
<tr>
<th width="555" height="457" scope="col"><table width="513" height="73" align="center">
<tr bgcolor="#CCCCCC" class="Estilo1">
<td width="253" rowspan="2"><div align="center">Sistema de Monitoreo y Evaluación </div></td>
<td height="40"><div align="center">Codigo de la Tarea </div></td>
<td><div align="center"><input name="tarea" type="text" id="tarea2" value="<?php echo $row['tarea']?>" /></div></td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td width="124" height="24"><div align="center">Dependencia</div></td>
<td width="120"><div align="right">
<input name="dependencia" type="text" id="dependencia2" value="<?php echo $row {'dependencia'}?>" />
</div></td>
</tr>
</table>
<table width="514" height="30" align="center">
<tr bgcolor="#CCCCCC" class="Estilo1">
<td width="191">Nombre de la actividad </td>
<td width="311" height="24"><input name="actividad" type="text" id="actividad2" value="<?php echo $row['actividad']?>" /></td>
</tr>
</table>
<table width="515" height="190" align="center">
<tr bgcolor="#CCCCCC" class="Estilo1">
<td width="204">Fecha de inicio </td>
<td width="178" height="28"><p>
<input name="f_i" type="text" id="f_i2" value="<?php echo $row['f_i']?>" /> <!-- ggPosX and ggPosY not set, so popup will autolocate to the right of the graphic -->
</p></td>
<td width="117"> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>Fecha de final </td>
<td height="24"><!-- ggPosX and ggPosY not set, so popup will autolocate to the right of the graphic -->
<input name="f_f" type="text" id="f_f2" value="<?php echo $row['f_f']?>" />
</td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>Fecha real de culminación</td>
<td height="24"><input name="f_r" type="text" id="f_r2" value="<?php echo $row['f_r']?>" /></td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>Monto de la Tarea </td>
<td height="24"><input name="monto" type="text" id="monto2" value="<?php echo $row['monto']?>" /></td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>unidad</td>
<td height="24"><input name="unidad" type="text" id="unidad2" value="<?php echo $row['unidad']?>" /></td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>Estimado</td>
<td height="24"><input name="estimado" type="text" id="estimado2" value="<?php echo $row['estimado']?>" /></td>
<td> </td>
</tr>
<tr bgcolor="#CCCCCC" class="Estilo1">
<td>calcular</td>
<td height="24"><input name="calcular" type="text" id="calcular2" value="<?php echo $row['calcular']?>" /></td>
<td> </td>
</tr>
</table>
<h6> </h6>
<table width="511" border="0" bgcolor="#CCCCCC">
<tr>
<th width="95" bgcolor="#CCCCCC" class="Estilo1" scope="col"><div align="left">Trimestre</div></th>
<th width="130" scope="col"><label>
<div align="right"><input name="trimestre" type="text" id="trimestre2" value="<?php echo $row['trimestre']?>" />
</div>
</label></th>
<th width="10" bgcolor="#CCCCCC" scope="col"> </th>
<th width="105" bgcolor="#CCCCCC" class="Estilo1" scope="col">programado</th>
<th width="149" scope="col"><input name="programado" type="text" id="programado2" value="<?php echo $row['programado']?>" /></th>
</tr>
</table>
</th>
</tr>
</table>
<td><input type="submit" name="Submit" value="Actualizar"></td>
<input name="seleccion" type="hidden" id="seleccion" value="2">
<input name="tarea" type="hidden" value="<?php echo $tarea?>">
<a href="actualizaractivi.php?cedula=<?php echo $cedula?>" style="color: #000000"></a>
</tr>
</form>
<?php
}
}
?>
</table>
<?php
$cedula=$_GET['tarea'];
if (!(empty ($tarea)))
{
$consulta="select * from actividades where tarea='$tarea'";
$resultados= mysql_db_query ($mydb,$consulta) or die("error consulta: ".mysql_error());
if (!(@mysql_num_rows ($resultados) == 0))
{
while ($campo = mysql_fetch_array($resultados))
{
$dependencia=$campo['dependencia'];
$actividad=$campo['actividad'];
$f_i=$campo['f_i'];
$f_f=$campo['f_f'];
$f_f=$campo['f_f'];
$monto=$campo['monto'];
$unidad=$campo['unidad'];
$programado=$campo['programado'];
$tarea=$campo['tarea'];
$trimestre=$campo['trimestre'];
$calcular=$campo['calcular'];
$estimado=$campo['estimado'];
}
}
?>
<form name="form1" method="post" action="caseactividad.php">
<label></label>
</form>
<?php
}
?>
<br>