<%'//LEFT AREA %>
<%IF uAgent = "WWTA" And uUser = "walkerhillny@hotmail.com" Then%>
|
|
 |
<%'// Contents Start ------------------------------------------------------------------------------------------------------%>
<% Else
Refresh("../index.asp")
End IF%>
<%
Dim UserID, UserType
UserID = Request.Cookies("user")("USER_ID") & " - ADMIN"
UserType = "agent"
Dim t, t2
t = datediff("s",Date(),now)
t2 = Right(t, 5)
'//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%> > |
SUN |
MON |
TUE |
WED |
THU |
FRI |
SAT |
<%
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 (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_MONTH_"&Request.Cookies("user")("PASS") & t2&"') " &_
" DROP VIEW SUMMARY_FOR_MONTH_"&Request.Cookies("user")("PASS") & t2&" "
objQuery.execute(dQuery1)
Dim tranQuery
tranQuery = " CREATE VIEW SUMMARY_FOR_MONTH_"&Request.Cookies("user")("PASS") & t2&" "
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 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 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_MONTH_"&Request.Cookies("user")("PASS") & t2&" "
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 ""
'---------------------------------
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 '//NJ to JFK
'//response.write Trim(arrCal(2, nxx)) &"||"&Trim(arrCal(4, nxx)) &" "
nDe = nDe + 1
nDe_s2 = cdbl(arrCal(7, nxx)) - 1
End If
IF Trim(arrCal(3, nxx)) = TargetDate Then '//JFK to NJ
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 " | "
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
%>
|
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)
|
|
<%
'// Calendar End -------------------------------------------------------------------------------------------------- %>
<%'// Contents End ------------------------------------------------------------------------------------------------------%>
|
 |
|