늘 고수님들의 도움으로 먹그 살고 있습니다. ㅋ
감사합니다.
td안에 백그라운드 이미지를 적용하는 건데요..
<td colspan="4" class="right" style="background-image: url('../images/<?php if($list[$i][wr_19] == stop){?>stop.png"<?php } else if($list[$i][wr_19] == ok){?>ok.png');" <?php } ?>
>
</td>
잘되는데..
stop도 ok도 아닐때는 백그라운드 이미지 적용안되게 하려면 어떻게 해야하는지..
어디서 본거같은데 생각이 안나네요,,,
if ~
else if ~
그담에 stop도 ok도 아닐 때요,,
냉정하게 말하며 방향보다
코드가 필요해여..ㅋ
재야님이 다음과 같이 하라고 해서 해봤는데 테이블이 밀리고 여러가지로 해봐도 안되네요,.
td 안에서 처리해야 할 거 같은데..
<?php if ($list[$i][wr_19] !== stop || $list[$i][wr_19] !== ok) { ?>
<td colspan="4" class="right">
<?php } else { ?>
<td colspan="4" class="right" style="background-image: url('../images/<?php if($list[$i][wr_19] == stop){?>stop.png"<?php } else if($list[$i][wr_19] == ok){?>ok.png');" <?php } ?>
>
답변 2개 / 댓글 2개
<?php
if($list[$i][wr_19] == '일본어 거시기") {
$test = '일본어 거시기 일때 이미지.png';
} else if($list[$i][wr_19] == '일본어 머시기") {
$test = '일본어 머시기 일때 이미지.png';
} else if($list[$i][wr_19] == '영문 거시기") {
$test = '영문 거시기 일때 이미지.png';
} else if($list[$i][wr_19] == '영문 머시기") {
$test = '영문 머시기 일때 이미지.png';
} else {
$test = '이도 저도 아닌 이미지.png';
}
?>
<td colspan="4" class="right" style="background-image: url('../images/<?php echo $test; ?>');">
또는
<?php
if($list[$i][wr_19] == '일본어 거시기" || $list[$i][wr_19] == '일본어 머시기") {
$test = '일본어 거시기 머시기 일때 이미지.png';
} else if($list[$i][wr_19] == '영문 거시기" || $list[$i][wr_19] == '영문 머시기") {
$test = '영문 거시기 머시기 일때 이미지.png';
} else {
$test = '이도 저도 아닌 이미지.png';
}
?>
<td colspan="4" class="right" style="background-image: url('../images/<?php echo $test; ?>');">
답변에 대한 댓글 1개
<?php
$test = ($list[$i][wr_19]) ? $list[$i][wr_19].'png' : ''; // 값 있으면 해당값.png, 없으면 공백
?>
<td colspan="4" class="right" style="background-image: url('../images/<?php echo $test; ?>');">
또는
<td colspan="4" class="right" style="background-image: url('../images/<?php echo ($list[$i][wr_19]) ? $list[$i][wr_19].'png' : ''; ?>');">
답변에 대한 댓글 1개
wr_19값이 영어가 아니라 중국어나 일본어라서,,,
이미지 파일명을 중국어나 일본어로 올릴 수 없는 상황이라 어렵네요..알ftp로 안올라가서
답변을 작성하려면 로그인이 필요합니다.
욜마들을 깔끔하게 정리해주시네요,,