<?php

global $genumDateFormat;
$params = array('enumStyle' => 'terse', 'clsRpt');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = '160pt';
$attributes = array('name' => 'frmTSProjects', 'id' => 'frmAddEdit');
echoT(form_open('staff/timesheets/ts_projects/assignHrsToProject/' . $lTSLogID, $attributes));
$bSubmitted = !is_null($logRec->dteSubmitted);
echoT(ts_util\strTSTLogOverviewBlock($clsRpt, $tst, $logRec, false, false));
$b24Hr = $logRec->b24HrTime;
$clsForm = new generic_form();
$clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel';
$clsForm->strTitleClass = 'enpViewTitle';
$clsForm->strEntryClass = 'enpView';
$clsForm->bValueEscapeHTML = false;
$clsForm->strStyleExtraLabel = 'padding-top: 8px;';
$clsForm->strStyleExtraValue = 'vertical-align: middle;';
openBlock('Assign Times to Projects', '');
echoT('<table class="enpView" >');
$idx = 0;
$clsForm->strID = 'addEditEntry';
foreach ($projects as $project) {
    writeProjectRow($idx, $project);
    ++$idx;
}
echoT('</table>');
closeBlock();
echoT($clsForm->strSubmitEntry('Save', 2, 'cmdSubmit', 'text-align: center; width: 90pt;'));
echoT(form_close('<br>'));
echoT('<script type="text/javascript">frmAddEdit.addEditEntry.focus();</script>');
<?php

global $genumDateFormat;
$params = array('enumStyle' => 'terse', 'clsRpt');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = '160pt';
$bSubmitted = !is_null($logRec->dteSubmitted);
echoT(ts_util\strTSTLogOverviewBlock($clsRpt, $tst, $logRec, true, true));
$b24Hr = $logRec->b24HrTime;
$attributes = new stdClass();
$attributes->lTableWidth = 1000;
openBlock('Entries', '', $attributes);
echoT('
      <table border="0" style="">');
$lTotMinutes = 0.0;
foreach ($tsCalendar as $tsDay) {
    echoT('
         <tr>
            <td style="border-bottom: 2px solid black;"><b>' . date($genumDateFormat . ' (D)', $tsDay->calDate) . '</b>
            </td>');
    echoT('
            <td style="padding-top: 7pt; padding-bottom: 2pt;
                       text-align: center; border-bottom: 2px solid black;">' . strLinkAdd_TimeSheetDailyEntry($lUserID, $lTSLogID, $tsDay->calDate, 'Add time sheet entry for this date', true) . '
            </td>');
    if (isset($tsDay->dailyEntries)) {
        if (!$bSubmitted) {
            echoT('               
               <td style="width: 20pt;"><b>
                  &nbsp;
               </td>
               <td style="width: 20pt;"><b>