<%@language="vbscript" %> <% 'recupera i dati dalla querystring check=request.form("check") 'modalità di controllo attiva ? if (check="") then check="off" end if 'se si sta eseguendo il controllo if(check="on") then ' blocco asp per il controllo della consistenza dei campi ' del form di prenotazione e invio della mail 'preleva i campi dal form 'dati nascosti hotelID=request.form("hotelID") season=request.form("season") IDroom=request.form("IDroom") roomdesc=request.form("roomdesc") Price=request.form("Price") City_name=request.form("City_name") 'query per i dati dell'hotel set hotel = Server.CreateObject("ADODB.Recordset") hotel.ActiveConnection = "dsn=chinahotel;" hotel.Source = "SELECT * FROM hotel where ID="&hotelID hotel.CursorType = 0 hotel.CursorLocation = 2 hotel.LockType = 3 hotel.Open hotelnome=hotel.fields.item("nome").value hoteladdress=hotel.fields.item("indirizzo").value hotel.close set hotel=nothing 'inizializza contatore e indice errori ercount=0 er=0 'dati inseriti dall'utente - controlla che i campi richiesti non siano vuoti arrMonth=request.form("arrmonth") if (arrMonth="000") then er=1 ercount=ercount+1 ' arrMonth="blank" end if arrDay=request.form("arrDay") if (arrDay="000") then er=1 ercount=ercount+1 ' arrDay="blank" end if arrYear=request.form("arrYear") if (arrYear="000") then er=1 ercount=ercount+1 ' arrYear="blank" end if depMonth=request.form("depmonth") if (depMonth="000") then er=1 ercount=ercount+1 ' depMonth="blank" end if depDay=request.form("depDay") if (depDay="000") then er=1 ercount=ercount+1 ' depDay="blank" end if depYear=request.form("depYear") if (depYear="000") then er=1 ercount=ercount+1 ' depYear="blank" end if guests=request.form("guests") if (guests="000") then er=1 ercount=ercount+1 ' guests="blank" end if rooms=request.form("rooms") if (rooms="000") then er=1 ercount=ercount+1 ' rooms="blank" end if cognome=request.form("cognome") if (cognome="") then er=1 ercount=ercount+1 cognome="zzzblank" end if nome=request.form("nome") if (nome="") then er=1 ercount=ercount+1 nome="zzzblank" end if email=request.form("email") if (email="") then er=1 ercount=ercount+1 email="zzzblank" end if address=request.form("address") if (address="") then er=1 ercount=ercount+1 address="zzzblank" end if city=request.form("city") if (city="") then er=1 ercount=ercount+1 city="zzzblank" end if paese=request.form("country") if (paese="000") then er=1 ercount=ercount+1 paese="blank" end if tel=request.form("tel") if (tel="") then er=1 ercount=ercount+1 tel="blank" end if fax=request.form("fax") if (fax="") then 'il fax non è obbligatorio ' er=1 ' ercount=ercount+1 fax="blank" end if notes=request.form("notes") 'no controllo 'valida indirizzo email %> <% if ((chkEmail(email)=1)or(email="zzzblank")) then er=1 email="badmail" end if ' ??? controlla che la partenza non sia prima dell'arrivo depString=depYear&depMonth&depDay arrString=arrYear&arrMonth&arrDay if(int(depString)" strto = "reservation@chinahotelsreservation.com" strsubject = "HOTEL RESERVATION: "&hotelnome strbody = "CHINAVACATIONS.NET"&chr(13)&"Reservation Send date: "&date&" Time: "&time&chr(13)&"---------------------------------------------------------"&chr(13)&chr(13)&"HOTEL NAME: "&hotelnome&chr(13)&"HOTEL ADDRESS: "&hoteladdress&chr(13)&"Hotel City: "&City_name&chr(13)&"Date Arrive (dd/mm/aaaa): "&arrDay&"/"&arrMonth&"/"&arrYear&chr(13)&"Date Leaving (gg/mm/aaaa): "&depDay&"/"&depMonth&"/"&depYear&chr(13)&chr(13)&"Type of Room: "&roomdesc&chr(13)&"Price(USD): "&Price&chr(13)&chr(13)&"N¡ã of Person: "&guests&chr(13)&"N¡ã of Room: "&rooms&chr(13)&chr(13)&"---------------------------------------------------------"&chr(13)&"Client Information : "&chr(13)&chr(13)&"Name: "&nome&chr(13)&"Surname: "&cognome&chr(13)&"Address: "&address&chr(13)&"City: "&city&chr(13)&"Country: "&paese&chr(13)&"Tel: "&tel&chr(13)&"Fax: "&fax&chr(13)&"E-Mail: "&email&chr(13)&"-------------------------Client NOTES -------------------------"&chr(13)¬es&chr(13)&"---------------------------------------------------------" lngImportance = "1" 'spedisci email Set myCDONTSMail = CreateObject("CDONTS.NewMail") myCDONTSMail.bcc="" myCDONTSMail.Send strFrom,strTo,strSubject,strBody,lngImportance Set myCDONTSMail = Nothing 'redirect alla pagina di OK destpage="bookok.asp?hotelid="&cstr(hotelID) response.redirect(destpage) end if 'fine della validazione del form end if 'se ci sono stati errori nella validazione salta recupero dati da querystring if check="off" then hotelID=request.querystring("hotel") seas=request.querystring("seas") IDroom=request.querystring("room") end if 'if check="on" then 'hotelID=request.form("hotelID") 'seas=request.form("season") 'IDroom=request.form("room") 'end if 'recupera dati hotel 'query per i dati dell'hotel set hotel = Server.CreateObject("ADODB.Recordset") hotel.ActiveConnection = "dsn=chinahotel;" hotel.Source = "SELECT * FROM hotel where ID="&hotelID hotel.CursorType = 0 hotel.CursorLocation = 2 hotel.LockType = 3 hotel.Open hotelnome=hotel.fields.item("nome").value hoteladdress=hotel.fields.item("indirizzo").value hotelcity=hotel.fields.item("idcitta").value hotel.close set hotel=nothing 'query per i dati di Citta set citta = Server.CreateObject("ADODB.Recordset") citta.ActiveConnection = "dsn=chinahotel;" citta.Source = "SELECT * FROM citta where ID="&hotelcity citta.CursorType = 0 citta.CursorLocation = 2 citta.LockType = 3 citta.Open City_name=citta.fields.item("citta").value citta.close set citta=nothing 'recupera i dati della stanza set room = Server.CreateObject("ADODB.Recordset") room.ActiveConnection = "dsn=chinahotel;" room.Source = "SELECT * FROM stanze where ID="&IDroom room.CursorType = 0 room.CursorLocation = 2 room.LockType = 3 room.Open roomdesc=room.fields.item("tipostanza").value 'PriceHigh=room.fields.item("prezzoalta").value 'PriceLow=room.fields.item("prezzobassa").value if (seas = "LO") then Price=room.fields.item("prezzobassa").value end if if (seas = "HI") then Price=room.fields.item("prezzoalta").value end if room.close set room=nothing %> China Hotels Reservation.com - <%=hotelnome %>

<%=hotelnome %>

China Vacations
 
China Vacations
China Hotels
China Briefing
China Business
China Culture
China Economy
China Market
China Travel
China Tourism

  <%=hotelnome %>

<% 'scrivi messaggio di errore if (er=1) then %> <% 'indirizzo posta non valido if (email="badmail") then %> <% end if %> <% 'date non valide if (baddate=1) then %> <% end if %> <% end if %>
 Form for requesting the availability of rooms
There are missing or wrong data in the form (shown in red)
The email address is not valid
The departure date is before the arrival date !
 Hotel data

<%=hotelnome %>
<%=hoteladdress %>

Your stay:

Arrival:


Departure:

class="error" <% end if %>>How many guests:

class="error" <% end if %>>How many rooms:

Room type: <%=roomdesc %>
Your data
class="error" <% end if %>> First name:
value="<%=nome %>" <% end if %>>
class="error" <% end if %>> Last name: value="<%=cognome %>" <% end if %>>
class="error" <% end if %>>e-mail address: value="<%=email %>" <% end if %>>
class="error" <% end if %>>Address: value="<%=address %>" <% end if %>>
class="error" <% end if %>>City: value="<%=city %>" <% end if %>>
class="error" <% end if %>>Country:
class="error" <% end if %>>Phone: value="<%=tel %>" <% end if %>>
Fax (optional): value="<%=fax %>" <% end if %>>
Other Requirements: (optional)
As soon as we receive your request, we will process it quickly,
and after a few hours you'll receive an e-mail confirmation of the room availability
and the confirmed price for the room.
Copyright (C)2005 China Hotels Reservation All rights reserved