"ID", "nadpis" => "nadpis", "perex" => "perex", "zaciatok" => "dátum", "poradie" => "poradie" ); $zoradenia = array( "DESC" => "zostupne", "ASC" => "vzostupne" ); $dni = array( 0 => "nedeľa", 1 => "pondelok", 2 => "utorok", 3 => "streda", 4 => "štvrtok", 5 => "piatok", 6 => "sobota" ); function drawNavigation($IDdesat, $navigation, $count){ $strSQL = "SELECT nadpis, rodic FROM desat WHERE IDdesat=$IDdesat"; $result = mysql_query($strSQL); $numrow = mysql_num_rows($result); for ($i = 0; $i < $numrow; $i++) { $nadpis = mysql_result($result, $i, 'nadpis'); $rodic = mysql_result($result, $i, 'rodic'); } $navigation = "$nadpis". $navigation; if($rodic > 1) $navigation=" | ".$navigation; if($rodic > 1) { $count++; drawNavigation($rodic, $navigation, $count); } else { if($count > 1) echo "
".$navigation."
"; } if($result) mysql_free_result($result); } if(isset($_REQUEST["desat"]) && is_numeric($_REQUEST["desat"])) $desat = $_REQUEST["desat"]; else { $desat = 2; } $desat=mysql_real_escape_string($desat); $strSQL = "SELECT * FROM desat WHERE IDdesat=$desat"; $result = mysql_query($strSQL); $numrow = mysql_num_rows($result); for ($i = 0; $i < $numrow; $i++) { $ID_current=mysql_result($result, $i, 'IDdesat'); $nadpis_current=mysql_result($result, $i, 'nadpis'); $perex_current=mysql_result($result, $i, 'perex'); $detail_current=mysql_result($result, $i, 'detail'); $rodic_current=mysql_result($result, $i, 'rodic'); $zaciatok_current=mysql_result($result, $i, 'zaciatok'); $zaciatok_current=strtotime($zaciatok_current); $koniec_current=mysql_result($result, $i, 'koniec'); $koniec_current=strtotime($koniec_current); $active_current=mysql_result($result, $i, 'active'); $a_zaciatok_current=mysql_result($result, $i, 'a_zaciatok'); $a_koniec_current=mysql_result($result, $i, 'a_koniec'); $a_perex_current=mysql_result($result, $i, 'a_perex'); $a_weekday_current=mysql_result($result, $i, 'a_weekday'); $weekday_zaciatok_current=date("w", $zaciatok_current); $weekday_koniec_current=date("w", $koniec_current); $a_cas_current=mysql_result($result, $i, 'a_cas'); $cas_zaciatok_current=date("H:i", $zaciatok_current); $cas_koniec_current=date("H:i", $koniec_current); $datum_zaciatok_current=date("j. ", $zaciatok_current).$mesiace[date("m", $zaciatok_current)-1].date(" Y", $zaciatok_current); $datum_koniec_current=date("j. ", $koniec_current).$mesiace[date("m", $koniec_current)-1].date(" Y", $koniec_current); $poradie_current=mysql_result($result, $i, 'poradie'); $triedenie_current=mysql_result($result, $i, 'triedenie'); $zoradenie_current=mysql_result($result, $i, 'zoradenie'); } if($result) mysql_free_result($result); if(isset($_REQUEST["rodic"])){$rodic=$_REQUEST["rodic"];}else{$rodic=$ID_current;} include("desat_top.php"); echo ""; echo "
"; // NAVIGATION drawNavigation($ID_current, "", 1); // TIME if($a_zaciatok_current==1){ if($a_weekday_current==1) $out = $dni[$weekday_zaciatok_current].", "; $out .= "$datum_zaciatok_current "; } if($a_cas_current==1) $out .= "$cas_zaciatok_current "; if((($a_zaciatok_current==1)&&($a_koniec_current==1))||(($a_cas_current==1)&&($cas_zaciatok_current!=$cas_koniec_current))) $out .= " - "; if(($a_zaciatok_current==1)&&($a_koniec_current==1)) { if(($a_weekday_current==1)&&($datum_zaciatok_current!=$datum_koniec_current)) $out .= "$weekday_koniec_current, "; if($datum_zaciatok_current!=$datum_koniec_current) $out .= "$datum_koniec_current "; } if(($a_cas_current==1)&&($cas_zaciatok_current!=$cas_koniec_current)) $out .="$cas_koniec_current "; if(($a_zaciatok_current==1)||($a_cas_current==1)) $out .= "
"; if(!empty($out)) echo "
".$out."
"; // NADPIS if((strlen($nadpis_current)>0)&&($ID_current!=2)) echo "

$nadpis_current

"; // PEREX $perex_current = fmt_text($perex_current, 0); if((strlen($perex_current)>0)&&($a_perex_current==1)) echo "
$perex_current
"; // uputavka end, children start $strSQL = "SELECT * FROM desat WHERE rodic=$ID_current AND active=1 ORDER BY $triedenie_current $zoradenie_current, IDdesat DESC"; $result=mysql_query($strSQL); $numrow=mysql_num_rows($result); for ($i = 0; $i < $numrow; $i++) { $IDdesat=mysql_result($result, $i, 'IDdesat'); $nadpis=mysql_result($result, $i, 'nadpis'); $perex=mysql_result($result, $i, 'perex'); $perex = fmt_text($perex, 0); $detail=mysql_result($result, $i, 'detail'); $detail = fmt_text($detail, 0); $zaciatok=mysql_result($result, $i, 'zaciatok'); $zaciatok=strtotime($zaciatok); $koniec=mysql_result($result, $i, 'koniec'); $koniec=strtotime($koniec); $active=mysql_result($result, $i, 'active'); $a_zaciatok=mysql_result($result, $i, 'a_zaciatok'); $a_koniec=mysql_result($result, $i, 'a_koniec'); $a_perex=mysql_result($result, $i, 'a_perex'); $a_weekday=mysql_result($result, $i, 'a_weekday'); $weekday_zaciatok=date("w", $zaciatok); $weekday_koniec=date("w", $koniec); $a_cas=mysql_result($result, $i, 'a_cas'); $cas_zaciatok=date("H:i", $zaciatok); $cas_koniec=date("H:i", $koniec); $datum_zaciatok=date("j. ", $zaciatok).$mesiace[date("m", $zaciatok)-1].date(" Y", $zaciatok); $datum_koniec=date("j. ", $koniec).$mesiace[date("m", $koniec)-1].date(" Y", $koniec); $poradie=mysql_result($result, $i, 'poradie'); $triedenie=mysql_result($result, $i, 'triedenie'); $zoradenie=mysql_result($result, $i, 'zoradenie'); echo "
"; // TIME $out = ""; if($a_zaciatok==1) { if($a_weekday==1) $out .= $dni[$weekday_zaciatok].", "; $out .= "$datum_zaciatok "; } if($a_cas==1) $out .= "$cas_zaciatok "; if((($a_zaciatok==1)&&($a_koniec==1))||(($a_cas==1)&&($cas_zaciatok!=$cas_koniec))) $out .= " - "; if(($a_zaciatok==1)&&($a_koniec==1)) { if(($a_weekday==1)&&($weekday_koniec!=$weekday_zaciatok)&&($datum_zaciatok!=$datum_koniec)) $out.= $dni[$weekday_koniec].", "; if($datum_zaciatok!=$datum_koniec) $out .= "$datum_koniec "; } if(($a_cas==1)&&($cas_zaciatok!=$cas_koniec)) $out .= "$cas_koniec "; if(($a_zaciatok==1)||($a_cas==1)) $out .= ""; if(!empty($out)) echo "
".$out."
"; // fotky childa $strSQL = "SELECT IDfoto FROM foto WHERE sec='desat' AND IDsec=$IDdesat"; $result_fotky = mysql_query($strSQL); $numrow_fotky_total = mysql_num_rows($result_fotky); if(strlen($nadpis)>0) { if((strlen($detail)>0) || ($numrow_fotky_total>6)) { echo "

$nadpis

"; } else { echo "

$nadpis

"; } } if($result_fotky) mysql_free_result($result_fotky); $strSQL = "SELECT * FROM foto WHERE sec='desat' AND IDsec=$IDdesat ORDER BY IDfoto DESC LIMIT 0, 6"; $result_fotky=mysql_query($strSQL); $numrow_fotky=mysql_num_rows($result_fotky); if($numrow_fotky > 0) { echo "
"; for ($k = 0; $k < $numrow_fotky; $k++) { $IDfoto=mysql_result($result_fotky, $k, 'IDfoto'); $popis=mysql_result($result_fotky, $k, 'popis'); pisFoto($IDfoto, $popis); } if($result_fotky) mysql_free_result($result_fotky); echo "
"; } if(strlen($perex)>0) { /*if(strlen($nadpis)!=0) echo "
";*/ echo "

".$perex; } if((strlen($detail)>0)||($numrow_fotky_total>6)) echo " >>>"; echo "

"; echo "
"; } if($result) mysql_free_result($result); // children end, clanok start //echo "CLANOK BEGIN"; $detail_current=fmt_text($detail_current, 1); if(strlen($detail_current)>0) echo "$detail_current"; // clanok end, foto start $strSQL = "SELECT * FROM foto WHERE sec='desat' AND IDsec=$ID_current ORDER BY IDfoto DESC"; $result=mysql_query($strSQL); $numrow=mysql_num_rows($result); /* if($numrow>0) { echo "
"; } */ $riadkovac=0; if($numrow > 0) { echo "
"; for ($i = 0; $i < $numrow; $i++) { $IDfoto=mysql_result($result, $i, 'IDfoto'); $popis=mysql_result($result, $i, 'popis'); pisFoto($IDfoto, $popis); $riadkovac++; if($riadkovac==6){ echo "
"; $riadkovac=0; } } echo "
"; } /* if($numrow>0) { echo "
"; } */ if($result) mysql_free_result($result); // foto end, media start // echo "CLANOK END"; require_once('media.lib.php'); showMediaTable('desat', $ID_current); // echo "PAGE END"; ?>
[pripraviť pre tlač]
"; include("desat_bottom.php"); ?>