Room booking query

$out=$this->Booking->find(‘list’,array(‘conditions’=>array(‘Booking.datein =’.$da),’fields’=>’Booking.room_no’));
if(empty($out)){
$this->set(‘rooms’,$this->Room->find(‘all’));
}
else
{
$out=$this->Room->find(‘all’,array(‘conditions’=>array(‘NOT’=>array(‘Room.room_no’=>$out))));
$this->set(‘rooms’,$out);

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s