Beispiel #1
0
        $GLOBALS['AjaxDo'] =& $this->dbObj;
        $GLOBALS['AjaxUid'] = $this->getUid();
        function getList($field)
        {
            $r = new xajaxResponse();
            $returnStr = '';
            if ($field == 'global') {
                $userSql = 'select userid,username from ' . WEB_ADMIN_TABPOX . 'user';
            } else {
                $userSql = 'SELECT DISTINCT u2.userid,u2.username FROM ' . WEB_ADMIN_TABPOX . 'user u 
					INNER JOIN ' . WEB_ADMIN_TABPOX . 'usergroup ug ON (u.userid = ug.userid) AND (u.userid = ' . $GLOBALS['AjaxUid'] . ')
					INNER JOIN ' . WEB_ADMIN_TABPOX . 'usergroup ug2 ON (ug2.groupid = ug.groupid)
					INNER JOIN ' . WEB_ADMIN_TABPOX . 'user u2 ON (u2.userid = ug2.userid)
				';
            }
            $rs = $GLOBALS['AjaxDo']->Execute($userSql);
            while (!$rs->EOF) {
                $returnStr .= '<input name="sendtoids[]" type="checkbox" value="' . $rs->fields['userid'] . '" checked>' . $rs->fields['username'] . '&nbsp;';
                $rs->MoveNext();
            }
            $r->addAssign('touser', 'innerHTML', $returnStr);
            $r->addAssign('touser', 'innerHTML', $returnStr);
            return $r;
        }
        $this->xo->registerFunction("getList");
        $this->xo->processRequests();
    }
}
$main = new PageMessage();
$main->Main();