public function run() { $smarty = $this->getSmarty(); $layout_array = array(); $i = 0; LayoutUtil::getAllLayout($this->db, $layout_array, $i); $layout_option = ''; foreach ($layout_array as $layout) { $layout_option .= "<option value=\"" . $layout['id'] . "\">"; $layout_option .= $layout['name'] . "</option>\n"; } $smarty->assign('layout_information', $layout_option); $smarty->display('bbssearch.tmpl'); return; }
/** * run this action * @param: NULL * @return: NULL * @access: public */ public function run() { $id = $this->getParameterFromGET('id'); if (!$id) { $this->AlertAndBack(USER_IS_EMPTY); return; } $sql = 'select count(*) as num from base_user_info where id=?'; $sth = $this->db->Prepare($sql); $res = $this->db->Execute($sth, array($id)); $rows = $res->FetchRow(); if (!$rows['num']) { $this->AlertAndBack(USER_IS_NOT_EXISTS); return; } $sql = 'select group_dep from base_user_info where id=?'; $sth = $this->db->Prepare($sql); $res = $this->db->Execute($sth, array($id)); $rows = $res->FetchRow(); $smarty = $this->getSmarty(); $smarty->assign('id', $id); $smarty->assign('group_id', $rows['group_dep']); $sql = 'select * from sys_group order by id asc '; $res = $this->db->Execute($sql); $temp = array(); while ($rows = $res->FetchRow()) { $temp[] = array('id' => $rows['id'], 'name' => $rows['group_name'], 'description' => $rows['description']); } $layout_array = array(); $i = 0; LayoutUtil::getAllLayout($this->db, $layout_array, $i); $layout_option = ''; foreach ($layout_array as $layout) { $layout_option .= "<option value=\"" . $layout['id'] . "\">"; $layout_option .= $layout['name'] . "</option>\n"; } $smarty->assign('layout_string', $layout_option); $smarty->assign('sysarray', $temp); $smarty->assign('page', $this->getParameterFromGET('page')); $smarty->assign('t', $this->getParameterFromGET('t')); $smarty->assign('m', $this->getParameterFromGET('m')); $smarty->display('adminsetgroup.tmpl'); return; }