<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Admin Volley-Ball Club Tihange - Huy

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 = "" _ & "" _ & "" _ & "Volley Tihange-Huy - match du " & dateMatch & " contre " & rsChkMatch("Adversaire") & " (" & NameCat & ") - Récapitulatif" _ & "" _ & "" If AlertChk = 1 then ContenuMail = 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 & "" If deplacement = 1 then ContenuMail = ContenuMail & "" end if If Coupe = 0 then ContenuMail = ContenuMail & "" end if ContenuMail = ContenuMail & "" If Resto = 1 then ContenuMail = ContenuMail & "" end if If ChkComment = 1 then ContenuMail = ContenuMail & "" end if ContenuMail = ContenuMail & "" TotalRdv = 0 TotalReserve = 0 TotalPremiere = 0 TotalResto = 0 TotalRestoNb = 0 Set rsJoueurs = Server.CreateObject("ADODB.Recordset") sqlJoueurs = "SELECT * FROM Joueurs_club WHERE (idCat=" & CatMatch & " OR idCat2=" & CatMatch & ") AND desactive=0 ORDER BY Nom, Prenom Asc" openrs rsJoueurs, sqlJoueurs While not rsJoueurs.eof RelCommentaire = "" IDJoueur = rsJoueurs("id") Set rsRelJM = Server.CreateObject("ADODB.Recordset") sqlRelJM = "SELECT * FROM relmatchjoueur_club WHERE IdM = " & idMatch & " AND IdJ = " & IDJoueur & "" openrs rsRelJM, sqlRelJM while not rsRelJM.eof RelReserve = rsRelJM("Reserves") RelMatch = rsRelJM("Matchs") RelRdv = rsRelJM("Rdv") RelResto = rsRelJM("Resto") RelRestoNb = rsRelJM("RestoNb") RelCommentaire = rsRelJM("Commentaire") rsRelJM.movenext wend rsRelJM.close If RelRestoNb = "" then RelRestoNb = "???" end if If deplacement = 1 then If RelRdv = 1 OR RelRdv = 2 OR RelRdv = 3 then If RelRdv = 1 then RelJRdv = "" TotalRdv = TotalRdv + 1 end if If RelRdv = 2 then RelJRdv = "" end if If RelRdv = 3 then RelJRdv = "" end if else RelJRdv = "" end if end if If Coupe = 0 then If RelReserve = 1 OR RelReserve = 2 OR RelReserve = 3 then If RelReserve = 1 then RelJReserve = "" TotalReserve = TotalReserve + 1 end if If RelReserve = 2 then RelJReserve = "" end if If RelReserve = 3 then RelJReserve = "" end if else RelJReserve = "" end if end if If RelMatch = 1 OR RelMatch = 2 OR RelMatch = 3 then If RelMatch = 1 then RelJMatch = "" TotalPremiere = TotalPremiere + 1 end if If RelMatch = 2 then RelJMatch = "" end if If RelMatch = 3 then RelJMatch = "" end if else RelJMatch = "" end if If Resto = 1 then If RelResto = 1 OR RelResto = 2 OR RelResto = 3 then If RelResto = 1 then RelJResto = "" TotalResto = TotalResto + 1 RelJRestoNb = RelRestoNb TotalRestoNb = TotalRestoNb + RelRestoNb end if If RelResto = 2 then RelJResto = "" RelJRestoNb = 0 end if If RelResto = 3 then RelJResto = "" RelJRestoNb = 0 end if else RelJResto = "" RelJRestoNb = "???" end if end if If Isnull(RelCommentaire) OR RelCommentaire = "" then RelCommentaire = " " end if ContenuMail = ContenuMail & "" If deplacement = 1 then ContenuMail = ContenuMail & RelJRdv End if If Coupe = 0 then ContenuMail = ContenuMail & RelJReserve & RelJMatch else ContenuMail = ContenuMail & RelJMatch end if If Resto = 1 then ContenuMail = ContenuMail & RelJResto & "" End if If ChkComment = 1 then ContenuMail = ContenuMail & "" End if ContenuMail = ContenuMail & "" rsJoueurs.movenext RelRdv = 0 RelReserve = 0 RelMatch = 0 RelResto = 0 RelRestoNb = 0 wend rsJoueurs.close set rsJoueurs = nothing If TotalReserve <> 0 OR TotalPremiere <> 0 OR TotalRdv <> 0 OR TotalResto <> 0 OR TotalRestoNb <> 0 then ContenuMail = ContenuMail & "" If deplacement = 1 then ContenuMail = ContenuMail & "" end if If Coupe = 0 then ContenuMail = ContenuMail & "" end if ContenuMail = ContenuMail & "" If Resto = 1 then ContenuMail = ContenuMail & "" _ & "" end if If ChkComment = 1 then ContenuMail = ContenuMail & "" End if ContenuMail = ContenuMail & "" End if ContenuMail = ContenuMail & "
JoueurRDV
" & RDV & "
Réserve
" & matchReserve & "
1ère
" & matchPremiere & "
" & restoName & "Pers.Commentaire
ouinonbô ????ouinonbô ????ouinonbô ????ouinonbô ????
" & rsJoueurs("Nom") & " " & rsJoueurs("Prenom") & "" & RelJRestoNb & "" & RelCommentaire & "
Total :" & TotalRdv & "" & TotalReserve & "" & TotalPremiere & "" & TotalResto & "" & TotalRestoNb & " 
" _ & "

www.eurobrevets.be/tihangehuy



" 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!") %>