오늘 날짜로부터 전6일 후7일 출겨 하려고 하는데 어떻게 수정 해야 하나요?

오늘 날짜로부터 전6일 후7일 출겨 하려고 하는데 어떻게 수정 해야 하나요?

QA

오늘 날짜로부터 전6일 후7일 출겨 하려고 하는데 어떻게 수정 해야 하나요?

본문

오늘 날짜로부터  전6일 후7일 출겨 하려고 하는데 어떻게 수정 해야 하나요?

 

트리플님 일정관리 - 최근 스킨을 사용하고있는데 이거를 오늘 날짜로부터  전6일 후7일 출겨 하려고 합니다.

례를 들면 오늘10일 이면

4일     5일    6일     7일     8일    9일     10일

11일   12일   13일   14일   15일   16일    17일

이렇게 출력 하려고 합니다

 

고수님 도와주세요

감사합니다.

 

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css?ver='.G5_CSS_VER.'">', 0);

// 날짜체크
$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;
}

//달력 변경시 년, 월 불러오기.
if ($_GET["year"]) {
    $year = $_GET["year"];
}
if ($_GET["month"]) {
    $month = $_GET["month"];
}

$lastday=array(0,31,28,31,30,31,30,31,31,30,31,30,31);
if($year%4 == 0) $lastday[2] = 29;
$dayoftheweek = date("w", mktime(0,0,0,$month,1,$year));

$sca_qstr = ($qstr) ? '&'.$qstr : '';

if($month == 1) {
    $year_prev = $year - 1;
    $month_prev = 12;
    $year_next = $year;
    $month_next = $month + 1;
} else if($month == 12) {
    $year_prev = $year;
    $month_prev = $month - 1;
    $year_next = $year + 1;
    $month_next = 1;
} else {
    $year_prev = $year;
    $month_prev = $month - 1;
    $year_next = $year;
    $month_next = $month + 1;
}

if (isset($year)) {
    $year = preg_replace('/[^0-9_]/i', '', $year);
    $qstr .= '&year=' . urlencode($year);
}

if (isset($month)) {
    $month = preg_replace('/[^0-9_]/i', '', $month);
    $qstr .= '&month=' . urlencode($month);
}

// 요일
//$yoil = array("토", "일", "월", "화", "수", "목", "금");

//$write_table = $g5['write_prefix'] . $bo_table;

$schedule_table = $g5['write_prefix'].$bo_table;

$board = sql_fetch(" select * from {$g5['board_table']} where bo_table = '$bo_table' ");

?>
<style>
    .breathe-btn1 {background:url(<?php echo G5_IMG_URL ?>/01.gif) repeat-x; text-align:center; margin-bottom:2px;}
    .breathe-btn2 {background:url(<?php echo G5_IMG_URL ?>/02.gif) repeat-x; text-align:center; margin-bottom:2px;}
    .breathe-btn3 {background:url(<?php echo G5_IMG_URL ?>/03.gif) repeat-x; text-align:center; margin-bottom:2px;}
    .breathe-btn4 {background:url(<?php echo G5_IMG_URL ?>/04.gif) repeat-x; text-align:center; margin-bottom:2px;}
    .breathe-btn5 {background:url(<?php echo G5_IMG_URL ?>/05.gif) repeat-x; text-align:center; margin-bottom:2px;}
</style>

<div class="schedule-box">
    <h2 class="lat_title">
        <a href="<?php echo $_SERVER[PHP_SELF]; ?>?bo_table=<?php echo $bo_table; if ( $month == 1) { $year_pre=$year-1;  $mon_pre=12; } else { $year_pre=$year;  $mon_pre= $month-1; } echo "&year=".$year_pre."&month=". $mon_pre; ?>" onfocus="this.blur()" title="<?php echo  $mon_pre; ?> 월">< </a>
        <a href="<?php echo G5_URL;?>" title="이번달">
            <i class="fa fa-calendar-check-o"></i> <?php echo $year;?>.<?php echo $month;?>
        </a>
        <a href="<?php echo $_SERVER[PHP_SELF]; ?>?bo_table=<?php echo $bo_table; if ( $month == 12) { $year_pre=$year+1;  $mon_pre=1; } else { $year_pre=$year;  $mon_pre= $month+1; } echo "&year=".$year_pre."&month=". $mon_pre; ?>" onfocus="this.blur()" title="<?php echo  $mon_pre; ?> 월"> ></a>
    </h2>

    <div style="padding:0px; margin-top: -10px;">
        <ul class="list-body">
        <?php
            $cday = 1;
            $sel_mon = sprintf("%02d",$month);
            $now_month = $year.$sel_mon;
            $sca_sql = ($sca) ? "and ca_name = '".$sca."'" : "";
            $result = sql_query("select * from $schedule_table where wr_is_comment = '0' and left(wr_1,6) <= '{$now_month}' and left(wr_2,6) >= '{$now_month}' $sca_sql order by wr_id asc");
            while ($row = sql_fetch_array($result)) {

                $start_day = (substr($row['wr_1'],0,6) <  $now_month) ? 1 : substr($row['wr_1'],6,2);
                $start_day = sprintf("%2.0f" , $start_day);

                $end_day = (substr($row['wr_2'],0,6) >  $now_month) ? $lastday[$month] : substr($row['wr_2'],6,2);
                $end_day = sprintf("%2.0f" , $end_day);

                $row2 = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);

                for ($s = (int)$start_day; $s <= (int)$end_day; $s++) {
                    $list[$s][] = $row2;
                }
            }

            $temp = 7 - (($lastday[$month]+$dayoftheweek)%7);

            if($temp == 7) $temp = 0;

            $lastcount = $lastday[$month]+$dayoftheweek + $temp;

            for ($iz = 1; $iz <= $lastcount; $iz++) {

                $is_today = ($b_year == $year && $b_mon == $month && $b_day == $cday) ? true : false;

                $daycolor = ' black';
                $bg_daycolor = ' bg-black';

                $dayweek = $iz%7;
                if($dayweek == 1) {
                    echo '<li class="list-item">'.PHP_EOL;
                    $daycolor = ' red';
                    $bg_daycolor = ' bg-red';
                } else if($dayweek == 0) {
                    $daycolor = ' blue';
                    $bg_daycolor = ' bg-blue';
                }

                //음력날짜 9,10,19,20,29,30일 손없는날 표시
                $myarray = soltolun($year,$month,$cday);

                $daytext = ($is_today) ? '<div style="font-weight:bold;text-align:center;background-color:#253dbe; color:#fff;">오늘</div>' : $cday;

                $do_cnt = count($list[$cday]);

                if($dayoftheweek < $iz && $iz <= $lastday[$month]+$dayoftheweek) {
                    $fr_date = $year.sprintf("%02d",$month).sprintf("%02d",$cday);
                ?>
                    <div class="<?php echo ($is_today) ? ' bg-today' : '';?>">
                        
                            <div class="font-13 pull-left<?php echo $daycolor;?>" style="width:100%; font-size:14px; font-weight:bold;height:20px;background-color:#f6f6f6; margin-bottom:5px; float:left;">
                                <?php echo $daytext;?>
                            </div>
                        <?php if($do_cnt > 0) { ?>
                        <div class="do-list" style="float:left;width:100%;">
                            <?php
                            for($i = 0; $i < $do_cnt; $i++) {
                                // 링크이동
                                $list[$cday][$i]['target'] = '';
                                if($is_link_target && $list[$cday][$i]['wr_link1']) {
                                    $list[$cday][$i]['target'] = $is_link_target;
                                    $list[$cday][$i]['href'] = $list[$cday][$i]['link_href'][1];
                                }
                                if($list[$cday][$i]['subject']){
                            ?>
                            <div class="<?php if ($list[$cday][$i]['wr_3'] == 1) {?>breathe-btn1<?php }else if ($list[$cday][$i]['wr_3'] == 2) {?>breathe-btn2<?php }else if ($list[$cday][$i]['wr_3'] == 3) {?>breathe-btn3<?php }else if ($list[$cday][$i]['wr_3'] == 4) {?>breathe-btn4<?php }else if ($list[$cday][$i]['wr_3'] == 5) {?>breathe-btn5<?php }?>">
                                <a <?php if ($is_admin) {?>
                                    href="<?php echo $list[$cday][$i]['href'];?>"<?php echo $list[$cday][$i]['target'];?> class="red"
                                <?php }else{?>
                                    href="<?php echo $list[$cday][$i]['wr_link1'];?>" target="_blank"
                                <?php }?>
                                style="color:<?php if ($list[$cday][$i]['wr_3'] == 1) {?>#ffff00<?php }else if ($list[$cday][$i]['wr_3'] == 2) {?>#fff<?php }else if ($list[$cday][$i]['wr_3'] == 3) {?>#fff<?php }else if ($list[$cday][$i]['wr_3'] == 4) {?>#000<?php }else if ($list[$cday][$i]['wr_3'] == 5) {?>#000<?php }else {?>#444<?php }?>; font-weight:bold;">
                                        <?php echo $list[$cday][$i][wr_subject]; ?>
                                        <?php echo $list[$cday][$i][wr_content]; ?>
                                    </a>
                            </div>
                            
                            <?php
                                } //if
                            }
                            ?>
                        </div>
                        <?php } ?>

                    </div>
                <?php
                    $cday++;
                } else {
                    echo '<div class="hidden-xs"></div>'.PHP_EOL;
                }

                if($iz%7 == 0) echo '</li>'.PHP_EOL;
            }
        ?>
        </ul>
    </div>

</div>

이 질문에 댓글 쓰기 :

답변을 작성하시기 전에 로그인 해주세요.
전체 2,663
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT