I coded this and have still a big problem, when I change the date (click on Monday, ..., Sunday) the date desn't change correctly at all!!!!
I'm lost, could someone help me, please... :queasy:
...thx for any help...
Here is the code:
<?php
$get_day = date("N");
$get_date_day = date("d");
$get_date_mth = date("m");
$get_date_yea = date("Y");
if($getdate=="" | $getdate=="-1") {
$set_day_bg['' . $get_day] = "bgcolor=\"$layout_list_color2\"";
}
if(empty($c)) {
echo"Debug: IF THEN<br>";
$get_date = date("Y-m-d");
$get_date_spec = explode("-",$get_date);
$get_p_week = "0";
$get_m_week = "0";
}
else {
echo"Debug: ELSE<br>";
$get_p_week = ($getdate+7);
$get_m_week = ($getdate-7);
$getweek = time() + (($get_p_week) * 86400);
$get_date = date("Y-m-d",$getweek);
$get_date_spec = explode("-",$get_date);
}
echo"
<table>
<tr>
<td><b>" . date("F d, Y", mktime (0,0,0,$get_date_spec[1],$get_date_spec[2],$get_date_spec[0])) . "</b> </td>
";
$i = 1;
$j = -$get_day;
while ($i <= 7):
$j=$j+1;
if(empty($c)) { $k = $get_p_week+$j-7; } else { $k = $get_p_week+$j-7; }
echo" <td " . $set_day_bg['' . $i] . "><a target=\"_self\" href=\"$PHP_SELF?getdate=$k&c=gw\">" . date("l", mktime (0,0,0,$get_date_mth,$get_date_day+$j,$get_date_yea)) . "</a></td>\n";
$i++;
endwhile;
echo"
<td><a target=\"_self\" href=\"$PHP_SELF?getdate=$get_m_week&c=gw\"> - </a></td>
<td><a target=\"_self\" href=\"$PHP_SELF?getdate=$get_p_week&c=gw\"> + </a></td>
</tr>
</table>
";
?>