/** * 获得当前页的相关权限,值,或数组值 */ function getAttachRule($varname, $id = null) { require_once WEB_ADMIN_CLASS_PATH . '/power/Power.cls.php'; $p = new Power($this->_db, $this->getUid()); if (is_null($id)) { $id = $this->_pageid; } else { if (!is_numeric($id)) { $id = $this->getMenuId($id); } } $sql = "\r\n\t\t\tSELECT configtype,configdefault,c.configvalue AS userdefault FROM " . WEB_ADMIN_TABPOX . "otherrule o \r\n\t\t\t\tLEFT OUTER JOIN\t" . WEB_ADMIN_TABPOX . "config c ON ( (o.otherruleid = c.otherruleid) AND (c.userid = " . $this->getUid() . ") )\r\n\t\t\tWHERE (o.isrule = 1) AND (configvarname = '{$varname}') AND (ruleid = {$id})\r\n\t\t"; $sourceStr = $this->_db->GetRow($sql); $p->parseSqlData(&$sourceStr); // print_r($this->_attachRuleArray[$id]); // print_r($sourceStr); // echo '<br>',$varname,'<br>'; // echo $id,$varname; // print_r($this->_attachRuleArray[$id][$varname]); if (isset($this->_attachRuleArray[$id][$varname])) { if (!is_array($this->_attachRuleArray[$id][$varname])) { return $this->_attachRuleArray[$id][$varname]; } else { if (isset($sourceStr['configtype'])) { switch (strtolower($sourceStr['configtype'])) { case 'text': case 'select': case 'radio': //有多个可选项的单选项 if (strlen($sourceStr['userdefault']) > 0) { return $sourceStr['userdefault']; } else { if (in_array($sourceStr['configdefault'], $this->_attachRuleArray[$id][$varname])) { return $sourceStr['configdefault']; } else { sort($this->_attachRuleArray[$id][$varname]); return $this->_attachRuleArray[$id][$varname][0]; } } break; default: return $this->_attachRuleArray[$id][$varname]; break; } } else { return false; } } } else { if (isset($sourceStr['configdefault'])) { if (strpos($sourceStr['configdefault'], '#')) { return explode('#', $sourceStr['configdefault']); } else { return $sourceStr['configdefault']; } } else { return false; } } }
/** * 数据库操作: 读取所有用户列表 * * @param void * @return array */ function getUserList() { //读取所有记录 return $this->db->getAll("select * from user2"); }