protected function _initialize()
{
parent::_initialize();
$this->rest_id = $_SESSION['manage_dine_branch'];
if (!empty($this->rest_id)) {
$sql = "select rl.name, rl.id from tp_dine_restlist as rl where rl.status = 1 AND rl.token='{$this->token}' and rl.id={$this->rest_id};";
$Model = new Model();
$rest = $Model->query($sql);
if ($rest != false) {
$this->rest_id = $rest[0]['id'];
$this->assign('branch_name', $rest[0]['name']);
$this->branch_name = $rest[0]['name'];
} else {
exit;
}
} else {
$sql = "select rl.name, rl.id from tp_dine_restlist as rl where rl.status = 1 AND rl.token='{$this->token}' LIMIT 1;";
$Model = new Model();
$rest = $Model->query($sql);
if ($rest != false) {
$this->rest_id = $rest[0]['id'];
$this->assign('branch_name', $rest[0]['name']);
} else {
exit;
}
}
$user_agent = $_SERVER['HTTP_USER_AGENT'];
if (ereg('Mozilla', $user_agent) && ereg('MSIE', $user_agent)) {
$this->assign('is_ie', 1);
} else {
$this->assign('is_ie', 0);
}
}