예제 #1
0
function writeUF_TableRow(&$clsUF, &$clsUTable)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $gbDev;
    $lTableID = $clsUTable->lKeyID;
    if ($gbDev) {
        $strLinkDebug = '  ' . strLinkDebug_Fields($clsUTable->lKeyID, 'Internal field details', true);
    } else {
        $strLinkDebug = '';
    }
    $bHidden = $clsUTable->bHidden;
    if ($bHidden) {
        $strHideStyle = 'color: #999; font-style: italic; ';
        $strHideLabel = ' (hidden)';
        $strFieldLink = '';
    } else {
        $strHideStyle = $strHideLabel = '';
        $strFieldLink = strLinkView_UFFields($lTableID, 'View fields', true, ' id="fieldView_' . $lTableID . '" ') . ' ';
    }
    $lTableID = $clsUTable->lKeyID;
    if ($clsUTable->bMultiEntry) {
        $strMLabel = 'Multiple-entry';
        if ($clsUTable->bReadOnly) {
            $strMLabel .= ' <i>(read only)</i>';
        }
    } else {
        $strMLabel = 'Single-entry';
    }
    echoT('<tr>
           <td class="enpRpt" style="' . $strHideStyle . '" nowrap>' . "\n" . str_pad($lTableID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_UFTable($lTableID, 'View table record', true, '') . '&nbsp;&nbsp;' . strLinkClone_PTable($lTableID, 'Clone', true) . '
           </td>
           <td class="enpRpt" style="' . $strHideStyle . '">' . "\n" . strLinkEdit_UFTable($lTableID, $clsUF->enumTType, 'Edit table', true, '') . '
           </td>
           <td class="enpRpt" width="30%" style="' . $strHideStyle . '">
              <b>' . nl2br(htmlspecialchars($clsUTable->strUserTableName)) . $strHideLabel . '</b>
           </td>
           <td class="enpRpt" style="text-align: left; ' . $strHideStyle . '" width="25%">' . "\n" . $strMLabel . '
           </td>
           <td class="enpRpt" style="text-align: right; ' . $strHideStyle . '" width="10%">' . "\n" . $strFieldLink . $clsUTable->lNumFields . $strLinkDebug . '
           </td>
           <td class="enpRpt" width="40%" style="' . $strHideStyle . '">' . "\n" . nl2br(htmlspecialchars($clsUTable->strDescription)) . '
           </td>
        </tr>');
}
function writeClientProgRow(&$cprog)
{
    //---------------------------------------------------------------------
    //
    //---------------------------------------------------------------------
    global $genumDateFormat, $gbDev;
    $lCProgID = $cprog->lKeyID;
    if ($cprog->bHidden) {
        $strStyle = 'color: #999; font-style: italic;';
        $strEnroll = '&nbsp;';
        $strAttend = '&nbsp;';
        $strClone = '&nbsp;';
    } else {
        $strStyle = '';
        $strEnroll = strLinkView_UFFields($cprog->lEnrollmentTableID, 'View enrollment fields', true) . '&nbsp;' . $cprog->lNumEFields;
        $strAttend = strLinkView_UFFields($cprog->lAttendanceTableID, 'View attendance fields', true) . '&nbsp;' . $cprog->lNumAFields;
        if ($gbDev) {
            $strEnroll .= '&nbsp;' . strLinkDebug_Fields($cprog->lEnrollmentTableID, 'Field debug info', true);
            $strAttend .= '&nbsp;' . strLinkDebug_Fields($cprog->lAttendanceTableID, 'Field debug info', true);
        }
        $strClone = strLinkClone_CProgram($lCProgID, 'Clone this client program', true);
    }
    if ($cprog->bMentorMentee) {
        $strProgType = '<br><i>Mentor Program</i>';
        //         &nbsp;'
        //                .strLinkEdit_CPMentorFields($lCProgID, 'Edit field association', true);
    } else {
        $strProgType = '';
    }
    echoT('
            <tr class="makeStripe">
               <td class="enpRpt" style="text-align: center; ' . $strStyle . '" nowrap>' . str_pad($lCProgID, 5, '0', STR_PAD_LEFT) . '&nbsp;' . strLinkView_CProgram($lCProgID, 'View program record', true) . '
               </td>
               <td class="enpRpt" style="text-align: center; vertical-align: top;' . $strStyle . '" nowrap>' . $strClone . '
               </td>
               <td class="enpRpt" style="' . $strStyle . '"><b>' . htmlspecialchars($cprog->strProgramName) . '</b>' . $strProgType . '<br>' . date($genumDateFormat, $cprog->dteStart) . ' - ' . date($genumDateFormat, $cprog->dteEnd) . '
               </td>
               <td class="enpRpt" style="width: 160pt; ' . $strStyle . '">' . nl2br(htmlspecialchars($cprog->strDescription)) . '
               </td>
               <td class="enpRpt" style="' . $strStyle . ' text-align: center;">' . $strEnroll . '
               </td>
               <td class="enpRpt" style="' . $strStyle . ' text-align: center;">' . $strAttend . '
               </td>
            </tr>');
}