Welcome Guest, Not a member yet? Register   Sign In
Calendar Problems, Days Overlapping
#1

[eluser]herbageonion[/eluser]
Hi,

I'm trying to get a calendar working for a full year and then highlight the days that have entries in the database.

The problem is, the days keep overlapping into subsequent months. My code is below. Anyone have any suggestions?

Cheers,
- E

Code:
$cal_data    = array();
        
for ( $i=1; $i<13; $i++ )
{
   $like_date = ($i < 10) ? $seg_3.'-0'.$i : $seg_3 .'-'. $i;
   // Query DB
   $query    = $this->db->query("SELECT * FROM `tbl_courses` WHERE FromDate LIKE '%$like_date%'");
  
   foreach ($query->result() as $row)
   {
      $cal_day           = mdate_to_human($row->FromDate, 'd');
      $year              = mdate_to_human($row->FromDate, 'Y');
      $month             = mdate_to_human($row->FromDate, 'm');
      $day               = mdate_to_human($row->FromDate, 'd');
      $cal_data[$cal_day]= $this->config->item('site_url') .'coursedesc/index/'. $year .'/'. $month .'/'. $day.'/';
   }
   $data['calendar'][$i] = $this->calendar->generate($seg_3, $i, $cal_data);
}


Messages In This Thread
Calendar Problems, Days Overlapping - by El Forum - 07-11-2007, 10:05 AM
Calendar Problems, Days Overlapping - by El Forum - 07-11-2007, 11:04 AM
Calendar Problems, Days Overlapping - by El Forum - 07-12-2007, 03:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB