$search = $group_query ? " AND " : " WHERE ";
    $search = $search . "( (" . $field['user'][0] . ") OR " . "((" . $field['firstname'][0] . ") OR (" . $field['lastname'][0] . ")))";
}
$query1 = "SELECT id,username,firstname,lastname FROM " . SUMO_TABLE_USERS . " " . $group_query . " " . $search . "";
$query2 = $query1 . " ORDER BY " . $_SESSION['relationship']['user2accesspoints']['col_sql'] . " " . $_SESSION['relationship']['user2accesspoints']['mode_sql'];
$rs = $SUMO['DB']->Execute($query1);
$tot = $rs->PO_RecordCount();
$rs = $SUMO['DB']->SelectLimit($query2, $_SESSION['rows_relationship_user2accesspoints'], $_SESSION['start_relationship_user2accesspoints']);
$vis = $rs->PO_RecordCount();
/**
 * Create list
 */
$list = sumo_get_table_header($table['data']['user2accesspoints']);
while ($tab = $rs->FetchRow()) {
    $style = sumo_alternate_str('tab-row-on', 'tab-row-off', $tab['username']);
    $ap = sumo_get_user_accesspoints($tab['id'], true);
    if ($search) {
        $tab['username'] = sumo_color_match_string($field['username'][1], $tab['username']);
        $tab['firstname'] = sumo_color_match_string($field['firstname'][1], $tab['firstname']);
        $tab['lastname'] = sumo_color_match_string($field['lastname'][1], $tab['lastname']);
    }
    //$width = $a > 5 ? " width='400'" : '';
    $list .= "<tr>\n" . " <td class='" . $style . "' style='padding:10px'>" . "<a href='javascript:sumo_ajax_get(\"users\",\"?module=users&action=view&id=" . $tab['id'] . "\");'>" . "<b>" . $tab['username'] . "</b><br>" . $tab['lastname'] . " " . $tab['firstname'] . "</a>" . "</td>\n";
    if ($_SESSION['relationship']['user2accesspoints']['col'][100]) {
        $list .= " <td>" . $ap . "</td>\n";
    }
    /*
    if($_SESSION['relationship']['user2accesspoints']['col'][101])
    {
    	$list .= " <td style='border-bottom:1px solid #DCDCDC'><img onclick='javascript:window.open(\"services.php?module=relationship&service=relationship&cmd=GET_USER2ACCESSPOINTS&id=".$tab['id']."\",\"user2accesspoints\",\"height=200,width=500,resizable=yes,scrollbars=yes\");' "
    			." src='services.php?module=relationship&service=relationship&cmd=GET_USER2ACCESSPOINTS&id=".$tab['id']."' alt=''$width></td>\n"
示例#2
0
 // If id not exist
 if (!$tab['username']) {
     $tpl['MESSAGE:H'] = sumo_get_message('W00001C', $_GET['id']);
 }
 // get data source of user
 $datasource = sumo_get_datasource_info($tab['datasource_id']);
 $tpl['PUT:Status'] = "";
 $tpl['PUT:GroupLevel'] = sumo_put_user_grouplevel($_GET['id']);
 $tpl['PUT:AddGroupLevel'] = $tab['username'] == 'sumo' ? "<input type='hidden' name='newgroup' value='sumo:7'>" : sumo_add_user_grouplevel('ModifyUsers', sumo_get_grouplevel($tab['usergroup'], true));
 $tpl['BUTTON:AddGroup'] = $tab['username'] == 'sumo' ? "" : "<input type='submit' class='button' value='" . $language['AddGroup'] . "'>";
 $tpl['PUT:DataSourceType'] = ($tab['username'] == 'sumo' || $tab['username'] == $SUMO['user']['user']) && $SUMO['user']['id'] != $tab['owner_id'] ? "<input name='datasource_id' type='hidden' value='" . $datasource['id'] . "'>" . $datasource['name'] : sumo_put_datasource($datasource['id']);
 $tpl['GET:LastLogin'] = sumo_get_human_date($tab['last_login']);
 $tpl['GET:PwdUpdated'] = sumo_get_human_date($tab['pwd_updated']);
 $tpl['GET:AccountCreated'] = sumo_get_human_date($tab['created']);
 $tpl['GET:Modified'] = sumo_get_human_date($tab['modified']);
 $tpl['GET:UserAccessPages'] = sumo_get_user_accesspoints($tab['id'], true);
 $tpl['GET:UpdateForm'] = sumo_get_form_req('', 'modify', 'id=' . $tab['id'], 'POST', ' enctype="multipart/form-data"');
 $tpl['GET:Expire'] = $tab['day_limit'] ? sumo_get_human_date($tab['day_limit'] * 86400 + $SUMO['server']['time'], false) : $language['Never'];
 $tpl['GET:User'] = $tab['username'] . "<input type='hidden' name='user' value='" . $tab['username'] . "'>";
 $tpl['IMG:User'] = "******" . $tab['id'] . "' alt='" . $tab['username'] . "' class='user'>";
 $tpl['IMG:Language'] = "<img src='themes/" . $SUMO['page']['theme'] . "/images/flags/" . $tab['language'] . ".png' alt='" . ucwords(sumo_get_string_languages($tab['language'])) . "' class='flag' id='userflag'>";
 $tpl['LINK:AddUser'] = sumo_get_action_icon("users", "new", "users.content", "?module=users&action=new&decoration=false");
 $tpl['LINK:EditUser'] = sumo_get_action_icon("users", "edit");
 // Verify image support for refection effects
 if (function_exists('imagecreatefromjpeg') && function_exists('imagecreatefrompng') && function_exists('imagecreatefromgif')) {
     $tpl['IMG:User'] . "<br><img src='services.php?module=users&service=image&cmd=GET_USER_REFLECTION&id=" . $tab['id'] . "&fade=6&height=30%'>";
 }
 // Create sub module (to hide or show only if necessary)
 // Set sub module visibility
 // NOTE: Use REQUEST method because when delete a group
 // the command came from a link