Esta es la tabla completa:
Código PHP:
$sql = "select * from beneficios where rut = '".mysql_escape_string($_POST['caja1'])."'";
$sql = mysql_query($sql) or die(mysql_error());
echo "<table width='700' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#999999'> \n";
echo "<td width='10%' bgcolor='BBBBBB'><b>FECHA:</b></td>";
echo "<td WIDTH='10%' bgcolor='BBBBBB'><b>SOLICITÓ:</b></td>";
echo "<td WIDTH='50%' bgcolor='BBBBBB'><b>OBSERVACIONES:</b></td>";
echo "<td WIDTH='20%' bgcolor='BBBBBB'><b>ESTADO:</b></td>";
echo "<td WIDTH='10%' bgcolor='BBBBBB'><b>ATENDIDO POR:</b></td>";
echo "</table>\n";
while($row = mysql_fetch_array($sql)){
echo "<table width='700' height='30' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#999999'> \n";
echo "<tr><td width='10%' height='30' style='vertical-align:top'>".$row['fecha']."</td>";
echo "<td width='10%' style='vertical-align:top'>".$row['solicita']."</td>";
echo "<td width='50%' style='vertical-align:top'>".$row['beneficio']."</td>";
echo "<td width='20%' style='vertical-align:top'>";
$result = mysql_query("Select estado From beneficios where rut = '".mysql_escape_string($_POST['caja1'])."'");
while($rew=mysql_fetch_array($result)) {
$estado=$rew['estado'];
if($estado=="Pendiente"){
echo "<select name='estado'>";
echo "<option value=\"".$estado."\ selected>".$estado."</option>";
echo "<option value='Solucionado'>Solucionado</option>";
echo "</select></td>";
}
if($estado=="Solucionado"){
echo "<select name='estado'>";
echo "<option value=\"".$estado."\ selected>".$estado."</option>";
echo "<option value='Pendiente'>Pendiente</option>";
echo "</select></td>";
}
}
echo "<td width='10%' style='vertical-align:top'>".$row['usuario']."</td>";
echo "</table>\n";
}