리스트 진행중,대기중,중지 아이콘출력
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://hellpa1987.ruatic.net/bbs/board.php?bo_table=board2&wr_id=6&page=0&sca=&sfl=&stx=&sst=&sod=&spt=0&page=0¤tId=5
이벤트 게시판을 손보고 있어용
현재 글쓰기페이지에 날짜 지정을 하고 작성을 합니다. 그러면
리스트에 아이콘 출력이
지정한 날짜 안에 들어가있으면 [진행중]아이콘 출력
지정한 날짜 전이면 [대기중]아이콘 출력
지정한 날짜 후면 [종료] 아이콘 출력
이렇게 되야하는데
진행중은 잘됩니다만 -_- 지정날짜 전에도 종료. 후에도 종료 +_+ 장난똥때리나..
고수님들 갈켜주십쇼! ㅎ
<?php
//남은 날이 - 이면, 이벤트 기간이 끝나면..
if($start_time <= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-ing.gif' alt='진행중' /></span>";
} else{
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-end.gif' alt='종료' /></span>";
} else{
if($start_time >= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-hold.gif' alt='대기중' /></span>";
}
?>
오류 주소 : http://hellpa1987.ruatic.net/bbs/board.php?bo_table=board2&wr_id=6&page=0&sca=&sfl=&stx=&sst=&sod=&spt=0&page=0¤tId=5
이벤트 게시판을 손보고 있어용
현재 글쓰기페이지에 날짜 지정을 하고 작성을 합니다. 그러면
리스트에 아이콘 출력이
지정한 날짜 안에 들어가있으면 [진행중]아이콘 출력
지정한 날짜 전이면 [대기중]아이콘 출력
지정한 날짜 후면 [종료] 아이콘 출력
이렇게 되야하는데
진행중은 잘됩니다만 -_- 지정날짜 전에도 종료. 후에도 종료 +_+ 장난똥때리나..
고수님들 갈켜주십쇼! ㅎ
<?php
//남은 날이 - 이면, 이벤트 기간이 끝나면..
if($start_time <= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-ing.gif' alt='진행중' /></span>";
} else{
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-end.gif' alt='종료' /></span>";
} else{
if($start_time >= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-hold.gif' alt='대기중' /></span>";
}
?>
댓글 4개
m7102
12년 전
순서상의 문제일듯싶습니다. ^^
<?
//남은 날이 - 이면, 이벤트 기간이 끝나면..
if($start_time <= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-ing.gif' alt='진행중' /></span>";
} else if($start_time >= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-hold.gif' alt='대기중' /></span>";
} else{
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-end.gif' alt='종료' /></span>";
}
?>
<?
//남은 날이 - 이면, 이벤트 기간이 끝나면..
if($start_time <= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-ing.gif' alt='진행중' /></span>";
} else if($start_time >= $current_time && $end_time >= $current_time){
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-hold.gif' alt='대기중' /></span>";
} else{
echo "<span class='icon-state'><img src='$board_skin_path/img/icon_event-end.gif' alt='종료' /></span>";
}
?>
돼지코구뇽
12년 전
ㅡ,.ㅡ아우 마이갓뜨 거꿀로 하고있었군요
m7102
12년 전
근데 기준점이 있어야해요..
제생각은 이렇게 하고 싶어요..
현재시간만 수정해보시면 의미를 아실듯..
<?
$start_time="2012-12-15"; //시작시간
$end_time="2012-12-18"; // 마감시간
$current_time="2012-12-19"; // 현재시간
$close_time="2012-12-20"; //종료시간
// 시작시간과 마감시간 이내라면 진행중
if($start_time <= $current_time && $end_time >= $current_time){
echo "진행중";
// 현재시간이 마감시간보다 크거나 종료시간보다 작을경우
} else if($end_time <= $current_time && $close_time >= $current_time){
echo "대기중";
// 현재시간이 종료시간 보다 크다 라고 판단..
} else{
echo "종료";
}
?>
제생각은 이렇게 하고 싶어요..
현재시간만 수정해보시면 의미를 아실듯..
<?
$start_time="2012-12-15"; //시작시간
$end_time="2012-12-18"; // 마감시간
$current_time="2012-12-19"; // 현재시간
$close_time="2012-12-20"; //종료시간
// 시작시간과 마감시간 이내라면 진행중
if($start_time <= $current_time && $end_time >= $current_time){
echo "진행중";
// 현재시간이 마감시간보다 크거나 종료시간보다 작을경우
} else if($end_time <= $current_time && $close_time >= $current_time){
echo "대기중";
// 현재시간이 종료시간 보다 크다 라고 판단..
} else{
echo "종료";
}
?>
돼지코구뇽
12년 전
$start_time="여분필드8"; //시작시간
$end_time="여분필드9"; // 마감시간
$current_time="컴퓨터시간"; // 현재시간
$close_time="여분필드7"; //종료시간
감사합니다
$end_time="여분필드9"; // 마감시간
$current_time="컴퓨터시간"; // 현재시간
$close_time="여분필드7"; //종료시간
감사합니다
게시글 목록
| 번호 | 제목 |
|---|---|
| 284438 | |
| 284437 | |
| 284435 | |
| 284430 | |
| 284420 | |
| 284417 | |
| 284409 | |
| 284401 | |
| 284399 | |
| 284397 | |
| 284380 | |
| 284378 | |
| 284371 | |
| 284370 | |
| 284366 | |
| 284364 | |
| 284360 | |
| 284357 | |
| 284355 | |
| 284354 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기