$ovlValue) { if ($ovlKey != "-1") { foreach($ovlValue as $ovl2Value) { $nbrGridCols[($thisday)] = kgv($nbrGridCols[($thisday)], ($ovl2Value["event_overlap"] + 1)); } } } } $thisdate = ($thisdate + (25 * 60 * 60)); } ?> <?php echo "$calendar_name - $display_date"; ?> "> "; } ?>
\"\n"; } $thisdate = ($thisdate + (25 * 60 * 60)); $i++; } while ($i < 7); ?> "; $thisdate = $start_week_time; $i = 0; echo ""; echo ""; do { $thisday = date("Ymd", $thisdate); $thisday3 = localizeDate($dateFormat_week_list, $thisdate); echo "\n"; $thisdate = ($thisdate + (25 * 60 * 60)); $i++; } while ($i < 7); echo ""; ?> \"\n"; } $thisdate = ($thisdate + (25 * 60 * 60)); $i++; } while ($i < 7); ?> \n"; echo ""; do { $thisday = date("Ymd", $thisdate); echo "\n"; $thisdate = ($thisdate + (25 * 60 * 60)); $i++; } while ($i < 7); echo "\n"; } // $master_array[($getdate)]["$day_time"] $thisdate = $start_week_time; for ($i=0;$i<7;$i++) { $thisday = date("Ymd", $thisdate); $event_length[$thisday] = array (); $thisdate = ($thisdate + (25 * 60 * 60)); } foreach ($day_array as $key) { $cal_time = $key; ereg('([0-9]{2})([0-9]{2})', $key, $regs_tmp); $key = mktime($regs_tmp[1],$regs_tmp[2],0,$this_month,$this_day,$this_year); $key = date ($timeFormat, $key); if (ereg("([0-9]{1,2}):00", $key)) { echo "\n"; echo "\n"; echo "\n"; } elseif("$cal_time" == "$day_start") { $size_tmp = 60 - (int)substr($cal_time,2,2); echo "\n"; echo "\n"; echo "\n"; } else { echo "\n"; echo "\n"; } // initialize $thisdate again $thisdate = $start_week_time; // loop this part 7 times, one for each day for ($week_loop=0; $week_loop<7; $week_loop++) { $thisday = date("Ymd", $thisdate); $dayborder = 0; unset($this_time_arr); if (isset($master_array[$thisday][$cal_time]) && sizeof($master_array[$thisday][$cal_time]) > 0) { $this_time_arr = $master_array[$thisday][$cal_time]; } if ("$day_start" == "$cal_time" && isset($master_array[$thisday]) && is_array($master_array[$thisday])) { foreach($master_array[$thisday] as $time_key => $time_arr) { if ((int)$time_key < (int)$cal_time && is_array($time_arr) && $time_key != '-1') { foreach($time_arr as $event_tmp) { if ((int)$event_tmp['event_end'] > (int)$cal_time) { $this_time_arr[] = $event_tmp; } } } else { break; } } } // check for eventstart if (isset($this_time_arr) && sizeof($this_time_arr) > 0) { foreach ($this_time_arr as $eventKey => $loopevent) { $drawEvent = drawEventTimes ($cal_time, $loopevent["event_end"]); $j = 0; while (isset($event_length[$thisday][$j])) { if ($event_length[$thisday][$j]["state"] == "ended") { $event_length[$thisday][$j] = array ("length" => ($drawEvent["draw_length"] / $gridLength), "key" => $eventKey, "overlap" => $loopevent["event_overlap"],"state" => "begin"); break; } $j++; } if ($j == sizeof($event_length[$thisday])) { array_push ($event_length[$thisday], array ("length" => ($drawEvent["draw_length"] / $gridLength), "key" => $eventKey, "overlap" => $loopevent["event_overlap"],"state" => "begin")); } } } if (sizeof($event_length[$thisday]) == 0) { if ($dayborder == 0) { $class = " class=\"weekborder\""; $dayborder++; } else { $class = ""; $dayborder = 0; } echo "\n"; } else { $emptyWidth = $nbrGridCols[$thisday]; for ($i=0;$i"; $drawWidth = $nbrGridCols[$thisday] / ($event_length[$thisday][$i]["overlap"] + 1); $emptyWidth = $emptyWidth - $drawWidth; switch ($event_length[$thisday][$i]["state"]) { case "begin": $event_length[$thisday][$i]["state"] = "started"; $event_start = $this_time_arr[($event_length[$thisday][$i]["key"])]["start_unixtime"]; $event_start = date ($timeFormat, $event_start); echo "\n"; break; case "started": break; case "ended": echo "\n"; break; } $event_length[$thisday][$i]["length"]--; if ($event_length[$thisday][$i]["length"] == 0) { $event_length[$thisday][$i]["state"] = "ended"; } } //fill emtpy space on the right if ($emptyWidth > 0) { echo "\n"; } while (isset($event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"]) && $event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"] == "ended") { array_pop($event_length[$thisday]); } } $thisdate = ($thisdate + (25 * 60 * 60)); } echo "\n"; } ?>
\"\n"; echo "$thisday3\n"; echo "
\n"; if (isset($master_array[($thisday)]["-1"])) { echo "\n"; foreach($master_array[($thisday)]["-1"] as $allday) { echo "\n"; echo "\n"; } echo "
"; openevent("$calendar_name", "", "", $allday, $allday_week_lines, 12, '', ""); echo "
\n"; } echo "
$key
$key
 \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
$event_start
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
"; $event_end = $this_time_arr[($event_length[$thisday][$i]["key"])]["end_unixtime"]; $event_end = date ($timeFormat, $event_end); openevent("$calendar_name2", "$event_start", "$event_end", $this_time_arr[($event_length[$thisday][$i]["key"])], $week_events_lines, 25, "", ""); echo "
\n"; echo "
\n"; echo "