Register Child and Waitlist working
This commit is contained in:
@@ -14,6 +14,30 @@ class Model_Room_Children extends ORM {
|
||||
'child'=>array(),
|
||||
);
|
||||
|
||||
public function filters() {
|
||||
return Arr::merge(parent::filters(),array(
|
||||
'date_start'=>array(array('strtotime', array(':value'))),
|
||||
'date_stop'=>array(array('strtotime', array(':value'))),
|
||||
));
|
||||
}
|
||||
|
||||
public function rules() {
|
||||
$x = parent::rules();
|
||||
|
||||
unset($x['id']);
|
||||
|
||||
return $x;
|
||||
}
|
||||
|
||||
protected $_display_filters = array(
|
||||
'date_start'=>array(
|
||||
array('Site::Date',array(':value')),
|
||||
),
|
||||
'date_stop'=>array(
|
||||
array('Site::Date',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
// @todo: Code A (availble) start/end dates cannot overlap with existing records - put in validation that it cannot be saved.
|
||||
public function day($day) {
|
||||
return $this->{'d_'.$day};
|
||||
|
@@ -13,7 +13,7 @@ class Model_Room_Dates extends ORM {
|
||||
// @todo: Code A (availble) start/end dates cannot overlap with existing records - put in validation that it cannot be saved.
|
||||
|
||||
public function avail($day) {
|
||||
return $this->{'d_'.$day};
|
||||
return $this->{'d_'.$day} ? $this->{'d_'.$day} : 0;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user