I'm having a demand for a php system.
I am listing documents from a certain directory that is on the server in my html page
<div class="tab-pane" id="docs">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Documento</th>
</tr>
</thead>
<tbody>
<?php
$result = mysql_query("SELECT * FROM gr_documento
WHERE id_entidade_documento = ". $_GET['id']."
AND tipo = 1");
while ($row = mysql_fetch_array($result)) {
?>
<tr>
<td><a href="/upload/docs/<?php echo $row['novo_nome']?>" target=“_blank” ><?php echo $row['nome_documento']?></a></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
I wonder if it is possible for me to create a column on the left only that an icon appears per the extension. Ex:
If the file has a .pdf extension, display a PDF linked icon If the file has the .xls extension display an attached icon to Excel If the file has the .doc extension display an icon linked to Word If the file has a .txt extension with a TXT-connected icon
I do not know if there is a function that performs this process. Can you help me?