<% '----------------------- Variable defination ----------------------- '------------- common------------------ font1 = "font-family=tahoma;" zfrom_email = "" photopath="images" appversion = "1.0" Session.LCID = 1033 ' mm/dd/yy zfontsize = session("zfontsize") web_title = "Minamoto battery" nu_events_list = 7 bgcolor_A = "#C8D3E6" bgcolor_B = "#E0DFE3" '------------- local dev------------------ %> <% 'On Error Resume Next '----------------------- database Connection ----------------------- 'Dim MyConnSC, rsSC, sqlSC connn = Server.Mappath("\db_\minamoto.mdb") ' Set MyConnSC = Server.CreateObject("ADODB.Connection") ' MyConnSC.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _ ' & "Data Source=" & connn & ";" '----------------------- SQL ----------------------- Function SQLxx(data) if data <> "" then SQLxx = Replace( data, "'", "''") SQLxx = "'" & Replace( SQLxx, """", "" ) & "'" else SQLxx = "''" end if End Function '######## Mytime #################### Function Mytime( Etime) dteHour = hour(Etime) dtemin = minute(Etime) dtesec = second(Etime) Mytime = dteHour & ":" & dtemin & ":" & dtesec End Function '######## MyDate #################### Function MyDate( Edate ) if Edate <> "" and isdate(Edate) = true then dteCurrent = Edate dteDay = Day(dteCurrent) dteMonth = left(Monthname(month(dteCurrent)),3) 'dteMonth = month(dteCurrent) dteYear = Year(dteCurrent) dteHour = hour(dteCurrent) if len(dteHour)=1 then dteHour = "0"&dteHour dtemin = minute(dteCurrent) if len(dtemin)=1 then dtemin = "0"&dtemin dtesec = second(dteCurrent) if len(dtesec)=1 then dtesec = "0"&dtesec 'MyDate = dteMonth & "/" & dteDay & "/" & dteYear &" "& dteHour & ":" & dtemin & ":" & dtesec 'MyDate = dteDay & "/" & dteMonth & "/" & dteYear &" "& dteHour & ":" & dtemin & ":" & dtesec MyDate = dteMonth & "/" & dteDay & "/" & dteYear &" "& dteHour & ":" & dtemin & ":" & dtesec else end if End Function '######## MyDate1 #################### Function MyDate1( Edate ) if Edate <> "" and isdate(Edate) = true then dteCurrent = Edate dteDay = Day(dteCurrent) 'dteMonth = left(Monthname(month(dteCurrent)),3) dteMonth = Monthname(month(dteCurrent)) dteYear = Year(dteCurrent) 'MyDate1 = dteMonth & "/" & dteDay & "/" & dteYear MyDate1 = dteDay & " " & left(dteMonth,3) & ", " & dteYear 'MyDate1 = month(dteCurrent) & " " & dteDay & "," & dteYear else end if End Function '######## MyDate2 #################### Function MyDate2( Edate ) if Edate <> "" and isdate(Edate) = true then dteCurrent = Edate dteDay = Day(dteCurrent) dteMonth = left(Monthname(month(dteCurrent)),3) 'dteMonth = Monthname(month(dteCurrent)) dteYear = Year(dteCurrent) 'MyDate1 = dteMonth & "/" & dteDay & "/" & dteYear MyDate2 = dteDay & "-" & dteMonth & "-" & dteYear else end if End Function '############## goback ################ Function goback() 'Go Back 'Response.Write "" Response.Write "" End Function '############## goback '------------ display error message --------- start Function showerrormsg(data) showerrormsg = "
"& replace(data,vbcrlf,"
") &"
" response.Write showerrormsg End Function '------------ display error message --------- end '------------ display system message --------- start Function showsysmsg(data) showsysmsg = "
"& data &"
" response.Write showsysmsg End Function '------------ display system message --------- end '---------------- format number -------------start function zformatnumber(data) if data <> "" then if isnumeric(data) = true then zformatnumber = formatnumber(data,2) end if end if End Function '---------------- check name -------------start '---------------- confirm registration send email --------------start Function confirmreg(data) if data <> "" then Dim objCDOMail, strBody, Item Dim zfrom, zto, zcc, zbcc, zsubject, zbody sqljj="Select * from tbl_registration where event_id = "&data&" and memberid = "&session("clientid") &"" Set rsjj=MyConnSC.Execute(sqljj) If rsjj.eof = false then this_reg_date = rsjj("reg_date") this_this_join = rsjj("this_join") this_no_of_guest = rsjj("no_of_guest") this_no_of_spouse = rsjj("no_of_spouse") this_no_of_guest_children = rsjj("no_of_guest_children") this_no_of_member_children = rsjj("no_of_member_children") else end if sqlqq="Select * from tbl_registration_question where event_id = "&data&" and member_id = "&session("clientid") &"" this_event_id = data Set rsqq=MyConnSC.Execute(sqlqq) If rsqq.eof = false then while not rsqq.eof QQ = QQ+1 this_question_answer = this_question_answer & check_question(rsqq("question_id")) &" - "& rsqq("question_ans") &"
" rsqq.movenext wend else end if sqlcr="Select * from tbl_event where event_id = "&data&"" Set rscr=MyConnSC.Execute(sqlcr) If rscr.eof = false then event_title = rscr("event_title") event_date = rscr("event_date") strBody = strBody & ""& vbcrlf strBody = strBody & "This a confirmation for your registration "& check_name(data) &"," strBody = strBody & "

"& replace(email_header,vbcrlf,"
") &"


" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "" strBody = strBody & "
" strBody = strBody & ""& event_title strBody = strBody & "
Event Date: " strBody = strBody & ""& mydate2(event_date) strBody = strBody & "
Registration Date: " strBody = strBody & ""& mydate2(this_reg_date) if this_this_join = "yes" then strBody = strBody & "
Yes, I want to join this event;" if this_no_of_member_children <> "" or this_no_of_member_children = 0 then strBody = strBody & "
"& this_no_of_member_children &" children will join" if this_no_of_spouse <> "" then strBody = strBody & "
My spouse will join" if this_no_of_guest <> "" then strBody = strBody & "
"& this_no_of_guest &" guest will join" if this_no_of_guest_children <> "" then strBody = strBody & "
"& this_no_of_guest_children &" guest children will join" else strBody = strBody & "
No, I regret I cannot attend." end if strBody = strBody & "

" strBody = strBody & "This is an auto reply from Minamoto battery." strBody = strBody & "

"& replace(email_footer,vbcrlf,"
") &"




" strBody = strBody & "

"& rnd(12345678) &"

" sqlto1="Select * from tbl_members where memberid ="&session("clientid")&"" Set rsto1=MyConnSC.Execute(sqlto1) If rsto1.eof = false then zto = rsto1("email") else zto = session("clientid") end if zfrom = zfrom_email zsubject = "Confirmation of "& web_title &" event - "& event_title zbody = strBody '@ 'response.Write zsubject '----------- for Win XP ----------- Set objCDOMail = CreateObject("CDO.Message") '----------- for Win 2000 ----------- 'Set objCDOMail = Server.CreateObject("CDONTS.NewMail") objCDOMail.From = zfrom objCDOMail.To = zto objCDOMail.Cc = zcc objCDOMail.bCc = zbcc objCDOMail.Subject = zsubject '----------- for Win XP ----------- objCDOMail.HTMLBody = zbody '----------- for Win 2000 ----------- 'objCDOMail.body = zbody 'if zto <> "" then objCDOMail.Send 'else 'end if Set objCDOMail = Nothing '@ 'response.Write "
1zbccx: "& data & "
" 'response.Write "
"& sqlbcc 'response.Write "
"& zbody else 'If rscr.eof = false then end if 'If rscr.eof = false then else 'if data <> "" then end if 'if data <> "" then End Function '---------------- confirm registration send email - --------------end '--------- subscript font ------- start function subscript(data) if data <> "" then subscript1 = replace(data,"2"," 2") subscript = replace(subscript1,"4"," 4") response.Write subscript end if end function '--------- subscript font ------- end '------------ check title ------- start function chktitle(data) if data <> "" then sqlcd1="Select * from tbl_main_cat where ztitle ='"& data &"'" Set rscd1=MyConnSC.Execute(sqlcd1) If rscd1.eof = false then chktitle = rscd1("Main_Category") end if end if end function '------------ check title ------- end %>