<tr>
<td colspan="6">
<p class="respDetalleAD">Destino</p>
	  <hr>
</td>
</tr>
<tr>
	<td>Nombre</td>
	<td colspan="3"><input type="text" name="nombreD" id="nombreD" size="49"/>
</td>
	<td>Obra</td>
<td><label>
	  <select name="obras">
	    <option>Ninguna</option>
	    <?php 
$Allobra = $obra->GetAll();
$claves = array_keys($Allobra);
$cant = count($Allobra);
if ($cant > 0) {
    for ($i = 0; $i < $cant; $i++) {
        echo "<option value={$claves[$i]}";
        if ($claves[$i] == $id_obra) {
            echo " selected ";
        }
        echo ">";
        foreach ($Allobra["{$claves[$i]}"] as $valor) {
            echo "{$valor}</option>";
        }
    }
}
?>
        if ($claves[$i] == $_SESSION["nareas"]) {
            echo " selected ";
        }
        echo ">";
        foreach ($Allareas["{$claves[$i]}"] as $valor) {
            echo "{$valor}</option>";
        }
    }
}
?>
      </select></td>
<td width="71">Obra</td>
<td width="174"><select name="obras">
	<option>Ninguna</option>
	     <?php 
$AllObras = $obra->GetAll();
$claves = array_keys($AllObras);
$cant = count($AllObras);
if ($cant > 0) {
    for ($i = 0; $i < $cant; $i++) {
        echo "<option value={$claves[$i]}";
        if ($claves[$i] == $_SESSION["nobra"]) {
            echo " selected ";
        }
        echo ">";
        foreach ($AllObras["{$claves[$i]}"] as $valor) {
            echo "{$valor}</option>";
        }
    }
}
?>
<input type="hidden" name="hd_variable" value="<?php 
echo $editar;
?>
"/>
<input type="hidden" name="id_variable" value="<?php 
if (!empty($editar)) {
    echo $editar;
} elseif (!empty($cerrar)) {
    echo $cerrar;
}
?>
"/>
</form>
<br>
<?php 
$AllObra = $obra->GetAll();
$claves = array_keys($AllObra);
$cant = count($AllObra);
if ($cant > 0) {
    echo "<table border=1   align='center' class='filaPar'>";
    echo "<tr class='titulosTabla'><td>Nombre</td><td>Encargado</td><td>Fecha de Creacion</td><td>Departamento Ejecutor</td><td>Tipo de Obra</td></tr>";
    for ($i = 0; $i < $cant; $i++) {
        echo "<tr align='center'>";
        foreach ($AllObra["{$claves[$i]}"] as $valor) {
            echo "<td>{$valor} </td>";
        }
        //echo "<td width='10%' ><a href='paso.php?c=4&editar=".$claves[$i]."'><img border=0 src='imagenes/editar.jpg' width='20' height='20' ></a></td>";
        //echo "<td><a href='paso.php?c=4&cerrar=".$claves[$i]."'>Cerrar</a></td>";
        echo "</tr>";
    }
    echo "</table>";