일정(달력)관리에서 오늘의 일정만 불러오려면 어떻게 해야 하나요?
일정(달력)관리에서 오늘의 일정만 불러오려면 어떻게 해야 하나요?
오늘의 일정이 없으면 "오늘 일정이 없습니다." 이렇게 나오고..
오늘 날짜를 조건 값으로 넣으면 될것 같은데....
부탁드립니다..
<-----------------------------schedule 쏘스---------------------------->
<?
echo "<table cellpadding=3 cellspacing=0 border=0 width=100%><tr><td height=1 bgcolor='#cccccc'></td></tr><tr>";
echo "<table cellpadding=3 cellspacing=0 border=0 width=100%><tr><td height=1 bgcolor='#cccccc'></td></tr><tr>";
//count는 <tr>태그를 넘기기위한 변水요일. 변水요일값이 7이되면 <tr>태그를 삽입한다.
$count=0;
//첫번째 주에서 빈칸을 1日요일전까지 빈칸을 삽입
for($i=0; $i<$first; $i++){
echo "";
$count++;
}
//===========날짜를 테이블에 표시=================//
for($day=01;$day<=$total_day;$day++){
$count++;
for($day=01;$day<=$total_day;$day++){
$count++;
$day=sprintf("%02d",$day);
//오늘 표시
if($day==$t_day && $month==$t_month && $year==$t_year){
if($day==$t_day && $month==$t_month && $year==$t_year){
$bgc = "bgcolor='#EFEFEF'";
if ($count==1) {$day_color=$sun_color;$message="(日요일)";}
else if ($count==2) {$day_color=$else_color;$message="(月요일)";}
else if ($count==3) {$day_color=$else_color;$message="(火요일)";}
else if ($count==4) {$day_color=$else_color;$message="(水요일)";}
else if ($count==5) {$day_color=$else_color;$message="(木요일)";}
else if ($count==6) {$day_color=$else_color;$message="(金요일)";}
else if ($count==7) {$day_color=$sat_color;$message="(土요일)";}
else if ($count==2) {$day_color=$else_color;$message="(月요일)";}
else if ($count==3) {$day_color=$else_color;$message="(火요일)";}
else if ($count==4) {$day_color=$else_color;$message="(水요일)";}
else if ($count==5) {$day_color=$else_color;$message="(木요일)";}
else if ($count==6) {$day_color=$else_color;$message="(金요일)";}
else if ($count==7) {$day_color=$sat_color;$message="(土요일)";}
}
else {//오늘이 아니면...
if ($month==1 && $day==1 || $month==3 && $day==1 || $month==4 && $day==5 || $month==5 && $day==5 || $month==6 && $day==6 || $month==7 && $day==17 || $month==8 && $day==15 || $month==10 && $day==3 || $month==12 && $day==25) { // 즐거운 공휴日요일
$bgc = "bgcolor='#FFEFE8'";
$day_color=$sun_color;
if ($count==1) { $message="(일요일)"; }
else if ($count==2) { $message="(월요일)"; }
else if ($count==3) { $message="(화요일)"; }
else if ($count==4) { $message="(수요일)"; }
else if ($count==5) { $message="(목요일)"; }
else if ($count==6) { $message="(금요일)"; }
else if ($count==7) { $message="(토요일)"; }
}
elseif ($count==1) {//일요일
$day_color=$sun_color;
$bgc = "bgcolor='#FFEFE8'";
$message="(일요일)";
$day_color=$sun_color;
$bgc = "bgcolor='#FFEFE8'";
$message="(일요일)";
}
elseif ($count==2) {//월요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(월요일)";
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(월요일)";
}
elseif ($count==3) {//火요일요日요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(화요일)";
}
elseif ($count==4) {//水요일요日요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(수요일)";
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(수요일)";
}
elseif ($count==5) {//木요일요日요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(목요일)";
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(목요일)";
}
elseif ($count==6) {//金요일요日요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(금요일)";
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
$message="(금요일)";
}
elseif ($count==7) {//土요일요日요일
$day_color=$sat_color;
$bgc = "bgcolor='#ffffff'";
$message="(토요일)";
}
else { //평日요일
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
}
$day_color=$else_color;
$bgc = "bgcolor='#ffffff'";
}
}//오늘이 아니면...끝
//===========내용보이는곳 (이 부분만 수정해서 사용할것)========================
$view_date = "$year-$month-$day $message";
$view_date2 = "<font color=#CD6601 style=font-family:tahoma;font-size:10pt>".$year."년 ".$month."月요일 ".$day."日요일</font>";
$view_date2 = "<font color=#CD6601 style=font-family:tahoma;font-size:10pt>".$year."년 ".$month."月요일 ".$day."日요일</font>";
$query_y="select * from gb_write_$bo_table where wr_link2='$view_date' order by wr_id desc";
$result_y=mysql_query($query_y, $connect);
if (mysql_num_rows($result_y)) {
$p_content = ''; // 초기수...
while($file=mysql_fetch_array($result_y)) {
while($file=mysql_fetch_array($result_y)) {
if($file[wr_secret]==1) {
$wr_subject="비밀글(관리자 전용)"; // 원하는 내용쓰세요
$wr_content="^^;"; // 원하는 내용쓰세요
}
$wr_subject="비밀글(관리자 전용)"; // 원하는 내용쓰세요
$wr_content="^^;"; // 원하는 내용쓰세요
}
else if(!$file[wr_secret]==1) {
$wr_subject = cut_str($file[wr_subject],60);
$wr_content = $file[wr_content];
}
$wr_subject = cut_str($file[wr_subject],60);
$wr_content = $file[wr_content];
}
$commentcnt = $file[wr_commentcnt];
$wr_id = $file[wr_id];
$wr_link1 = $file[wr_link1];
$wr_id = $file[wr_id];
$wr_link1 = $file[wr_link1];
$p_content .= "<span style='<?=$wr_link1?>'><B><a href=./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id=$wr_id title='$wr_content'>$wr_subject</a></B></span>";
// $p_content .= $s_str;
// $p_content .= $s_str;
}
?>
<span style='cursor:hand'>
<td <?=$bgc?> align=left>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=center width=30 title='글쓰기'>
<a href='./?doc=bbs/gbform.php&w=&bo_table=<?=$bo_table?>&link2=<?=$view_date?>'>
<span style='color:<?=$day_color;?>'><b><?=$day?></b></span>
</td>
<tr>
<td align=center width=30 title='글쓰기'>
<a href='./?doc=bbs/gbform.php&w=&bo_table=<?=$bo_table?>&link2=<?=$view_date?>'>
<span style='color:<?=$day_color;?>'><b><?=$day?></b></span>
</td>
<td width=60><span style='color:<?=$day_color?>;'> <?=$message?></span></a></td>
<td width=5></td>
<td><?=$p_content?> <?=$icon_new?> </td>
<td width=30><?=$day_memo?></td>
</tr>
</table>
<td width=5></td>
<td><?=$p_content?> <?=$icon_new?> </td>
<td width=30><?=$day_memo?></td>
</tr>
</table>
</td></tr>
<tr><td height=1 bgcolor='#dddddd'></td></tr><tr>
</span>
<?
}
else {
echo "<td $bgc align=left>";
echo "<table border=0 cellpadding=0 cellspacing=0>";
echo "<tr>";
echo "<td align=center width=30 title='글쓰기'>";
echo "<a href='./?doc=bbs/gbform.php&w=&bo_table=$bo_table&link2=$view_date' onfocus=blur()>";
echo "<span style='color:$day_color;'> $day</span>";
echo "</td>";
echo "<td width=60><span style='color:$day_color;'> $message</a></span></td>";
echo "<td width=5></td>";
echo "<td></td>";
echo "<td width=30>$day_memo</td>";
echo "</tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td height=1 bgcolor='#cccccc'></td></tr><tr>";
}
echo "<tr><td height=1 bgcolor='#cccccc'></td></tr><tr>";
}
//================내용보이는곳 끝==================================
if($count==7 && $day == $total_day ){ //마지막주의 경우
echo"</tr>";
}
elseif($count==7){ //토요일이 되면 색바꾸기 위한 식
echo "";
$count=0;
}
}
echo "</table>";
echo "</table>";
?>
댓글 11개
18년 전
1. select 쿼리를 오늘 날짜와 비교하여 오늘 입력된 데이터만 출력한다.
select * from 테이블 where 입력날짜 = '오늘날짜' 이런식으로.
2. if문을 사용하여 오늘날짜와 현재 들어가있는 데이터의 입력날짜를 비교하여 출력을 제어한다. if(오늘날짜 == '입력된날짜') 이런식으로...
select * from 테이블 where 입력날짜 = '오늘날짜' 이런식으로.
2. if문을 사용하여 오늘날짜와 현재 들어가있는 데이터의 입력날짜를 비교하여 출력을 제어한다. if(오늘날짜 == '입력된날짜') 이런식으로...
18년 전
저 그렇게 말씀하셔도 모르는뎅~~ㅠ,.ㅠ;
쏘스를 고쳐 주시면.....^^;;;;;;;;;;
쏘스를 고쳐 주시면.....^^;;;;;;;;;;
18년 전
$file[입력날짜]가 있겠죠..?
이놈을 이용하는겁니다.
오늘시간은 입력된 데이터의 형식에 맞게 받으시면 되구요
음..now()이걸쓰면되려나? ..음
여하튼
if($file[입력날짜] == '오늘날짜'){ }else{ echo"오늘일정이 없습니다."; }
이런식이 되겠죠.
이놈을 이용하는겁니다.
오늘시간은 입력된 데이터의 형식에 맞게 받으시면 되구요
음..now()이걸쓰면되려나? ..음
여하튼
if($file[입력날짜] == '오늘날짜'){ }else{ echo"오늘일정이 없습니다."; }
이런식이 되겠죠.
18년 전
입력 날짜는 예전에 입력하고 오늘은 내용이 있으면, 안되지 않나요?
입력날짜와 오늘날짠는 다른 것 같은뎅...
미리 일정을 입력할수도 있으니깐...
ㅠ,.ㅠ;
입력날짜와 오늘날짠는 다른 것 같은뎅...
미리 일정을 입력할수도 있으니깐...
ㅠ,.ㅠ;
18년 전
제가 말씀드린 입력날짜는 일정의 시작일을 말씀드리는겁니다.
ㅡ.ㅡa
입력날짜 ==> 일정의 시작일
ㅡ.ㅡa
입력날짜 ==> 일정의 시작일
18년 전
예를 들어 2월 27일 일정은 물론 오늘도 입력할수 있지만, 어제도 입력할수 있습니다.
즉, 어떤때에 입력하던간에 오늘날짜의 일정만 뽑는 것이죠...
오늘 날짜를 뽑아오고, 일정이 있으면 뿌려 주면 될것 같은데...
제가 이쪽을 잘 몰라서....
자세히 부탁합니다...가능한 위의 쏘스를 수정하여...^^;;;;;;;;
즉, 어떤때에 입력하던간에 오늘날짜의 일정만 뽑는 것이죠...
오늘 날짜를 뽑아오고, 일정이 있으면 뿌려 주면 될것 같은데...
제가 이쪽을 잘 몰라서....
자세히 부탁합니다...가능한 위의 쏘스를 수정하여...^^;;;;;;;;
18년 전
테이블 스키마좀 올려줘보세요..ㅎㅎ
그리고 기왕이면 홈피 url도요..
그리고 기왕이면 홈피 url도요..
18년 전
홈피 주소는 http://ys.inbiz.co.kr/ 이고요..
파일은
----------------------------------------------------------------------------------
<?
$today = getdate();
$b_mon = $today['mon'];
$b_day = $today['mday'];
$b_year = $today['year'];
if ($year < 1) {
$month = $b_mon;
$mday = $b_day;
$year = $b_year;
}
?>
<table cellpadding=0 cellspacing=0 align=center>
<tr>
<td height=5 align="center"><? echo ("$month".월 ."$mday".일); ?></td>
</tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i) { echo "<tr><td height=1></td></tr>"; } ?>
<tr>
<td style=line-height:170%>
<a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'>
[<?=substr($link[$i][link1],11,15)?>] <?=cut_str($list[$i][wr_content], 13, '…' )?> </a></td>
</tr>
<? if (count($list) == 0) { echo "<tr><td align=center >자료가 없습니다.</td></tr>"; } ?>
<? } ?>
</table>
파일은
----------------------------------------------------------------------------------
<?
$today = getdate();
$b_mon = $today['mon'];
$b_day = $today['mday'];
$b_year = $today['year'];
if ($year < 1) {
$month = $b_mon;
$mday = $b_day;
$year = $b_year;
}
?>
<table cellpadding=0 cellspacing=0 align=center>
<tr>
<td height=5 align="center"><? echo ("$month".월 ."$mday".일); ?></td>
</tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i) { echo "<tr><td height=1></td></tr>"; } ?>
<tr>
<td style=line-height:170%>
<a href='<?="./?doc=bbs/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'>
[<?=substr($link[$i][link1],11,15)?>] <?=cut_str($list[$i][wr_content], 13, '…' )?> </a></td>
</tr>
<? if (count($list) == 0) { echo "<tr><td align=center >자료가 없습니다.</td></tr>"; } ?>
<? } ?>
</table>
18년 전
메인에서 <? latest(calendar, scejul, 2, 15); ?> 이런 형태로 불러오는데, 즉 calendar 폴더에서 gblist.php 에서 처리합니다.
18년 전
추가하였습니당~~^^;;
18년 전
장군전사님 대단히 감사합니다.. 드릴껀 없고 포인트라도~~~~
게시글 목록
| 번호 | 제목 |
|---|---|
| 37495 | |
| 37493 | |
| 37491 | |
| 37486 | |
| 37482 | |
| 37476 | |
| 37471 | |
| 37467 | |
| 37462 | |
| 37458 | |
| 37455 | |
| 37451 | |
| 37449 | |
| 37446 | |
| 37439 | |
| 37436 | |
| 37434 | |
| 37419 | |
| 37408 | |
| 37397 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기