module_config($this->_object_name); return empty($mc[$key]) ? '' : $mc[$key]; } /** * Function help to find records that are active */ public function list_active($active=TRUE) { $x=($active ? $this->where_active() : $this); return $x->find_all(); } public function list_count($active=TRUE) { $x=($active ? $this->where_active() : $this); return $x->find_all()->count(); } public function where_active() { return $this->where($this->_table_name.'.active','=',TRUE); } public function where_startstop($date,$date_end,$start='date_start',$stop='date_stop') { if (array_key_exists('priority',$this->table_columns())) $this->order_by('priority','ASC'); return $this ->where_open() ->where_open()->where($start,'<=',$date)->and_where($stop,'>=',$date)->where_close() ->or_where_open()->where($start,'<=',$date_end)->and_where($stop,'>=',$date_end)->where_close() ->or_where_open()->where($start,'is',NULL)->where_open()->where($stop,'is',NULL)->or_where($stop,'>=',$date)->where_close()->where_close() ->or_where_open()->where($stop,'is',NULL)->where_open()->where($start,'is',NULL)->or_where($start,'<=',$date_end)->where_close()->where_close() ->where_close() ->order_by($start,'ASC') ->order_by($stop,'ASC'); } } ?>