달력스킨에 게시글 내용보이게 하는방법 문의드립니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
달력스킨에 게시글 내용보이게 하는방법 문의드립니다.

QA

달력스킨에 게시글 내용보이게 하는방법 문의드립니다.

본문

현재 엑셀 프레임웤을 짜고 있는데,

달력 날짜밑부분 에다가 그누보드 [wr_content] 를 각각 넣고 싶은데 어떻게 루프를 돌려야할지 감이 안잡힙니다!

고수님들 도와주십시요!

1994272523_1511657927.1707.png

 

<!-- 소스부분 --->

<?php
$bo_table = $_GET['bo_table'];
include_once("./_common.php");
if(!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if($_GET[sdate] && $_GET[edate]){

  $sdate_a = $_GET[sdate]." 00:00:00";
  $edate_a = $_GET[edate]." 23:59:59";

  $searches .= "and (wr_datetime between '{$sdate_a}' and '{$edate_a}') ";
 }
$total_count = $board['bo_count_write'];
if($_GET[year]){
   $exyear = $_GET[year];}
   else {$exyear = date("Y");}
$sql = "select * from $write_table where YEAR(wr_1) = {$exyear} and wr_is_comment = '0' ORDER BY wr_1 ASC ";
$result = sql_query($sql);
$cnt = _num_rows($result);

$i=0;
while($row = sql_fetch_array($result)) {
 $list[$i]['번호'] = $row['wr_num'];
 $list[$i]['작성자'] = $row['wr_name'];
 $list[$i]['결과서'] = $row['wr_3'];
 $list[$i]['특이사항'] = $row['wr_4'];
 $list[$i]['서명'] = $row['wr_5'];
 $list[$i]['수행기간(까지)'] = date("Y-m-d", strtotime(substr($row['wr_2'],0,10)));
 //$list[$i]['고정자산'] = $row['wr_5'];
 //$list[$i]['고정자산부가세'] = $row['wr_6'];
 $list[$i]['수행장소'] = $row['wr_content'];
 //$list[$i]['비고'] = $row['wr_8'];
 $list[$i]['수행자'] = $row['wr_10'];
 $list[$i]['수행기간(부터)'] = date("Y-m-d", strtotime(substr($row['wr_1'],0,10)));
 $i++;
}
    header("Content-charset=utf-8");
    header("Content-Type: application/x-msexcel; name=\"{$bo_table}-".date("ymd", time())."wk".".xls\"");
    header("Content-Disposition: attachment; filename=\"{$bo_table}-".date("ymd", time())."wk".".xls\"");
    $fname = tempnam(G5_DATA_PATH, $board.".xls");
    $fh=fopen($fname, "rb");
    fpassthru($fh);
    unlink($fname);
   
    /******************************
달력
******************************/

/********** 사용자 설정값 **********/
$startYear        = 2007;
$endYear        = date( "Y" ) + 4;

/********** 입력값 **********/
$year            = ( $_GET['toYear'] )? $_GET['toYear'] : date( "Y" );
$month            = ( $_GET['toMonth'] )? $_GET['toMonth'] : date( "m" );
$doms            = array( "일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일" );

/********** 계산값 **********/
$mktime            = mktime( 0, 0, 0, $month, 1, $year );      // 입력된 값으로 년-월-01을 만든다
$days            = date( "t", $mktime );                        // 현재의 year와 month로 현재 달의 일수 구해오기
$startDay        = date( "w", $mktime );                        // 시작요일 알아내기

// 지난달 일수 구하기
$prevDayCount    = date( "t", mktime( 0, 0, 0, $month, 0, $year ) ) - $startDay + 1;

$nowDayCount    = sprintf("%02d", 1);                                        // 이번달 일자 카운팅
$nextDayCount    = 1;                                          // 다음달 일자 카운팅

// 이전, 다음 만들기
$prevYear        = ( $month == 1 )? ( $year - 1 ) : $year;
$prevMonth        = ( $month == 1 )? 12 : ( $month - 1 );
$nextYear        = ( $month == 12 )? ( $year + 1 ) : $year;
$nextMonth        = ( $month == 12 )? 1 : ( $month + 1 );

// 출력행 계산
$setRows = ceil( ( $startDay + $days ) / 7 );
?>
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<style id="통합 문서1_28651_Styles">
 br{mso-data-placement:same-cell;}
<!--table{mso-displayed-decimal-separator:"\.";mso-displayed-thousand-separator:"\,";}
.font528651{color:windowtext;font-size:8.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;}
.xl6828654{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:12.0pt;font-weight:600;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:center;vertical-align:middle;border:solid black;border-width:1pt 1pt .5pt .5pt;mso-background-source:auto;mso-pattern:black none;white-space:nowrap;}
.xl6828653{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:12.0pt;font-weight:600;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:center;vertical-align:middle;border:solid black;border-width:1pt .5pt .5pt 1pt;mso-background-source:auto;mso-pattern:black none;white-space:nowrap;}
.xl6828652{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:18.0pt;font-weight:800;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:center;vertical-align:middle;border:.0pt solid gray;mso-background-source:auto;mso-pattern:black none;white-space:nowrap;}
.xl6328651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:general;vertical-align:middle;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}
.xl6428651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid gray;mso-background-source:auto;mso-pattern:auto;white-space:normal;}
.xl6528651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:"Short Date";text-align:center;vertical-align:middle;border:.5pt solid gray;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}
.xl6628651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:general;vertical-align:middle;border:.5pt solid gray;mso-background-source:auto;mso-pattern:auto;white-space:normal;}
.xl6928651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:right;vertical-align:middle;border:.5pt solid gray;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}
.xl6728651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:"_-* \#\,\#\#0_-\;\\-* \#\,\#\#0_-\;_-* \0022-\0022_-\;_-\@_-";text-align:general;vertical-align:middle;border:.5pt solid gray;mso-background-source:auto;mso-pattern:auto;white-space:nowrap;}
.xl6828651{padding-top:1px;padding-right:1px;padding-left:1px;mso-ignore:padding;color:black;font-size:10.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-number-format:General;text-align:center;vertical-align:middle;border:.5pt solid gray;background:#E7E6E6;mso-pattern:black none;white-space:nowrap;}
ruby{ruby-align:left;}
rt{color:windowtext;font-size:8.0pt;font-weight:400;font-style:normal;text-decoration:none;font-family:"맑은 고딕", monospace;mso-font-charset:129;mso-char-type:none;}
-->
</style>
</head>

<body>

<div id="통합 문서1_28651" align=center x:publishsource="Excel">

<!---------- 달력 출력 ---------->

<center>

<table border=1 cellpadding=0 cellspacing=0 width=1094 class=xl6328651 style='border-collapse:collapse;table-layout:fixed;width:822pt'>
 <!--엑셀 열 설정
 <col class=xl6328651 width=42 style='mso-width-source:userset;mso-width-alt:1344;width:32pt'>
 <col class=xl6328651 width=89 style='mso-width-source:userset;mso-width-alt:2848;width:67pt'>
 <col class=xl6328651 width=89 style='mso-width-source:userset;mso-width-alt:3712;width:67pt'>
 <col class=xl6328651 width=116 style='mso-width-source:userset;mso-width-alt:4256;width:100pt'>
 <col class=xl6328651 width=89 style='width:54pt'>
 <col class=xl6328651 width=200 style='mso-width-source:userset;mso-width-alt:2624;width:62pt'>
 <col class=xl6328651 width=180 style='mso-width-source:userset;mso-width-alt:4448;width:104pt'>
 <col class=xl6328651 width=150 style='mso-width-source:userset;mso-width-alt:2624;width:62pt'>
 <col class=xl6328651 width=82 style='mso-width-source:userset;mso-width-alt:4448;width:104pt'>
 <col class=xl6328651 width=72 style='width:54pt'>
 <col class=xl6328651 width=128 style='mso-width-source:userset;mso-width-alt:4096;width:96pt'>
 <col class=xl6328651 width=133 style='mso-width-source:userset;mso-width-alt:4256;width:100pt'>
 -->
 <tr height=6 style='mso-height-source:userset;height:40pt'>
   <td class=xl6828652 width="300" height="100" colspan="7">
   <?php echo "<"." ".$exyear."년"." ".$board['bo_subject']." "."일정표"." ".">"; ?>
   </td>
  </tr>
    <tr style='mso-height-source:userset;height:20pt'>
        <? for( $i = 0; $i < count( $doms ); $i++ ) { ?>
        <td bgcolor="#dcdcdc" align="center" style="height:30pt;width:100pt">
        <? if ( $doms[$i] == "일요일" ) { ?>
                <b><font color="red"><?="일요일"?></font></b>
                <? } else if ( $doms[$i] == "토요일" ) { ?>
                <b><font color="blue"><?="토요일"?></font></b>
                <? } else { ?>
                <b><?=$doms[$i] ?></b>
                <? } ?>
        <? } ?>
    </tr>

    <? for( $rows = 0; $rows < $setRows; $rows++ ) { ?>
    <tr style='mso-height-source:userset;height:10pt'>
        <?
        for( $cols = 0; $cols < 7; $cols++ )
        {
            // 셀 인덱스 만들자
            $cellIndex    = ( 7 * $rows ) + $cols;
            ?>

            <?
            // 이번달이라면
            if ( $startDay <= $cellIndex && $nowDayCount <= $days ) { ?>
            <td class=xl6528651 align="center" style="height:20pt;width:100pt">
                <? if ( date( "w", mktime( 0, 0, 0, $month, $nowDayCount, $year ) ) == 6 ) { ?>
                <b><font color="blue"><?=$month."월".sprintf("%02d", $nowDayCount++)."일"?></font></b>
               
                <? } else if ( date( "w", mktime( 0, 0, 0, $month, $nowDayCount, $year ) ) == 0 ) { ?>
                <b><font color="red"><?=$month."월".sprintf("%02d", $nowDayCount++)."일"?></font></b>
               
                <? } else { ?>
                <b><?=$month."월".sprintf("%02d", $nowDayCount++)."일"?></b>
                <? } ?>
            </td>
           
            <?
            // 이전달이라면
            } else if ( $cellIndex < $startDay ) { ?>
            <td align="center" style="height:20pt;width:100pt">
            <font color="gray"><b><?=date(m,strtotime("-1 month"))."월".sprintf("%02d", $prevDayCount++)."일"?></b></font>
            </td>
           
            <?
            // 다음달 이라면
            } else if ( $cellIndex >= $days ) { ?>
            <td align="center" style="height:20pt;width:100pt">
            <font color="gray"><b><?=date(m,strtotime("+1 month"))."월".sprintf("%02d", $nextDayCount++)."일"?></b></font>
            </td>
            <? } ?>
      <? } ?>
      <tr>
      <td></td>
      </tr>
    <? } ?>
</center>
</div>
</body>
</html>

이 질문에 댓글 쓰기 :

답변 2

날짜 <td> 안에서 년월일로 조회를 해서 query를 만들어서 wr_content 만 출력하시면 됩니다.

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

회원로그인

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