Zdravim mám problé s kalendářem !!! tady je kód
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<?
function kalendar($mesic){
$k=1;
//k vynulovaní pole----------------------------------------------------------------------------------------------------
for($i=1;$i<=6;$i++){
for($j=1;$j<=7;$j++){
$kalendar[$i][$j]=' ';
}
}
$kolik_dni=date("t",$mesic);
// konec nulovani----------------------------------------------------------------------------------------------------------
$u=date("w",$mesic)+1;
for($i=1;$i<=6;$i++){
for($j=$u;$j<=7;$j++){
if($k<=$kolik_dni){
if($k==date("j",$mesic)){
$kalendar[$i][$j]="<b>".$k."</b>";
}else{
$kalendar[$i][$j]=$k;
}
}
$k++;
}
$u=1;
}
//výpis tabulky kalendare--------------------------------------------------------------------------------
echo "<table>";
echo "<tr><td>Mo </td><td>Tu </td><td>We </td><td>Th </td><td>Fr </td><td>St </td><td>Su </td></tr>";
for($i=1;$i<=6;$i++){
echo "</tr>";
for($j=1;$j<=7;$j++){
echo "<td>".$kalendar[$i][$j]."</td>";
}
echo "</tr>";
}
echo "</table>";
//konec výpisu tabulky kalendare---------------------------------------------------------------------------
}
?>
</head>
<body>
<form method="post">
rok:<select name="rok">
<?
for($i=date("Y");$i<=date("Y")+1;$i++){
echo "<option>$i</option>";
}
?>
</select>
mesic:
<select name="mesic">
<?
for($i=1;$i<=12;$i++){
echo "<option>$i</option>";
}
?>
</select>
<input type="submit" value="zobraz" />
</form>
<?
if(isset($_POST['rok'])){
// a tady si nevim rady-------------------------------------------
$rozdil_rok=(date("Y")-$_POST['rok']);
$rozdil_mesic=($rozdil_rok*12)+(date("n")-$_POST['mesic']);
$mesic=strtotime("+".$rozdil_mesic." month");
}else{
$mesic=strtotime("+1 month");
}
kalendar($mesic);
echo "<hr>";
echo "rok: ".$_POST['rok'];
echo "<br>";
echo "mesic: ".$_POST['mesic'];
?>
</body>
</html>
pro aktualní měsíc mi to funguje jak má ale když tam měnim ten rok a měsíc tak už to tak dobrý neni ! pls Help !!!