Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Colore mese corrente

  1. #1

    Colore mese corrente

    Ciao a tutti,


    ho un problema, non so
    come posso colorare in rosso il mese corrente
    in una pagina con i dodici mesi dell'anno presi da database?

    Grazie

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    select case month(rs("data_da_db"))
    case 1
       txt_color = "#ffffff"
    case 2
       txt_color = "#000000;"
    ...
    ...
    ...
    case else
       txt_color = "#d2d2d2;"
    end select
    Roby

  3. #3
    Ciao Roby_72 e grazie per la tua risposta

    ma come lo devo inserire?

    questa è la mia pagina, in rosso il record ripetuto per visualizzare i 12 mesi:

    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> 
    
    <%
    Dim rs_mesi
    Dim rs_mesi_numRows
    
    Set rs_mesi = Server.CreateObject("ADODB.Recordset")
    rs_mesi.ActiveConnection = MM_conn_roy_STRING
    rs_mesi.Source = "SELECT * FROM tb_mesi"
    rs_mesi.CursorType = 0
    rs_mesi.CursorLocation = 2
    rs_mesi.LockType = 1
    rs_mesi.Open()
    
    rs_mesi_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    
    Repeat1__numRows = -1
    Repeat1__index = 0
    rs_mesi_numRows = rs_mesi_numRows + Repeat1__numRows
    %>
    <%
    Dim MM_paramName 
    %>
    <%
    ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
    
    Dim MM_keepNone
    Dim MM_keepURL
    Dim MM_keepForm
    Dim MM_keepBoth
    
    Dim MM_removeList
    Dim MM_item
    Dim MM_nextItem
    
    ' create the list of parameters which should not be maintained
    MM_removeList = "&index="
    If (MM_paramName <> "") Then
      MM_removeList = MM_removeList & "&" & MM_paramName & "="
    End If
    
    MM_keepURL=""
    MM_keepForm=""
    MM_keepBoth=""
    MM_keepNone=""
    
    ' add the URL parameters to the MM_keepURL string
    For Each MM_item In Request.QueryString
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
      End If
    Next
    
    ' add the Form variables to the MM_keepForm string
    For Each MM_item In Request.Form
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
      End If
    Next
    
    ' create the Form + URL string and remove the intial '&' from each of the strings
    MM_keepBoth = MM_keepURL & MM_keepForm
    If (MM_keepBoth <> "") Then 
      MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
    End If
    If (MM_keepURL <> "")  Then
      MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
    End If
    If (MM_keepForm <> "") Then
      MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
    End If
    
    ' a utility function used for adding additional parameters to these strings
    Function MM_joinChar(firstItem)
      If (firstItem <> "") Then
        MM_joinChar = "&"
      Else
        MM_joinChar = ""
      End If
    End Function
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
     xml:lang="it">
    <html>
    <head>
    <title>Hotel Roy</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id="container">
        <div id="service">
    	<ul>[*]Area riservata
    	[/list]
    	</div>
        
      <div id="header"> 
        <h1><a href="../index.asp">Hotel
    
          Roy</a></h1>
         </div>
    	 <div id="main">
    	 <div id="titolomanifestazioni">
          <h2><span>Manifestazioni</span></h2>
        </div>
    	<div id="contentinfo">
    	
    	  
    
    </p>
          
          <% 
    While ((Repeat1__numRows <> 0) AND (NOT rs_mesi.EOF)) 
    %>
          <table width="30%" border="0" align="center" cellpadding="0" cellspacing="10">
            <tr align="center"> 
              <td width="33%"> <h3>"><%=(rs_mesi.Fields.Item("Mese").Value)%></h3></td>
            </tr>
          </table>
          <% 
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rs_mesi.MoveNext()
    Wend
    %>
          
    
    </p>
    	
    
    </p>
    	
    
    </p>
    
    	</div>
    	
    	</div>
    		<div id="menu">
    	<div class="sidebarhotel">
            <ul>[*]Info Hotel[*]Dove siamo
    	[*]Virtual tour[*]Servizi
    	[*]Sale riunioni
    	[*]Tariffe
    	[*]Last minute[*]Prenotazioni[*]Manifestazioni
    	[*]Parco del sile[*]Itinerari
    	[/list]
        </div>
    	<div class="sidebarresidence">
            <ul>[*]Dove siamo
    	[*]Virtual tour[*]Tariffe[*]Last minute[/list]
        </div>
    	</div>
    	<div id="footer">
        
    
    &copy; 2005 Roy Hotel</p>
      </div>
    </div>
    
    </body>
    </html>
    <%
    rs_mesi.Close()
    Set rs_mesi = Nothing
    %>
    ciao e grazie

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    DW non lo digerisco...

    Roby

  5. #5
    Grazie mille


Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.