public function bTestNoStatEntries($lSCID, $bShowNotice, $strExtraMessage, &$strErrorMsg)
 {
     //---------------------------------------------------------------------
     // must first call $clsClientStat->loadClientStatCatsEntries(
     //                         true,         $lSCID,
     //                         false, null,
     //                         true,  false);
     //---------------------------------------------------------------------
     global $gbAdmin;
     $strErrorMsg = '';
     $bNoStatEntry = $this->lNumCatEntries <= 0;
     if ($bNoStatEntry && $bShowNotice) {
         $this->loadClientStatCats(false, true, $lSCID);
         $strErrorMsg .= '<i>There are no client status entries defined
             for status category <b>' . htmlspecialchars($this->statCats[0]->strCatName) . '</b>. <br><br>' . $strExtraMessage . '</i><br><br>';
         if ($gbAdmin) {
             $strErrorMsg .= 'You can add client status entries ' . strLinkView_ClientStatEntries($lSCID, 'here', false) . '.<br><br>';
         } else {
             $strErrorMsg .= 'Please contact your ' . CS_PROGNAME . ' administrator to add one or more client status entries.<br><br>';
         }
     }
     return $bNoStatEntry;
 }
function strClientStatusCatTable(&$statCats, &$statCatsEntries, $bShowLinks, $bCenterTable)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    $lCols = $bShowLinks ? 5 : 4;
    $strOut = '<table class="enpRpt' . ($bCenterTable ? 'C' : '') . '">
            <tr>
               <td class="enpRptTitle" colspan="' . $lCols . '">
                  Client Status Categories
               </td>
            </tr>';
    $strOut .= '<tr>
               <td class="enpRptLabel" style="vertical-align: middle;">
                  Category ID
               </td>';
    if ($bShowLinks) {
        $strOut .= '<td class="enpRptLabel" style="vertical-align: middle;">
                  &nbsp;
               </td>';
    }
    $strOut .= '<td class="enpRptLabel" style="vertical-align: middle;">
                  Category
               </td>
               <td class="enpRptLabel" style="width: 200pt;">
                  Description
               </td>
               <td class="enpRptLabel" style="vertical-align: middle;">
                  Entries
               </td>
            </tr>';
    foreach ($statCats as $clsCat) {
        $lKeyID = $clsCat->lKeyID;
        if ($bShowLinks && !$clsCat->bProtected) {
            $strLinkEdit = strLinkEdit_ClientStatCat($lKeyID, 'Edit client status category', true) . ' ';
            $strLinkEntries = strLinkView_ClientStatEntries($lKeyID, 'View/edit/add entries', true) . ' ' . strLinkView_ClientStatEntries($lKeyID, 'View/edit/add entries', false);
            $strLinkRemove = strLinkRem_ClientCatEntry($lKeyID, 'Remove this status category', true, true);
        } else {
            $strLinkEdit = '';
            $strLinkEntries = '';
            $strLinkRemove = strCantDelete('Default category can not be removed');
        }
        $strOut .= '<tr class="makeStripe">
                  <td class="enpRpt" style="text-align: center; vertical-align: top;  width: 70pt;">' . $strLinkEdit . str_pad($lKeyID, 5, '0', STR_PAD_LEFT) . '
                  </td>';
        if ($bShowLinks) {
            $strOut .= '<td class="enpRpt" style="vertical-align: top;">' . $strLinkRemove . '
                  </td>';
        }
        $strOut .= '<td class="enpRpt" style="vertical-align: top;">' . htmlspecialchars($clsCat->strCatName) . '
                  </td>
                  <td class="enpRpt" style="vertical-align: top; width: 200pt;">' . nl2br(htmlspecialchars($clsCat->strDescription)) . '
                  </td>
                  <td class="enpRpt" style="text-align: left; vertical-align: top; width: 200pt;">';
        if (is_null($statCatsEntries[$lKeyID][0]->lKeyID)) {
            $strOut .= '<i>No entries</i><br>';
        } else {
            $strOut .= '<ul style="list-style-type: square; display:inline; margin-left: 0; padding: 0pt;">';
            foreach ($statCatsEntries[$lKeyID] as $clsE) {
                $strOut .= '<li style="margin-left: 20px;">' . htmlspecialchars($clsE->strStatusEntry) . '</li>';
            }
            $strOut .= '</ul>';
        }
        $strOut .= $strLinkEntries . '
                  </td>
               </tr>';
    }
    $strOut .= '</table>';
    return $strOut;
}