12) { $m_next = 1; //next month is in next year $y_next = $year +1; $nr_next = date("t", mktime(12, 0, 0, $m_next, 1, $y_next)); //number of days next month previous year } else { $nr_next = date("t", mktime(12, 0, 0, $m_next, 1, $year)); //number of days next month this year } $nr = date("t", mktime(12, 0, 0, $month, 1, $year)); //nr of days of the current month $firstday = date("w", mktime(12, 0, 0, $month, $d, $year)); //what is the weekday of current date if ($firstday == 0) { $firstday = 7; } //our current day is a sunday so we need 7 an not 0 $day = $d - $firstday +1; //what is the monday, this is our first day of the first week $start_week = date("W", mktime(12, 0, 0, $month, $day, $year)); //what is first week number $week_day = date("w", mktime(12, 0, 0, $month, $d, $year)); function fill_time_slots() //fill the wording of the time slots from table { global $tpl; global $table_configuration; global $timeslots_header_color; $query = "SELECT config_value FROM $table_configuration WHERE config_key LIKE 'agenda_time%' ORDER BY config_key"; $result = mysql_query($query); $i = 1; while ($time_list = mysql_fetch_array($result)) //fill the time stamps from table { $tpl->assign("time$i", $time_list[0]); $i++; } $tpl->assign("timeslots_header_color", $timeslots_header_color); } function fill_agenda_list() { global $tpl; global $d; global $month; global $year; global $a; global $sas_lang, $userid, $table_users; global $table_agenda_name; global $bgcolor, $months_bgcolor, $week_days_bgcolor, $week_number_bgcolor, $mouse_over_color; if (IsSet ($_POST[a])) { $a = $_POST[a]; } if (IsSet ($_GET[a])) { $a = explode(",", $_GET[a]); } $query = "SELECT id, name, username FROM $table_agenda_name ORDER BY sort"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { print "" . $sas_lang['agenda_empty_agenda_warning'] . ""; exit; } $i = 0; while ($row = mysql_fetch_array($result)) { $agenda[$i] = $row[1]; $agenda_id[$i] = $row[0]; $agenda_user[$i] = $row[2]; $i++; } //print_r($a); //print_r($agenda_id); $agenda_name = ""; $agenda_result = "