<div class="block">
		<div class="block-title">
			<h4><strong>Upcoming</strong> Events</h4>
		</div>
	<p>
	  <?php
  if(!$events)
    {
      echo '<img src="'.SITE_URL.'/lib/images/event_cs.png" alt="Coming Soon!" style="max-width: 100%; max-height: 100%; outline:10px; text-decoration:none;">';
    }
  else
    {
      foreach($events as $event)
        {
          $nextevent = $event;
          if(getimagesize($nextevent->image)) {
          echo '
          <a href="'.SITE_URL.'/index.php/events/view/'.$nextevent->id.'">
            <img src="'.$nextevent->image.'" alt="'.$nextevent->title.'" style="max-width:100%; max-height: 100%; outline:10px; text-decoration:none;" />
          </a>';
          } else {
          	?>
          	<h2><a target="_blank" href="<?php echo SITE_URL; ?>/index.php/events/get_event?id=<?php echo $nextevent->id; ?>" class='label label-primary'><?php echo $nextevent->title; ?></a> on <?php echo date(DATE_FORMAT, strtotime($nextevent->date)) ; ?>
          		<br>
          	<span class="text-muted">
          		<small>Click to know more</small>
          	</span>
          	</h2>

          	<?php
          }
        }
      /*foreach($events as $event)
        {  ?>
      <div class="table">
        <tr>
          <td>
              <div class="well well-sm">
                <strong><?php echo gmdate('d', strtotime($event->starttime)); ?></strong> &nbsp;
                  <?php echo gmdate('M', strtotime($event->starttime)); ?>
              </div>
          </td>
          <td valign="top">
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <a href="<?php echo SITE_URL; ?>/index.php/ccevents/event/<?php echo $event->id; ?>">
                <?php echo $event->evname; ?>
              </a>
          </td>
        </tr>
    <?php } echo "</table>"; */
    } ?>
	</p>
</div>
