Jump to content

Help with php/sql coding


romenyrr

Recommended Posts

Greetings All,

 

I'm trying to modify this really SIMPLE calendar and I need some pointers. This little mini calendar displays all the events for that day in links. Now what I want is just for that day to be highlighted (already have a css class for that) so I can click on the day and it displays all the events for that day.  Heres the code thats spits out all of the events for that day on the calendar itself; again,  i'm trying to have none of the events show up on the mini-calendar itself. All i want is for me to be able to click the day and have it spit out all the events for that day. hope that makes sense lol :

 

IF(isset($events[$i])){

echo "<div align=\"left\"><span class=\"highlighteddayboxes\">\n";

while (list($key, $value) = each ($events[$i]))

{

echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n";

}

echo "</span></div>\n";

}

echo "</td>\n";

Link to comment
https://forums.phpfreaks.com/topic/102271-help-with-phpsql-coding/
Share on other sites

The overall Calendar code

 

<?
	for ($i = 1; $i <= $first_day_of_month-1; $i++) {
		$days_so_far = $days_so_far + 1;
		$count_boxes = $count_boxes + 1;
		echo "<td width=\"100\" height=\"25\" class=\"beforedayboxes\"></td>\n";
	}
	for ($i = 1; $i <= $days_in_month; $i++) {
   			$days_so_far = $days_so_far + 1;
    			$count_boxes = $count_boxes + 1;
		IF($_GET['month'] == $todays_month+1){
			IF($i == $todays_date){
				$class = "highlighteddayboxes";
			} ELSE {
				$class = "dayboxes";
			}
		} ELSE {
			IF($i == 1){
				$class = "highlighteddayboxes";
			} ELSE {
				$class = "dayboxes";
			}
		}
		echo "<td width=\"100\" height=\"25\" class=\"$class\">\n";
		$link_month = $_GET['month'] - 1;
		echo "<div align=\"right\"><span class=\"toprightnumber\">\n$i</a> </span></div>\n";
		IF(isset($events[$i])){


			echo "<div align=\"left\"><span class=\"$class\">\n";
			while (list($key, $value) = each ($events[$i])) 
			{
				echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n";
			}
			echo "</span></div>\n";
		}
		echo "</td>\n";
		IF(($count_boxes == 7) AND ($days_so_far != (($first_day_of_month-1) + $days_in_month))){
			$count_boxes = 0;
			echo "</TR><TR valign=\"top\">\n";
		}
	}
	$extra_boxes = 7 - $count_boxes;
	for ($i = 1; $i <= $extra_boxes; $i++) {
		echo "<td width=\"100\" height=\"25\" class=\"afterdayboxes\"></td>\n";
	}
	$time_end = getmicrotime();
	$time = round($time_end - $time_start, 3);
	?>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

hmmm, it still displays the events. http://agobor.com/gblive/cal/ ; any other suggestions? i'm still fairly new to php, but i thought it might have to do something with:

 

IF(!empty($events[$i])){


			echo "<div align=\"left\"><span class=\"$class\">\n";

			while (list($key, $value) = each ($events[$i])) 

			{ 
			echo "<a href=\"javascript:MM_openBrWindow('cal/event.php?id=$value','','width=500,height=200');\">Events</a>\n<br>\n";
			}
			echo "</span></div>\n";

 

The while section

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.