<% Option Explicit %> <% dim strPageCode strPageCode = "32Pro01" 'dim strpagecode 'strpagecode= "FAIRG40" session("usertype")="NUS" %> <% dim strinsert dim rs dim company_name dim chSalutation dim contact_person dim Addr1 dim Addr2 dim Addr3 dim city dim pin_code dim country_code, country_name dim area_code dim phone1 dim phone2 dim fax1 dim fax2 dim email dim website dim pan_no dim salestaxno dim prodid dim other_product_name dim CategoryId dim TypeCode dim HallSpaceCode dim chkHS1 dim hallid1 dim preferenceorder1 dim spacebooked1 dim CalAmount1 dim chkHS2 dim hallid2 dim preferenceorder2 dim spacebooked2 dim CalAmount2 dim chkHS3 dim hallid3 dim preferenceorder3 dim spacebooked3 dim CalAmount3 dim chk1 dim SpaceId1 dim space1 dim CalSpaceAmount1 dim chk2 dim SpaceId2 dim space2 dim CalSpaceAmount2 dim CreateUserID dim CreateDate dim strQry dim NextMaxId dim totalAmount dim AdvanceAmount dim spacebook1,spacebook2,spacebook3,spacebook4,spacebook5,ttamt dim hall1,hall2,hall3,spacen1,spacen2 session("hall1") =Request.Form("hdcustname") session("hall2") =Request.Form("hdcustname1") session("hall3") =Request.Form("hdcustname2") session("spacen1") =Request.Form("hdcustname3") session("spacen2") =Request.Form("hdcustname4") NextMaxId = 0 company_name = "" chSalutation = "" contact_person = "" Addr1 = "" Addr2 = "" Addr3 = "" city = "" pin_code = "" country_code = "" area_code = "" phone1 = "" phone2 = "" fax1 = "" fax2 = "" email = "" website = "" pan_no = "" salestaxno = "" prodid = "" other_product_name = "" CategoryId = "" TypeCode = "" HallSpaceCode = "" totalAmount = 0 AdvanceAmount = 0 chkHS1 = "" hallid1 = "" preferenceorder1 = "" spacebooked1 = "" CalAmount1 = "" chkHS2 = "" hallid2 = "" preferenceorder2 = "" spacebooked2 = "" CalAmount2 = "" chkHS3 = "" hallid3 = "" preferenceorder3 = "" spacebooked3 = "" CalAmount3 = "" chk1 = "" SpaceId1 = "" space1 = "" CalSpaceAmount1 = "" chk2 = "" SpaceId2 = "" space2 = "" CalSpaceAmount2 = "" company_name = replace(trim(request.Form("companyname")),"'","''",1,-1,1) chSalutation = replace(trim(request.Form("cboSalutation")),"'","''",1,-1,1) contact_person = replace(trim(request.Form("personname")),"'","''",1,-1,1) Addr1 = replace(trim(request.Form("addr1")),"'","''",1,-1,1) Addr2 = replace(trim(request.Form("addr2")),"'","''",1,-1,1) Addr3 = replace(trim(request.Form("addr3")),"'","''",1,-1,1) city = replace(trim(request.Form("city")),"'","''",1,-1,1) pin_code = replace(trim(request.Form("pincode")),"'","''",1,-1,1) country_code = replace(trim(request.Form("cboCountry")),"'","''",1,-1,1) country_name = replace(trim(request.Form("cboCountryName")),"'","''",1,-1,1) area_code = replace(trim(request.Form("areacode")),"'","''",1,-1,1) 'phone1 = replace(trim(request.Form("phone1")),"'","''",1,-1,1) phone1 = trim(request.Form("strPhone1")) phone2 = replace(trim(request.Form("phone2")),"'","''",1,-1,1) 'fax1 = replace(trim(request.Form("faxno1")),"'","''",1,-1,1) fax1 = trim(request.Form("faxno1")) fax2 = replace(trim(request.Form("faxno2")),"'","''",1,-1,1) email = replace(trim(request.Form("email")),"'","''",1,-1,1) website = replace(trim(request.Form("website")),"'","''",1,-1,1) pan_no = replace(trim(request.Form("panno")),"'","''",1,-1,1) salestaxno = replace(trim(request.Form("salestaxno")),"'","''",1,-1,1) prodid = trim(request.Form("cboProduct")) other_product_name = replace(trim(request.Form("otherproduct")),"'","''",1,-1,1) CategoryId = trim(request.Form("cboCategory")) TypeCode = trim(request.Form("cboType")) HallSpaceCode = trim(request.Form("cboHallSpace")) totalAmount = trim(request.Form("totalamt")) AdvanceAmount = trim(request.Form("advamt")) '-- data for Halls -------------' chkHS1 = trim(request.Form("chkHS1")) hallid1 = trim(request.Form("cboHall1")) preferenceorder1 = "1" spacebooked1 = trim(request.Form("hallspace1")) CalAmount1 = trim(request.Form("hallamt1")) chkHS2 = trim(request.Form("chkHS2")) hallid2 = trim(request.Form("cboHall2")) preferenceorder2 = "2" spacebooked2 = trim(request.Form("hallspace2")) CalAmount2 = trim(request.Form("hallamt2")) chkHS3 = trim(request.Form("chkHS3")) hallid3 = trim(request.Form("cboHall3")) preferenceorder3 = "3" spacebooked3 = trim(request.Form("hallspace3")) CalAmount3 = trim(request.Form("hallamt3")) ' -- end of data for the Halls ---' '------ Outdoor Spaces ----' chk1 = trim(request.Form("chk1")) SpaceId1 = trim(request.Form("cboSpace1")) space1 = trim(request.Form("space1")) CalSpaceAmount1 = trim(request.Form("outspaceamt1")) chk2 = trim(request.Form("chk2")) SpaceId2 = trim(request.Form("cboSpace2")) space2 = trim(request.Form("space2")) CalSpaceAmount2 = trim(request.Form("outspaceamt2")) session("spacebook1") = spacebooked1 session("spacebook2") = spacebooked2 session("spacebook3") = spacebooked3 session("spacebook4") = space1 session("spacebook5") = space2 session("ttamt") = totalAmount '----- end of Outdoor Space ---' CreateUserID = trim(Session("userid")) CreateDate = now() set rs = Server.CreateObject("ADODB.RECORDSET") if trim(request("accept")) = "Y" then ObjConn.BeginTrans Insert_Into_Temp_Tables Insert_Into_Original_Tables Delete_From_Temp_Tables end if function Insert_Into_Temp_Tables() 'Inserting into the HallBooking Transaction table. if prodid = 0 then strinsert = " Insert into HallBookingTemp (company_name,chSalutation, " & _ " contact_person,Addr1, Addr2, Addr3, city, pin_code, " & _ " country_code, area_code,phone1, phone2, fax1, fax2, email, " & _ " website, pan_no, salestaxno, prodid, other_product_name, " & _ " CategoryId,TypeCode, HallSpaceCode, CreateUserID, CreateDate," & _ " totalAmount,AdvanceAmount) " & _ " values ('" & company_name & "','" & chSalutation & _ "','" & contact_person & "','" & Addr1 & "','" & Addr2 & "','" & _ Addr3 & "','" & city & "','" & pin_code & "'," & country_code & _ ",'" & area_code & "','" & phone1 & "','" & phone2 & "','" & _ fax1 & "','" & fax2 & "','" & email & "','" & website & "','" & _ pan_no & "','" & salestaxno & "',NULL,'" & other_product_name & _ "'," & CategoryId & ",'" & TypeCode & "','" & HallSpaceCode & "','" & _ CreateUserID & "','" & CreateDate & "'," else strinsert = " Insert into HallBookingTemp (company_name,chSalutation, " & _ " contact_person,Addr1, Addr2, Addr3, city, pin_code, " & _ " country_code, area_code,phone1, phone2, fax1, fax2, email, " & _ " website, pan_no, salestaxno, prodid, other_product_name, " & _ " CategoryId,TypeCode, HallSpaceCode, CreateUserID, CreateDate," & _ " totalAmount,AdvanceAmount) " & _ " values ('" & company_name & "','" & chSalutation & _ "','" & contact_person & "','" & Addr1 & "','" & Addr2 & "','" & _ Addr3 & "','" & city & "','" & pin_code & "'," & country_code & _ ",'" & area_code & "','" & phone1 & "','" & phone2 & "','" & _ fax1 & "','" & fax2 & "','" & email & "','" & website & "','" & _ pan_no & "','" & salestaxno & "'," & prodid & ",NULL," & CategoryId & _ ",'" & TypeCode & "','" & HallSpaceCode & "','" & _ CreateUserID & "','" & CreateDate & "'," end if if AdvanceAmount = "" then strinsert = strinsert & totalAmount & ",NULL)" else strinsert = strinsert & totalAmount & "," & AdvanceAmount & ")" end if 'on error resume next ' response.Write strinsert ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 'finding the AppId of the just inserted Application. strQry = " Select Max(appid) MaxId from hallbookingTemp where Upper(ltrim(rtrim(company_name))) = '" & _ company_name & "' and country_code = " & country_code 'on error resume next 'set rs = ObjConn.Execute(strQry) rs.ActiveConnection = objConn ' rs.Properties("Preserve On Commit").Value = True ' rs.Properties("Preserve On Abort").Value = True rs.CursorLocation = adUseClient rs.Open strQry, ,adOpenStatic, adLockOptimistic if err <> 0 then response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 if not ( rs.EOF and rs.BOF ) then nextMaxId = rs("MaxId") end if 'Inserting into HallPreferancedetails ie Halls and their entries 'First Hall 'response.write " nextMaxId = " & nextMaxId if chkHS1 = "on" then strinsert = " Insert into HallPreferancedetailsTemp (appid,hallid, preferenceorder, " & _ " spacebooked, CalAmount, CreateUserID, CreateDate) " & _ " values (" & nextMaxId & "," & hallid1 & ",1," & _ spacebooked1 & "," & CalAmount1 & ",'" & CreateUserID & "','" & _ CreateDate & "')" 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 end if 'Second Hall if chkHS2 = "on" then strinsert = " Insert into HallPreferancedetailsTemp (appid,hallid, preferenceorder, " & _ " spacebooked, CalAmount, CreateUserID, CreateDate) " & _ " values (" & nextMaxId & "," & hallid2 & ",2," & _ spacebooked2 & "," & CalAmount2 & ",'" & CreateUserID & "','" & _ CreateDate & "')" 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 end if 'Third Hall if chkHS3 = "on" then strinsert = " Insert into HallPreferancedetailsTemp (appid,hallid, preferenceorder, " & _ " spacebooked, CalAmount, CreateUserID, CreateDate) " & _ " values (" & nextMaxId & "," & hallid3 & ",3," & _ spacebooked3 & "," & CalAmount3 & ",'" & CreateUserID & "','" & _ CreateDate & "')" 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 end if if chk1 = "on" then strinsert = " Insert into HallBookOutdoorSpacedetailsTemp (appid,SpaceId, " & _ " spacebooked, " & _ " CalAmount, CreateUserID, CreateDate) " & _ " values (" & nextMaxId & "," & SpaceId1 & "," & _ space1 & "," & CalSpaceAmount1 & ",'" & CreateUserID & "','" & _ CreateDate & "')" 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 end if if chk2 = "on" then strinsert = " Insert into HallBookOutdoorSpacedetailsTemp (appid,SpaceId, " & _ " spacebooked, " & _ " CalAmount, CreateUserID, CreateDate) " & _ " values (" & nextMaxId & "," & SpaceId2 & "," & _ space2 & "," & CalSpaceAmount2 & ",'" & CreateUserID & "','" & _ CreateDate & "')" 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 end if if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End else 'objconn.CommitTrans 'SendUnformattedMail 'Response.redirect "/inc/admin/confirm.asp?message=1§ion=" & Server.URLEncode("Hall Registration")& "&path=/fairregistration/admin" 'now, user will be taken to the Payment Order site. 'session("name") = company_name 'session("appid") = nextMaxId 'response.Redirect("Ssl_Order.asp") end if end function function Insert_Into_Original_Tables() 'Inserting into the HallBooking Transaction table. 'on error resume next 'response.Write strinsert strinsert = " Insert into HallBooking select * from HallBookingTemp where appid = " & nextMaxId ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 'on error resume next strinsert = " Insert into HallPreferancedetails select * from HallPreferancedetailsTemp where appid = " & nextMaxId ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 strinsert = " Insert into HallBookOutdoorSpacedetails select * from HallBookOutdoorSpacedetailsTemp where appid = " & nextMaxId 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End else 'objconn.CommitTrans 'SendUnformattedMail 'Response.redirect "/inc/admin/confirm.asp?message=1§ion=" & Server.URLEncode("Hall Registration")& "&path=/fairregistration/admin" end if end function function Delete_From_Temp_Tables() 'on error resume next 'response.Write strinsert strinsert = " Delete from HallBookingTemp where appid = " & nextMaxId ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if 'response.write "herewithq" 'response.end on error goto 0 'on error resume next strinsert = " Delete from HallPreferancedetailsTemp where appid = " & nextMaxId ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 strinsert = " Delete from HallBookOutdoorSpacedetailsTemp where appid = " & nextMaxId 'on error resume next ObjConn.Execute strinsert if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 if err <> 0 then objconn.RollbackTrans response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End else objconn.CommitTrans session("name") = company_name session("city") = city session("countryname") = country_name session("address") = Addr1 session("appid") = nextMaxId Response.write "him" 'Response.end SendUnformattedMail Response.redirect "/inc/admin/confirm.asp?message=1§ion=" & Server.URLEncode("Hall Registration")& "&path=/fairregistration/admin" end if end function function SendUnformattedMail_old() 'on error resume next dim reqmail,assmail,reqno, strQe, myMail, MAIL_REGARDS,strTo strQe = "" MAIL_REGARDS = "Regards," & chr(13) & Application("adminname") & ", " & chr(13) & "Tradeportalofindia.com" dim strRequestorEmail dim strGoalKMail dim strCaptainMail strRequestorEmail = "" strGoalKMail = "" strCaptainMail = "" Set myMail = server.CreateObject("CDONTS.NEWMAIL") strTo = "" myMail.From = Application("adminname") 'myMail.To = "iitf2003@itpo-online.com" myMail.To = "ajays@hclcomnet.co.in" myMail.CC = "himanshun@hclcomnet.co.in" 'myMail.CC = "ksd@itpo-online.com" myMail.Subject = " Customer Request for Hall / Space Booking " myMail.Body = company_name & " has requested for space booking in the IITF 2003 fair." & chr(13) & chr(13) & _ MAIL_REGARDS 'on error resume next 'Response.write "hello" myMail.Send 'Response.write "Hi" 'Response.end if err.number<>0 then Response.Redirect "/UserInterface/inc/error.asp?errtype=err_object§ion=" & SectionName Response.End end if ON ERROR GOTO 0 Set myMail = Nothing end function %>