%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
![]() |
![]() |
|||||||||||||||||||||||||||||||||
|
|
Mailing Resume Prochain match (2 jours)<% Today = Date() NextMatch = DateAdd("d",2,Today) JourNextMatch = Day(NextMatch) MoisNextMatch = Month(NextMatch) AnneeNextMatch = Year(NextMatch) NextMatchSql = AnneeNextMatch & "-" & MoisNextMatch & "-" & JourNextMatch Set rsChkMatch = Server.CreateObject("ADODB.Recordset") sqlChkMatch = "SELECT * from matchs where DateM = '" & NextMatchSql & "'" Openrs rsChkMatch, sqlChkMatch If rsChkMatch.eof then Response.Write("Pas de match") else While not rsChkMatch.eof ContenuMail = "" CatMatch = rsChkMatch("idCat") NameCat = DLookUp("Categorie", "NomCat", "id=" & CatMatch) idMatch = rsChkMatch("id") dateMatch = rsChkMatch("DateM") dayMatch = day(dateMatch) monthMatch = month(dateMatch) yearMatch = year(dateMatch) nbDayMatch = Weekday(dateMatch,2) jourMatch = DLookUp("jours_semaine", "dayFr", "id=" & nbDayMatch) dateMatch = dayMatch & "/" & monthMatch & "/" & yearMatch adversaire = rsChkMatch("Adversaire") deplacement = rsChkMatch("Depl") HeureRDV = Hour(rsChkMatch("RDV")) If HeureRDV < 10 then HeureRDV = "0" & HeureRDV end if MinuteRDV = Minute(rsChkMatch("RDV")) If MinuteRDV < 10 then MinuteRDV = "0" & MinuteRDV end if RDV = HeureRDV & "h" & MinuteRDV LieuRDV = rsChkMatch("LieuRDV") HeureReserve = Hour(rsChkMatch("Reserve")) If HeureReserve < 10 then HeureReserve = "0" & HeureReserve end if MinuteReserve = Minute(rsChkMatch("Reserve")) If MinuteReserve < 10 then MinuteReserve = "0" & MinuteReserve end if matchReserve = HeureReserve & "h" & MinuteReserve HeurePremiere = Hour(rsChkMatch("Premiere")) If HeurePremiere < 10 then HeurePremiere = "0" & HeurePremiere end if MinutePremiere = Minute(rsChkMatch("Premiere")) If MinutePremiere < 10 then MinutePremiere = "0" & MinutePremiere end if matchPremiere = HeurePremiere & "h" & MinutePremiere coatch = rsChkMatch("Coatch") LieuMatch = rsChkMatch("Lieu") GoogleMap = rsChkMatch("GoogleMap") Resto = rsChkMatch("Resto") restoName = rsChkMatch("RestoName") If isnull(rsChkMatch("AlertMessage")) OR rsChkMatch("AlertMessage") = "" then AlertChk = 0 else AlertChk = 1 AlertMessage = rsChkMatch("AlertMessage") end if StreetMatch = rsChkMatch("Street") CityMatch = rsChkMatch("City") FeuilleMatch = rsChkMatch("FeuilleMatch") Coupe = rsChkMatch("Coupe") ChkComment = 0 set rsChkComment = Server.CreateObject("ADODB.Recordset") sqlChkComment = "SELECT * FROM relmatchjoueur_club WHERE IdM=" & idMatch openrs rsChkComment, sqlChkComment While not rsChkComment.eof If rsChkComment("Commentaire") <> "" then ChkComment = 1 end if rsChkComment.movenext Wend rsChkComment.close set rsChkComment = nothing ContenuMail = "" _ & "" _ & "" _ & " " & AlertMessage & "" end if If deplacement = 2 then ContenuMail = ContenuMail & "Match du " & jourMatch & " " & dateMatch & " contre " & adversaire & "" _ & "A " & LieuMatch & "" else ContenuMail = ContenuMail & "Match du " & jourMatch & " " & dateMatch & " contre " & adversaire & "" _ & "A " & LieuMatch If StreetMatch <> "" then ContenuMail = ContenuMail & " - " & StreetMatch End if If CityMatch <> "" then ContenuMail = ContenuMail & " - " & CityMatch End if If GoogleMap <> "" then ContenuMail = ContenuMail & " - Voir le plan" end if ContenuMail = ContenuMail & "" end if If LieuRDV <> "" OR LieuRDV <> empty then ContenuMail = ContenuMail & "Lieu Rendez-Vous : " & LieuRDV & "" End if If FeuilleMatch <> "" then ContenuMail = ContenuMail & "Feuille match : " & FeuilleMatch & "" end if If Coupe = 1 then ContenuMail = ContenuMail & "Match de coupe, pas de match réserve !!!" end if ContenuMail = ContenuMail & "
" mailsubject = "Volley Tihange-Huy - match du " & dateMatch & " contre " & rsChkMatch("Adversaire") & " (" & NameCat & ") - Récapitulatif" If TotalPremiere < 6 then TotalManquant = 6 - TotalPremiere mailsubject = mailsubject & " - " & TotalManquant & " joueur(s) manquant(s) sinon forfait!" end if Set rsJoueurs = Server.CreateObject("ADODB.Recordset") sqlJoueurs = "SELECT * FROM Joueurs_club WHERE (idCat=" & CatMatch & " OR idCat2=" & CatMatch & ") AND desactive=0 AND optout=0" openrs rsJoueurs, sqlJoueurs BCCSend = "" While not rsJoueurs.eof AddToMail = "" AddToMail = "" _ & "Suivez ce lien pour vous désinscrire de la mailing list" _ & "" MailToSend = ContenuMail & AddToMail Mail1 = "" Mail2 = "" mailsendto = "" mailsendcc = "" Mail1 = rsJoueurs("Mail1") If Mail1 <> "" then mailsendto = Mail1 Mail2 = rsJoueurs("Mail2") If Mail2 <> "" then mailsendcc = Mail2 end if SendCDOEmail "mail.eurobrevets.be","tihangehuy@eurobrevets.be","eB.1963", mailsubject, MailToSend,"tihangehuy@eurobrevets.be",mailsendto,mailsendcc, 1, "HTML" end if rsJoueurs.movenext Response.Write(MailToSend & " ") wend rsJoueurs.close set rsJoueurs = nothing rsChkMatch.movenext Wend end if Response.Write("Succeed!") %> |