function writeUserBlock($uperm)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    if ($uperm->lNumAccts == 0) {
        echoT('<i>There are no users in this category.</i>');
    } else {
        echoT('<table style="width: 270pt;">');
        foreach ($uperm->accounts as $acct) {
            $lUserID = $acct->lUserID;
            if ($acct->bInactive) {
                $strColor = 'color: #aaa;';
            } else {
                $strColor = '';
            }
            echoT('
               <tr class="makeStripe">
                  <td style="width: 80pt; text-align: left; ' . $strColor . '">' . strLinkView_User($lUserID, 'View user account', true) . '&nbsp;&nbsp;' . strLinkEdit_User($lUserID, 'Edit user account', true) . '&nbsp;' . str_pad($lUserID, 5, '0', STR_PAD_LEFT) . '
                  </td>
                  <td style="' . $strColor . '">' . htmlspecialchars($acct->strLastName . ', ' . $acct->strFirstName) . ' <i>(' . htmlspecialchars($acct->strUserName) . ')</i>
                  </td>
               </tr>');
        }
        echoT('</table>');
    }
}
<h2>Welcome to Delightful Labor!</h2>
<?php 
global $glUserID;
//echo('test test test test '.$lNumTotLogins.'<br>'); $lNumTotLogins=1;
if ($lNumTotLogins == 1) {
    $strAttribute = 'target="_blank"';
    echoT('It looks like this is your first log-in to <b><i>Delightful Labor</b></i>. These links (all open in a new page)
      will <br>help you get started:<br>');
    echoT('<ul>
        <li>The Delightful Labor <b>user\'s guide</b> can be found ' . anchor('http://www.delightfullabor.com/userGuide/', 'here.', $strAttribute) . '</li>
        <li>You can update your <b>user account</b>  ' . strLinkEdit_User($glUserID, 'here.', false, $strAttribute) . '
        <li>You can update your <b>organization\'s information</b>  ' . anchor('admin/org/orgView', 'here.', $strAttribute) . '</li>
                   
        <li>You can configure many of the <b>lists</b> used by Delightful Labor ' . anchor('admin/alists/showLists', 'here.', $strAttribute) . '</li>                   
      </ul>');
}
function showUserRecBlock($clsRpt, $lUserID, $clsUsers, $lLabelWidth, $bAsAdmin)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gdteNow, $glUserID, $gbVolLogin;
    if ($lUserID == $glUserID || $clsUsers->us_bInactive) {
        $strLinkDeactivate = '';
    } else {
        $strLinkDeactivate = '&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkSpecial_UserDeactivate($lUserID, 'Deactivate user', true);
    }
    if (!$gbVolLogin) {
        if ($clsUsers->us_bInactive) {
            $strLinkActivate = '&nbsp;&nbsp;&nbsp;&nbsp;' . strLinkSpecial_UserActivate($lUserID, 'Activate user', true);
        } else {
            $strLinkActivate = '';
        }
    }
    if ($bAsAdmin) {
        openBlock('User Account', strLinkEdit_User($lUserID, 'Edit user record', true) . $strLinkDeactivate . $strLinkActivate);
    } else {
        openBlock('Your Account', strLinkEdit_YourAcct($lUserID, 'Edit your account record', true));
    }
    echoT($clsRpt->openReport());
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('ID:', $lLabelWidth) . $clsRpt->writeCell(str_pad($lUserID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('User Name:', $lLabelWidth) . $clsRpt->writeCell(htmlspecialchars($clsUsers->us_strUserName)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Name:', $lLabelWidth) . $clsRpt->writeCell($clsUsers->strSafeName) . $clsRpt->closeRow());
    if (!$gbVolLogin) {
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Status:', $lLabelWidth) . $clsRpt->writeCell($clsUsers->us_bInactive ? '<b>INACTIVE</b>' : 'Active') . $clsRpt->closeRow());
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Address:', $lLabelWidth) . $clsRpt->writeCell($clsUsers->strAddress) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Phone:', $lLabelWidth) . $clsRpt->writeCell(htmlspecialchars($clsUsers->us_strPhone)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Cell:', $lLabelWidth) . $clsRpt->writeCell(htmlspecialchars($clsUsers->us_strCell)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Email:', $lLabelWidth) . $clsRpt->writeCell(htmlspecialchars($clsUsers->us_strEmail)) . $clsRpt->closeRow());
    $strAcctPerms = '';
    if ($clsUsers->bStandardUser && $bAsAdmin) {
        if ($clsUsers->us_bUserDataEntryPeople) {
            $strAcctPerms .= '<br>* Data Entry (people/businesses/volunteers)';
        }
        if ($clsUsers->us_bUserDataEntryGifts) {
            $strAcctPerms .= '<br>* Data Entry (donations)';
        }
        if ($clsUsers->us_bUserEditPeople) {
            $strAcctPerms .= '<br>* Edit (people/businesses/volunteers)';
        }
        if ($clsUsers->us_bUserEditGifts) {
            $strAcctPerms .= '<br>* Edit (donations)';
        }
        if ($clsUsers->us_bUserViewPeople) {
            $strAcctPerms .= '<br>* View (people/businesses/volunteers)';
        }
        if ($clsUsers->us_bUserViewGiftHistory) {
            $strAcctPerms .= '<br>* View (gift histories)';
        }
        if ($clsUsers->us_bUserViewReports) {
            $strAcctPerms .= '<br>* View (reports)';
        }
        if ($clsUsers->us_bUserAllowExports) {
            $strAcctPerms .= '<br>* Allow exports';
        }
        if ($clsUsers->us_bUserAllowSponsorship) {
            $strAcctPerms .= '<br>* Access to sponsorships';
        }
        if ($clsUsers->us_bUserAllowSponFinancial) {
            $strAcctPerms .= '<br>* Access to sponsorships financials';
        }
        if ($clsUsers->us_bUserAllowClient) {
            $strAcctPerms .= '<br>* Access to client records';
        }
        if ($clsUsers->us_bUserAllowAuctions) {
            $strAcctPerms .= '<br>* Allow access to silent auctions';
        }
        if ($clsUsers->us_bUserAllowInventory) {
            $strAcctPerms .= '<br>* Allow access to inventory management';
        }
        if ($clsUsers->us_bUserAllowGrants) {
            $strAcctPerms .= '<br>* Allow access to grants';
        }
    }
    if (!$gbVolLogin) {
        $strAcctType = '';
        if ($clsUsers->us_bAdmin) {
            $strAcctType = 'Admin';
        } elseif ($clsUsers->us_bVolAccount) {
            $strAcctType = 'Volunteer';
        } else {
            $strAcctType = 'User';
        }
        if ($clsUsers->us_bDebugger) {
            $strAcctType .= ' / Debugger';
        }
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('Account Type:', $lLabelWidth) . $clsRpt->writeCell($strAcctType . $strAcctPerms) . $clsRpt->closeRow());
        if ($clsUsers->us_bVolAccount) {
            $strAccess = '';
            if ($clsUsers->us_bVolEditContact) {
                $strAccess .= '* Edit contact information<br>';
            }
            if ($clsUsers->us_bVolPassReset) {
                $strAccess .= '* Reset password<br>';
            }
            if ($clsUsers->us_bVolViewGiftHistory) {
                $strAccess .= '* View donation history<br>';
            }
            if ($clsUsers->us_bVolEditJobSkills) {
                $strAccess .= '* Update job skills<br>';
            }
            if ($clsUsers->us_bVolViewHrsHistory) {
                $strAccess .= '* View history of volunteer hours<br>';
            }
            if ($clsUsers->us_bVolAddVolHours) {
                $strAccess .= '* Add/edit volunteer hours<br>';
            }
            if ($clsUsers->us_bVolShiftSignup) {
                $strAccess .= '* Sign up for volunteer shifts<br>';
            }
            echoT($clsRpt->openRow() . $clsRpt->writeLabel('Volunteer Access:', $lLabelWidth) . $clsRpt->writeCell($strAccess) . $clsRpt->closeRow());
        }
    }
    if (!is_null($clsUsers->lPeopleID) && !$gbVolLogin) {
        $lPID = $clsUsers->lPeopleID;
        echoT($clsRpt->openRow() . $clsRpt->writeLabel('People ID:', $lLabelWidth) . $clsRpt->writeCell(str_pad($lPID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
    }
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Date format:', $lLabelWidth) . $clsRpt->writeCell(date($clsUsers->us_enumDateFormat, $gdteNow)) . $clsRpt->closeRow() . $clsRpt->openRow() . $clsRpt->writeLabel('Measurement:', $lLabelWidth) . $clsRpt->writeCell($clsUsers->us_enumMeasurePref) . $clsRpt->closeRow() . $clsRpt->closeReport());
    closeBlock();
}