Site Status and Room numbers implemented

This commit is contained in:
Deon George
2014-09-05 15:13:25 +10:00
parent 2115c70db0
commit 30f6717c9f
10 changed files with 166 additions and 18 deletions

View File

@@ -175,5 +175,20 @@ abstract class ORM extends lnApp_ORM {
return $this->where($aid,'IN',$ao->RTM->customers($ao->RTM));
}
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');
}
}
?>