Kalender und seite umblättern.

Dieses Thema im Forum "Webentwicklung" wurde erstellt von snoopy, 30. März 2008 .

Schlagworte:
  1. 30. März 2008
    Hey leute bin gerade dabei einen kalender zu erstellen nur komme ich jetzt nicht weiter.
    Kalender usw. ist da aber ich möchte auch gerne durchblättern also einen Monat vor oder zurück aber es will einfach nicht klappen. Hier mal der Code.

    Bewertung gibt es natürlich auch für die Hilfe.

    Danke schonmal

    PHP:
    <? php
    if(!empty( $_GET )) {
      
    extract ( $_GET );
    }
    elseif(!empty(
    $HTTP_GET_VARS )) {
      
    extract ( $HTTP_GET_VARS );
    }

    if(!empty(
    $_POST )) {
      
    extract ( $_POST );
    }
    elseif(!empty(
    $HTTP_POST_VARS )) {
      
    extract ( $HTTP_POST_VARS );
    }

    $time = time ();
    $heute_mon = date ( "m" , $time );
    $heute_jahr = date ( "Y" , $time );

      if(
    $wert_sel == and  $wert_zur == 1 ) {
        
    $mon_w = $mon_w  1 ;
      }
      elseif(
    $wert_sel == and  $wert_vor == 1 ) {
        
    $mon_w = $mon_w  1 ;
      }


      if(
    $wert_zur == and  $wert_vor == and  $wert_sel == 0 ) {
        
    $mon_w = $heute_mon ;
        
    $jahr_w = $heute_jahr ;
      }

      if(
    $wert_zur == 1 ) {
        
    $mon_w = $mon_w  1 ;
      }

      if(
    $wert_vor == 1 ) {
        
    $mon_w = $mon_w  1 ;
      }

      if (
    $mon_w <= 0 ) {
        
    $mon_w = 12 ;
        
    $jahr_w = $jahr_w  1 ;
      }

      if (
    $mon_w > 12 ) {
        
    $mon_w = 1 ;
        
    $jahr_w = $jahr_w  1 ;
      }

      if(
    strlen ( $mon_w )== 1 ) {  $mon_w = "0 $mon_w " ; }


    $mon_aktuell = $mon_w ;
    $jahr_aktuell = $jahr_w ;
    $pfad_zur = "index.php?wert_zur=1&mon_w= $mon_w &jahr_w= $jahr_w " ;
    $pfad_vor = "index.php?wert_vor=1&mon_w= $mon_w &jahr_w= $jahr_w " ;


    $mon_name =array ();
    $mon_name [ 0 ] =  "Dezember" ;
    $mon_name [ 1 ] =  "Januar" ;
    $mon_name [ 2 ] =  "Februar" ;
    $mon_name [ 3 ] =  "M&auml;rz" ;
    $mon_name [ 4 ] =  "April" ;
    $mon_name [ 5 ] =  "Mai" ;
    $mon_name [ 6 ] =  "Juni" ;
    $mon_name [ 7 ] =  "Juli" ;
    $mon_name [ 8 ] =  "August" ;
    $mon_name [ 9 ] =  "September" ;
    $mon_name [ 10 ] =  "Oktober" ;
    $mon_name [ 11 ] =  "November" ;
    $mon_name [ 12 ] =  "Dezember" ;
    $mon_name [ 13 ] =  "Januar" ;

    $days  date ( "t" $time ); 
    $mon_w  $mon_w

    $first_day  date ( "w" mktime ( 0 0 0 date ( "n" $time ),  1 date ( "Y" $time ))); 
    if(
    $first_day  ==  0 ) { 
        
    $first_day  6
    } else { 
        
    $first_day  $first_day - 1

    $rest  $days -( 7 -( $first_day + 1 )); 

    $zeilen  ceil ( $rest / 7 ); 
    $aktuell  date ( "dmY" ); 
    $last_day  date ( "w" mktime ( 0 0 0 date ( "n" $time ),  date ( "t" $time ),  date ( "Y" $time ))); 
    if(
    $last_day  ==  0 ) { 
        
    $zeilen  $zeilen - 1

    ?> 
    <html>
    <head>
    <meta name="content-type" content="text/html; charset=UTF-8">
    </head>
    <body bgcolor="#FFFFFF"#ffff" leftmargin="3" topmargin="3" marginwidth="3" marginheight="3">
    <center><br>
    <a href="index.php"><font color="#000000"><b>Startseite</b></font></a>
    <br><br><table width="70%" border="0"><tr><td><center>
    <table width="100%" border="0"><tr><td align=left valign=top width=30%>
       <b><a href="<?  echo  $pfad_zur ?>"><?  echo  $mon_name [ $mon_w  1 ];  ?></a></b></td><td align=center>
    <?
    //ueberschrift monat/jahr
    if( $mon_w < 10 ) {  $mon_w_ = ereg_replace ( "0" , "" , $mon_w ); } else {  $mon_w_ = $mon_w ; }
    echo 
    "<h2><font size=+0>"  $mon_name [ $mon_w_ ] .  "&nbsp;"  $jahr_w  "</font></h2>" ;
    echo 
    "</td>" ;
    ?></td>
    <td align=right width=30% valign=top>
    <b><a href="<?  echo  $pfad_vor ?>"><?  echo  $mon_name [ $mon_w  1 ];  ?></a></b>
    </td></tr></table></center>
    <?
    //Anfang Kalender
    ?>
      

     

    <table cellpadding="2" cellspacing="0" border="2" width="100%" style="font-family: Arial"> 
    <tr> 
     <th>Mo</th> 
     <th>Di</th> 
     <th>Mi</th> 
     <th>Do</th> 
     <th>Fr</th> 
     <th>Sa</th> 
     <th>So</th> 
    </tr> 
    <?php
    for( $zeile = 0 ; $zeile <= $zeilen ; $zeile ++) { 
        echo 
    "<tr>"
        if(
    $zeile  ==  0 ) { 
            for(
    $i = 0 ; $i < $first_day ; $i ++) { 
                echo 
    "<td>&nbsp;</td>"
            } 
            
    $start  1
            
    $ende  7 - $first_day
        } else { 
            
    $start  $ende  1
            
    $ende  $start  6
            if(
    $ende  $days
                
    $ende  $days
        } 
        for(
    $i = $start ; $i <= $ende ; $i ++) { 
            unset(
    $bg ); 
            if(
    $aktuell  ==  date ( "dmY" mktime ( 0 , 0 , 0 , date ( "n" , $time ), $i , date ( "Y" $time )))) { 
                
    $bg  " bgcolor='#Fc0000'"
            } 
            echo 
    "<td" . $bg . " align='right'>" . $i . "</td>"
        } 
           
    $b  6 -( $ende - $start ); 
        if(
    $zeile  ==  $zeilen  &&  $b > 0 ) { 
            for(
    $g = 0 ; $g < $b ; $g ++) { 
                echo 
    "<td>&nbsp;</td>"
            } 
        } 
        echo 
    "</tr>"

    echo 
    "</table>"
    //Ende Kalender
    ?> 

    </td></tr></table></center></body></html>


     
  2. 4. April 2008
    AW: Kalender und seite umblättern.

    Kannst du den Code bitte einfach mal hochladen, dann erkennen wir vll mehr...
    Wenn du noch keinen kostenlosen Hoster hast: http://raw.to/rubriken/freewebspace_pages.html

    mfg Olaf
     
  3. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.