<%@ Language=VBScript%> <% dim strpagecode strpagecode= "4EXIS02" %> <% 'Page/form name:5.6_userregentry.asp 'Purpose:User interface for entering his details 'Date Modified:17-09-2001 'Author: Ashish Bansal %> <% on error resume next dim rsUserMaster,rsAssReguGenMaster,rsCountryMaster,rsExhibInquiry dim strLoginId,strUserType,EncodedSectionName dim strSqlExhibEnquiry dim strCompName,strAddress1,strAddress2,strAddress3,strCity,strState,strPIN,strCountry,strCountryCode dim strEMail,strTitle,strExec,strDesig,strBusinessNature,strComments dim strPh1,strPh2,strFax1 dim strTele11,strTele12,strTele13,strTele21,strTele22,strTele23,strFax11,strFax12,strFax13 dim NewObjConn set NewObjConn=server.CreateObject("adodb.connection") NewObjConn.Open strconstring if err <> 0 then response.Redirect "/inc/commoninc/error.asp?section=" & EncodedSectionName & "&errortype=err_con" Response.End end if EncodedSectionName=Server.URLEncode("Inquiry") strLoginId=trim(session("USERID")) if strLoginId="" then Response.Redirect "/inc/commoninc/error.asp?section=" & EncodedSectionName & "&errorno=MF5" end if strCompName=trim(request("ExhibEnq_CompName")) strAddress1=trim(request("ExhibEnq_Addr1")) strAddress2=trim(request("ExhibEnq_Addr2")) strAddress3=trim(request("ExhibEnq_Addr3")) strCity=trim(request("ExhibEnq_City")) strPIN=trim(request("ExhibEnq_Pin")) strState=trim(request("ExhibEnq_State")) strCountry=trim(request("ExhibEnq_Country")) strEMail=trim(request("ExhibEnq_Email")) strTitle=trim(request("Title")) strExec=trim(request("ExhibEnq_Exec1")) strDesig=trim(request("ExhibEnq_Desig1")) strBusinessNature=trim(request("ExhibEnq_BuisnessNature")) strComments=trim(request("ExhibEnq_Comments")) if trim(request("Tele11") )="" then strPh1="" else strPh1=request("Tele11") & "-" & request("Tele12") & "-" & request("Tele13") end if if trim(request("Tele21") )="" then strPh2="" else strPh2=request("Tele21") & "-" & request("Tele22") & "-" & request("Tele23") end if if trim(request("Fax11") )="" then strFax1="" else strFax1=request("Fax11") & "-" & request("Fax12") & "-" & request("Fax13") end if 'Processing of single quote function changequotes(inputstr) changequotes= replace(inputstr,"'","''") changequotes=trim(changequotes) end function 'set rsExhibInquiry=server.CreateObject("ADODB.RECORDSET") 'rsExhibInquiry.Open "select * from exhib_inquiry where LoginId='" & strLoginId & "'",objConn 'if not rsExhibInquiry.EOF then InsertExhibMater 'else ' UpdateExhibMater 'end if 'Response.Write strSqlExhibEnquiry NewObjConn.Execute strSqlExhibEnquiry if Err then 'if error occurred. NewObjConn.Rollbacktrans NewObjConn.Close set NewObjConn=nothing Response.Redirect "/inc/commoninc/error.asp?section=" & EncodedSectionName & "&errorno=1" Response.End else NewObjConn.CommitTrans UpdateLogTable NewObjConn.Close set NewObjConn=nothing Response.Redirect "/inc/commoninc/Confirm.asp?section=" & EncodedSectionName & "&message=Thanks for submitting your inquiry. We will shortly contact you." end if sub InsertExhibMater() NewObjConn.BeginTrans strSqlExhibEnquiry="Insert into exhib_inquiry(LoginId,Company_Name,Address1,Address2,Address3," &_ "phone1,phone2,Fax,Email,Title,Contact_Executive,Contact_Designation," &_ "City,State,Pincode,Country,business_Nature,Comments,Replied," &_ "createuserid,createdate)" &_ " values('"& changequotes(strLoginId) &"','" & changequotes(strCompName) & "','" & changequotes(strAddress1) & "','" & changequotes(strAddress2) &_ "','" & changequotes(strAddress3) & "','" & changequotes(strPh1) & "','" & changequotes(strPh2)&_ "','" & changequotes(strFax1) & "','" & changequotes(strEMail) & "','" & changequotes(strTitle) & "','" & changequotes(strExec) & "','" & changequotes(strDesig) & "'," &_ "'" & changequotes(strCity) & "','" & changequotes(strState) & "'," &_ "'" & changequotes(strPIN) & "','" & changequotes(strCountry) & "','" & changequotes(strBusinessNature) & "'," &_ "'" & changequotes(strComments) & "','N','" & changequotes(strLoginId) &"','" & date & "')" end sub sub UpdateExhibMater() NewObjConn.BeginTrans strSqlExhibEnquiry="Update exhib_inquiry set Company_Name='" & changequotes(strCompName)& "' , " &_ "Address1='" & changequotes(strAddress1)& "' , Address2='" & changequotes(strAddress2)& "' , Address3='" & changequotes(strAddress3)& "' , phone1='" & changequotes(strPh1)& "' , phone2='" & changequotes(strPh2)& "' , " &_ "Fax='" & changequotes(strFax1) & "' , Email='" & changequotes(strEMail) & "' , Contact_Executive='" & changequotes(strExec) & "' , " &_ "Contact_Designation='" & changequotes(strDesig) & "' ,city='" & changequotes(strCity) & "' , state='" & changequotes(strState) & "' , country='" & changequotes(strCountry) & "' , " &_ "PinCode='" & changequotes(strPIN) & "' , business_Nature='" & changequotes(strBusinessNature) & "' , Comments='" & changequotes(strComments) & "' , " &_ " ModifyUserid='" & changequotes(UserId) & "', ModifyDate='" & Date & "' where LoginId='" & strLoginId & "'" end sub %> <% Sub UpdateLogTable() strRelativePath="/exhibitioncenter/inquiry.asp" URLPath = "http://" & Request.ServerVariables("SERVER_NAME") & strRelativePath ipaddress = Request.ServerVariables("REMOTE_ADDR") machinename = Request.ServerVariables("REMOTE_HOST") sec_code = "455" uploadtype = "D" ' tablename = "Exhib_Enquiry" primarykey = "" ' if session("userid")<>"" then userid=session("userid") : else : userid=" " currentdate = formatdatetime(now(),vbshortdate) filepath = null dim cmd Set cmd = Server.CreateObject("ADODB.Command") Set cmd.ActiveConnection = objConn cmd.CommandText = "sp_upload_log" cmd.CommandType = adCmdStoredProc cmd.Parameters.Refresh 'Insert values cmd.Parameters("@userid")=userid cmd.Parameters("@ip")=ipaddress cmd.Parameters("@machinename")=machinename cmd.Parameters("@sectioncode")=sec_code cmd.Parameters("@tablename")=tablename cmd.Parameters("@primarykey")=primarykey cmd.Parameters("@date")=currentdate cmd.Parameters("@uploadtype")=uploadtype cmd.Parameters("@filepath")=filepath cmd.Parameters("@urlpath")=urlpath cmd.Execute End Sub%>