_common.php 오류로 인해 페이지가 정상적으로 생성되지 않습니다.

_common.php 오류로 인해 페이지가 정상적으로 생성되지 않습니다.

QA

_common.php 오류로 인해 페이지가 정상적으로 생성되지 않습니다.

본문

해당 페이지를 불러오면 오늘 날짜의 달력을 불러와야 하는데, 정상적으로 불러와지질 않아서

달력 페이지의 값이 늘 초기값인 1970-01-01 로 고정되어 있습니다.

스크린샷 2014-04-28 오후 1.58.23.png

다음과 같이 출력되는데, 전달과 다음달로의 이동도 정상적으로 이루어지지 않고 있습니다.

common.php를 include해줘서 직접 경로를 지정해줬음에도 저런 에러가 계속 발생되고 있습니다.

해당 파일은 root/new/category07 폴더에 위치해있고, 루트에는 _common.php와 common.php가 위치해있습니다.

제가 뭘 잘못해서 이 에러가 계속 발생하는 걸까요?



<?
$g4_path='../..'; 
/* @require_once($g4_path.'/common.php'); */
include_once($g4_path.'/common.php'); 
?>
<?


// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;

//if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>
?>
<style>

.calendarT table,td { font-family : dotum ; font-size : 9pt; }
.hand { cursor:hand; }
</style>
<?php
 

	if(!$ndate) {
		$ndate = date("Y-m");
	}

	$ntime = strtotime($ndate);
	$curY=date("Y", $ntime);
	$curM=date("m", $ntime);

	if($curY == date("Y") && $curM == date("m")) {
		$curD = date("d");
	}

    if ($curM =="") 
    { 
    
        $tmpDate = getdate(); 
        $curM = $tmpDate[mon]; 
        $curD = $tmpDate[mday]; 
        
    } 
    
    if($curY ==''){
    	$curY = $tmpDate[year];
    } 
    
    $preM = $curM - 1; 
    $nextM = $curM + 1; 
    $preY = $curY; 
    $nextY = $curY; 
     
    if ($curM==1) 
    { 
        $preM = 12; 
        $preY = $curY - 1; 
    } 
    elseif($curM==12) 
    { 
        $nextM = 1; 
        $nextY = $curY + 1; 
    } 
         
    $preDate = mktime(0,0,0,$preM, 1,$preY); 
    $curDate = mktime(0,0,0,$curM, 1,$curY); 
    $nextDate = mktime(0,0,0,$nextM, 1,$nextY); 

    $preMaxday = date(t,$preDate); 
    $curMaxday = date(t,$curDate); 
    $nextMaxday = date(t,$nextDate); 

    $preFw = date(w,$preDate);   
    $curFw = date(w,$curDate);   
    $nextFw = date(w,$nextDate);   

    $preJu = floor(($preMaxday+$preFw)/7)+1 ;     // 
    $curJu =floor(($curMaxday+$curFw)/7)+1 ;     // 
    $nextJu = floor(($nextMaxday+$nextFw)/7)+1 ;     // 
    $yoil = array('','SUN','MON','TUE','WED','THU','FRI','SAT');  
    $month = array('','January','February','May','April','March','June','July','August','September','October','November','December'); 
     

    
    
    //메인테이블 시작 
    $cur = 0; 
    echo "<div align=left style='padding-top:10px;'>";


?>
<table width='760' cellspacing='0' cellpadding='0' style="padding-left:1px;">
  <tr><td colspan="5" height="30"></td></tr>
  <tr>
    <td width='124' align='left' class='a2'>
		<?
		echo date("Y.m",strtotime("-1 month", $ntime)); 
		?>
	</td>
    <td width='39' align='left'><a href="?f_submenus=<?=$f_submenus?>&ndate=<?=date("Y-m",strtotime("-1 month", $ntime))?>"><img src='../images/left.gif' /><a/></td>
    <td width='' align='center' class='a1'>
	<?
		echo date("Y.m",$ntime);
	?>
	</td>
    <td width='39' align='right'><a href="?f_submenus=<?=$f_submenus?>&ndate=<?=date( "Y-m", strtotime("+20 day", mktime( 0, 0, 0, date("m",$ntime), 20, date("Y",$ntime)))  )?>"><img src='../images/rig.gif'/></a></td>
    <td width='124' align='right' class='a2'>
		<?
		echo date( "Y.m", strtotime("+20 day", mktime( 0, 0, 0, date("m",$ntime), 20, date("Y",$ntime)))  );
		?>
	</td>
  </tr>
  <tr>
    <td colspan='5' align='center'><img src='../images/d_day.png' /></td>
  </tr>
</table>	
<?

    echo "<table width='760' border='0' cellpadding='5' cellspacing='0' class='bg coun_cal'>"; 

    for($row = 0;$row<$curJu;$row++) 
    { 
        
            
            echo "<tr bgcolor='#FFFFFF'>";    
             
            for($col = 0;$col<=6;$col++)   
            {   $reserve_info="";              
                   
                    $cur++;   
                    if (($cur<=$curFw) || ($cur > ($curMaxday+$curFw)) == true) 
                    {                         
                        echo "<td width='106' height='98' align='right' valign='top' bgcolor='#fff9f6'> ";     
                    }else{ 
                        $day_fnc = $cur-$curFw;
                         

						if ($col==0) $colc="class='a4'";
						else if ($col==6) $colc="class='a3'";
						else $colc="";



                        echo "<td width='106' height='98' align='right' valign='top' bgcolor='#fff9f6' ".$colc.">"; 
                         

                        if (($cur-$curFw)==$curD)//오늘일자 하이라이트. 
                        {
							echo "<p class='today_cal'>".($cur-$curFw)."</p>";
						} else {
							echo $cur-$curFw;     
						}
                        
                                   

                        $sTime = mktime(0,0,0,$curM , $day_fnc , $curY );
                        $tTime = mktime(0,0,0,date("m") , date("d") , date("Y") );
                        $eTime = mktime(0,0,0,$curM , $day_fnc , $curY ) + 86390;

						$rdate = date("Y-m-d", $sTime);

						if (time() < $sTime && $col > 0 ) {
						?><div style="width:88px;padding-top:15px;text-align:center;color:#0000ff;">
								<a href='../../bbs/write.php?bo_table=reserve&rdate=<?=$rdate?>&f_submenus=0705'><img src='../images/a1.gif'/></a>
							</div><?
						} else {
						?>
						<div style="width:88px;padding-top:15px;text-align:center;color:#0000ff;">
						
						</div>
						<?
						}
                    } 
                 
                echo "</td>"; 
            } 
            echo "</tr>"; 
         
    } 

    echo "</table></div><br><Br>"; 

?> 
					
			<table width="760" cellspacing='0' cellpadding='0'>
				<tr>
					<td align="center">
							<a href="./sub.php?f_submenus=0705"><img src="../images/btn_resv01.jpg"/></a>
							<?
							if (!$member['mb_id']) {
							?>
									
							<?
							} else {
							?>
								<a href="../../bbs/board.php?bo_table=reserve&f_submenus=0705_1"><img src="../images/btn_resv03.jpg"/></a>
							<?
							}
							?>

							<?
							if (!$member['mb_id']) {
							?>
									<a href="./sub.php?f_submenus=0705_2"><img src="../images/btn_resv02.jpg"/></a>
							<?
							} else {
							?>
							
							<?
							}
							?>
							
                 
					</td>
				</tr>
				<tr>
					<td height="20"></td>
				</tr>
				</table>				
<style type="text/css">
.a1 {
	color: #f26122;
	font-size: 33px;
	font-weight: bold;
	font-family: Verdana, Geneva, sans-serif;
}
.a2 {
	color: #999;
	font-size: 20px;
	font-family: Verdana, Geneva, sans-serif;
}
.bg {
	color: #000;
	background-color: #fff9f6;
	font-weight: bold;
}
.a3 {
	color: #5180ad;
}
.a4 {
	color: #ca111a;
}

.coun_cal {border-left:1px solid #aaa; margin-left:2px;}
.coun_cal td {border-bottom:1px solid #ccc; border-right:1px solid #ccc;}
.today_cal {background:#f26122; color:#fff; padding:2px 4px; display:inline;}


</style>

 

이 질문에 댓글 쓰기 :

답변 2

category_0705.php 파일에서 main 이라는 함수를 찾지 못하는것 같은데요?

아마도 common.php 파일이 include 되기도 전에 함수를 호출해서 그런듯 합니다.


root 에 common.php 파일이 있는지 확인해보세요.
답변을 작성하시기 전에 로그인 해주세요.
전체 36
QA 내용 검색

회원로그인

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