<% if Request("Format") = "E" then 'The following 2 lines are what makes this happen... Response.ContentType ="Application/vnd.excel" Response.AddHeader "Content-Disposition", "attachment; filename=Presences.xls" end if if Request("Format") = "D" then 'The following 2 lines are what makes this happen... Response.ContentType ="Application/vnd.word" Response.AddHeader "Content-Disposition", "attachment; filename=Presences.doc" end if %> <% dim stActivites, stGroupe, sMax, counter,sNomA,sLocal,sNbrGroupe, counterGroupe counter = 0 sSemaine = "" stOrder = request("Order") stActivites = RemoveJunk(Request("Activites")) stGroupe = RemoveJunk(Request("Groupe")) strSql1 = "SELECT * FROM Activites where CodeA = "& stActivites Set rsQuery1 = Conn.Execute(strSql1) if not rsQuery1.eof then if rsQuery1("Max") <> "" then sMax = int (rsQuery1("Max")) else sMax = 1000 end if sNomA = rsQuery1("Nom") sNbrGroupe = rsQuery1("Groupe") sAnimateur = rsQuery1("Animateur") end if '*********l'ensemble des groupe**************** '**********Groupes************** if Request.Form("TGroupe") = "1" then for counterGroupe = 1 to sNbrGroupe Step 0 sSemaine = "" strSql = "SELECT * FROM Horaire where CodeA = "& stActivites&" and GroupeA = '"& counterGroupe &"'" Set rsQuery = Conn.Execute(strSql) if not rsQuery.eof then sTypeHoraire = rsQuery("TypeHoraire") sDateDebut = rsQuery("DateDebut") sDateFin = rsQuery("DateFin") sHeureD = rsQuery("HeureD") sHeureF = rsQuery("HeureF") sLunHD = rsQuery("LunHD") sLunHF = rsQuery("LunHF") sMarHD = rsQuery("MarHD") sMarHF = rsQuery("MarHF") sMerHD = rsQuery("MerHD") sMerHF = rsQuery("MerHF") sJeuHD = rsQuery("JeuHD") sJeuHF = rsQuery("JeuHF") sVenHD = rsQuery("VenHD") sVenHF = rsQuery("VenHF") sSamHD = rsQuery("SamHD") sSamHF = rsQuery("SamHF") sDimHD = rsQuery("DimHD") sDimHF = rsQuery("DimHF") end if '******Inscription parametres******** '******Type Horaire*********************** '****Semaine**** if sTypeHoraire = "Semaine" then For S = 1 to Request("NbreSemaines") Step 1 semaine = "Semaine"&S if Request.Form(semaine) = "1" then sSemaine = sSemaine &"-"&s&"-" end if Next if sSemaine <> "" then sSqlR = sSqlR & "Inscriptions.Semaines Like '%" & sSemaine & "%' and " end if end if '***Jours****** if sTypeHoraire = "Jours" then if Request.Form("Lundi") = "1" then sJours = sJours &"-Lundi-" end if if Request.Form("Mardi") = "1" then sJours = sJours &"-Mardi-" end if if Request.Form("Mercredi") = "1" then sJours = sJours &"-Mercredi-" end if if Request.Form("Jeudi") = "1" then sJours = sJours &"-Jeudi-" end if if Request.Form("Vendredi") = "1" then sJours = sJours &"-Vendredi-" end if if Request.Form("Samedi") = "1" then sJours = sJours &"-Samedi-" end if if Request.Form("Dimanche") = "1" then sJours = sJours &"-Dimanche-" end if if sJours <> "" then sSqlR = sSqlR & "Inscriptions.Jours Like '%" & sJours & "%' and " end if end if '**fin Type Horaire*********************** sSqlR = sSqlR & "Inscriptions.CodeA = " & stActivites & " and " sSqlH = sSqlH & "Horaire.CodeA = " & stActivites & " and " sSqlR = sSqlR & "Inscriptions.Groupe = '" & counterGroupe & "' and " sSqlH = sSqlH & "Horaire.GroupeA = '" & counterGroupe & "' and " if sSqlR <> "" then strSql = "SELECT count(*) as iNbrNodes FROM Inscriptions WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and AnnulerIns = false " Set rsQuery = Conn.Execute(strSql) nbrToDisplay = rsQuery("iNbrNodes") '*******Access SQL*************** sSQL = " SELECT Personnes.* , Inscriptions.* " sSQL = sSQL & "FROM Inscriptions INNER JOIN Personnes ON Inscriptions.CodeM = Personnes.CodeM " sSQL = sSQL & "WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and AnnulerIns = false " sSQL = sSQL & "ORDER BY Personnes."&stOrder&" " Set RS = Conn.Execute(sSQL) '********************************* sSQLH = "SELECT * FROM Locaux where CodeL in (select CodeL from Horaire WHERE "& Left(sSqlH, Len(sSqlH) - 4)&") " Set RSHoraire = Conn.Execute(sSQLH) if not RSHoraire.eof then sLocal = RSHoraire("Nom") end if else Response.Redirect ("Presences.asp") end if %> <% if not RS.eof then %>
<%if counterGroupe <> "" then%> <%end if%>

Fiche médicale

Date  :   <% = Date()%>

Nom de l'activité :    <%= sNomA %>
Local :    <%= sLocal %>
Groupe :    <%=counterGroupe%>
Responsable :    <%=sAnimateur%>
Date de début :    <%=sDateDebut %>
Date de fin :    <%=sDateFin %>
Nombre Totale :    <%=nbrToDisplay%>
  
<% Do While counter < sMax AND Not RS.EOF sNom = RS("Nom") sPrenom = RS("Prenom") sDDN = RS("DDN") sSexe = RS("Sexe") sTelR = RS("TelR") sTelT = RS("TelT") sTelU = RS("TelU") sAssMaladie = RS("AssMaladie") sNote18 = RS("Note18") sCodeIns = RS("CodeIns") sDateIns = RS("DateIns") sNoteSante = RS("NoteSante") %> <% RS.MoveNext counter = counter + 1 Loop counter = 0 RS.Close Set RS = Nothing %>
Nom Prénom Sexe

Age

Tél.(R)

Tél (B)

Tél (U)

Note santé

Ass Maladie

 <%=sNom%>  <%=sPrenom%>  <%=sSexe%>  <%if sDDN <> "" then Response.Write left(datediff("m",sDDN,date()) / 12,2) end if %>  <%=sTelR%>  <%=sTelT%>  <%=sTelU%>  <%=sNoteSante %>  <%=sAssMaladie%>

 

<%end if%> <% counterGroupe = counterGroupe + 1 sSqlR = "" sSqlH = "" Next '******fin de l'ensemble des groupes************ %> <% else '*******un seule groupe************** '******Inscription parametres******** if stGroupe <> "" then strSql = "SELECT * FROM Horaire where CodeA = "& stActivites&" and GroupeA = '"& stGroupe &"'" Set rsQuery = Conn.Execute(strSql) else strSql = "SELECT * FROM Horaire where CodeA = "& stActivites Set rsQuery = Conn.Execute(strSql) end if if not rsQuery.eof then sTypeHoraire = rsQuery("TypeHoraire") sDateDebut = rsQuery("DateDebut") sDateFin = rsQuery("DateFin") sHeureD = rsQuery("HeureD") sHeureF = rsQuery("HeureF") sLunHD = rsQuery("LunHD") sLunHF = rsQuery("LunHF") sMarHD = rsQuery("MarHD") sMarHF = rsQuery("MarHF") sMerHD = rsQuery("MerHD") sMerHF = rsQuery("MerHF") sJeuHD = rsQuery("JeuHD") sJeuHF = rsQuery("JeuHF") sVenHD = rsQuery("VenHD") sVenHF = rsQuery("VenHF") sSamHD = rsQuery("SamHD") sSamHF = rsQuery("SamHF") sDimHD = rsQuery("DimHD") sDimHF = rsQuery("DimHF") end if '******Type Horaire*********************** '****Semaine**** if sTypeHoraire = "Semaine" then For S = 1 to Request("NbreSemaines") Step 1 semaine = "Semaine"&S if Request.Form(semaine) = "1" then sSemaine = sSemaine &"-"&s&"-" end if Next if sSemaine <> "" then sSqlR = sSqlR & "Inscriptions.Semaines Like '%" & sSemaine & "%' and " end if end if '***Jours****** if sTypeHoraire = "Jours" then if Request.Form("Lundi") = "1" then sJours = sJours &"-Lundi-" end if if Request.Form("Mardi") = "1" then sJours = sJours &"-Mardi-" end if if Request.Form("Mercredi") = "1" then sJours = sJours &"-Mercredi-" end if if Request.Form("Jeudi") = "1" then sJours = sJours &"-Jeudi-" end if if Request.Form("Vendredi") = "1" then sJours = sJours &"-Vendredi-" end if if Request.Form("Samedi") = "1" then sJours = sJours &"-Samedi-" end if if Request.Form("Dimanche") = "1" then sJours = sJours &"-Dimanche-" end if if sJours <> "" then sSqlR = sSqlR & "Inscriptions.Jours Like '%" & sJours & "%' and " end if end if '**fin Type Horaire*********************** sSqlR = sSqlR & "Inscriptions.CodeA = " & stActivites & " and " sSqlH = sSqlH & "Horaire.CodeA = " & stActivites & " and " if stGroupe <> "" then sSqlR = sSqlR & "Inscriptions.Groupe = '" & stGroupe & "' and " sSqlH = sSqlH & "Horaire.GroupeA = '" & stGroupe & "' and " end if if sSqlR <> "" then strSql = "SELECT count(*) as iNbrNodes FROM Inscriptions WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and AnnulerIns = false" Set rsQuery = Conn.Execute(strSql) nbrToDisplay = rsQuery("iNbrNodes") '*******Access SQL*************** sSQL = " SELECT Personnes.* , Inscriptions.* " sSQL = sSQL & "FROM Inscriptions INNER JOIN Personnes ON Inscriptions.CodeM = Personnes.CodeM " sSQL = sSQL & "WHERE "& Left(sSqlR, Len(sSqlR) - 4)&" and AnnulerIns = false " sSQL = sSQL & "ORDER BY Personnes."&stOrder&" " Set RS = Conn.Execute(sSQL) '********************************* sSQLH = "SELECT * FROM Locaux where CodeL in (select CodeL from Horaire WHERE "& Left(sSqlH, Len(sSqlH) - 4)&") " Set RSHoraire = Conn.Execute(sSQLH) if not RSHoraire.eof then sLocal = RSHoraire("Nom") end if else Response.Redirect ("Presences.asp") end if %> <%if not RS.eof then %>
<%if counterGroupe <> "" then%> <%end if%>

Fiche médicale

Date  :   <% = Date()%>

Nom de l'activité :     <%= sNomA %>
Local :    <%= sLocal %>
Groupe :    <%=counterGroupe%>
Responsable :    <%=sAnimateur%>
Date de début :    <%=sDateDebut %>
Date de fin :    <%=sDateFin %>
Nombre Totale :    <%=nbrToDisplay%>
  
<% Do While counter < sMax AND Not RS.EOF sNom = RS("Nom") sPrenom = RS("Prenom") sDDN = RS("DDN") sSexe = RS("Sexe") sTelR = RS("TelR") sTelT = RS("TelT") sTelU = RS("TelU") sAssMaladie = RS("AssMaladie") sNote18 = RS("Note18") sCodeIns = RS("CodeIns") sDateIns = RS("DateIns") sNoteSante = RS("NoteSante") %> <% counter = counter + 1 RS.MoveNext Loop RS.Close Set RS = Nothing %>
Nom Prénom Sexe

Age

Tél (R) Tél (B) Tél.(U) Note santé

Ass. maladie

 <%=sNom%>  <%=sPrenom%>  <%=sSexe%>  <%if sDDN <> "" then Response.Write left(datediff("m",sDDN,date()) / 12,2) end if %>  <%=sTelR%>  <%=sTelT%>  <%=sTelU%>  <%=sNoteSante %>  <%=sAssMaladie%>
<%end if%> <%end if%>