IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP Discussion :

Lier une date d'un calendrier à une date de congrès


Sujet :

ASP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    90
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 90
    Points : 47
    Points
    47
    Par défaut Lier une date d'un calendrier à une date de congrès
    Bonjour,

    J'ai un calendrier et quand je clique sur une date j'aimerai avoir la liste des congrès correspond à la date au mois et l'année.
    Comment faire ?

    Voici le code du calendrier
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
     
    <% 
    ' --------------------------------------------------------------------------------------------
    ' ---------------------------- Debut Fonction----------------------------------------------
    ' --------------------------------------------------------------------------------------------
     
          function nom_mois (mois)
             select case mois
                case "1"
                   nom_mois = "Janvier"
                case "2"
                   nom_mois = "Février"
                case "3"
                   nom_mois = "Mars"
                case "4"
                   nom_mois = "Avril"
                case "5"
                   nom_mois = "Mai"
                case "6"
                   nom_mois = "Juin"
                case "7"
                   nom_mois = "Juillet"
                case "8"
                   nom_mois = "Août"
                case "9"
                   nom_mois = "Septembre"
                case "10"
                   nom_mois = "Octobre"
                case "11"
                   nom_mois = "Novembre"
                case "12"
                   nom_mois = "Décembre"
             end select
          end function
     
     
    ' -------------------------------------------------------------------------------------------
    ' ---------------------------- Fin Fonction ------------------------------------------------
    ' -------------------------------------------------------------------------------------------
     
          D=date() 
     
    ' --- récupération du mois recherché --- '
     
          mois = request.querystring("mois")
     
          if mois = "" then 
             D=date() 
          else
             an=year(D)
             D=dateserial(an,mois,1)
          end if
     
    ' --- récupération de l'année recherchée --- '
     
          an = request.querystring("an")
     
          if an = "" then 
             D=date() 
          else
             mois=month(D)
             D=dateserial(an,mois,1)
          end if
     
    ' --- création de mes variables ---'
     
          an=year(D)
          jour=day(D)
          mois=month(D)
          jour_semaine=weekdayname(weekday(D))
     
    ' --- gestion des années pour la liste de choix ---'
     
          ann_rep = year(Date())
          an_deb = ann_rep - 2
          an_fin = ann_rep + 4
     
    ' --- nombre de jours dans le mois actuel --- '
     
          D1 = dateserial(an,mois,1)
          jour_mois=weekdayname(weekday(D1))
          D2 = dateserial(an,mois + 1,1)
          jours_mois = datediff("d",D1,D2)
     
    ' --- détermination du jour de la semaine pour le premier du mois --- '
          pos_premier = Weekday(D1,2)
          pos_premier = pos_premier - 1
     
    ' --- détermination des variables de calcul du tableau --- '
          j=1         ' compteur de jours du mois
          l=0         ' compteur de ligne... permet de déterminer le positionnement du 1 dans la première ligne
          c=0         ' compteur de cellule... permet de déterminer le saut de ligne du tableau
          p=0         ' positionnement du premier jours du mois dans une semaine de 7 jours
    %>
     
    <table >
      <tr> 
        <td colspan="7"> 
          <p align="center">
          <select onchange="window.location='?an=<%= an %>&mois='+this.value">
                   <option value="1" <% if mois=1 then response.write "selected" end if%> >Janvier</option>
                   <option value="2" <% if mois=2 then response.write "selected" end if%> >Février</option>
                   <option value="3" <% if mois=3 then response.write "selected" end if%> >Mars</option>
                   <option value="4" <% if mois=4 then response.write "selected" end if%> >Avril</option>
                   <option value="5" <% if mois=5 then response.write "selected" end if%> >Mai</option>
                   <option value="6" <% if mois=6 then response.write "selected" end if%> >Juin</option>
                   <option value="7" <% if mois=7 then response.write "selected" end if%> >Juillet</option>
                   <option value="8" <% if mois=8 then response.write "selected" end if%> >Août</option>
                   <option value="9" <% if mois=9 then response.write "selected" end if%> >Septembre</option>
                   <option value="10" <% if mois=10 then response.write "selected" end if%> >Octobre</option>
                   <option value="11" <% if mois=11 then response.write "selected" end if%> >Novembre</option>
                   <option value="12" <% if mois=12 then response.write "selected" end if%> >Décembre</option>
          </select>
           - 
          <select onchange="window.location='?mois=<%=mois%>&an='+this.value">
             <% 
             for i = an_deb to an_fin 
             %>
                <option value="<%= an_deb %>"
    					<% if an=an_deb then response.write "selected" end if%> ><%= an_deb %></option>
             <%
             an_deb = an_deb + 1
             next
             %>
          </select>
        </td>
      </tr>
      <tr>
      <BR>
      </tr>
      <tr bgcolor="#F4F28C" bordercolor="#F4F28C"> 
        <td align="center"><font color="#000000" size="2" face="Arial">L</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">M</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">J</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">V</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">S</font></td>
        <td align="center"><font color="#000000" size="2" face="Arial">D</font></td>
      </tr>
      <tr> 
        <% 
    for i = 1 to jours_mois
          ' --- incrémentation de ma variable cellule jusqu'à la valeur 7 ---
          c=c+1
     
          if l=0 then
             for p = 1 to pos_premier
             c=c+1
             %>
                 <td align="center"><font size="2" face="Arial"></font></td>
              <%
             next
          end if
          date_agenda = dateserial(an,mois,i)
          %>
           <td align="center" <% if date_agenda = date() then %> style="border:1 solid #FF0000" <% end if %> >
             <font size="2" face="Arial">
             <a href="#?><%= date_agenda %>" ><%= i %></a>
             </font>
          </td>
        <%
          ' --- gestion du retour à la ligne après 7 jours affichés ---
                if c=7 then 
                   response.write "</tr>"
                   c=0 
                end if 
          ' --- incrémente la variable l précisant le passage à la deuxième ligne ---
                l=1
          ' --- boucle de mon for to next ---
    next
     
    %>
      </tr>
    </table>
    et voici mon problème. Je ne sais pas ce qu'il faut mettre à se niveau
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
             <a href="#?><%= date_agenda %>" ><%= i %></a>
    A+
    Cédric

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Juillet 2008
    Messages
    90
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2008
    Messages : 90
    Points : 47
    Points
    47
    Par défaut
    Re,

    J'ai trouvé...

    La ligne du lien est la suivante
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
             <a href="/site/pagesnews/Copie%20de%20CDL.asp?dateserial=<%=Request.Querystring("date_agenda")%><%= date_agenda %>" ><%= i %></a>
    Tout le reste du code ne change pas.

    Depuis ce lien j'accéde à ma page liste des congrès par date de "debut_congres" qui se trouvent dans ma "Tbl_Congres"

    Voici mon code de ma page "Congres Date liste"

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
     
    <fieldset style="background-color:#FFF8B0"><legend><H2><%=UCASE(Request.Querystring("Pays"))%></H2></legend>
    <%
    	Str_dateserial = Request.QueryString("dateserial")
    	strRequete="SELECT * FROM Tbl_Congres WHERE Valid=1 AND debut_congres='" & Str_dateserial & "'"
    	Set RsCongres=Server.CreateObject("ADODB.Recordset")
    	RsCongres.Open strRequete,Connexion
    	If Not RsCongres.Eof Then
    %>
     
    <%
    	i=1
    	While Not RsCongres.Eof
    %>
     
    <%
    	If (i mod 2) then
    %>
     
    <fieldset>
    <legend><span class="Style3">Congres <%=RsCongres("specialite_fr")%></span></legend>
    	<table bgcolor="#F9D577" width="100%">
    		<tr>
    			<td width="5%" align="left" valign="top"><%=i%></td>
    			<td width="90%"><p>
    			<img src="" alt="" width="60" height="60" />	<%=RsCongres("intitule")%> <%=RsCongres("programme")%>
    			<p> du <%=RsCongres("debut_congres")%> au <%=RsCongres("fin_congres")%>
    			</td>
    			<td width="5%"></td>
    		</tr>
    	</table>
    	<table bgcolor="#F9D577" width="100%">
    		<tr>
    			<td width="25%"></td>
    			<td width="60%" align="left">
    			<p> <img src="" alt="" width="40" height="40" />	<%=RsCongres("ville")%>
    			<br> <%= RsCongres("lieu_congres")%>
    			</td>
    			<td width="15%">
    			<a style="text-decoration : none" href="/site/pagesnews/CPF.asp?numero=<%=RsCongres("Id_num")%>">
    			Détail...</a>
    			</td>
    		</tr>
    	</table>
    </fieldset>
     
    <%
    	Else
    %>
     
    <fieldset>
    <legend><span class="Style3">Congres <%=RsCongres("specialite_fr")%></span></legend>
    	<table bgcolor="#F9D577" width="100%">
    		<tr>
    			<td width="5%" align="left" valign="top"><%=i%></td>
    			<td width="90%"><p>
    			<img src="" alt="" width="60" height="60" />	<%=RsCongres("intitule")%> <%=RsCongres("programme")%>
    			<p> du <%=RsCongres("debut_congres")%> au <%=RsCongres("fin_congres")%>
    			</td>
    			<td width="5%"></td>
    		</tr>
    	</table>
    	<table bgcolor="#F9D577" width="100%">
    		<tr>
    			<td width="25%"></td>
    			<td width="60%" align="left">
    			<p> <img src="" alt="" width="40" height="40" />	<%=RsCongres("ville")%>
    			<br> <%= RsCongres("lieu_congres")%>
    			</td>
    			<td width="15%">
    			<a style="text-decoration : none" href="/site/pagesnews/CPF.asp?numero=<%=RsCongres("Id_num")%>">
    			Détail...</a>
    			</td>
    		</tr>
    	</table>
    </fieldset>
     
    <%
    	End If
    %>
     
    <%
     
    	RsCongres.Movenext	
    	i=i+1
    	Wend	
    %>
     
    <%
    	Else
    %>
     
     
    <%
    	End If		
    	Set Connexion=Nothing
    %>
     
    </fieldset>
    Quand pensez-vous ...

    A+

    Cédric.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 4
    Dernier message: 27/10/2014, 11h55
  2. Réponses: 2
    Dernier message: 05/03/2010, 14h15
  3. Réponses: 1
    Dernier message: 06/11/2009, 13h52
  4. Réponses: 1
    Dernier message: 11/02/2009, 06h33
  5. Réponses: 4
    Dernier message: 26/08/2008, 17h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo