코멘트 유무로 대기 완료 list.skin.php 에 표시하는 소스중에.. 정보
코멘트 유무로 대기 완료 list.skin.php 에 표시하는 소스중에..본문
일단 php 코딩을 전혀 모르는 사람입니다 ㅠ
아래 소스는
코멘트가 없으면 대기 이미지가 뜨고
코멘트가 있으면 완료 이미지가 뜹니다.
추가하고 싶은건 코멘트가 1개이상, 즉 코멘트 2개부터는
완료2 가 표시되게 하고싶은데
else if 를 써봐도 안되네요 ㅠ
도움을 요청합니다!
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo "<img src='$board_skin_path/img/icon_standby.gif' width='50' height='18' alt='입금대기' />";
} else {
echo "<img src='$board_skin_path/img/icon_select.gif' width='50' height='18' alt='예약완료' />";
}
?>
아래 소스는
코멘트가 없으면 대기 이미지가 뜨고
코멘트가 있으면 완료 이미지가 뜹니다.
추가하고 싶은건 코멘트가 1개이상, 즉 코멘트 2개부터는
완료2 가 표시되게 하고싶은데
else if 를 써봐도 안되네요 ㅠ
도움을 요청합니다!
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo "<img src='$board_skin_path/img/icon_standby.gif' width='50' height='18' alt='입금대기' />";
} else {
echo "<img src='$board_skin_path/img/icon_select.gif' width='50' height='18' alt='예약완료' />";
}
?>
댓글 전체
if ($total_count == 0) {
echo "<img src='$board_skin_path/img/icon_standby.gif' width='50' height='18' alt='입금대기' />";
} else if ($total_count == 1) {
echo "<img src='$board_skin_path/img/icon_select.gif' width='50' height='18' alt='예약완료' />";
} else
{
echo "<img src='$board_skin_path/img/icon_select2.gif' width='50' height='18' alt='예약완료2' />";
}
이렇게 하면 댈꺼같습니다
echo "<img src='$board_skin_path/img/icon_standby.gif' width='50' height='18' alt='입금대기' />";
} else if ($total_count == 1) {
echo "<img src='$board_skin_path/img/icon_select.gif' width='50' height='18' alt='예약완료' />";
} else
{
echo "<img src='$board_skin_path/img/icon_select2.gif' width='50' height='18' alt='예약완료2' />";
}
이렇게 하면 댈꺼같습니다