mesic'.$month.''; //echo ' mesic'.$year.''; echo ''; echo ""; echo ''; echo ''; for ($i=1;$i<=$dnuvmesici;$i++ ) { $den = mktime(0,0,0,$month,$i,$year); if (( date("N", $den) == 6 ) || ( date("N", $den) == 7 ) ) { $styl = 'class="vikend"'; } else { $styl = 'class="den"'; } if ($t['mday']==$i and $t['mon']==$month) { $styl = 'class="akt_den"'; } $styl_prazdny = 'class="prazdny_den"'; if ($i==1) { for ($j=1; $j< $denvtydnu;$j++) { echo ""; // vypis prazdnych policek pokud mesic nezacina v PO } } global $wpdb; $table = $wpdb->prefix."hockey_game"; $akt_sezona = get_option('akt_season'); // ziskani aktualne nastavene sezony z WP-options $query = "SELECT zapas.id AS id_zapas, zapas.cid_domaci AS id_domaci, zapas.cid_hoste AS id_hoste, zapas.skore_domaci AS skore_d, zapas.skore_hoste AS skore_h, zapas.cas AS cas, zapas.misto AS misto, zapas.typ AS typ, zapas.sezona AS sezona, liga.nazev AS nazev_liga, domaci.nazev AS nazev_d, hoste.nazev AS nazev_h, domaci.logo AS logo_d, hoste.logo AS logo_h FROM ".$wpdb->prefix."hockey_game AS zapas, ". $wpdb->prefix."hockey_league AS liga, ". $wpdb->prefix."hockey_team AS domaci, ". $wpdb->prefix."hockey_team AS hoste WHERE zapas.active = 1 AND zapas.sezona='$akt_sezona' AND zapas.datum=$den AND zapas.cid_liga=liga.id AND zapas.cid_domaci=domaci.id AND zapas.cid_hoste=hoste.id "; /*$query = "SELECT * FROM $table AS zapas $podminka";*/ $results = $wpdb->get_results($query); $logo = ""; foreach ($results as $key) { $obr = $key->logo_d; if ( ($key->logo_d=="SPUTNIK2.jpg") && ($key->typ=="ligový")) { $obr = $key->logo_h; } $logo = "../wp-content/plugins/hockey/images/loga/80_".$obr; } echo ""; if (!(($i+$denvtydnu-1) % 7)) { echo ''; } } $posledni = mktime(0,0,0,$month,$i,$year); $poslden = date("N", $posledni); if ($poslden!=1) { for ($j = $poslden; $j <= 7; $j++) { echo ""; // vypis prazdnych policek pokud mesic nezacina v PO } } echo '
$mesic $year
PoÚtStČtSoNe
 "; echo ''; if($logo != "") { echo ""; } echo "$i.$month
"; foreach ($results as $key) { $obr = $key->logo_d; if ( ($key->logo_d=="SPUTNIK2.jpg") && ($key->typ=="ligový")) { $obr = $key->logo_h; } $logo = "../wp-content/plugins/hockey/images/loga/80_".$obr; /******************************/ /* POPUP OKNO */ echo '
'; if(($key->nazev_d == "HC Sputnik B" or $key->nazev_d == "HC Sputnik A") and ($key->nazev_h == "HC Sputnik B" or $key->nazev_h == "HC Sputnik A")) { // je to trenal } else { // je to zapas echo "".$key->nazev_d." vs ".$key->nazev_h."
"; echo "Skore: ".$key->skore_d." : ".$key->skore_h."
"; } echo $key->typ;//.",".$key->nazev_liga; echo "
"; echo $key->misto; echo "
"; echo $key->cas; echo '
'; /******************************/ } echo '
'; echo "
 
'; } //$year = 2010; //$month = 11; //calendar($month, $year); date_default_timezone_set('UTC'); echo '
'; global $wpdb; $akt_sezona = get_option('akt_season'); // ziskani aktualne nastavene sezony z WP-options echo "

Kalendář akcí pro sezonu: $akt_sezona

"; $t = getdate(); $dnes= mktime(0,0,0,$t['mon'],$t['mday'],$t['year']); // vypise aktualni mesic + 2 dalsi for ($m = 0;$m < 3;$m++ ) { $mesic = date("m", $dnes)+ $m; $rok = date("Y", $dnes); if ($mesic > 12) // prelom roku { $mesic = $mesic - 12; $rok++; } calendar($mesic,$rok); } echo '
' ?>