% Inst = Request.Querystring("Inst") Set mailmsg = Server.CreateObject("CDONTS.NewMail") Themonth = DatePart("m", Date) If Inst = "TS" or Inst = "EM" Then SQL = "Select * from TSCount where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Select * from WLCount where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If Set Conn = Server.CreateObject("ADODB.Connection") Set RS = Server.CreateObject("ADODB.RecordSet") Conn.Open ("DRIVER={MySQL ODBC 3.51 Driver};SERVER=sql1.cpt2.host-h.net;PORT=3306;DATABASE=visita_db1; UID=visita_1;PWD=blom;OPTION=3;") RS.Open SQL, Conn If Inst = "TS" or Inst = "EM" Then htmlText ="New Referral from WWW.VISITAFRICA.CO.ZA property Other Destinations
" Else htmlText ="New Referral from WWW.VISITAFRICA.CO.ZA property section to WWW.WILDLIFEPROPERTY.CO.ZA
" End If If Not RS.EOF Then IF RS("DayDate") = Date Then DAYTOTAL = RS("DayTotal") + 1 If Inst = "TS" or Inst = "EM" Then SQL = "Update TSCount set DayTotal = '"&DAYTOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Update WLCount set DayTotal = '"&DAYTOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If Conn.execute SQL Else If Inst = "TS" or Inst = "EM" Then SQL = "Update TSCount set DayTotal = '1', DayDate = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/"&DatePart("d", Date)&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Update WLCount set DayTotal = '1', DayDate = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/"&DatePart("d", Date)&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If Conn.execute SQL DAYTOTAL = 1 End If MONTHTOTAL = RS("MonthTotal") + 1 If Inst = "TS" or Inst = "EM" Then SQL = "Update TSCount set MonthTotal = '"&MONTHTOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Update WLCount set MonthTotal = '"&MONTHTOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If Conn.execute SQL TOTAL = RS("Total") + 1 If Inst = "TS" or Inst = "EM" Then SQL = "Update TSCount set Total = '"&TOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Update WLCount set Total = '"&TOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If Conn.execute SQL htmlText = htmlText & "Total referrals for today " & DatePart("d", Date)&" "&MonthName(Themonth)&" "&DatePart("yyyy", Date)&" : "&DAYTOTAL&"
" htmlText = htmlText & "Total referrals for "&MonthName(Themonth)&" : "&MONTHTOTAL&"
" htmlText = htmlText & "Total referrals from Visit Africa : "&TOTAL&"
" mailmsg.BodyFormat = 1 mailmsg.WrapLength = 160 If Inst = "TS" or Inst = "EM" Then If Inst = "EM" Then mailmsg.Subject = "Referral From E-mail" Else mailmsg.Subject = "Referral From Visit Africa" End If mailmsg.To = "travelsite@visitafrica.co.za" mailmsg.From = "bookings@visitafrica.co.za" Else mailmsg.Subject = "Referral From Visit Africa Web Site" mailmsg.To = "julian@wildlifeproperty.co.za" mailmsg.From = "bookings@visitafrica.co.za" End If mailmsg.Body = "New Referral from WWW.VISITAFRICA.CO.ZA property section to WWW.WILDLIFEPROPERTY.CO.ZA"&Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals for today " & DatePart("d", Date)&" "&MonthName(Themonth)&" "&DatePart("yyyy", Date)&" : " & DAYTOTAL&Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals for "&MonthName(Themonth)&" : "&MONTHTOTAL&Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals from Visit Africa : "&TOTAL&Chr(13) & Chr(10) _ Else If Inst = "TS" or Inst = "EM" Then SQL = "Insert into TSCount (Date, DayDate, MonthTotal, DayTotal) Values ('" Else SQL = "Insert into WLCount (Date, DayDate, MonthTotal, DayTotal) Values ('" End If SQL = SQL & DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01', '" SQL = SQL & DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/"&DatePart("d", Date)&"', '" SQL = SQL & "1', '1')" Conn.execute SQL htmlText = htmlText & "Total referrals for today " & DatePart("d", Date)&" "&MonthName(Themonth)&" "&DatePart("yyyy", Date)&" : 1
" htmlText = htmlText & "Total referrals for "&MonthName(Themonth)&" : 1
" mailmsg.BodyFormat = 1 mailmsg.WrapLength = 160 If Inst = "TS" or Inst = "EM" Then If Inst = "EM" Then mailmsg.Subject = "Referral From E-mail" Else mailmsg.Subject = "Referral From Visit Africa" End If mailmsg.To = "travelsite@visitafrica.co.za" Else mailmsg.Subject = "Referral From Visit Africa Web Site" mailmsg.To = "julian@wildlifeproperty.co.za" End If mailmsg.From = "bookings@visitafrica.co.za" mailmsg.Body = "New Referral from WWW.VISITAFRICA.CO.ZA property section to WWW.WILDLIFEPROPERTY.CO.ZA"&Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals for today " & DatePart("d", Date)&" "&MonthName(Themonth)&" "&DatePart("yyyy", Date)&" : 1 "&Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals for "&MonthName(Themonth)&" : 1 " &Chr(13) & Chr(10) _ &Chr(13) & Chr(10) _ & "Total referrals from Visit Africa : "&TOTAL NewDate = DateAdd("m", -1, Date) SQL = "Select Total from WLCount where Date = '"&DatePart("yyyy", NewDate)&"/"&DatePart("m", NewDate)&"/01'" If Inst = "TS" or Inst = "EM" Then SQL = "Select Total from TSCount where Date = '"&DatePart("yyyy", NewDate)&"/"&DatePart("m", NewDate)&"/01'" Else SQL = "Select Total from WLCount where Date = '"&DatePart("yyyy", NewDate)&"/"&DatePart("m", NewDate)&"/01'" End If Set RS = Server.CreateObject("ADODB.RecordSet") RS.Open SQL, Conn If Not rs.eof Then TOTAL =RS("Total") + 1 If Inst = "TS" or Inst = "EM" Then SQL = "Update TSCount set Total = '"&TOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" Else SQL = "Update WLCount set Total = '"&TOTAL&"' where Date = '"&DatePart("yyyy", Date)&"/"&DatePart("m", Date)&"/01'" End If htmlText = htmlText & "Total referrals from Visit Africa : "&TOTAL&"
" Conn.execute sql END iF End If mailmsg.send Set mailmsg = Nothing RS.Close Conn.Close set RS = Nothing Set Conn = Nothing 'Set objMail = Server.CreateObject("CDONTS.NewMail") ' objMail.From = "bookings@visitafrica.co.za" 'objMail.To = "info@visitafrica.co.za" 'objMail.Cc = "julian@wildlifeproperty.co.za" ' objMail.Subject = "New Referral from Visit Africa" 'objMail.BodyFormat = 0 'objMail.Body = htmlText ' objMail.Send 'Set objMail = Nothing If Inst = "TS" or Inst = "EM" Then RESPONSE.REDIRECT ("http://www.safarinow.com/") Else RESPONSE.REDIRECT ("http://www.wildlifeproperty.co.za/?SiteId=VA") End If %>