Best way to set up a table

1

I need to assemble a table with some documents. These documents are sent by users of the application. But two of these documents, even if it has not been sent, should appear the name (it is constant) in the table without the date of birth.

<table>
    <tr>
        <th>Documento</th>
        <th>Data que foi enviado</th>
        <th>Acao</th>
    </tr>
    <?php foreach ($documentos as $documento): ?>
        <tr>
            <td><?php echo $documento->nome; ?></td>
            <td><?php echo $documento->data; ?></td>
            <td><input type="file" id="myFile"></td>
        </tr>
    <?php endforeach ?>
</table>

If the user has sent all the documents the application will return something like:

$documentos = array(
new Documentos(1, 'RG', '01/06/2014'),
new Documentos(2, 'CPF', '01/06/2015'),
new Documentos(3, 'OUTROS', '10/10/2013'));

Otherwise you should return:

$documentos = array(
new Documentos(1, 'RG', '01/06/2014'),
new Documentos(3, 'OUTROS', '10/10/2013'));

or

$documentos = array(
new Documentos(3, 'OUTROS', '10/10/2013'));

or

$documentos = array();

Even if you do not return all documents, the appendix should display the RG: and CPF.

I need help finding the best solution.

    
asked by anonymous 22.07.2015 / 02:01

0 answers