Пример #1
0
        $temp_dir = W2P_BASE_DIR . '/files/temp';
        $output = new w2p_Output_PDFRenderer();
        $output->addTitle($AppUI->_('Overall Report'));
        $output->addDate($df);
        if ($log_all) {
            $date = new w2p_Utilities_Date();
            $title = "All hours as of " . $date->format($df);
        } else {
            $sdate = new w2p_Utilities_Date($log_start_date);
            $edate = new w2p_Utilities_Date($log_end_date);
            $title = "Hours from " . $sdate->format($df) . ' to ' . $edate->format($df);
        }
        foreach ($allpdfdata as $company => $data) {
            $title = $company;
            $options = array('showLines' => 1, 'showHeadings' => 0, 'fontSize' => 8, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '500', 'cols' => array(0 => array('justification' => 'left', 'width' => 250), 1 => array('justification' => 'right', 'width' => 120)));
            $output->addTable($title, null, $data, $options);
        }
        $w2pReport = new CReport();
        if ($output->writeFile($w2pReport->getFilename())) {
            echo '<a href="' . W2P_BASE_URL . '/files/temp/' . $w2pReport->getFilename() . '.pdf" target="pdf">';
            echo $AppUI->_('View PDF File');
            echo '</a>';
        } else {
            echo 'Could not open file to save PDF.  ';
            if (!is_writable($temp_dir)) {
                'The files/temp directory is not writable.  Check your file system permissions.';
            }
        }
    }
    echo '</td>
</tr>
Пример #2
0
     echo $diff_total < 0 ? '</span>' : '';
     ?>
             </td>
         </tr><?php 
     $pdfdata[] = array(sprintf('%.1f%%', $project->project_percent_complete), '  ' . $projectName, $contactName, $AppUI->formatTZAwareTime($project->project_start_date, $df), $AppUI->formatTZAwareTime($criticalTasks[0]['task_end_date'], $df), $targetBudget, $actualCost, $w2Pconfig['currency_symbol'] . $diff_total);
 }
 if ($log_pdf) {
     // make the PDF file
     $temp_dir = W2P_BASE_DIR . '/files/temp';
     $output = new w2p_Output_PDFRenderer('A4', 'landscape');
     $output->addTitle($AppUI->_('Costs By Project'));
     $output->addDate($df);
     $output->addSubtitle($companies[$company_id]);
     $pdfheaders = array($AppUI->_('Work', UI_OUTPUT_JS), '  ' . $AppUI->_('Project Name', UI_OUTPUT_JS), $AppUI->_('Project Owner', UI_OUTPUT_JS), $AppUI->_('Start Date', UI_OUTPUT_JS), $AppUI->_('Finish Date', UI_OUTPUT_JS), $AppUI->_('Target Budget', UI_OUTPUT_JS), $AppUI->_('Actual Cost', UI_OUTPUT_JS), $AppUI->_('Difference', UI_OUTPUT_JS));
     $options = array('showLines' => 1, 'fontSize' => 9, 'rowGap' => 1, 'colGap' => 1, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '500', 'cols' => array(0 => array('justification' => 'center', 'width' => 45), 1 => array('justification' => 'left', 'width' => 175), 2 => array('justification' => 'center', 'width' => 75), 3 => array('justification' => 'center', 'width' => 65), 4 => array('justification' => 'center', 'width' => 65), 5 => array('justification' => 'center', 'width' => 65), 6 => array('justification' => 'center', 'width' => 65), 7 => array('justification' => 'center', 'width' => 65)));
     $output->addTable($title, $pdfheaders, $pdfdata, $options);
     $w2pReport = new CReport();
     if ($output->writeFile($w2pReport->getFilename())) {
         echo '<tr><td colspan="13">';
         echo '<a href="' . W2P_BASE_URL . '/files/temp/' . $w2pReport->getFilename() . '.pdf" target="pdf">';
         echo $AppUI->_('View PDF File');
         echo '</a>';
         echo '</td></tr>';
     } else {
         echo '<tr><td colspan="13">';
         echo 'Could not open file to save PDF.  ';
         if (!is_writable($temp_dir)) {
             echo 'The files/temp directory is not writable.  Check your file system permissions.';
         }
         echo '</td></tr>';
     }
Пример #3
0
        $output->addSubtitle(w2PgetConfig('company_name'));
        if ($project_id != 0) {
            $output->addSubtitle($pname);
        }
        $subhead = '';
        if ($log_all) {
            $title = $AppUI->_('All task entries');
        } else {
            if ($end_date != ' ') {
                $title = $AppUI->_('Task entries from') . ' ' . $start_date->format($df) . $AppUI->_('to') . ' ' . $end_date->format($df);
            } else {
                $title = $AppUI->_('Task entries from') . ' ' . $start_date->format($df);
            }
        }
        $options = array('showLines' => 2, 'showHeadings' => 1, 'fontSize' => 9, 'rowGap' => 4, 'colGap' => 5, 'xPos' => 50, 'xOrientation' => 'right', 'width' => '750', 'shaded' => 0, 'cols' => array(array('justification' => 'left', 'width' => 225), array('justification' => 'left', 'width' => 225), array('justification' => 'left', 'width' => 80), array('justification' => 'center', 'width' => 80), array('justification' => 'center', 'width' => 80), array('justification' => 'center', 'width' => 70)));
        $output->addTable($title, $columns, $pdfdata, $options);
        $w2pReport = new CReport();
        if ($output->writeFile($w2pReport->getFilename())) {
            echo '<a href="' . W2P_BASE_URL . '/files/temp/' . $w2pReport->getFilename() . '.pdf" target="pdf">';
            echo $AppUI->_('View PDF File');
            echo '</a>';
        } else {
            echo 'Could not open file to save PDF.  ';
            if (!is_writable($temp_dir)) {
                'The files/temp directory is not writable.  Check your file system permissions.';
            }
        }
    }
    echo '</td>
</tr>
</table>';