혹시 간단한 달력 소스 하나 만들어줄수있나요 ?..

혹시 간단한 달력 소스 하나 만들어줄수있나요 ?..

QA

혹시 간단한 달력 소스 하나 만들어줄수있나요 ?..

답변 4

본문

진짜 달력처럼 말고 그냥 이번달 1~30 까지 숫자로 그냥 출력 되게끔 ....ㅜ_ㅜ..

이 질문에 댓글 쓰기 :

답변 4

http://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=71515

심플한 달력이네요. 


<?php
if(!$year_cal)
{
 $year_cal = date("Y");
}
if(!$month_cal)
{
 $month_cal = date("m");
}
if(!$day_cal)
{
 $day_cal = date("j");
}
$next_year = date("Y",strtotime($year_cal."-".$month_cal."-".$day_cal."+1 year"));
$prev_year = date("Y",strtotime($year_cal."-".$month_cal."-".$day_cal."-1 year"));
$time = strtotime($year_cal.'-'.$month_cal.'-01'); 
list($tday, $sweek) = explode('-', date('t-w', $time));  // 총 일수, 시작요일 
$tweek = ceil(($tday + $sweek) / 7);  // 총 주차 
$lweek = date('w', strtotime($year_cal.'-'.$month_cal.'-'.$tday));  // 마지막요일 
$holiday_array = array //2013년 휴일
     (
      "1"=>array("1"=>"신정", "22"=>"구정", "23"=>"구정", "24"=>"구정"),
      "2"=>array(),
      "3"=>array("1"=>"삼일절"),
      "4"=>array("5"=>"식목일"),
      "5"=>array("5"=>"어린이날", "28"=>"석가탄신일"),
      "6"=>array("6"=>"현충일"),
      "7"=>array(),
      "8"=>array("15"=>"광복절"),
      "9"=>array("29"=>"추석", "30"=>"추석"),
      "10"=>array("1"=>"추석", "3"=>"개천절"),
      "11"=>array(),
      "12"=>array("25"=>"성탄절")
     );
?>
<html>
<head><title>::달력::</title>
<link rel="stylesheet" type="text/css" href="../bbs_file/style.css">
</head>
<body topmargin=0>
<table cellpadding=0 cellspacing=0 width="90%" align=center border=0 height="100%">
<tr><td>
<!--제목-->
<table cellpadding=5 cellspacing=0 width="100%" align=center height="100%">
<tr>
 <td align=center><font style="text-decoration:none;font-size:12px;font-weight:bold"><?=$year_cal?>년 <?=$month_cal?>월</font></td>
</tr>

</table>
</td></tr>
<tr height=2><td></td></tr>
<tr><td>
<!--내용-->
<table width='100%' cellpadding='3' cellspacing='1' border='0' align=center height="100%"> 
 <tr> 
 <th align=center bgcolor="#7abae4">일</th> 
 <th align=center bgcolor="#7abae4">월</th> 
 <th align=center bgcolor="#7abae4">화</th> 
 <th align=center bgcolor="#7abae4">수</th> 
 <th align=center bgcolor="#7abae4">목</th> 
 <th align=center bgcolor="#7abae4">금</th> 
 <th align=center bgcolor="#7abae4">토</th> 
 </tr> 
 <? for ($n=1,$i=0; $i<$tweek; $i++) { ?> 
 <tr> 

  <? for ($k=0; $k<7; $k++) { ?> 
  <td align=center style="border:solid 1px #7abae4"> 
   <?
   if ($k =="0") //일요일
   {
   $color="red";
   }
   elseif ($k =="6") //토요일
   {
   $color="blue";
   }
   else // 평일
   {
   $color="black";
   }
   ?>
   <? if (!(($i == 0 && $k < $sweek) || ($i == $tweek-1 && $k > $lweek))) { ?> 
    <?
    if ($n==date("d")) //오늘
    {
    $color="orange";
    }
    ?>
 <? if($year_cal==2012 && $holiday_array[(int)$month_cal][$n]) $color=red; ?>
     <font color="<?=$color?>"><?=$n?></font>
    <?
    $n++
    ?>
    <? } //if?> 
  <br><!--td채우기-->
  </td> 
  <? } //for?> 
 </tr> 
 <? } //for?> 
</table> 
</td></tr>
</table>

</body>
</html>​
 

웹 상에 공개되어 있는것인데 참고하세요.

제작의뢰로 .... ㅋㅋㅋㅋ - 3-;; 죄송

익명닉네임께 부탁 하면 하나 뚝딱 만들어 주십니다. 응? 

음.. 그랬죠 .. 근데 하나의 공부가 더 남았지요.. 출석부 업데이트 해서 배포할려고 준비중이죠 .. 근대 출석부에 달력을 넣었어요 ~ 성공은햇어요 !! 이제 남은건 날짜 인식해서 출석했는지 안했는지 인식하는걸 만들어야 되요 ㅎㅎ 일이 커지네

날짜인식해서 출석도장 찍어주는거 만드세요....^^
익명닉네임님께서 만들면 별로 어렵진 않으실꺼예요.

전 JS빌더 그누4 버전때 만들어 둔게 있어서 그누5로 변환만 하면 되거든요....ㅎㅎ
안되면 익명닉네임님이 만든걸 쓸쩍.....

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 29
© SIRSOFT
현재 페이지 제일 처음으로