% 'put the information to the database if request.querystring("success")="yes" then end if%> <%if trim(request("REQUEST_METHOD")) = "POST" and len(request.querystring("success"))=0 then if request("arrival_year")="Year" then pickup_date=request("arrival_month")+"/"+request("arrival_day")&"/"&year(now()) else pickup_date=request("arrival_month")+"/"+request("arrival_day")&"/"&request("arrival_year") end if if request("dropoff_year")="Year" then dropoff_date=request("dropoff_month")+"/"+request("dropoff_day")&"/"&year(now()) else dropoff_date=request("dropoff_month")+"/"+request("dropoff_day")&"/"&request("dropoff_year") end if 'response.write(request("arrival_month")="Jun" or request("pickup_month")="Jul" or request("pickup_month")="Aug" or request("pickup_month")="Sep") 'response.end if ((request("arrival_month")="Jun" or request("arrival_month")="Jul" or request("arrival_month")="Aug" or request("arrival_month")="Sep") and (cdate(dropoff_date)-cdate(pickup_date)>=7)) or ((request("arrival_month")="Jan" or request("arrival_month")="Feb" or request("arrival_month")="Mar" or request("arrival_month")="Apr" or request("arrival_month")="May" or request("arrival_month")="Oct" or request("arrival_month")="Nov" or request("arrival_month")="Dec") and (cdate(dropoff_date)-cdate(pickup_date)>=3)) then 'sql="select * from tbl_vehicle where vehicle_name='"+request("RV_size")+"'" 'set oConn=server.createobject("adodb.connection") 'DSNtemp="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("Utilization_Inventory.mdb") 'oConn.Open DSNtemp 'set rs_rv=server.createobject("adodb.recordset") 'rs_rv.open sql,oconn 'if rs_rv("vehicle_qty")=0 then 'set rs_book=server.createobject("adodb.recordset") 'sql="select * from tbl_books where is_reser is null" 'rs_book.open sql,oconn 'is_has="no" 'do while not rs_book.eof 'if rs_book("dropoff_date")< cdate(pickup_date) then ' is_has="yes" 'exit do 'end if 'rs_book.movenext 'loop 'if is_has="yes" then ' sql="update tbl_books set is_reser='yes' where book_id="&rs_book("book_id") 'oconn.execute sql 'end if ' end if 'if rs_rv("vehicle_qty")>0 or is_has="yes" then 'get all information firstname=request("firstname") lastname=request("lastname") address=request("address") city=request("city") state=request("state_prov") zip=request("postalzip") country=request("country") guests=request("guests") phone=request("phone") email=request("email") if request("arrival_year")="Year" then pickup_date=request("arrival_month")+"/"+request("arrival_day")&"/"&year(now()) else pickup_date=request("arrival_month")+"/"+request("arrival_day")&"/"&request("arrival_year") end if pickup=request("pickup_city") if request("dropoff_year")="Year" then dropoff_date=request("dropoff_month")+"/"+request("dropoff_day")&"/"&year(now()) else dropoff_date=request("dropoff_month")+"/"+request("dropoff_day")&"/"&request("dropoff_year") end if dropoff=request("dropoff_city") motor_type=request("rv_size") mileage=request("mileage") Insurance=request("Insurance") 'response.write("dddd="&insurance) 'response.end kits=request("Convenience_Kits") if isnumeric(request("extra")) then extra=cdbl(request("extra"))*0.29 else extra=0 end if 'response.write("aaaa="&extra) 'response.end pick_month=request("arrival_month") pick_day=request("arrival_day") drop_month=request("dropoff_month") drop_day=request("dropoff_day") if pick_month=drop_month then diff_day=cint(drop_day)-cint(pick_day) if pick_month="Nov" or pick_month="Dec" or pick_month="Jan" or pick_month="Feb" or pick_month="Mar" or pick_month="Apr" then 'total=100*diff_day if request("mileage")="160km" then total=total+diff_day*16 elseif request("mileage")="unlimited" then total=total+diff_day*77 end if if request("Insurance")="Insurance" then total=total+diff_day*20 end if if request("RV_size")="MHC24" then total=total+95*diff_day end if if request("RV_size")="MHC28" then total=total+110*diff_day end if if request("RV_size")="MHC30" then total=total+125*diff_day end if if request("RV_size")="MHA30" then total=total+140*diff_day end if if request("RV_size")="MHADL" then total=total+155*diff_day end if end if if pick_month="May" or pick_month="Oct" then ' total=100*diff_day if request("mileage")="160km" then total=total+diff_day*16 elseif request("mileage")="unlimited" then total=total+diff_day*77 end if if request("Insurance")="Insurance" then total=total+diff_day*20 end if if request("RV_size")="MHC24" then total=total+125*diff_day end if if request("RV_size")="MHC28" then total=total+140*diff_day end if if request("RV_size")="MHC30" then total=total+155*diff_day end if if request("RV_size")="MHA30" then total=total+170*diff_day end if if request("RV_size")="MHADL" then total=total+185*diff_day end if end if if pick_month="Jun" or pick_month="Sep" then 'total=100*diff_day if request("mileage")="160km" then total=total+diff_day*16 elseif request("mileage")="unlimited" then total=total+diff_day*77 end if if request("Insurance")="Insurance" then total=total+diff_day*20 end if if request("RV_size")="MHC24" then total=total+155*diff_day end if if request("RV_size")="MHC28" then total=total+170*diff_day end if if request("RV_size")="MHC30" then total=total+185*diff_day end if if request("RV_size")="MHA30" then total=total+200*diff_day end if if request("RV_size")="MHADL" then total=total+155*diff_day end if end if if pick_month="Jul" or pick_month="Aug" then 'total=100*diff_day if request("mileage")="160km" then total=total+diff_day*16 elseif request("mileage")="unlimited" then total=total+diff_day*77 end if if request("Insurance")="Insurance" then total=total+diff_day*20 end if if request("RV_size")="MHC24" then total=total+200*diff_day end if if request("RV_size")="MHC28" then total=total+225*diff_day end if if request("RV_size")="MHC30" then total=total+260*diff_day end if if request("RV_size")="MHA30" then total=total+275*diff_day end if if request("RV_size")="MHADL" then total=total+155*diff_day end if end if 'response.write("dddd="&diff_day) 'response.end end if if pick_month<>drop_month then if (pick_month="Nov" and drop_month="Dec") or (pick_month="Dec" and drop_month="Jan") or (pick_month="Jan" and drop_month="Feb") or (pick_month="Feb" and drop_month="Mar") or (pick_month="Mar" and drop_month="Apr") then if pick_month="Jan" and drop_month="Feb" then diff_day1=31-cint(pick_day) elseif pick_month="Feb" and drop_month="Mar" then diff_day1=28-cint(pick_day) elseif pick_month="Mar" and drop_month="Apr" then diff_day1=31-cint(pick_day) elseif pick_month="Dec" and drop_month="Jan" then diff_day1=31-cint(pick_day) elseif pick_month="Nov" and drop_month="Dec" then diff_day1=30-cint(pick_day) end if diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+95*(diff_day1+diff_day2) end if if request("RV_size")="MHC28" then total=total+110*(diff_day1+diff_day2) end if if request("RV_size")="MHC30" then total=total+125*(diff_day1+diff_day2) end if if request("RV_size")="MHA30" then total=total+140*(diff_day1+diff_day2) end if if request("RV_size")="MHADL" then total=total+155*(diff_day1+diff_day2) end if end if if (pick_month="Apr" and drop_month="May") then diff_day1=30-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+125*diff_day2 total=total+95*diff_day1 end if if request("RV_size")="MHC28" then total=total+140*diff_day2 total=total+110*diff_day1 end if if request("RV_size")="MHC30" then total=total+155*diff_day2 total=total+125*diff_day1 end if if request("RV_size")="MHA30" then total=total+170*diff_day2 total=total+140*diff_day1 end if if request("RV_size")="MHADL" then total=total+185*diff_day2 total=total+155*diff_day1 end if end if if (pick_month="May" and drop_month="Jun") then diff_day1=31-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+125*diff_day1 total=total+155*diff_day2 end if if request("RV_size")="MHC28" then total=total+140*diff_day1 total=total+170*diff_day2 end if if request("RV_size")="MHC30" then total=total+155*diff_day1 total=total+185*diff_day2 end if if request("RV_size")="MHA30" then total=total+170*diff_day1 total=total+200*diff_day2 end if if request("RV_size")="MHADL" then total=total+185*diff_day1 total=total+215*diff_day2 end if end if if (pick_month="Jun" and drop_month="Jul") then diff_day1=30-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+200*diff_day2 total=total+155*diff_day1 end if if request("RV_size")="MHC28" then total=total+225*diff_day2 total=total+170*diff_day1 end if if request("RV_size")="MHC30" then total=total+260*diff_day2 total=total+185*diff_day1 end if if request("RV_size")="MHA30" then total=total+275*diff_day2 total=total+200*diff_day1 end if if request("RV_size")="MHADL" then total=total+290*diff_day1 total=total+215*diff_day2 end if end if if (pick_month="Jul" and drop_month="Aug") then diff_day1=31-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+200*(diff_day2+diff_day1) end if if request("RV_size")="MHC28" then total=total+225*(diff_day2+diff_day1) end if if request("RV_size")="MHC30" then total=total+260*(diff_day2+diff_day1) end if if request("RV_size")="MHA30" then total=total+275*(diff_day2+diff_day1) end if if request("RV_size")="MHADL" then total=total+290*(diff_day1+diff_day2) 'total=total+155*diff_day2 end if end if if (pick_month="Aug" and drop_month="Sep") then diff_day1=31-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+200*diff_day1 total=total+155*diff_day2 end if if request("RV_size")="MHC28" then total=total+225*diff_day1 total=total+170*diff_day2 end if if request("RV_size")="MHC30" then total=total+260*diff_day1 total=total+185*diff_day2 end if if request("RV_size")="MHA30" then total=total+275*diff_day1 total=total+200*diff_day2 end if if request("RV_size")="MHADL" then total=total+290*diff_day1 total=total+215*diff_day2 end if end if if (pick_month="Sep" and drop_month="Oct") then diff_day1=30-cint(pick_day) diff_day2=cint(drop_day) 'total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+125*diff_day2 total=total+155*diff_day1 end if if request("RV_size")="MHC28" then total=total+140*diff_day2 total=total+170*diff_day1 end if if request("RV_size")="MHC30" then total=total+155*diff_day2 total=total+185*diff_day1 end if if request("RV_size")="MHA30" then total=total+170*diff_day2 total=total+200*diff_day1 end if if request("RV_size")="MHADL" then total=total+185*diff_day2 total=total+215*diff_day1 end if end if if (pick_month="Oct" and drop_month="Nov") then diff_day1=31-cint(pick_day) diff_day2=cint(drop_day) ' total=100*(diff_day1+diff_day2) if request("mileage")="160km" then total=total+(diff_day1+diff_day2)*16 elseif request("mileage")="unlimited" then total=total+(diff_day1+diff_day2)*77 end if if request("Insurance")="Insurance" then total=total+(diff_day1+diff_day2)*20 end if if request("RV_size")="MHC24" then total=total+125*diff_day1 total=total+95*diff_day2 end if if request("RV_size")="MHC28" then total=total+140*diff_day1 total=total+110*diff_day2 end if if request("RV_size")="MHC30" then total=total+155*diff_day1 total=total+125*diff_day2 end if if request("RV_size")="MHA30" then total=total+170*diff_day1 total=total+140*diff_day2 end if if request("RV_size")="MHADL" then total=total+185*diff_day1 total=total+155*diff_day2 end if end if end if if isnumeric(request("extra")) then total=total+cdbl(request("extra"))*0.29 end if ' response.write("dddd="&request("Convenience_Kits")) ' response.end if request("Convenience_Kits")<>"None" then total=total+cdbl(request("Convenience_Kits")) end if total=(total+125)*1.14 'response.write(total) 'response.end 'if all is ok,go to paypal 'response.write("dddd="&insurance) ' response.end SQL="insert into tbl_books (first_name,last_name,address,city,state,zip,country,phone,email,number_of_people,pickup_date" _ & ",pickup_location,dropoff_date,dropoff_location,motor_selection,mileage_plan,insurance,extra,convenience_kit) values ('" _ & firstname&"','"&lastname&"','"&address&"','"&city&"','"&state&"','"&zip&"','"&country&"','"&phone&"','"&email&"'," _ & guests&",'"+pickup_date+"','"+pickup+"','"+dropoff_date+"','"+dropoff+"','"+motor_type+"','"+mileage+"','" _ & insurance&"',"&extra&",'"&Kits&"')" set oConn=server.createobject("adodb.connection") DSNtemp="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("Utilization_Inventory.mdb") oConn.Open DSNtemp 'oconn.execute SQL sql="select * from tbl_vehicle where vehicle_name='"+motor_type+"'" set rs_rv1=server.createobject("adodb.recordset") rs_rv1.open sql,oconn rv_qty=rs_rv1("vehicle_qty")-1 sql="update tbl_vehicle set vehicle_qty=" & rv_qty & " where vehicle_name='"+motor_type+"'" 'oconn.execute sql set rv_qty1=nothing 'response.write("ok") 'response.end %> <% 'else 'response.write "" firstname=request("firstname") lastname=request("lastname") address=request("address") city=request("city") state=request("state_prov") zip=request("postalzip") country=request("country") guests=request("guests") phone=request("phone") email=request("email") 'end if else Response.Write("") firstname=request("firstname") lastname=request("lastname") address=request("address") city=request("city") state=request("state_prov") zip=request("postalzip") country=request("country") guests=request("guests") phone=request("phone") email=request("email") end if end if %>

Reservations