static public function getBooleanParam($param, $defaultValue = false)
{
$value = self::getParam($param, $defaultValue);
return $value === $defaultValue ? $value : (boolean)$value;
}
public function getDetailSite($where_array = array())
{
$where = '';
if($where_array)
{
foreach($where_array as $k => $v)
{
if($k == 'site_id')
{
$where .= empty($where)?'':' AND ';
$where .= 'web.SiteId ='.$v;
}
}
}
$where = empty($where)?'':' WHERE '.$where;
$query = 'SELECT *
FROM dbt_site as web '.$where.' LIMIT 1';
$result = DbPool::getConnection()->query($query);
return $result->fetch(PDO::FETCH_ASSOC);
}
public function getListTemplateOption($where_array = array(),$selected = null)
{
$template_arr = array('1' => 'airport hotel');
$tmp_option = '';
foreach($template_arr as $k => $v)
{
$tmp_option .= '<option value="'.$k.'">'.$v.'</option>';
}
$tmp_option = str_replace('<option value="'.$selected.'"', '<option value="'.$selected.'" selected',$tmp_option);
return $tmp_option;
}
public function getReconfigureSearch()
{
$checkInDate = $this->checkInDate = $_REQUEST['checkIn'];
$checkOutDate = $this->checkOutDate = $_REQUEST['checkOut'];
$adults = $_REQUEST['adults'];
$children = $_REQUEST['children'];
$this->_template->assign( 'checkIn', $checkInDate);
$this->_template->assign( 'checkOut', $checkOutDate);
$this->_template->assign( 'adults', $adults);
$this->_template->assign( 'children', $children);
return $this->_template->fetch('element/reconfigure_search.html');
}
public function assignToArray(&$parameters, $key, $value, $condition = true)
{
if ($condition) $parameters[$key] = $value;
}