여기서 어떻게 지난 날짜일정은 나타안나게 할수잇나요 현재는 한달일정 모두 표시됩니다
본문
<div id="day1">
</div>
<?php $_NUM1 = getDbRows($table[$m.'ticket'],'category='.$R['category'].' and schedule='.$R['uid'].' and sday='.$sday1);?>
<?php if(!$_NUM1):?>
<li style="width:500px;">출발 일정이 없습니다.<li>
<?php else:?>
<?php $_TCD = getDbArray($table[$m.'ticket'],'category='.$R['category'].' and schedule='.$R['uid'].' and sday='.$sday1,'*','sdate','asc',0,1);?>
<?php $i=0; while($_T=db_fetch_array($_TCD)):?>
<li><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $m?>&mod=view&uid=<?php echo $R['uid']?>&sdate=<?php echo $_T['sdate']?>" style="color:<?php if($_T['step']==0):?>gray<?php elseif($_T['step']==1):?>green<?php elseif($_T['step']==2):?>blue<?php elseif($_T['step']==3):?>red<?php endif?>;"><?php echo substr($_T['sdate'],6,2)?></a></li>
<?php $i++; endwhile?>
<?php endif?>
</ul>
</div>
여기서 어떻게 지난 날짜일정은 나타안나게 할수잇나요 현재는 한달일정 모두 표시됩니다.
답변 1
<?php $i=0; while($_T=db_fetch_array($_TCD)):?>
<li><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $m?>&mod=view&uid=<?php echo $R['uid']?>&sdate=<?php echo $_T['sdate']?>" style="color:<?php if($_T['step']==0):?>gray<?php elseif($_T['step']==1):?>green<?php elseif($_T['step']==2):?>blue<?php elseif($_T['step']==3):?>red<?php endif?>;"><?php echo substr($_T['sdate'],6,2)?></a></li>
<?php $i++; endwhile?>
//$_T['sdate'] << 이게 날짜 기준이라고 한다면요.
<?php $i=0; while($_T=db_fetch_array($_TCD)):?>
<?if($_T['sdate'] > date("Y-m-d")){// 기준날짜가 현재보다 크다면?> // 추가
<li><a href="<?php echo $g['s']?>/?r=<?php echo $r?>&m=<?php echo $m?>&mod=view&uid=<?php echo $R['uid']?>&sdate=<?php echo $_T['sdate']?>" style="color:<?php if($_T['step']==0):?>gray<?php elseif($_T['step']==1):?>green<?php elseif($_T['step']==2):?>blue<?php elseif($_T['step']==3):?>red<?php endif?>;"><?php echo substr($_T['sdate'],6,2)?></a></li>
<?}?> // 추가
<?php $i++; endwhile?>
날짜가 2015-05-05 라면 위에처럼 하시면되고요 2015.05.05 이러면 date("Y.m.d") 이런식으로 하시면되요.