{"id":523,"date":"2002-08-29T04:15:58","date_gmt":"2002-08-29T04:15:58","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=523"},"modified":"2002-08-29T04:15:58","modified_gmt":"2002-08-29T04:15:58","slug":"%ec%9e%91%ec%9d%80-%eb%8b%ac%eb%a0%a5-%ed%91%9c%ec%8b%9c%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=523","title":{"rendered":"\uc791\uc740 \ub2ec\ub825 \ud45c\uc2dc\ud558\uae30"},"content":{"rendered":"<p><?php <br \/>\n\/\/*       calendar \uc6a9.. <\/p>\n<p>\/\/\ud45c\uc2dc\ud558\uace0\uc790 \ud558\ub294 \uc6d4 \uac12 \ucd08\uae30\ud654 <br \/>\n$cur_date = isset($cur_date) ? strtotime($cur_date) : time(); <\/p>\n<p>\/\/\uc694\uc77c\uc758 \uc2dc\uc791\uc744 \uc124\uc815(\uc77c\uc694\uc77c\uc774\uba74 0, \uc6d4\uc694\uc77c\uc774\uba74 1) <br \/>\n$start_dayofweak = 0;\/\/0-sunday , 1-monday <\/p>\n<p>\/\/\ub2ec\ub825\uc815\ubcf4 : \ub2ec\ub825\uc5d0\uc11c \ud45c\uc2dc\ud558\ub294 \uccab\ub0a0\uacfc \ub9c8\uc9c0\ub9c9\ub0a0\uc758 \uc815\ubcf4 <br \/>\n$calendar = getCalendarInfo($cur_date,$start_dayofweak); <br \/>\n$day_term = 60*60*24; <\/p>\n<p>\/\/\uc804\uc6d4\uacfc \ub2e4\uc74c\uc6d4 : \ub9c1\ud06c\uc704\ud574 \uc0ac\uc6a9 <br \/>\n$before_cur_date = date(&#8220;Y-m-d&#8221;,mktime(0,0,0,date(&#8220;m&#8221;,$cur_date)-1,1,date(&#8220;Y&#8221;,$cur_date))); <br \/>\n$next_cur_date = date(&#8220;Y-m-d&#8221;,mktime(0,0,0,date(&#8220;m&#8221;,$cur_date)+1,1,date(&#8220;Y&#8221;,$cur_date))); <\/p>\n<p>echo &#8221; <\/p>\n<table border=0 cellpadding=2 cellspacing=0><\/p>\n<tr><\/p>\n<td colspan=5><b>&#8220;.strftime(&#8216;%B, %Y&#8217;,$cur_date).&#8221;<\/b><\/td>\n<p><\/p>\n<td colspan=2 align='right'><b> <br \/>\n              <a href='$PHP_SELF?cur_date=$before_cur_date'><<\/a>&nbsp;&nbsp; <br \/>\n              <a href='$PHP_SELF?cur_date=$next_cur_date'>><\/a> \n       <\/td>\n<p>\n<\/tr>\n<p><\/p>\n<tr align=center bgcolor='#DDDDDD'>&#8220;; <br \/>\nfor($i = 0;$i<7;$i++)       echo \"\n\n<td width=30>&#8220;.substr(date(&#8220;l&#8221;,intval($calendar[startdate]+$i*$day_term)),0,1).&#8221;<\/td>\n<p>&#8220;; <br \/>\necho &#8220;<\/tr>\n<p>&#8220;; <\/p>\n<p>$disp_type = 0;       \/\/0:no month, 1:with month <br \/>\n$_disp_month = 0; <\/p>\n<p>$_cnt = 0; <br \/>\nwhile(1){ <br \/>\n       \/\/\ud45c\uc2dc\ud560 \ub0a0\uc9dc <br \/>\n       $display_date = intval($calendar[startdate]+$_cnt*$day_term); <\/p>\n<p>       \/\/\uc0c9\uae54 <br \/>\n       switch(strftime(&#8220;%w&#8221;,$display_date)){ <br \/>\n       case 0:       \/\/sun <br \/>\n              $fontstyle = &#8220;<font style='color:red'>&#8220;;break; <br \/>\n       case 6:\/\/sat <br \/>\n              $fontstyle = &#8220;<font style='color:blue'>&#8220;;break; <br \/>\n       default: <br \/>\n              $fontstyle = &#8220;<font style='color:black'>&#8220;;break; <br \/>\n       } <br \/>\n       if(date(&#8220;m&#8221;,$cur_date)!=date(&#8220;m&#8221;,$display_date)) <br \/>\n              $fontstyle = &#8220;<font style='color:gray'>&#8220;; <\/p>\n<p>       if(strtotime(date(&#8220;Y-m-d&#8221;)) == $display_date)       $fontstyle.=&#8221;<b>&#8220;; <\/p>\n<p>       \/\/\ucd9c\ub825 <br \/>\n       if(!$_disp_month): <br \/>\n              $date_str = date(&#8220;m\/d&#8221;,$display_date); <br \/>\n              $_disp_month = true; <br \/>\n       else: <br \/>\n              if(intval(date(&#8220;d&#8221;,$display_date)) == 1) { <br \/>\n                     $date_str = date(&#8220;m\/d&#8221;,$display_date); <br \/>\n              } else { <br \/>\n                     $date_str = date(&#8220;d&#8221;,$display_date); <br \/>\n              } <br \/>\n       endif; <\/p>\n<p>       echo sprintf(&#8220;%s<\/p>\n<td>%s%s<\/td>\n<p>%s&#8221;,(($_cnt%7 == 0) ? &#8220;<\/p>\n<tr align=center>&#8221; : &#8220;&#8221;),$fontstyle,$date_str,((!$_cnt%7 == 6) ? &#8220;<\/tr>\n<p>&#8221; : &#8220;&#8221;)); <\/p>\n<p>       if($display_date==$calendar[enddate]) break; <\/p>\n<p>       $_cnt++; <br \/>\n} <\/p>\n<p>\n\/\/*       \ud574\ub2f9\uc6d4 \ub2ec\ub825\uc815\ubcf4 <br \/>\nfunction getCalendarInfo($date,$start_dayofweak = 0){ <\/p>\n<p>       $_date = is_numeric($date) ? $date : strtotime($date); <\/p>\n<p>       $info = array(); <br \/>\n       \/\/\uadf8\ub2ec\uc758 \uccab\ub0a0 <br \/>\n       $info[firstdate] = mktime(0,0,0,date(&#8220;m&#8221;,$_date),1,date(&#8220;Y&#8221;,$_date)); <br \/>\n       \/\/\uadf8\ub2ec\uc758 \ub9c8\uc9c0\ub9c9\ub0a0 <br \/>\n       $info[lastdate] = mktime(0,0,0,date(&#8220;m&#8221;,$_date)+1,0,date(&#8220;Y&#8221;,$_date)); <br \/>\n       \/\/\ub2ec\ub825\uc2dc\uc791\uc77c <br \/>\n       $info[startdate] = $info[firstdate] + 60*60*24*intval($start_dayofweak-strftime(&#8220;%w&#8221;,$info[firstdate])); <br \/>\n       \/\/\ub2ec\ub825\uc885\ub8cc\uc77c <br \/>\n       $info[enddate] = $info[lastdate] + 60*60*24*intval($start_dayofweak-strftime(&#8220;%w&#8221;,$info[lastdate])+6); <br \/>\n       return $info; <br \/>\n} <br \/>\n?><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-523","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=523"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/523\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}