[eluser]Zimooon[/eluser]
Hey guys,
I want to set my calender entries offline when the current date/time > the datetime i set for the end of it. At the moment my entries can be manually set activ or not.
Here is my current code:
Model:
Code:
function getactiveCalender($active = FALSE) {
if($active = TRUE)
{
$this->db->where('active',1);
}
$query = $this->db->get('calender');
$calender = array();
foreach ($query->result() as $row) {
$posts[] = array(
'id' => $row->id,
'ctitle' => $row->ctitle,
'ccontent' => $row->ccontent,
'start' => $row->start,
'end' => $row->end,
'active' => $row->active
);
}
return $calender;
}
Something like
$now = time();
if $now > $end {
etc?
Best option would be to set active == 0 by now>end else active == 1 or stuff like that.
Thanks for help
Best regards