sub getRegisterStep4()
cnx.beginTrans
on error resume next
dim sqlNewId, newId
sqlNewId = "select seq_tie.nextval newid from dual"
dim rsNewId
set rsNewId = Server.CreateObject("ADODB.RecordSet" )
set rsNewId.ActiveConnection = cnx
rsNewId.Open sqlNewId
newId = rsNewId("newid" )
rsNewId.Close
Set rsNewId = Nothing
dim sqlPay
sqlPay = "select etbcod, posfis, typcde from pay where codpay = " & Quote(Request.Form("codpay" ))
dim rsPay
set rsPay = Server.CreateObject("ADODB.RecordSet" )
set rsPay.ActiveConnection = cnx
rsPay.Open sqlPay
dim sqlINS
sqlINS = "insert into tie (CODSOC, TYPTIE, SIGTIE, NOMTIE, CODPAY, CODDEV, TYPCDE, SIGREP, SIGGRP, POSFIS, CODBAR, ETBCOD, FAMTIE, MODRGL, CODDPT, CODQUA, CODSPE) " &_
"values (0, 'CLI', " & Quote(newId) & ", " & Quote(Request.Form("NOMTIE" )) & ", " & Quote(Request.Form("CODPAY" )) & ", " & Quote(Request.Form("CODDEV" )) & ", " & Quote(rsPay("typcde" )) & ", 'WEB" & rsPay("etbcod" ) & "', ' ', " & Quote(rsPay("posfis" )) & ", ' ', " & Quote(rsPay("etbcod" )) & ", " & Quote(Request.Form("FAMTIE" )) & ", 'CB', '@', 0, " & Quote(Request.Form("CODSPE" )) & " )"
cnx.Execute sqlINS
rsPay.Close
Set rsPay = Nothing
dim contact
if Len(Trim(Request.Form("contact1" )) & " " & Trim(Request.Form("contact2" ))) <= 20 then
contact = Trim(Request.Form("contact1" )) & " " & Trim(Request.Form("contact2" ))
else
contact = Mid(Trim(Request.Form("contact2" )), 1, 20)
end if
dim sqlADR
sqlADR = "insert into adr (CODSOC, TYPTIE, SIGTIE, TYPADR, NUMADR, LIBADR, ADRESS, ADRSUI, LOCALI, CODPOS, CENPOS, CODPAY, CONTACT, TEL, FAX, COMMEN1, COMMEN2, COMMEN3, COMMEN4, COMMEN5, ADREDI, CODCIV) " &_
"values (0, 'CLI', " & Quote(newId) & ", 'COM', 800, " & Quote(Request.Form("nomtie" )) & ", " & Quote(Request.Form("adress" )) & ", nvl(" & Quote(Request.Form("adrsui" )) & ", ' '), nvl(" & Quote(Request.Form("locali" )) & ", ' '), " & Quote(Request.Form("codpos" )) & ", " & Quote(Request.Form("cenpos" )) & ", " & Quote(Request.Form("codpay" )) & ", " & Quote(contact) & ", " & Quote(Request.Form("tel" )) & ", nvl(" & Quote(Request.Form("fax" )) & ", ' '), ' ', ' ', ' ', ' ', ' ', " & Quote(Request.Form("email" )) & ", " & Quote(Request.Form("codciv" )) & " )"
cnx.Execute sqlADR
randomize
dim strCHARS, strPASS, i
strCHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
strPASS = ""
for i = 1 to 8
strPASS = strPASS & Mid(strCHARS, int(rnd(i) * 36) + 1, 1)
next
dim news
if Request.Form("news" ) <> "" then
news = "Y"
else
news = "N"
end if
dim sqlUSR
sqlUSR = "insert into usr (CODSOC, LOGIN, PASSWORD, NOM, PRENOM, CODLAN, CODDEV, TYPTIE, SIGTIE, EMAIL, NEWS, ACTIF) " &_
"values (0, " & Quote(newId) & ", " & Quote(strPASS) & ", " & Quote(Trim(Request.Form("contact1" ))) & ", " & Quote(Trim(Request.Form("contact2" ))) & ", " & Quote(Request.Form("codlan" )) & ", " & Quote(Request.Form("coddev" )) & ", 'CLI', " & Quote(newId) & ", " & Quote(Request.Form("email" )) & ", " & Quote(news) & ", 'Y')"
cnx.Execute sqlUSR
if err = 0 then
on error goto 0
cnx.CommitTrans
call registerMail(Request.Form("contact1" ), Request.Form("contact2" ), newId, strPASS, Request.Form("codlan" ), Request.Form("email" ))
dim sql
sql = "select desc1 from news where typnew = 'REG' and codlan = " & Quote(codlan) & " and rank = 4"
dim rs
set rs = Server.CreateObject("ADODB.RecordSet" )
set rs.ActiveConnection = cnx
rs.Open sql
if not rs.EOF then
Response.Write "<p>" & rs("desc1" ) & "</p>"
end if
rs.Close
set rs = Nothing
else
Response.Write getLabel("errorOccured", codlan)
cnx.RollbackTrans
on error goto 0
end if
end sub
|