Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá, gostaria de auxílio em como exibir uma imagem no lugar do sexo, por exemplo se for do sexo Masculino exibir o símbolo de marte, e se Feminino o símbolo de vênus.
seguem os arquivos:
arquivo que mostra os falecimentos ocorridos no mês:
CODE
<?
$pg=$_GET[pg];
$page=$_GET
$dia = "";
$mes = /*$_GET[mes];*/ date("m");
$ano = "";
$busca = "SELECT * FROM obitos WHERE data_falec LIKE '" . date(Y) . "-" . date(m). "%' ";
// termina a função para buscar a categoria
$total_reg = "$qts_ultimos";
if(!$page){
$page = "1";
}
$inicio = $page-1;
$inicio = $inicio*$total_reg;
$limite = mysql_query("$busca LIMIT $inicio,$total_reg");
$todos = mysql_query("$busca");
$tr = mysql_num_rows($todos);
$tp = ceil($tr / $total_reg);
if(mysql_num_rows($todos)>0){
// if (($todos%2)==0) { $bgcolor="#FFFFFF"; } else { $bgcolor="#C0C0C0"; }
?>
<table width="600" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><strong>Foram
encontrados <? echo "<b><font color=$coronmouse>$tr</font></b>";?> registros!<br />
<br />
Exibindo registros de <font color="<? echo $coronmouse?>"><? echo $inicio+1?></font> a <font color="<? echo $coronmouse?>">
<? if($tp == $page){ echo $tr; } else { echo $inicio+$total_reg;}?>
</font></strong></td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td height="1" colspan="2" background="images/layout/barrinha_divisao_horizontal.gif"></td>
</tr>
<tr>
<td height="5" colspan="2"></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center">
<td bgcolor="#99ccff"><b>Nome</b></td>
<td bgcolor="#99ccff"><img src="images/estrela.gif" width="20" height="18" /></td>
<td colspan="2" bgcolor="#C0C0C0"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45%" bgcolor="#99ccff"><div align="center"><strong><img src="images/cruz.gif" width="20" height="18" /></strong></div></td>
<td width="28%" bgcolor="#99ccff"><div align="center"><strong>Local</strong></div></td>
<td width="27%" bgcolor="#99ccff"><div align="center"><strong>Idade</strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5" colspan="4"></td>
</tr>
<? while ($dados=mysql_fetch_array($limite)) {?>
<tr align="center">
<td width="178" align="left"><div align="left"><b>
<?=$dados[nome]?>
</b></div></td>
<td width="158" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%"> </td>
<td width="88%"><div align="center"><strong>
<? $data=explode("-", $dados[data_nasc]); echo "$data[2]/$data[1]/$data[0]";?>
</strong></div></td>
</tr>
</table></td>
<td width="316" align="center"><table width="98%" height="23" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="51%"><div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%"> </td>
<td width="86%"><div align="center"><strong>
<? $data=explode("-", $dados[data_falec]); echo "$data[2]/$data[1]/$data[0]";?>
</strong></div></td>
</tr>
</table>
</div></td>
<td width="49%"><div align="center"><b><? echo "$dados[cidade_falec]";?></b></div></td>
</tr>
</table>
<a href=""></a></td>
<td width="74" align="center"><b>
<?=$dados[idade] ?>
</b><strong>Anos</strong></td>
</tr>
<tr>
<td height="5" colspan="6" background="images/layout/barrinha_divisao_horizontal.gif"></td>
</tr>
<tr>
<td height="1" colspan="6" background="../images/layout/barrinha_divisao_horizontal.gif"></td>
</tr>
<tr>
<td height="5" colspan="6"></td>
</tr>
<? }?>
<tr>
<td colspan="6"><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" align="right" valign="top"><?
if($page > 1){
$anterior = $page -1;
$url = "?pg=$pg&page=$anterior";
echo "<a href='$url'>« Anterior</a> |";
} else {
echo "<font color='$corcelula2'>« Anterior</font> |";
}
?>
</td>
<td align="center"><?
for($x=1; $x<=$tp; $x++){
$url = "?pg=$pg&page=$x";
if ($x==$page) {
echo "<font color='$coronmouse'><b>$x</b></font>|";
} else {
echo "<a href='$url'>$x</a>|";
}
}
?>
</td>
<td width="100" align="left" valign="top"><?
if($tp > $page){
$proxima = $page +1;
$url = "?pg=$pg&page=$proxima";
echo " <a href='$url'>Próxima »</a>";
} else {
echo " <font color='$corcelula2'>Próxima »</font>";
}
?>
</td>
</tr>
</table></td>
</tr>
</table>
<br />
<br />
<? } else {?>
<br />
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="bottom"><br />
<br />
<br />
<br />
<font color="#006600"><strong>Neste mês não houve nenhum falecimento!</strong></font><br />
<br />
<br />
</td>
</tr>
</table>
<? } ?>
<br>
;
e o banco de dados de onde vem as informações:
CODE
--
-- Estrutura da tabela obitos
--
CREATE TABLE `obitos` (
`id_obito` int(11) NOT NULL auto_increment,
`nome` varchar(50) NOT NULL,
`sobrenome` varchar(50) NOT NULL,
`sexo` varchar(10) NOT NULL,
`data_nasc` date NOT NULL,
`cidade_nasc` varchar(50) NOT NULL,
`estado_nasc` varchar(2) NOT NULL,
`data_falec` date NOT NULL,
`cidade_falec` varchar(50) NOT NULL,
`estado_falec` varchar(2) NOT NULL,
`nota` longtext NOT NULL,
`idade` varchar(3) NOT NULL,
PRIMARY KEY (`id_obito`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
--
-- Extraindo dados da tabela obitos
--
INSERT INTO `obitos` VALUES (12, 'pafuncio', 'pafuncio', 'M', '1935-02-21', 'Altamira', 'SC', '2008-08-12', 'Caçador', '', 'nota', '73');
INSERT INTO `obitos` VALUES (6, 'chico', 'ruas', 'M', '1978-07-21', 'peninha', 'SC', '2008-07-20', 'Caçador', 'SC', 'teste', '29');
INSERT INTO `obitos` VALUES (13, '77777777777777', '777777777777777777', 'F', '1911-11-11', 'Caçador', 'SC', '2008-08-18', 'Caçador', '', '', '96');
INSERT INTO `obitos` VALUES (11, 'rrrrrrrrrrrr', 'eeeeeeeeeeeee', 'M', '2000-12-20', 'Caçapava', 'RS', '2008-07-24', 'Caçador', 'PE', '', '7');
gostaria de mostrar ao lado do nome o símblo referente ao sexo da pessoa.
não tenho idéia de como fazer isso, se puderem me auxiliar eu agradeço.
Carregando comentários...