[eluser]jigen7[/eluser]
Hi everyone I cant seem to make this work, i got a function in the model where it returns the date of the query then store the sql result to an array $date_arr then pass that variable to the calendar just lyk in the User Guide but when i tried it,
the calendar only display the last query result of the date??can anyone help me here??thx
Model Code
Code:
function get_calendar_date($id,$month,$year){
$sql = "Select Date FROM schedule WHERE resort_id = $id AND Month = $month AND Year = $year";
$query = $this->db->query($sql);
return $query;
}
Controller Code
Code:
$query = $this->Reservations->get_calendar_date($id,$month,$year);
$date_arr = array();
foreach($query->result() as $row):
$date_arr[$row->Date] = $row->Date;
endforeach;
print_r($date_arr);
$data['cal'] = $this->calendar->generate($year,$month,$date_arr);
$this->load->view('calendar',$data);