<?php   
	if(empty($problem))
	{
  	$query="SELECT * FROM events ORDER BY created DESC LIMIT 6";
	$data=mysqli_query($con,$query);
	echo '<div class="fs1" style="position:relative;float:left;width:724px;min-height:150px;margin:0px 0px 10px 40px;padding-bottom:5px;">
    <div class="left stretchfont grad1" style="font-size:36px;color:#575757;margin-bottom:15px;width:722px;border:1px solid grey;padding:5px 0px;">
    <span class="left" style="margin-left:10px;">Latest Musical Events</span>
    </div>
	<div id="wrapper" >
	<div class="slider-wrapper theme-default">
	<div id="slider" class="nivoSlider left ncaption" style="height:300px;">';
	if(mysqli_num_rows($data)>0)
	{
		while($row=mysqli_fetch_array($data))
		{
			$filemtime = @filemtime($row['photo']);
			$path=$row['photo'].'?'.$filemtime;
			$path=preg_replace('/main/','large',$path);
			echo '<a href="events.php?ide='.$row['event_id'].'"><img src="'.$path.'"  data-thumb="'.$path.'" alt="" title="'.htmlspecialchars($row['title']).'"/></a>';
		}
	}
	echo '</div></div></div></div><script type="text/javascript">$(window).load(function() {$("#slider").nivoSlider({effect: "fold", pauseOnHover: true, pauseTime: 6000});});</script>';
	mysqli_free_result($data);
	}
?>  