<?php require_once('../topo.php');?>
<?php require_once('../lateral.php');?>
<br><br><br>
<?php 
$idobra = $_GET['idobra']; 

$SelecionaObra = Seleciona("obras", "WHERE idobra='$idobra'", "LIMIT 0,1");
while($linha_obras = mysql_fetch_array($SelecionaObra)){
$codmax = $linha_obras['codmax']; 

}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="50" colspan="4" align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="40" class="TituloPagina" style="padding-left: 5px;">LISTA DE ACESSO #<?php echo $codmax;?></td>
        <td align="left" class="TituloPagina" style="padding-left: 5px;"><table width="100" border="0" align="right" cellpadding="2" cellspacing="0">
          <tr>
            <td width="167" align="left"><table width="200" border="0" cellspacing="0" cellpadding="2" class="BoxMenuCinzaEscuro" onclick="location.href='listar_obras_listadeacessos.php?idobra=<?php echo $idobra;?>';">
              <tr>
                <td height="25" align="center" class="TextoMenuCinza"><img src="img/icone_novo.gif" width="29" height="21" /></td>
                <td align="left"><span class="TextoMenuBranco" style="font-weight:normal; color:#FFF;">Todas as Listas</span></td>
                </tr>
              </table></td>
            <td width="150" align="left"><table width="190" border="0" cellspacing="0" cellpadding="2" class="BoxMenuCinzaEscuro" onclick="location.href='manutencao_obras_listadeacessos.php?idobra=<?php echo $idobra;?>';">
              <tr>
                <td height="25" align="center" class="TextoMenuCinza"><img src="img/icone_novo.gif" width="29" height="21" /></td>
                <td align="left"><span class="TextoMenuBranco" style="font-weight:normal; color:#FFF;">Nova Lista</span></td>
                </tr>
              </table></td>
            <td width="125" align="left">&nbsp;</td>
            </tr>
          </table></td>
        <td align="right"><table width="100%" border="0" cellspacing="0" cellpadding="7">
          <tr>
            <?php if($acao == "Alterar"){ ?>
            <td width="100" align="right">&nbsp;</td>
            <?php } ?>
            </tr>
          </table></td>
        <td width="80" align="right" style="padding-right: 8px;"><table width="70" border="0" cellspacing="0" cellpadding="2" class="BoxMenuCinza" onclick="location.href='../detalhe_obra.php?idobra=<?php echo $_GET['idobra'];?>';">
          <tr>
            <td height="25" align="center" class="TextoMenuBranco">Ver Obra</td>
          </tr>
        </table></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="4" align="center" valign="top">
    
    <table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" id="tabela_padrao" class="display">
     <thead>
      <tr class="TextoCinzaEscuro">
        <td width="20%" height="30" bgcolor="#A6A6A6" class="TextoCinzaEscuro"><strong>TITÚLO</strong></td>
        <td width="20%" align="center" bgcolor="#A6A6A6"><strong>DATA LIBERAÇÃO</strong></td>
        <td width="20%" align="center" bgcolor="#A6A6A6"><strong>DATA FIM LIBERAÇÃO</strong></td>
        <td width="20%" align="center" bgcolor="#A6A6A6"><strong>QTDE. PESSOAS</strong></td>
        <td width="20%" align="center" bgcolor="#A6A6A6">&nbsp;</td>
        
        </tr>
        </thead>
        <tbody>
      <?php
		$busca = $_POST['busca'];
			$cor_fundo = "#FFFFFF";			  
		 	$seleciona = Seleciona("obras_listadeacesso", "WHERE idobra='$idobra'", "");
			while($linha=mysql_fetch_array($seleciona)){			
			
			if($cor_fundo == "#FFFFFF"){
				$cor_fundo = "#E4E4E4";
			}else{
				$cor_fundo = "#FFFFFF";
			}
		?>
      <tr class="TextoCinzaPequeno" bgcolor="<?php echo $cor_fundo;?>" onmouseover="javascript:this.style.backgroundColor='#CCCCCC'" onmouseout="javascript:this.style.backgroundColor='<?php echo $cor_fundo;?>'" style="cursor:pointer;" onclick="location.href='manutencao_obras_listadeacessos.php?idobra_listadeacesso=<?php echo $linha['idobra_listadeacesso'];?>&idobra=<?php echo $idobra;?>';">
        <td width="20%" height="30"><?php echo $linha['titulo'];?></td>
        <td width="20%" align="center"><?php echo InverteDataNovoSeparador($linha['datainicio'], "-", "/");?></td>
        <td width="20%" align="center"><?php echo InverteDataNovoSeparador($linha['datafim'], "-", "/");?></td>
        <td width="20%" align="center">&nbsp;</td>
        <td width="20%"><img src="img/icone_detalhe.gif" width="22" height="24" border="0" /></td>
        </tr>
      <?php }?>
        </tbody>
    </table>
    
    </td>
  </tr>
  <tr>
    <td colspan="4" align="center" valign="middle">
</td>
  </tr>
</table>
<?php require_once('../rodape.php');?>