if ($x == -6) { $x = 1; } for ($x = $x; $x <= $totalDaysInMonth; $x++) { if ($y == 1) { echo "<tr>"; } ?> <td> <?php if ($x <= 0) { echo " "; } else { $tmpCurrent = $currentYear . "-" . $currentMonth . "-" . $x; $tmpTime = strtotime($tmpCurrent); $ifData = $dashboard->hasEvent($tmpTime); if (isset($ifData[0]->id)) { echo "<a class='dateClass' href='viewEvents.php?time=" . $tmpTime . "'>" . $x . "</a>"; } else { echo "<span class='cal-" . $x . "'>" . $x . "</span>"; } ?> <span class="eventmenu"> <a class="addevent" rel="<?php echo date("M j, Y", strtotime($tmpCurrent)); ?> |<?php echo $tmpCurrent; ?> |<?php echo $tmpTime;