선택이란님의 예약스킨중 질문 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

선택이란님의 예약스킨중 질문 정보

선택이란님의 예약스킨중 질문

본문

현재날짜 보다 전날들은 즉 지난날들은  객실이름과 현재예약상태가 아예 안나오게 하고싶습니다..

오늘 계속 소스분석해보았는데 잘모르겄네여..




<style>

.calendarT table,td { font-family : dotum ; font-size : 9pt; }
.hand { cursor:hand; }
</style>
<?php
 
    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)+2 ;    //
    $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');
   
    //양옆 미니달력 만들기 함수
    function mk_mCal($y,$m,$ju,$fw,$maxday)
    {
        GLOBAL $preM, $preY, $preJu, $preFw, $preMaxday, $nextJu, $nextFw, $nextMaxday, $yoil, $month;
        $cur=0;
        echo "<center><font face=굴림 size=2 color='#3399FF'>".$y."-".$m."</font></center><table cellspacing=2 cellpadding=0 height=150>";
            for($row = 0;$row<=$ju;$row++)
            {
                echo "<tr align=center>";
                for($col = 1;$col<=7;$col++)
                {
                    echo "<td><font face=굴림 size=2 color='#3399FF'>";
                    if ($row==0)
                    {
                        echo "<u>".$yoil[$col]."</u>";
                    }
                    else
                    {
                        $cur++;
                        if (($cur <= $fw) || ($cur-$fw>$maxday)==true)
                        {
                            echo " ";
                        }
                        else
                        {
                            if ($cur-$preFw<10)
                            {
                                echo "0";
                                echo $cur-$fw;
                            }
                            else
                            {
                                echo $cur-$fw;
                            }
                        }
                    }
                }
            }
        echo "</table>";
    }

   
   
    //메인테이블 시작
    $cur = 0;
    echo "
    <div align=left>
    <table border=0 width=700 height=600 cellspacing=1 cellpadding=0 bgcolor='#eeeeee' id='calendarT'>";
    for($row = 0;$row<=$curJu;$row++)
    {
       
        if ($row==0)
        {
         
            $tdT = $optionT ="";
           
            for($y = date("Y")-1; $y < date("Y") + 10; $y++){
$sel = ( $y == $curY ) ? "selected":"";
$optionT .="<option value=$y $sel >$y</option>";

}

for($i=1; $i < 13; $i++){
$bgc = ($curM == sprintf('%02d',$i)) ?"#ff6600":"#000000";
$tdT .="<td onclick=\"location.href='$PHP_SELF?bo_table=$bo_table&curY=$nextY&curM=".sprintf('%02d',$i)."&curD=$curD'\" style='color:$bgc;cursor:hand; border:0; font-size:9pt' align=center>${i}월</td>";
}

            echo "
            <tr height=20><td colspan=13 align=center width=100%>
            <table cellpadding=5 cellspacing=5 width=80% border=0>
            <form name=Yform method=post>
            <tr>
            <td ><select name=curY onchange=\"javascript:document.Yform.submit();\">$optionT</select></td>
            $tdT
            </tr>
            </form>
            </table>
            </td></tr>";
        }
        else
        {           
            echo "<tr bgcolor='#FFFFFF'>";   
           
            for($col = 1;$col<=7;$col++) 
            {  $reserve_info="";             
                if($row==1)   
                {
                    echo "<td height=30 width=14.2857% height=150 align=center style='font-size:10pt;font-weight:bold'><font face='arial black'>";
                    echo "<font color=#3d3d3d>";
                    if ($col==1) echo "<font color=#e36432>";
                    if ($col==7) echo "<font color=#4a4ae9>";
                    echo "$yoil[$col]</font><br>";
                }else{                   
                    $cur++; 
                    if (($cur<=$curFw) || ($cur > ($curMaxday+$curFw)) == true)
                    {                       
                        echo "<td valign=top> ";   
                    }else{
                        $day_fnc = $cur-$curFw;
                       
                        if (($cur-$curFw)==$curD)//오늘일자 하이라이트.
                        {
                            echo "<td valign=top>";    //한칸 그리고
                            $date_td = "#eeeeee";
                            $overAction="";
                        }else{
                            echo "<td valign=top>";    //한칸 그리고
                            $date_td = "#ffffff";
                       
                        }
                       
                        echo "<table border=0 height=100% bgcolor=$date_td width=100% height=100% cellspacing=0 cellpadding=2><tr><td valign=top class=hand style='font-size:9pt;font-weight:' >";
                        /*$tdbgcolor="#fff";*/
                        $fontcolor = "black;";
                       
                        if ($col==1) { /*$tdbgcolor="#fff";*/  $fontcolor = "#cf3858"; }
                        if ($col==7) { /*$tdbgcolor="#fff";*/  $fontcolor = "#3164aa"; }
                       
                        echo "<span style='width:22px;height:22px;background:$tdbgcolor;color:$fontcolor;text-align:center;padding:3 0 0 0' onmouseover=\"his.style.backgroundColor='green';\" onmouseout=\"this.style.backgroundColor='$tdbgcolor';\" >";
                       
                        echo $cur-$curFw;                   
                       
                        echo "</span><br><table cellpadding=2 cellspacing=0 border=0>";
                        $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;
                        $roomRes = sql_query("select * from $makeTableName order by id asc");
                        while($roomRow = mysql_fetch_array($roomRes)){
                       
                        $reservationData = sql_fetch("select * from $write_table where ( wr_1 = $sTime or ( wr_1 < $sTime and  wr_2 >= $eTime ) ) and wr_4 = '$roomRow[id]' ");
                        switch($reservationData[wr_3]){
                        case "입금대기" : $roomState = "<img border=0  src=reser_1.gif>";
                        $link = "";
                        break;
                        case "예약완료" : $roomState = "<img border=0 src=reser_2.gif>";
                        $link = "";
                        break;
                       
                          default        : $roomState = "<img border=0 src=reser_0.gif>"; 
                          $link = "location.href='./write.php?bo_table=$bo_table&rd=$sTime&ri=$roomRow[id]'";

                        }
                       
                        $link = (time() > $eTime)? "alert('지난날짜는 예약할수 없습니다.')" : $link;
$link2="href='./write.php?bo_table=$bo_table&rd=$sTime&ri=$roomRow[id]'";
                          $link2 = (time() > $eTime)? "alert('지난날짜는 예약할수 없습니다.')" : $link;
                       

echo "<tr><td><a style=hand onclick=\"$link\"><font size=3px face=바탕체 style='color:#4f4f4f'><tt>$roomRow[roomName]</font>
$roomState</a></td></tr>";


                        }
                       
                        echo "</table></td></tr></table>";
                    }
                }
                echo "</td>";
            }
            echo "</tr>";
        }
    }

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

?>

<!--<a style=hand onclick=\"$link\">-->

댓글 전체

전체 14 |RSS
그누4 질문답변 내용 검색

회원로그인

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