Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Calendario php, visualizzare 31 giorni su un'unica riga

    Ho preso questo calendario ma ha la visualizzazione classica di 7 giorni alla volta.
    Io vorrei mettere tutti e 31 i giorni sulla stessa riga.
    Come posso modificare?

    Codice PHP:
    <style type="text/css"> 
    <!-- 
      td 
      { 
        font-size:9pt; 
        line-height:14pt; 
        font-family:Verdana; 
      } 
    //--> 
    </style> 

    <?   

    ## change to the previous month 
    if ($command == "prev_month"

      if (--
    $month == 0
      { 
        
    $month 12
        
    $year--; 
      } 

    ## change to the next month 
    else if ($command == "next_month"

      if (++
    $month == 13
      { 
        
    $month 1
        
    $year++; 
      } 


    ## if no month has been passed 
    if ($month == ""

      
    $yeardate("Y"); 
      
    $monthdate("n"); 
      
    $month_name date("F",mktime(0,0,0,$month,1,$year)); 

    ## use current date if no month is passed 
    else 

      
    $yeardate("Y",mktime(0,0,0,$month,1,$year)); 
      
    $monthdate("n",mktime(0,0,0,$month,1,$year)); 
      
    $month_name date("F",mktime(0,0,0,$month,1,$year)); 



    $dow date("w",mktime(0,0,0,$month,1,$year));  //which day 1 falls on in the week 
    ("0" == Sun); 
    $dim date("d",mktime (0,0,0,$month+1,0,$year)); //days in the current month 
    ## modification to only print the number of weeks in a month 
    $wim ceil(($dim+$dow)/7); //weeks in month 

    $ct=0

    echo 
    "
     
    <table border='0' cellpadding='1' cellspacing='1' width='425' align='center'> 
    <tr> 
      <td align='center'><h1>[url='index.php?command=prev_month&month=
    $month&year=$year']<<[/url] $month_name $year [url='index.php?command=next_month&month=$month&year=$year']>>[/url]</h1></td> 
    </tr> 
    </table> 
    <table border='1' cellpadding='1' cellspacing='1' width='425' align='center'> 
    <tr> 
      <td  align='center'>[b]Sun</td> 
      <td  align='center'>[b]Mon</td> 
      <td  align='center'>[b]Tue</td> 
      <td  align='center'>[b]Wed</td> 
      <td  align='center'>[b]Thu</td> 
      <td  align='center'>[b]Fri</td> 
      <td  align='center'>[b]Sat</td> 
    </tr> 
      "


    ## print only the number of weeks needed 
    for($row=1;$row<$wim+1;$row++) 
    {   
      echo 
    "<tr height='60'>";   

      
    ## prints week (Sun to Sat) 
      
    for($week=1;$week<8;$week++)   
      {   
        
    $ct++;   
        
    $value=mktime(0,0,0,$month,$ct-$dow,$year);   
         
        
    ## if $value is part of current month 
        
    if (date("m",$value)==$month)   
        {   
          echo 

          <td align='center' class='body' width='85' valign='top'> 
            <div align='center'>[b]"
    .date("j",$value)."</a>[/b]</div>
     <div align='center'><input name=\"
    $value\" type=\"text\" size=\"3\"></div>
          </td>"
    ;   
        }   
        
    ## print previous and next month dates, but grayed out 
        
    else 
        { 
          echo 
    "<td align='center' class='body' width='85' valign='top' 
    bgcolor='#CCCCCC'><div 
    align='right'>[b]"
    .date("j",$value)."</a>[/b]</div>
    </td>"

        }   
      } 
       
      echo 
    "</tr>"
    }   


    echo 
    "</table>";   

    ?>
    Mai dire Mai

  2. #2

    prova così

    <style type="text/css">
    <!--
    td
    {
    font-size:9pt;
    line-height:14pt;
    font-family:Verdana;
    }
    //-->
    </style>

    <?

    ## change to the previous month
    if ($command == "prev_month")
    {
    if (--$month == 0)
    {
    $month = 12;
    $year--;
    }
    }
    ## change to the next month
    else if ($command == "next_month")
    {
    if (++$month == 13)
    {
    $month = 1;
    $year++;
    }
    }

    ## if no month has been passed
    if ($month == "")
    {
    $year= date("Y");
    $month= date("n");

    $month_name = date("F",mktime(0,0,0,$month,1,$year));
    }
    ## use current date if no month is passed
    else
    {
    $year= date("Y",mktime(0,0,0,$month,1,$year));
    $month= date("n",mktime(0,0,0,$month,1,$year));

    $month_name = date("F",mktime(0,0,0,$month,1,$year));
    }
    $giorni = date("t",mktime(0, 0, 0, $month, 1, $year)); //giorni del mese in questione
    echo$giorni;
    $array=array('Dom','Lun','Mar','Mer','Gio','Ven',' Sab','Dom','Lun','Mar','Mer','Gio','Ven','Sab','Do m','Lun','Mar','Mer','Gio','Ven','Sab','Dom','Lun' ,'Mar','Mer','Gio','Ven','Sab','Dom','Lun','Mar',' Mer','Gio','Ven','Sab');
    $dow = date("w",mktime(0,0,0,$month,1,$year)); //which day 1 falls on in the week
    ("0" == Sun);
    $dim = date("d",mktime (0,0,0,$month+1,0,$year)); //days in the current month
    ## modification to only print the number of weeks in a month
    $wim = ceil(($dim+$dow)/7); //weeks in month

    $ct=0;

    echo "

    <table border='0' cellpadding='1' cellspacing='1' width='425' align='center'>
    <tr>
    <td align='center'><h1><< $month_name $year >></h1></td>
    </tr>
    </table>
    <table border='1' cellpadding='1' cellspacing='1' width='425' align='center'>
    <tr> ";
    $s=7-$wim;
    for($r=$s;$r<$giorni+$s;$r++)
    {
    echo" <td align='center'>[b]$array[$r]</td>";

    }


    echo"</tr> ";


    ## print only the number of weeks needed
    for($row=1;$row<2;$row++)
    {
    echo ".<tr height='60'>";

    ## prints week (Sun to Sat)
    for($week=1;$week<31+$wim;$week++)
    {
    $ct++;
    $value=mktime(0,0,0,$month,$ct,$year);

    ## if $value is part of current month
    if (date("m",$value)==$month)
    {
    echo "
    <td align='center' class='body' width='85' valign='top'>
    <div align='center'>".date("j",$value)."</a></div>
    <div align='center'><input name=\"$value\" type=\"text\" size=\"3\"></div>
    </td>";
    }
    ## print previous and next month dates, but grayed out
    else
    {
    //echo "<td align='center' class='body' width='85' valign='top'
    //bgcolor='#ffffff'><div
    //align='right'>
    //".date("",$f)."</a>
    </div>
    </td>";
    }
    }
    echo "</tr>";


    }


    echo "</table>";

    ?>

  3. #3
    @sy5225

    gentilmente, quando posti codice, soprattutto se cosi tanto, utilizza gli appositi tag PHP o CODE per impaginare il codice altrimenti diventa illeggibile

    http://forum.html.it/forum/misc.php?s=&action=bbcode
    The fastest Redis alternative ... cachegrand! https://github.com/danielealbano/cachegrand

  4. #4

    scarica direttamente il file

    a questo link:
    http://www.poochiepooh.it/updown/upd...ction=download

    si chiama trippacchiello.rar
    saluti

  5. #5

    ecco il codice con i tag

    codice:
    <style type="text/css"> 
    <!-- 
    td 
    { 
    font-size:9pt; 
    line-height:14pt; 
    font-family:Verdana; 
    } 
    //--> 
    </style>
    Codice PHP:
    ## change to the previous month 
    if ($command == "prev_month"

    if (--
    $month == 0

    $month 12
    $year--; 


    ## change to the next month 
    else if ($command == "next_month"

    if (++
    $month == 13

    $month 1
    $year++; 



    ## if no month has been passed 
    if ($month == ""

    $yeardate("Y"); 
    $monthdate("n"); 

    $month_name date("F",mktime(0,0,0,$month,1,$year)); 

    ## use current date if no month is passed 
    else 

    $yeardate("Y",mktime(0,0,0,$month,1,$year)); 
    $monthdate("n",mktime(0,0,0,$month,1,$year)); 

    $month_name date("F",mktime(0,0,0,$month,1,$year)); 

    $giorni date("t",mktime(000$month1$year)); //giorni del mese in questione
    //echo$giorni;
    $array=array('Dom','Lun','Mar','Mer','Gio','Ven','Sab','Dom','Lun','Mar','Mer','Gio','Ven','Sab','Dom','Lun','Mar','Mer','Gio','Ven','Sab','Dom','Lun','Mar','Mer','Gio','Ven','Sab','Dom','Lun','Mar','Mer','Gio','Ven','Sab');
    $dow date("w",mktime(0,0,0,$month,1,$year)); //which day 1 falls on in the week 
    ("0" == Sun); 
    $dim date("d",mktime (0,0,0,$month+1,0,$year)); //days in the current month 
    ## modification to only print the number of weeks in a month 
    $wim ceil(($dim+$dow)/7); //weeks in month 

    $ct=0

    echo 
    "
     
    <table border='0' cellpadding='1' cellspacing='1' width='425' align='center'> 
    <tr> 
    <td align='center'><h1>[url='index.php?command=prev_month&month=
    $month&year=$year']<<[/url] $month_name $year [url='index.php?command=next_month&month=$month&year=$year']>>[/url]</h1></td> 
    </tr> 
    </table> 
    <table border='1' cellpadding='1' cellspacing='1' width='425' align='center'> 
    <tr> "
    ;
    $s=7-$wim;
    for(
    $r=$s;$r<$giorni+$s;$r++) 

    echo
    " <td align='center'>[b]$array[$r][/b]</td>"

    }


    echo
    "</tr> ";


    ## print only the number of weeks needed 
    for($row=1;$row<2;$row++) 

    echo 
    ".<tr height='60'>"

    ## prints week (Sun to Sat) 
    for($week=1;$week<31+$wim;$week++) 

    $ct++; 
    $value=mktime(0,0,0,$month,$ct,$year); 

    ## if $value is part of current month 
    if (date("m",$value)==$month

    echo 

    <td align='center' class='body' width='85' valign='top'> 
    <div align='center'>[b]"
    .date("j",$value)."</a>[/b]</div>
     <div align='center'><input name=\"
    $value\" type=\"text\" size=\"3\"></div> 
    </td>"


    ## print previous and next month dates, but grayed out 
    else 

     
    //  echo "<td align='center' class='body' width='85' valign='top' 
    //bgcolor='#CCCCCC'><div 
    //align='right'>[b]".date("j",$value)."</a>[/b]</div>
    </td>";



    echo "
    </tr>"; 





    echo "
    </table>"; 

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.