Exemplo n.º 1
0
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $output);
         break;
     case 'nextime_activity_id':
         $output = nexlistValue($CONF_NEXTIME['nexlist_nextime_activities'], $XX['nextime_activity_id'], 0);
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $output);
         break;
     case 'project_id':
         $output = nexlistValue($CONF_NEXTIME['nexlist_nextime_projects'], $XX['project_id'], 1);
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $output);
         break;
     case 'task_id':
         $output = nexlistValue($CONF_NEXTIME['nexlist_timesheet_tasks'], $XX['task_id'], 1);
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $output);
         break;
     case 'total_reg_hours':
         $output = $ts->getTotalHRSFromID($XX['id']);
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $output == 0 ? '' : $output);
         break;
     default:
         $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter, $XX[$key] == 0 ? '' : $XX[$key]);
         break;
 }
 $objPHPExcel->getActiveSheet()->getStyle($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
 if ($key == 'total_reg_hours') {
     $objPHPExcel->getActiveSheet()->getStyle($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter)->getFont()->setBold(true);
 }
 if ($colnum >= 7 || $colnum <= 20) {
     $objPHPExcel->getActiveSheet()->getStyle($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_NUMBER_00);
 }
 if ($key == 'standby') {
     $objPHPExcel->getActiveSheet()->getStyle($CONF_NEXTIME['report_columns'][$colnum] . $rowCounter)->getNumberFormat()->setFormatCode('"$"#0_-');
Exemplo n.º 2
0
 //now cycle thrue each of these..
 $taskcount = 1;
 $startingRowCount = $rowCounter;
 while ($X = DB_fetchArray($perUserRes)) {
     $objPHPExcel->getActiveSheet()->setCellValue('A' . $rowCounter, date('l', $X['datestamp']));
     $objPHPExcel->getActiveSheet()->setCellValue('B' . $rowCounter, date('Y/m/d', $X['datestamp']));
     $objPHPExcel->getActiveSheet()->setCellValue('C' . $rowCounter, $taskcount);
     //and now for each column, starting at offset 5
     $colcount = 0;
     $xlscol = 4;
     //column d
     foreach ($LANG_NEXTIME_REPORT_COLUMNS as $dbcol => $name) {
         if ($colcount > 3) {
             //skip out 0-4
             if ($dbcol == 'total_reg_hours') {
                 $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$xlscol] . $rowCounter, $ts->getTotalHRSFromID($X['id']));
             } else {
                 $objPHPExcel->getActiveSheet()->setCellValue($CONF_NEXTIME['report_columns'][$xlscol] . $rowCounter, $X[$dbcol]);
             }
             $xlscol += 1;
         }
         $colcount += 1;
     }
     $taskcount += 1;
     $rowCounter += 1;
 }
 $endRowCounter = $rowCounter - 1;
 //give a totals line....
 //totals line goes from $startingRowCount to $endRowCounter
 $colcount = 0;
 $xlscol = 4;