<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <%=site_title%> <% validation_cond="" set rs9874=server.CreateObject("adodb.recordset") sql9874="select * from h_roomtype where my=true" rs9874.open sql9874,conn,1,3 while not rs9874.eof validation_cond=validation_cond&"document.form7812.requested_"&rs9874("roomtype_id")&".value > 0 || " rs9874.movenext wend rs9874.close varlength=Len(validation_cond) varlength=varlength-3 validation_cond=Left(validation_cond,varlength) %> <% if request("startdate")="" then response.Redirect("myhotel_info.asp?id="&request("id")&"&info=1&err=1") end if if request("closingdate")="" then response.Redirect("myhotel_info.asp?id="&request("id")&"&info=1&err=2") end if d1=FormatDateTime(request("startdate"),2) 'response.Write(d1)&"
" d2=FormatDateTime(DateAdd("d",-1,request("closingdate")),2) 'response.Write(d2)&"
" 'response.Write(date) 'response.End() dif=DateDiff("d",date,d1) dif1=DateDiff("d",date,d2) dif3=DateDiff("d",d1,d2) 'response.Write(dif) if dif3 < 0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&info=1&err=3") end if if dif < 0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&info=1&err=4") end if if dif1 < 0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&info=1&err=5") end if %>
booking now
 
Booking : select ACCOMMODATION
 
 
<% function getWorkingDays(d1, d2) if not (isdate(d1) and isdate(d2)) then response.write "At least one date is invalid." exit function else d1 = cdate(d1): d2 = cdate(d2) if d1 > d2 then response.write "Invalid date range." exit function end if end if ' figure out how many actual days getWorkingDays = datediff("d", d1, d2) ' subtract the in-between weekends 'getWorkingDays = absdays '- cint(2 * (absdays \ 7)) ' in case both are in the same weekend 'if getWorkingDays < 0 then getWorkingDays = 0 end function d1=request("startdate") d2=request("closingdate") rw getWorkingDays(d1, d2) sub rw(s) a = s newdate=d1-1 'response.Write(newdate) & "
" & a & "
" Resultdate=newdate dim b 'response.Write request("startdate") 'response.Write request("closingdate") session("boockedroom")="" set rs=server.CreateObject("adodb.recordset") 'sql="SELECT DISTINCT room_id FROM h_bookinfo WHERE hotels_id="&request("id")&" and ((manual_booking=true or status=true) or (manual_booking=true and status=true)) and ((#" & request("startdate") & "# Between checkin_date And checkout_date Or checkin_date between #" & request("startdate") & "# and #" & DateAdd("d",-1,request("closingdate")) & "#) Or (#" & DateAdd("d",-1,request("closingdate")) & "# Between checkin_date And checkout_date Or checkout_date between #" & request("startdate") & "# and #" & DateAdd("d",-1,request("closingdate")) & "#) )" 'response.Write(sql) 'response.End() 'rs.open sql,conn,1,3 'while not rs.eof 'response.Write rs("room_id") 'session("boockedroom")= session("boockedroom") & rs("room_id") & "," 'rs.movenext 'wend 'rs.close flag=0 'response.write session("boockedroom")& "
" 'response.End() 'sql="Select * from h_room where hotels_id="&request("id")&" and roomtype_id="&request("type")&" and capacity="&request("capacity")&"" sql="Select t.hotels_id,t.roomtype_id,t.capacity,count(t.room_no) as total_room from h_room t where t.hotels_id="&request("id")&" and t.capacity="&request("capacity")&" and not exists (SELECT DISTINCT b.room_id FROM h_bookinfo a,h_room_booked b WHERE a.bookinfo_id=val(b.bookinfo_id) and hotels_id="&request("id")&" and b.room_id=t.room_id and ((manual_booking=true or status=true) or (manual_booking=true and status=true)) and ((#" & request("startdate") & "# Between checkin_date And checkout_date Or checkin_date between #" & request("startdate") & "# and #" & DateAdd("d",-1,request("closingdate")) & "#) Or (#" & DateAdd("d",-1,request("closingdate")) & "# Between checkin_date And checkout_date Or checkout_date between #" & request("startdate") & "# and #" & DateAdd("d",-1,request("closingdate")) & "#) ))group by t.hotels_id,t.roomtype_id,t.capacity "&"" ' response.Write(sql) rs.open sql,conn,3,3 while not rs.eof 'roomid=rs("room_id") room_type_id=rs("roomtype_id") hid=rs("hotels_id") 'response.write instr(1,session("boockedroom"),roomid) & "
" 'avl_room=instr(1,session("boockedroom"),roomid) avl_room=0 if avl_room = 0 then 'response.write "This Room is available =" & roomid & "
" ' new location start bprice=0 set rs_bprice=server.CreateObject("adodb.recordset") sql_bprice="select * from h_roomtype where hotels_id="&request("id")&" and roomtype_id="&room_type_id&"" rs_bprice.open sql_bprice,conn,1,3 if not rs_bprice.eof then bprice=rs_bprice("price") end if finalprice=0 ba_price=0 b=0 bpr=0 for i=1 to a Resultdate= DateSerial(Year(Resultdate), Month(Resultdate), Day(Resultdate)+1) 'response.Write(resultdate) 'session("price1")= session("price1") & resultdate & "," set rs_price=server.CreateObject("adodb.recordset") if request("capacity")=1 then sql_price="SELECT single FROM h_prices WHERE roomtype_id="&room_type_id&" And hotels_id="&request("id")&" And (#"&resultdate&"# Between start_date And end_date Or start_date=#"&resultdate&"# Or end_date=#"&resultdate&"#)" end if if request("capacity")=2 then sql_price="SELECT double FROM h_prices WHERE roomtype_id="&room_type_id&" And hotels_id="&request("id")&" And (#"&resultdate&"# Between start_date And end_date Or start_date=#"&resultdate&"# Or end_date=#"&resultdate&"#)" end if if request("capacity")=3 then sql_price="SELECT trip FROM h_prices WHERE roomtype_id="&room_type_id&" And hotels_id="&request("id")&" And (#"&resultdate&"# Between start_date And end_date Or start_date=#"&resultdate&"# Or end_date=#"&resultdate&"#)" end if if request("capacity")=4 then sql_price="SELECT quad FROM h_prices WHERE roomtype_id="&room_type_id&" And hotels_id="&request("id")&" And (#"&resultdate&"# Between start_date And end_date Or start_date=#"&resultdate&"# Or end_date=#"&resultdate&"#)" end if 'response.Write(sql_price) 'response.End() rs_price.open sql_price,conn,1,3 'response.Write sql_price if not rs_price.eof then if request("capacity")=1 then if rs_price("single")=0 then response.Redirect("myhotel_info.asp?er=1") else ba_price=rs_price("single") b=b+rs_price("single") 'response.Write(rs_price("single"))& "
" end if end if if request("capacity")=2 then if rs_price("double")=0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&er=7") else ba_price=rs_price("double") b=b+rs_price("double") 'response.Write(rs_price("double"))& "
" end if end if if request("capacity")=3 then if rs_price("trip")=0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&er=8") else ba_price=rs_price("trip") b=b+rs_price("trip") end if end if if request("capacity")=4 then if rs_price("quad")=0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&er=9") else ba_price=rs_price("quad") b=b+rs_price("quad") end if end if else 'if resultdate=d2 then 'else bpr=bpr+bprice 'response.Write(bpr)&"
" 'response.End() 'end if end if next finalprice=b+bpr 'response.Write b &" "&bpr&" "&"
" if ba_price=0 then ba_price=bprice end if 'response.Write finalprice if finalprice=0 then response.Redirect("myhotel_info.asp?id="&request("id")&"&er=10") end if 'response.Write session("price1")& "
" 'dat=instr(1,session("price"),roomid) b=0 bpr=0 'response.End() ' new location end %> <% flag=flag+1 end if rs.movenext wend %> <% if flag=0 then %> <% end if %>
Capacity Room type Details Price Rooms Available
   <%=rs("capacity")%> <% set rs_type=server.CreateObject("adodb.recordset") sql_type="select * from h_roomtype where roomtype_id=" &room_type_id ' response.Write(sql_type) ' response.End() rs_type.open sql_type,conn,1,3 response.Write rs_type("type_name") %> <%=d_currency%><%=ba_price%> x <%=(dif3+1)%> night(s) <%=d_currency%><%=finalprice%>
"> "> "> "> "> "> <% if flag <> 0 then %> <% end if %>
Sorry no room available as your searching criteria. Please see calendar bellow.
<%end sub%>