<% Dim strPageTitle strPageTitle = "Confirmation" %> <% Sub SubMain(ByRef objQuery) Call SubContent(objQuery) End Sub Sub SubContent(ByRef objQuery) %>
<%'//LEFT AREA %>  
<%'// Contents Start ------------------------------------------------------------------------------------------------------%>
Name   ">  
<% Dim UserID, UserType UserID = SESSION("USERID") UserType = "agent" '//Calender Start Dim iYear, iMonth, iDay, totDay ,iWeekDay, iLastDay, RecDay, NowDate, NowYear, NowMonth RecDay =Request.Querystring("RecDay_y") '´Þ·Â ³×À̺£ÀÌ¼Ç ´ÙÀ½´Þ ÀÌÀü´Þ ¹ÞÀº º¯¼ö IF EventDate_MM1 <> "" Then Dim tempM, tempD IF Left(EventDate_MM1, 1) = "0" Then tempM = Right(EventDate_MM1, 1) Else tempM = EventDate_MM1 End If IF Left(EventDate_DD1, 1) = "0" Then tempD = Right(EventDate_DD1, 1) Else tempD = EventDate_DD1 End If RecDay = tempM &"/"& tempD &"/"& EventDate_YYYY1 End IF NowYear = Year(Date) ' ÇöÀç ³âÀ» ÀúÀåÇÔ. NowMonth = Month(Date) ' ÇöÀç ´ÞÀ» ÀúÀåÇÔ. iDay = Day(Date) 'ÇöÀç ³¯À» ÀúÀåÇÔ. if RecDay ="" then '³×À̰ÔÀ̼ǿ¡ ¹ÞÀº º¯¼ö°¡ ¾øÀ¸¸é ÇöÀç °ªÀ¸·Î ÃʱâÈ­ ÃʱâÈ­ iYear = NowYear iMonth = NowMonth else iYear = Year(RecDay) '¿ä±¸ÇÏ´Â ³â°ú ´ÞÀ» ±¸ÇÔ. iMonth = Month(RecDay) end If iWeekDay = Weekday(DateSerial(iYear, iMonth, 01)) ' ¿ä±¸Çϴ´ÞÀÇ Ã¹³¯ÀÇ ¿äÀÏÀ» ¼ýÀÚ·Î ¾Ë¾Æ³½´Ù. 'ÀÏ~ Åä ¿äÀÏÀ» 1 ~ 7·Î Á¤ÀÇ if iMonth= 4 or iMonth=6 or iMonth = 9 or iMonth =11 then ' ±×´ÞÀÇ ³¯¼ö¸¦ ¼±Åà totDay = 30 elseif iMonth =2 then if (((iYear mod 4 = 0 ) and (iYear mod 100 <> 0)) or (iYear mod 400 = 0)) then 'À±³âÀ» üũÇÔ. totDay =29 else totDay = 28 end if else totDay =31 end if Dim sMonth Select Case iMonth Case "1" sMonth = "January" Case "2" sMonth = "February" Case "3" sMonth = "March" Case "4" sMonth = "April" Case "5" sMonth = "May" Case "6" sMonth = "June" Case "7" sMonth = "July" Case "8" sMonth = "August" Case "9" sMonth = "September" Case "10" sMonth = "October" Case "11" sMonth = "November" Case "12" sMonth = "December" End Select %>
<%=sMonth%> <%=iYear%> < <%=iMonth%> >
<% Dim targetMonth, targetDay, targetYear, TargetDate targetMonth = iMonth targetYear = iYear IF Len(Trim(targetMonth)) > 1 Then targetMonth = Trim(targetMonth) Else targetMonth = "0" & Trim(targetMonth) End IF Dim sQuery, rsCal, arrCal, nxx IF UserID <> "" Then 'sQuery = " SELECT user_id, confirmation_id, depart_date, return_date, " 'sQuery = sQuery & " name_first, name_last, email, adult_cnt + child_cnt as passenger " 'sQuery = sQuery & " FROM S_Reservation " 'sQuery = sQuery & " WHERE user_id='"&SESSION("USERID")&"' and agent_name='"&SESSION("AGENT")&"' and " 'sQuery = sQuery & " (Left(depart_date,2) = '"&targetMonth&"' or Left(return_date,2) = '"&targetMonth&"') " 'sQuery = sQuery & " and (Right(depart_date,4) = '"&targetYear&"' or Right(return_date,4) = '"&targetYear&"') " 'sQuery = sQuery & " Order By depart_date ASC " Dim dQuery1 dQuery1 = " IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS " &_ " WHERE TABLE_NAME = 'SUMMARY_FOR_MONTHLY_"&SESSION("AGENT")&"') " &_ " DROP VIEW SUMMARY_FOR_MONTHLY_"&SESSION("AGENT")&" " objQuery.execute(dQuery1) Dim tranQuery tranQuery = " CREATE VIEW SUMMARY_FOR_MONTHLY_"&SESSION("AGENT")&" " tranQuery = tranQuery & " AS " tranQuery = tranQuery & " SELECT user_id, confirmation_id, depart_date, return_date, name_first, name_last, email, adult_cnt + child_cnt as passenger " tranQuery = tranQuery & " FROM S_Reservation " tranQuery = tranQuery & " WHERE user_id='"&SESSION("USERID")&"' and agent_name='"&SESSION("AGENT")&"' and " tranQuery = tranQuery & " d_flight = 'OZ221' and Left(depart_date,2) = '"&targetMonth&"' and Right(depart_date,4) = '"&targetYear&"' and d_air_2 not in(d_air_1) " tranQuery = tranQuery & " Union ALL " tranQuery = tranQuery & " SELECT user_id, confirmation_id, depart_date, return_date, name_first, name_last, email, adult_cnt + child_cnt as passenger " tranQuery = tranQuery & " FROM S_Reservation " tranQuery = tranQuery & " WHERE user_id='"&SESSION("USERID")&"' and agent_name='"&SESSION("AGENT")&"' and " tranQuery = tranQuery & " r_flight = 'OZ222' and Left(return_date,2) = '"&targetMonth&"' and Right(return_date,4) = '"&targetYear&"' and r_air_2 not in(r_air_1) " objQuery.execute(tranQuery) sQuery = " SELECT distinct confirmation_id, user_id, depart_date, return_date, name_first, name_last, email, passenger " sQuery = sQuery & " FROM SUMMARY_FOR_MONTHLY_"&SESSION("AGENT")&" " sQuery = sQuery & " Order By depart_date ASC " Set rsCal = objQuery.execute(sQuery) If rsCal.EOF Then arrCal = Empty Else arrCal = rsCal.GetRows End If rsCal.close Set rsCal = Nothing End IF '/Response.write sQuery '/Response.end Dim j, icX, nDe, nRe, nDe_s1, nRe_s1, nDe_s2, nRe_s2, nNF_t1, nFN_t1, nNF_t2, nFN_t2 j = 1 nxx = 0 nNF_t1 = 0 nFN_t1 = 0 nNF_t2 = 0 nFN_t2 = 0 dim interval interval = iWeekDay -1 '°ø¹éÀ» ä¿ì±âÀ§ÇÑ º¯¼ö Do while j <= totDay response.write "" for icX=1 to 7 if interval > 0 then ' ù¶óÀÎÀÎ °ø¹éÀ» üũÇÔ¿© ÀÖÀ¸¸é °ø¹éÀ» »ðÀÔ response.write " " interval = interval -1 ' Çϳª¾¿ °¨»êÇÏ¿© °ø¹éÀ» ü¿ò else if j <= totDay then response.write "" Else '--------------------------------- if icX <> 1 then if (j = iDay) and (iYear = NowYear) and NowMonth = iMonth then response.write "" & j & "" else response.write j end if Response.write "" else ' ÀÏ¿äÀÏ¿¡ »¡°£»öÀ¸·Î Ä¥ÇÔ if (j = iDay) and (iYear = NowYear) and NowMonth = iMonth then response.write "" & j & "" else response.write " " & j & "" end if end If End IF j=j+1 else '³¯¼ö¸¦ ä¿ì°í ³­ ºóÄ­ÀÇ ¿©¹é ä¿ì±â response.write "" end if end if next response.write "" Loop %>
SUN MON TUE WED THU FRI SAT
 " '--------------------------------- targetDay = j IF Len(Trim(targetDay)) > 1 Then targetDay = Trim(targetDay) Else targetDay = "0" & Trim(targetDay) End IF TargetDate = targetMonth&"/"&targetDay&"/"&targetYear '//Response.write TargetDate IF IsArray(arrCal) Then if icX <> 1 then if (j = iDay) and (iYear = NowYear) and NowMonth = iMonth then response.write "" & j & "" else response.write j end if else ' ÀÏ¿äÀÏ¿¡ »¡°£»öÀ¸·Î Ä¥ÇÔ if (j = iDay) and (iYear = NowYear) and NowMonth = iMonth then response.write "" & j & "" else response.write "" & j & "" end if end If nDe = 0 nRe = 0 nDe_s1 = 0 nRe_s1 = 0 For nxx = 0 To UBound(arrCal, 2) nDe_s2 = 0 nRe_s2 = 0 IF Trim(arrCal(2, nxx)) = TargetDate Then nDe = nDe + 1 nDe_s2 = cdbl(arrCal(7, nxx)) - 1 End If IF Trim(arrCal(3, nxx)) = TargetDate Then nRe = nRe + 1 nRe_s2 = cdbl(arrCal(7, nxx)) - 1 End If nDe_s1 = nDe_s1 + nDe_s2 nRe_s1 = nRe_s1 + nRe_s2 Next IF nDe > 0 Then '//UserID, UserType Response.write "
NJ>JFK "&nDe&" (+" & nDe_s1 & ")" nNF_t1 = nNF_t1 + nDe nNF_t2 = nNF_t2 + nDe_s1 Else Response.write "
NJ>JFK "&nDe&"" End If IF nRe > 0 Then Response.write "
JFK>NJ "&nRe&" (+" & nRe_s1 & ")" nFN_t1 = nFN_t1 + nRe nFN_t2 = nFN_t2 + nRe_s1 Else Response.write "
JFK>NJ "&nRe&"" End IF Response.write "
 
Previous Calendar    Next Calendar

MONTHLY TOTAL PASSENGERS
NJ -> JFK : Primary (<%=nNF_t1%>) / Fellows (<%=nNF_t2%>)     Total (<%=nNF_t1 + nNF_t2%> Passengers)
JFK -> NJ : Primary (<%=nFN_t1%>) / Fellows (<%=nFN_t2%>)     Total (<%=nFN_t1 + nFN_t2%> Passengers)
Summary of Reservation (<%=sMonth%>)
Printable List of Reservation (<%=sMonth%>)

<% '// Calendar End -------------------------------------------------------------------------------------------------- %> <%'// Contents End ------------------------------------------------------------------------------------------------------%>
<% End Sub %>