0
Good afternoon, I have a list of patients, where displays files through a href
giving to visualize them, i want to display an image instead of a "link" (as it is in the picture below) and when I hover over the image, the file name appears. But only in data that has registered files...
I don’t know what to do, I think you should use IF
and ELSE
...
My table fields: educacao_fisica, enfermagem, nutricao, pedagogia, terapia_ocupacional, servicos_sociais.
PROBLEM: The image appears in all fields, even without having files in this X field.
Page code (list_report.php):
<?php
require('conexaobd.php');
$sql = "SELECT * FROM relatorio";
$resultado = mysqli_query($link, $sql);
$inc = 0;
while ($cont = mysqli_fetch_array($resultado)) {
echo "
<tr>
<td>".$cont['paciente']."</td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadsed/".$cont['relatorio_educacao_fisica']."' target='_blank'>".$cont['relatorio_educacao_fisica']."<img src='http://icons.iconarchive.com/icons/zhoolego/material/512/Filetype-Docs-icon.png' style='width:30px; height:30px;cursor:pointer;'></a></td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadsenf/".$cont['relatorio_enfermagem']."' target='_blank'>".$cont['relatorio_enfermagem']."</a></td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadsnut/".$cont['relatorio_nutricao']."' target='_blank'>".$cont['relatorio_nutricao']."</a></td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadsped/".$cont['relatorio_pedagogia']."' target='_blank'>".$cont['relatorio_pedagogia']."</a></td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadster/".$cont['relatorio_terapia_ocupacional']."' target='_blank'>".$cont['relatorio_terapia_ocupacional']."</a></td>
<td><a style='color: Blue' href='ver-arquivo.php?documento=uploads/uploadser/".$cont['relatorio_servicos_sociais']."' target='_blank'>".$cont['relatorio_servicos_sociais']."</a></td>
</tr>
";
}
?>
Anybody got any ideas? Thanks.
If there is no file, which returns in this variable
$cont['relatorio_educacao_fisica']
?– Pedro Henrique
Returns nothing, stays blank
– user175046
And when there is no file, what will be shown?
– Pedro Henrique
Nothing either '-', Example: https://prnt.sc/qu4q5y
– user175046
Leaving something like ? https://prntscr.com/qu4was
– Pedro Henrique
That, then when you hover the mouse over a file, display the name of that file, understand?
– user175046
https://prntscr.com/qu4xw8, see if that’s it
– Pedro Henrique
Let’s go continue this discussion in chat.
– user175046