Visualizzazione risultati 1 fino 10 di 10

Discussione: problema con calendario in php, mesi numerati male

  1. #1
    naturewildlife non è connesso Utente giovane
    Data registrazione
    14-08-2010
    Messaggi
    34

    Predefinito problema con calendario in php, mesi numerati male

    Buongiorno :)
    Ho bisogno di un altro aiuto. vorrei capire perchè in questo calendario il mese di dicembre, ossia l'ultimo mese dell'anno è indicato nella barra degli indirizzi con numero 13 anzichè 12, di conseguenza anche novembre che anzichè essere 11 è 12, ottobre 11 anzichè 10 ecc.. e gennaio, il primo mese dell'anno è segnato come il numero 2 anzichè 1. come devo fare per sistemare meglio questo script in modo tale che i mesi vengano numerati correttamente?

    codice:

    Codice HTML:
    <?    
    require_once("includes/config.php");   
    
    if(!isset($installed))   
    {   
        header("Location: install.php");   
        exit;   
    }   
    else   
    {   
        if(file_exists('install.php'))   
        {   
            header("Location: install.php");   
            exit;   
        }   
    }   
    
    $db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());     
    $db_select = mysql_select_db ($DBName) or die (mysql_error());   
    $db_table = $TBL_PR . "events";   
    
    function getmicrotime(){    
        list($usec, $sec) = explode(" ",microtime());    
        return ((float)$usec + (float)$sec);    
    }    
    
    $time_start = getmicrotime();   
    
    IF(!isset($_GET['year'])){   
        $_GET['year'] = date("Y");   
    }   
    IF(!isset($_GET['month'])){   
        $_GET['month'] = date("n")+1;   
    }   
    
    $month = addslashes($_GET['month'] - 1);   
    $year = addslashes($_GET['year']);   
    
    $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";   
    $query_result = mysql_query ($query);   
    while ($info = mysql_fetch_array($query_result))   
    {   
        $day = $info['event_day'];   
        $event_id = $info['event_id'];   
        $events[$day][] = $info['event_id'];   
        $event_info[$event_id]['0'] = substr($info['event_title'], 0, 12);;   
        $event_info[$event_id]['1'] = $info['event_time'];   
    }   
    
    $todays_date = date("j");   
    $todays_month = date("n");   
    
    $days_in_month = date ("t", mktime(0,0,0,$_GET['month'],0,$_GET['year']));   
    $first_day_of_month = date ("w", mktime(0,0,0,$_GET['month']-1,1,$_GET['year']));   
    $first_day_of_month = $first_day_of_month + 1;   
    $count_boxes = 0;   
    $days_so_far = 0;   
    
    IF($_GET['month'] == 13){   
        $next_month = 2;   
        $next_year = $_GET['year'] + 1;   
    } ELSE {   
        $next_month = $_GET['month'] + 1;   
        $next_year = $_GET['year'];   
    }   
    
    IF($_GET['month'] == 2){   
        $prev_month = 13;   
        $prev_year = $_GET['year'] - 1;   
    } ELSE {   
        $prev_month = $_GET['month'] - 1;   
        $prev_year = $_GET['year'];   
    }   
    
    
    ?>   
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">   
    <html>   
    <head>   
    <title>PHPCalendar</title>   
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">   
    <link href="images/cal.css" rel="stylesheet" type="text/css">   
    <script language="JavaScript" type="text/JavaScript">   
    <!--   
    function MM_jumpMenu(targ,selObj,restore){ //v3.0   
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");   
      if (restore) selObj.selectedIndex=0;   
    }   
    function MM_openBrWindow(theURL,winName,features) { //v2.0   
      window.open(theURL,winName,features);   
    }   
    //-->   
    </script>   
    </head>   
    
    <body>   
    <div align="center"><span class="currentdate"><? echo date ("F Y", mktime(0,0,0,$_GET['month']-1,1,$_GET['year'])); ?></span><br>   
    </div>   
    <div align="center"><br>   
      <table width="700" border="0" cellspacing="0" cellpadding="0">   
        <tr>    
          <td><div align="right"><a href="<? echo "index.php?month=$prev_month&year=$prev_year"; ?>"><img src="http://images-1.findicons.com/files/icons/1688/web_blog/48/arrow_left.png"></a></div></td>   
          <td width="200" style="border: 1px solid #F2F2F2"><div align="center">   
                   
              <select name="month" id="month" onChange="MM_jumpMenu('parent',this,0)">   
                <?   
                for ($i = 1; $i <= 12; $i++) {   
                    $link = $i+1;   
                    IF($_GET['month'] == $link){   
                        $selected = "selected";   
                    } ELSE {   
                        $selected = "";   
                    }   
                    echo "<option value=\"index.php?month=$link&year=$_GET[year]\" $selected>" . date ("F", mktime(0,0,0,$i,1,$_GET['year'])) . "</option>\n";   
                }   
                ?>   
              </select>   
              <select name="year" id="year" onChange="MM_jumpMenu('parent',this,0)">   
              <?   
              for ($i = 2009; $i <= 2015; $i++) {   
                  IF($i == $_GET['year']){   
                    $selected = "selected";   
                } ELSE {   
                    $selected = "";   
                }   
                  echo "<option value=\"index.php?month=$_GET[month]&year=$i\" $selected>$i</option>\n";   
              }   
              ?>   
              </select>   
            </div></td>   
          <td><div align="left"><a href="<? echo "index.php?month=$next_month&year=$next_year"; ?>"><img src="http://images-2.findicons.com/files/icons/1688/web_blog/48/arrow_right.png"></a></div></td>   
        </tr>   
      </table>   
      <br>   
    </div>   
    <table width="1050" border="0" align="center" cellpadding="0" cellspacing="0">   
      <tr>   
        <td><table border="0" width="100%" cellpadding="0" cellspacing="1" bgcolor="#DDDDDD">   
            <tr class="topdays">    
              <td><div align="center">Domenica</font></div></td>   
              <td><div align="center">Lunedì</div></td>   
              <td><div align="center">Martedì</div></td>   
              <td><div align="center">Mercoledì</div></td>   
              <td><div align="center">Giovedì</div></td>   
              <td><div align="center">Venerdì</div></td>   
              <td><div align="center">Sabato</div></td>   
            </tr>   
            <tr valign="top" bgcolor="#FFFFFF">    
            <?   
            for ($i = 1; $i <= $first_day_of_month-1; $i++) {   
                $days_so_far = $days_so_far + 1;   
                $count_boxes = $count_boxes + 1;   
                echo "<td width=\"100\" height=\"100\" class=\"beforedayboxes\"></td>\n";   
            }   
            for ($i = 1; $i <= $days_in_month; $i++) {   
                   $days_so_far = $days_so_far + 1;   
                    $count_boxes = $count_boxes + 1;   
                IF($_GET['month'] == $todays_month+1){   
                    IF($i == $todays_date){   
                        $class = "highlighteddayboxes";   
                    } ELSE {   
                        $class = "dayboxes";   
                    }   
                } ELSE {   
                    IF($i == 1){   
                        $class = "highlighteddayboxes";   
                    } ELSE {   
                        $class = "dayboxes";   
                    }   
                }   
                echo "<td width=\"100\" height=\"100\" class=\"$class\">\n";   
                $link_month = $_GET['month'] - 1;   
                echo "<div align=\"right\"><span class=\"toprightnumber\">\n<a style=\"color: #222222\"  href=\"java-script:MM_openBrWindow('event_add.php?day=$i&month=$link_month&year=$_GET[year]','','width=500,height=300');\">$i</a>&nbsp;</span></div>\n";   
                IF(isset($events[$i])){   
                    echo "<div align=\"center\"><span class=\"eventinbox\">\n";   
                    while (list($key, $value) = each ($events[$i])) {   
                        echo "<br><table class=\"corner\"><tr><td><a href=\"java-script:MM_openBrWindow('event.php?id=$value','','width=500,height=200');\" style=\"color: #3D3D3D; font-size: 13px; text-decoration: none; text-shadow: 0px 1px 1px #FFF;\">" . $event_info[$value]['1'] . " - " . $event_info[$value]['0']  . "</a></td></tr></table>\n<br>\n";   
                    }   
                    echo "</span></div>\n";   
                }   
                echo "</td>\n";   
                IF(($count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){   
                    $count_boxes = 0;   
                    echo "</TR><TR valign=\"top\">\n";   
                }   
            }   
            $extra_boxes = 7 - $count_boxes;   
            for ($i = 1; $i <= $extra_boxes; $i++) {   
                echo "<td width=\"100\" height=\"100\" class=\"afterdayboxes\"></td>\n";   
            }   
            $time_end = getmicrotime();   
            $time = round($time_end - $time_start, 3);   
            ?>   
            </tr>   
          </table></td>   
      </tr>   
    </table>   
    </body>   
    </html>   
    snapshot per farvi capire: http://img508.imageshack.us/img508/6063/calendariob.png

  2. #2
    Guest

    Predefinito

    Chiedere all'autore dello script è male?

  3. #3
    naturewildlife non è connesso Utente giovane
    Data registrazione
    14-08-2010
    Messaggi
    34

    Predefinito

    ovviamente ho già provato a contattare ma non ho avuto risposte!

  4. #4
    Guest

    Predefinito

    simpleticket, se non sai/puoi aiutare, evita di rispondere in questo modo: oltre ad essere un po' irrispettoso, non è di nessun aiuto all'utente e tanto meno lo è a chi entrerà nel thread in futuro; non credo ti faccia piacere se qualcuno ti rispondesse così in un forum pubblico.

    naturewildlife, puoi postare il link dove hai scaricato questo script? Senza installazione viene un po' difficile, anche perché vengono utilizzate abbastanza male le variabili (esempio, viene valorizzata $year con $_GET['year'], ma viene sempre usata quest'ultima).


  5. #5
    Guest

    Predefinito

    Citazione Originalmente inviato da biccheddu Visualizza messaggio
    simpleticket, se non sai/puoi aiutare, evita di rispondere in questo modo: oltre ad essere un po' irrispettoso, non è di nessun aiuto all'utente e tanto meno lo è a chi entrerà nel thread in futuro; non credo ti faccia piacere se qualcuno ti rispondesse così in un forum pubblico.
    @biccheddu
    Scusa, cosa vedi di irrispettoso nell'invito a cercare una soluzione presso chi ha sviluppato lo script e che quindi meglio di chiunque conosce il prodotto?
    Tu stesso ammetti che non lo conosci e quindi non sai aiutarlo. Se tu ne fossi stato l'autore sapresti se trattasi di un bug, di un problema di installazione, di cattivo uso, ecc.
    Qui non parlava di uno scritpt dell'utente che non riesce a fare quello che si prefigge, di un disservizio di Altervista, ecc... Si sta parlando di uno script bello e confezionato. Con tutto il rispetto qualunque intervento fatto così, secodo me, rischia di creare più problemi di quanti ne risolva. IMHO.

  6. #6
    naturewildlife non è connesso Utente giovane
    Data registrazione
    14-08-2010
    Messaggi
    34

    Predefinito

    buongiorno biccheddu :) premetto che lo script l'ho scaricato tempo indietro e adesso andare a ritrovare precisamente il link originario è difficile!

  7. #7
    Guest

    Predefinito

    Citazione Originalmente inviato da simpleticket Visualizza messaggio
    @biccheddu
    Scusa, cosa vedi di irrispettoso nell'invito a cercare una soluzione presso chi ha sviluppato lo script e che quindi meglio di chiunque conosce il prodotto?
    Tu stesso ammetti che non lo conosci e quindi non sai aiutarlo. Se tu ne fossi stato l'autore sapresti se trattasi di un bug, di un problema di installazione, di cattivo uso, ecc.
    Qui non parlava di uno scritpt dell'utente che non riesce a fare quello che si prefigge, di un disservizio di Altervista, ecc... Si sta parlando di uno script bello e confezionato. Con tutto il rispetto qualunque intervento fatto così, secodo me, rischia di creare più problemi di quanti ne risolva. IMHO.
    Stai andando OT solo per replicare al fatto che: non sai la risposta? NON rispondere, è facile. Si evita, poi, come in questo caso, di inserire 4 messaggi in un thread solo per spiegare un qualcosa che è buon senso su internet e soprattutto di una community di Supporto quale AV. Se ad ogni topic, si rispondesse "fai una ricerca su Google" senza dare un aiuto, mi dici cosa c'è di utile nella risposta? Non prenderla a male, ma fidati, la tua risposta è fuori luogo

    Comunque ho fatto una ricerca ed ho trovato i sorgenti e la tabella. L'ho modificato e sembra funzionare come vorresti:
    Codice PHP:
    <?
    require_once("includes/config.php");

    if(!isset(
    $installed))
    {
    header("Location: install.php");
    exit;
    }
    else
    {
    if(
    file_exists('install.php'))
    {
    header("Location: install.php");
    exit;
    }
    }


    $db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());
    $db_select = mysql_select_db ($DBName) or die (mysql_error());
    $db_table = $TBL_PR . "events";

    function
    getmicrotime(){
    list(
    $usec, $sec) = explode(" ",microtime());
    return ((float)
    $usec + (float)$sec);
    }

    $time_start = getmicrotime();

    $month = (!isset($_GET['month'])) ? date("n") : addslashes($_GET['month']);
    $year = (!isset($_GET['year'])) ? date("Y") : addslashes($_GET['year']);

    $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";
    $query_result = mysql_query ($query);

    while (
    $info = mysql_fetch_array($query_result))
    {
    $day = $info['event_day'];
    $event_id = $info['event_id'];
    $events[$day][] = $info['event_id'];
    $event_info[$event_id]['0'] = substr($info['event_title'], 0, 12);;
    $event_info[$event_id]['1'] = $info['event_time'];
    }

    $todays_date = date("j");
    $todays_month = date("n");

    $days_in_month = date ("t", mktime(0,0,0,$month,0,$year));
    $first_day_of_month = date ("w", mktime(0,0,0,$month,1,$year));
    $first_day_of_month = $first_day_of_month;
    $count_boxes = 0;
    $days_so_far = 0;

    IF(
    $month == 12){
    $next_month = 1;
    $next_year = $year + 1;
    } ELSE {
    $next_month = $month + 1;
    $next_year = $year;
    }

    IF(
    $month == 1){
    $prev_month = 12;
    $prev_year = $year - 1;
    } ELSE {
    $prev_month = $month - 1;
    $prev_year = $year;
    }


    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>PHPCalendar</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="http://forum.it.altervista.org/images/cal.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>

    <body>
    <div align="center"><span class="currentdate"><? echo date ("F Y", mktime(0,0,0,$month,1,$year)); ?></span><br>
    </div>
    <div align="center"><br>
    <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><div align="right"><a href="<? echo "?month=$prev_month&year=$prev_year"; ?>"><img src="http://images-1.findicons.com/files/icons/1688/web_blog/48/arrow_left.png"></a></div></td>
    <td width="200" style="border: 1px solid #F2F2F2"><div align="center">

    <select name="month" id="month" onChange="MM_jumpMenu('parent',this,0)">
    <?
    for ($i = 1; $i <= 12; $i++) {
    IF(
    $month == $i){
    $selected = "selected";
    } ELSE {
    $selected = "";
    }
    echo
    "<option value=\"?month=$i&year=$year\" $selected>" . date ("F", mktime(0,0,0,$i,1,$year)) . "</option>\n";
    }
    ?>
    </select>
    <select name="year" id="year" onChange="MM_jumpMenu('parent',this,0)">
    <?
    for ($i = 2009; $i <= 2015; $i++) {
    IF(
    $i == $year){
    $selected = "selected";
    } ELSE {
    $selected = "";
    }
    echo
    "<option value=\"?month=$month&year=$i\" $selected>$i</option>\n";
    }
    ?>
    </select>
    </div></td>
    <td><div align="left"><a href="<? echo "?month=$next_month&year=$next_year"; ?>"><img src="http://images-2.findicons.com/files/icons/1688/web_blog/48/arrow_right.png"></a></div></td>
    </tr>
    </table>
    <br>
    </div>
    <table width="1050" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td><table border="0" width="100%" cellpadding="0" cellspacing="1" bgcolor="#DDDDDD">
    <tr class="topdays">
    <td><div align="center">Domenica</font></div></td>
    <td><div align="center">Lunedì</div></td>
    <td><div align="center">Martedì</div></td>
    <td><div align="center">Mercoledì</div></td>
    <td><div align="center">Giovedì</div></td>
    <td><div align="center">Venerdì</div></td>
    <td><div align="center">Sabato</div></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
    <?
    for ($i = 1; $i <= $first_day_of_month-1; $i++) {
    $days_so_far = $days_so_far + 1;
    $count_boxes = $count_boxes + 1;
    echo
    "<td width=\"100\" height=\"100\" class=\"beforedayboxes\"></td>\n";
    }
    for (
    $i = 1; $i <= $days_in_month; $i++) {
    $days_so_far = $days_so_far + 1;
    $count_boxes = $count_boxes + 1;
    IF(
    $month == $todays_month){
    IF(
    $i == $todays_date){
    $class = "highlighteddayboxes";
    } ELSE {
    $class = "dayboxes";
    }
    } ELSE {
    IF(
    $i == 1){
    $class = "highlighteddayboxes";
    } ELSE {
    $class = "dayboxes";
    }
    }
    echo
    "<td width=\"100\" height=\"100\" class=\"$class\">\n";
    $link_month = $month - 1;
    echo
    "<div align=\"right\"><span class=\"toprightnumber\">\n<a style=\"color: #222222\" href=\"java-script:MM_openBrWindow('event_add.php?day=$i&month=$link_month&year=$year','','width=500,height=300');\">$i</a>&nbsp;</span></div>\n";
    IF(isset(
    $events[$i])){
    echo
    "<div align=\"center\"><span class=\"eventinbox\">\n";
    while (list(
    $key, $value) = each ($events[$i])) {
    echo
    "<br><table class=\"corner\"><tr><td><a href=\"java-script:MM_openBrWindow('event.php?id=$value','','width=500,height=200');\" style=\"color: #3D3D3D; font-size: 13px; text-decoration: none; text-shadow: 0px 1px 1px #FFF;\">" . $event_info[$value]['1'] . " - " . $event_info[$value]['0'] . "</a></td></tr></table>\n<br>\n";
    }
    echo
    "</span></div>\n";
    }
    echo
    "</td>\n";
    IF((
    $count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){
    $count_boxes = 0;
    echo
    "</TR><TR valign=\"top\">\n";
    }
    }
    $extra_boxes = 7 - $count_boxes;
    for (
    $i = 1; $i <= $extra_boxes; $i++) {
    echo
    "<td width=\"100\" height=\"100\" class=\"afterdayboxes\"></td>\n";
    }
    $time_end = getmicrotime();
    $time = round($time_end - $time_start, 3);
    ?>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>

  8. #8
    naturewildlife non è connesso Utente giovane
    Data registrazione
    14-08-2010
    Messaggi
    34

    Predefinito

    Ti ringrazio moltissimo, sei stato veramente disponibile e di grande aiuto :) grazie moltissime ancora Federico
    Ultima modifica di naturewildlife : 24-12-2011 alle ore 15.02.06

  9. #9
    Guest

    Predefinito

    Prova ad usare questo, anche se non riscontro il tuo problema:
    Codice PHP:
    <?php

    require_once("includes/config.php");

    if(!isset(
    $installed))
    {
    header("Location: install.php");
    exit;
    }
    else
    {
    if(
    file_exists('install.php'))
    {
    header("Location: install.php");
    exit;
    }
    }

    $db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());
    $db_select = mysql_select_db ($DBName) or die (mysql_error());
    $db_table = $TBL_PR . "events";

    function
    getmicrotime(){
    list(
    $usec, $sec) = explode(" ",microtime());
    return ((float)
    $usec + (float)$sec);
    }

    $time_start = getmicrotime();

    $month = (!isset($_GET['month'])) ? date("n") : addslashes($_GET['month']);
    $year = (!isset($_GET['year'])) ? date("Y") : addslashes($_GET['year']);

    $query = "SELECT event_id,event_title,event_day,event_time FROM $db_table WHERE event_month='$month' AND event_year='$year' ORDER BY event_time";
    $query_result = mysql_query ($query);

    while (
    $info = mysql_fetch_array($query_result))
    {
    $day = $info['event_day'];
    $event_id = $info['event_id'];
    $events[$day][] = $info['event_id'];
    $event_info[$event_id]['0'] = substr($info['event_title'], 0, 12);;
    $event_info[$event_id]['1'] = $info['event_time'];
    }

    $todays_date = date("j");
    $todays_month = date("n");

    $days_in_month = date ("t", mktime(0,0,0,$month,0,$year));
    $first_day_of_month = date ("w", mktime(0,0,0,$month,1,$year));
    $first_day_of_month = $first_day_of_month;
    $count_boxes = 0;
    $days_so_far = 0;

    IF(
    $month == 12){
    $next_month = 1;
    $next_year = $year + 1;
    } ELSE {
    $next_month = $month + 1;
    $next_year = $year;
    }

    IF(
    $month == 1){
    $prev_month = 12;
    $prev_year = $year - 1;
    } ELSE {
    $prev_month = $month - 1;
    $prev_year = $year;
    }


    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>PHPCalendar</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="http://forum.it.altervista.org/images/cal.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>

    <body>
    <div align="center"><span class="currentdate"><? echo date ("F Y", mktime(0,0,0,$month,1,$year)); ?></span><br>
    </div>
    <div align="center"><br>
    <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><div align="right"><a href="<? echo "?month=$prev_month&year=$prev_year"; ?>"><img src="http://images-1.findicons.com/files/icons/1688/web_blog/48/arrow_left.png"></a></div></td>
    <td width="200" style="border: 1px solid #F2F2F2"><div align="center">

    <select name="month" id="month" onChange="MM_jumpMenu('parent',this,0)">
    <?
    for ($i = 1; $i <= 12; $i++) {
    IF(
    $month == $i){
    $selected = "selected";
    } ELSE {
    $selected = "";
    }
    echo
    "<option value=\"?month=$i&year=$year\" $selected>" . date ("F", mktime(0,0,0,$i,1,$year)) . "</option>\n";
    }
    ?>
    </select>
    <select name="year" id="year" onChange="MM_jumpMenu('parent',this,0)">
    <?
    for ($i = 2009; $i <= 2015; $i++) {
    IF(
    $i == $year){
    $selected = "selected";
    } ELSE {
    $selected = "";
    }
    echo
    "<option value=\"?month=$month&year=$i\" $selected>$i</option>\n";
    }
    ?>
    </select>
    </div></td>
    <td><div align="left"><a href="<? echo "?month=$next_month&year=$next_year"; ?>"><img src="http://images-2.findicons.com/files/icons/1688/web_blog/48/arrow_right.png"></a></div></td>
    </tr>
    </table>
    <br>
    </div>
    <table width="1050" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td><table border="0" width="100%" cellpadding="0" cellspacing="1" bgcolor="#DDDDDD">
    <tr class="topdays">
    <td><div align="center">Domenica</font></div></td>
    <td><div align="center">Lunedì</div></td>
    <td><div align="center">Martedì</div></td>
    <td><div align="center">Mercoledì</div></td>
    <td><div align="center">Giovedì</div></td>
    <td><div align="center">Venerdì</div></td>
    <td><div align="center">Sabato</div></td>
    </tr>
    <tr valign="top" bgcolor="#FFFFFF">
    <?
    for ($i = 1; $i <= $first_day_of_month-1; $i++) {
    $days_so_far = $days_so_far + 1;
    $count_boxes = $count_boxes + 1;
    echo
    "<td width=\"100\" height=\"100\" class=\"beforedayboxes\"></td>\n";
    }
    for (
    $i = 1; $i <= $days_in_month; $i++) {
    $days_so_far = $days_so_far + 1;
    $count_boxes = $count_boxes + 1;
    IF(
    $month == $todays_month){
    IF(
    $i == $todays_date){
    $class = "highlighteddayboxes";
    } ELSE {
    $class = "dayboxes";
    }
    } ELSE {
    IF(
    $i == 1){
    $class = "highlighteddayboxes";
    } ELSE {
    $class = "dayboxes";
    }
    }
    echo
    "<td width=\"100\" height=\"100\" class=\"$class\">\n";
    $link_month = $month - 1;
    echo
    "<div align=\"right\"><span class=\"toprightnumber\">\n<a style=\"color: #222222\" href=\"java-script:MM_openBrWindow('event_add.php?day=$i&month=$link_month&year=$year','','width=500,height=300');\">$i</a>&nbsp;</span></div>\n";
    IF(isset(
    $events[$i])){
    echo
    "<div align=\"center\"><span class=\"eventinbox\">\n";
    while (list(
    $key, $value) = each ($events[$i])) {
    echo
    "<br><table class=\"corner\"><tr><td><a href=\"java-script:MM_openBrWindow('event.php?id=$value','','width=500,height=200');\" style=\"color: #3D3D3D; font-size: 13px; text-decoration: none; text-shadow: 0px 1px 1px #FFF;\">" . $event_info[$value]['1'] . " - " . $event_info[$value]['0'] . "</a></td></tr></table>\n<br>\n";
    }
    echo
    "</span></div>\n";
    }
    echo
    "</td>\n";
    IF((
    $count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){
    $count_boxes = 0;
    echo
    "</TR><TR valign=\"top\">\n";
    }
    }
    $extra_boxes = 7 - $count_boxes;
    for (
    $i = 1; $i <= $extra_boxes; $i++) {
    echo
    "<td width=\"100\" height=\"100\" class=\"afterdayboxes\"></td>\n";
    }
    $time_end = getmicrotime();
    $time = round($time_end - $time_start, 3);
    ?>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>

  10. #10
    naturewildlife non è connesso Utente giovane
    Data registrazione
    14-08-2010
    Messaggi
    34

    Predefinito

    Sono riuscito a sistemare con un po di pazienza :) grazie moltissime :)

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •