Table inside tabs. Rules

1

I'm having trouble putting a table inside tabs. The data is all in but the tables.

  echo'<div id="tabs-1">


      <p><b>Alvará: </b></p>';
        echo '<table width=500>
        <tr>
        <td><b>Número</b></td>
        <td><b>Validade</b></td>
        <td><b>Anexo</b></td>
        </tr>';
        echo "<td>".$exibe['AlvaraNumero']."</td>";
        if ($exibe['AlvaraValidade']) { 
        if (strtotime($exibe['AlvaraValidade']) < time())  {
        echo "<tr>";
        echo " <td>'<span style='color:red'>".$exibe['AlvaraValidade']."</span>'</td>";
        }else{
        echo " <td>".$exibe['AlvaraValidade']."</td>";
        }
        echo "<td><a href='MostrarAlvara.php?id=".$exibe['id']."'>Ver PDF </a></td>";
        echo "</tr>";
        }
        echo '</table>';
 '</p>
 </div>';

    
asked by anonymous 12.06.2014 / 10:31

3 answers

2

To make a link within an echo is simple:

echo '<a href="MostrarAlvara.php?id='.$exibe["id"] .'">Ver PDF</a>';

Always close the quotation marks you have opened so there is no error in your code.

    
12.06.2014 / 11:49
2

Try the code below. I have noticed some ELSE closing errors and closing quotes.

echo'<p><b>Alvará: </b></p>';
echo '<table>
<tr>
<td>Número</td>
<td>Validade</td>
<td>Anexo</td>
</tr>';
if ($exibe['AlvaraValidade']) { 
    if (strtotime($exibe['AlvaraValidade']) < time())  {
        echo "<tr>";
        echo " <td>'<span style='color:red'>".$exibe['AlvaraValidade']."</span>'</td>";
    } else {
        echo " <td>".$exibe['AlvaraValidade']."</td>";
    }
    echo "</tr>";
}
if($exibe['Nome2'] != NULL) {
    echo "<tr>
    <td>{$exibe['Nome2']}</td>
    <td>{$exibe['Funcao2']}</td>
    </tr>";
}
echo '</table>';
    
12.06.2014 / 11:00
-1

Try using this code with the modifications I made.

link

<?php
    echo '<div id="tabs-1">';
    echo '<img align="right" src="logos/'.$exibe["Nome"].'.jpg">';
    echo '<p>Nome:<b>'.$exibe["Nome"].'</b></p>';
    echo '<p>Morada:   '.$exibe["Morada"].'</p>';
    echo '<p>Distrito: '.$exibe["Distrito"].'</p>';
    echo '<p>Concelho: '.$exibe["Concelho"].'</p>';
    echo '<p>Tipo: '.$exibe["Tipo"].'</p>';
    echo '<div align="right"> <p>Avaliação: '.$exibe["Avaliacao"].'</p> </div>';
    echo '<p>Email: '.$exibe["Email"].'</p>';
    echo '<p>Organograma: <a href="MostrarOrganograma.php?id='.$exibe['id'] . '">
        Ver Organograma </a></p>';
    echo'<p><b>Alvará: </b></p>';
    echo '<table border="0">';  
    echo '<tr><td>Número</td><td>Validade</td><td>Anexo</td></tr>';
    echo "<tr><td>".$exibe['AlvaraNumero']."</td></tr>";
    if ($exibe['AlvaraValidade']) {
        if (strtotime($exibe['AlvaraValidade']) < time())  {
          echo "<tr><td>'<span style='color:red'>".$exibe['AlvaraValidade']."</span>'</td>";
        } else {
          echo " <td>".$exibe['AlvaraValidade']."</td>";
        }
        echo "<td><a href='MostrarAlvara.php?id=".$exibe['id']."'>Ver PDF </a></td></tr>";
    }
    echo '</table>';
    echo '</div>';
?>
    
12.06.2014 / 12:03