$this->Cell($w[2], 6, "NET Salary", 'LR', 0, 'L', true); $this->Cell($w[3], 6, number_format($netTotal, 2, '.', ','), 'LR', 0, 'R', true); $this->Ln(); $fill = !$fill; $this->SetTextColor(0); // Closing line $this->Cell($margin); $this->Cell(array_sum($w), 0, '', 'T'); $this->Ln(15); } } // Instanciation of inherited class $pdf = new PDF('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->ChapterTitle("Salary Slip"); $pdf->Cell(15); $pdf->SetFont('Times', '', 11); $pdf->Cell(40, 5, 'Employee Name :', 0, 1); $pdf->Cell(15); $pdf->Cell(40, 5, 'Month & Year :', 0, 1); $pdf->Ln(15); //////// // Column headings //$header = array('Earnings', 'Rs', 'Deductions', 'Rs'); // Data loading //$data = $pdf->LoadData('countries.txt'); //$pdf->FancyTable($header,$data,15); //$pdf->Ln(4); // Column headings $header = array('Earnings', 'Rs', 'Deductions', 'Rs');
function savePdf() { $meeting =& $this->meeting; $submission =& $this->submission; $summary = $submission->getSummaryFile() != null ? $submission->getSummaryFile() : $this->getData('summary'); $specificDiscussionText = $this->getData('discussionText'); $discussionType = $this->getData('discussionType'); $typeOther = $this->getData('typeOther'); $isUnanimous = $this->getData('unanimous') == "Yes" ? true : false; $decision = $this->getData("decision"); $votes = $this->getData("votes"); $minorityReason = $this->getData("minorityReason"); $chairReview = $this->getData('chairReview'); $abstract = $submission->getLocalizedAbstract(); $pdf = new PDF(); $pdf->AddPage(); $pdf->ChapterTitle('CONTINUING REVIEW of ' . $submission->getProposalId()); $pdf->ChapterItemKeyVal('Protocol Title', $abstract->getScientificTitle(), "BU"); $pdf->ChapterItemKeyVal('Principal Investigator (PI)', $submission->getAuthorString(), "BU"); $pdf->ChapterItemKeyVal('Unique project identification # assigned', $submission->getProposalId(), "BU"); $pdf->ChapterItemKeyVal('Responsible Staff Member', $submission->getUser()->getFullName(), "BU"); if ($isUnanimous) { switch ($decision) { case SUBMISSION_SECTION_DECISION_APPROVED: $decisionStr = "The proposal was accepted in principal unanimously by all the members of the ERC present in the meeting, and was approved with clarifications mentioned above."; break; case SUBMISSION_SECTION_DECISION_RESUBMIT: $decisionStr = "The proposal was assigned for revision and resubmission in principal unanimously by all the members of the ERC present in the meeting provided with the considerations and conditions mentioned above."; break; case SUBMISSION_SECTION_DECISION_DECLINED: $decisionStr = "The proposal was not accepted in principal unanimously by all the members of the ERC present in the meeting due to concerns stated above."; break; } } else { switch ($decision) { case SUBMISSION_SECTION_DECISION_APPROVED: $decisionStr = "The proposal was accepted in principal by the majority of the ERC members present in the meeting and was approved with clarifications mentioned above."; break; case SUBMISSION_SECTION_DECISION_RESUBMIT: $decisionStr = "The proposal was assigned for revision and resubmission in principal by the majority of the ERC members present in the meeting provided with the considerations and conditions mentioned above."; break; case SUBMISSION_SECTION_DECISION_DECLINED: $decisionStr = "The proposal was not accepted in principal unanimously by the majority of the ERC members present in the meeting due to concerns stated above."; break; } $votesStr = "The distribution of votes are as follows. " . $this->getData('votesApprove') . " member(s) voted for, " . $this->getData('votesNotApprove') . " member(s) voted against, " . $this->getData('votesAbstain') . " member(s) abstained."; $reasonsStr = "Reasons for minority opinions are as follows: {$minorityReason}"; } $pdf->ChapterItemKey('IRB Decision and Votes', "BU"); $pdf->ChapterItemVal($decisionStr); if (!$isUnanimous) { $pdf->ChapterItemVal($votesStr); $pdf->ChapterItemVal($reasonsStr); if ($chairReview != null) { $pdf->ChapterItemVal($chairReview); } } $journal =& Request::getJournal(); $journalId = $journal->getId(); $filename = $abstract->getScientificTitle() . ".pdf"; $meetingFilesDir = Config::getVar('files', 'files_dir') . '/journals/' . $journalId . '/meetings/' . $meeting->getId() . "/continuingReviews/" . $filename; import('classes.file.MinutesFileManager'); $minutesFileManager = new MinutesFileManager($meeting->getId(), "continuingReviews", $submission->getId()); if ($minutesFileManager->createDirectory()) { $pdf->Output($meetingFilesDir, "F"); } }
$pdf->SetFont('Times', '', 7); $data = $data_outbox; $i = 0; $nama_bagian = ''; if (!empty($data_outbox)) { foreach ($data_outbox as $outbox) { if ($nama_bagian != $outbox->nama_bagian) { if ($i > 0) { $pdf->CountJenis($i); } $i = 0; if ($nama_bagian != '') { $pdf->AddPage(); } $nama_bagian = $outbox->nama_bagian; $pdf->ChapterTitle($nama_bagian); } if ($pdf->GetY() >= 175) { $pdf->AddPage(); } $i++; $pdf->Cell(-6); $pdf->Cell(6, $margin, $i, 0, 0); $pdf->Cell(30, $margin, $outbox->no_surat, 0, 0); $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_masuk)), 0, 0); $pdf->Cell(15, $margin, date("d-m-Y", strtotime($outbox->tgl_surat)), 0, 0); $current_x1 = $pdf->GetX(); $current_y1 = $pdf->GetY(); $pdf->Cell(90); $current_x2 = $pdf->GetX(); $current_y2 = $pdf->GetY();
$results = $database->query($query); $regelsArr['n'] = $results->numRows(); if (isset($regelsArr['filename_pdf'])) { require_once $place_incl . 'pdf.inc'; /* * pdf process initiation */ $pdf = new PDF(); global $title; global $owner; $owner = $regelsArr['owner']; $title = $regelsArr['project']; $run = date("Ymd_His"); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->ChapterTitle(1, ucfirst($regelsArr['app'])); $pdf_text = ''; $pdf_data = array(); $notfirst = false; $pdf->SetFont('Arial', '', 8); // header if ($debug) { Gsm_debug($regelsArr, __LINE__); } if ($regelsArr['print_regels'] > 1) { $pdf_header = array(ucfirst($MOD_GSMOFF['tbl_label']), ucfirst($MOD_GSMOFF['tbl_value'])); } else { $pdf_header = array(); for ($i = 1; $i <= 6; $i++) { if (isset($regelsArr['veldhead'][$i]) && strlen($regelsArr['veldhead'][$i]) > 1) { $pdf_header[] = ucfirst($regelsArr['veldhead'][$i]);
$this->Ln(0); } } $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); $pdf->SetTextColor(32); $pdf->Cell(0, 5, $company, 0, 1, 'R'); $pdf->Cell(0, 5, $address, 0, 1, 'R'); $pdf->Cell(0, 5, $email, 0, 1, 'R'); $pdf->Cell(0, 5, 'Tel: ' . $telephone, 0, 1, 'R'); $pdf->Cell(0, 30, '', 0, 1, 'R'); $pdf->SetFillColor(200, 220, 255); //$pdf->ChapterTitle('Invoice Number ',$number); $pdf->ChapterTitle('Invoice Date ', date('d-m-Y')); $pdf->Cell(0, 20, '', 0, 1, 'R'); $pdf->SetFillColor(224, 235, 255); $pdf->SetDrawColor(192, 192, 192); $pdf->Cell(170, 7, 'Item', 1, 0, 'L'); $pdf->Cell(20, 7, 'Price', 1, 1, 'C'); while ($row = $result->fetch_array()) { $pdf->Cell(20, 7, $row[0], 1, 0, 'L', 0); $pdf->Cell(150, 7, $row[1], 1, 0, 'L', 0); $pdf->Cell(20, 7, $row[3] . 'Rs', 1, 1, 'C', 0); } $pdf->Cell(0, 0, '', 0, 1, 'R'); $pdf->Cell(170, 7, 'VAT', 1, 0, 'R', 0); $pdf->Cell(20, 7, $vat, 1, 1, 'C', 0); $pdf->Cell(170, 7, 'Total', 1, 0, 'R', 0); $pdf->Cell(20, 7, $re . 'Rs', 1, 0, 'C', 0);
$type_of_salary = $hint["type_of_salary"]; //$fund = $hint["fund"]; $center = $hint["center"]; $fund = substr($center, 0, 3); $center = substr($center, 3); $center2 = $hint["center2"]; $center2 = substr($center2, 3); $funding_source = $hint["funding_source"]; $details = $hint["details"]; $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->threecolumns('SFU ID', 'Rank', 'New/Returning', $sfu_id, $type_of_appointment, $_SESSION["new/ret"]); //$pdf->threecolumns('SFU ID','Rank','New/Returning', $sfu_id, $s,$lim_id); $pdf->Ln(7); $pdf->ChapterTitle('', 'Personal Information'); $pdf->threecolumns('Last Name', 'Legal First Name', 'Prefered First Name', $s1, $firstname, $preferredFirstName); $pdf->Ln(7); $pdf->Ln(); $pdf->threecolumns('Citizenship', 'Gender', 'Former Sfu Student', $hint['citizenship'], $hint['gender'], ' '); $pdf->Ln(7); $pdf->Ln(1); $pdf->oneBigcolumns('Mailling Address', $hint['Address1']); $pdf->Ln(2); $pdf->threecolumns('City', 'Telephone', 'Email Address', $hint['city'], $hint['Phonenumber'], $hint['email']); $pdf->Ln(7); $pdf->Ln(2); $pdf->fourcolumns('Highest Degree', 'Year of Degree', 'Institution name', 'City/Country', $highest_degree_1, $year_of_degree_1, $institution_name_city_1, $country_edu_1); $pdf->fourcolumns(' ', ' ', ' ', ' ', $highest_degree_2, $year_of_degree_2, $institution_name_city_2, $country_edu_2); $pdf->fourcolumns(' ', ' ', ' ', ' ', $highest_degree_3, $year_of_degree_3, $institution_name_city_3, $country_edu_3); $pdf->Ln(2);
$this->Cell(0, 6, "{$num} {$label}", 0, 1, 'L', true); $this->Ln(0); } } $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times', '', 12); $pdf->SetTextColor(32); $pdf->Cell(0, 5, 'About Fitness', 0, 1, 'R'); $pdf->Cell(0, 5, 'LPU phagwara', 0, 1, 'R'); $pdf->Cell(0, 5, '*****@*****.**', 0, 1, 'R'); $pdf->Cell(0, 5, 'Tel: 9872851376', 0, 1, 'R'); $pdf->Cell(0, 30, '', 0, 1, 'R'); $pdf->SetFillColor(200, 220, 255); $pdf->ChapterTitle('Invoice Number ', $number); $pdf->ChapterTitle('Invoice Date ', date('d-m-Y')); $pdf->Cell(0, 20, '', 0, 1, 'R'); $pdf->SetFillColor(224, 235, 255); $pdf->SetDrawColor(192, 192, 192); $pdf->Cell(170, 7, 'Item', 1, 0, 'L'); $pdf->Cell(20, 7, 'Price', 1, 1, 'C'); $pdf->Cell(170, 7, 'Member Plan FEE', 1, 0, 'L', 0); $pdf->Cell(20, 7, $price, 1, 1, 'C', 0); $pdf->Cell(0, 0, '', 0, 1, 'R'); $pdf->Cell(170, 7, 'VAT', 1, 0, 'R', 0); $pdf->Cell(20, 7, $vat, 1, 1, 'C', 0); $pdf->Cell(170, 7, 'Total', 1, 0, 'R', 0); $pdf->Cell(20, 7, $re . " Rs", 1, 0, 'C', 0); $pdf->Cell(0, 20, '', 0, 1, 'R'); $pdf->Cell(0, 5, $pay, 0, 1, 'L');
function appdate() { // Label $this->SetFont('Helvetica', '', 11); $this->Cell(23, 10, 'Date :_______________________', 'b', 0); } } session_start(); // now it has sh_id, lets find everything and dumped in page //$s= $_SESSION["iddd"]; //$s = '973009072'; // Instanciation of inherited class $pdf = new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->ChapterTitle('', 'Approval'); $pdf->Cell(20, 6, ' ', 0, 0); $pdf->approve('Chair/Director', 'Date'); $pdf->Cell(68, 6, ' ', 0, 0); $pdf->appdate(); $pdf->Ln(8); $pdf->Cell(16, 6, ' ', 0, 0); $pdf->approve('Dean of Faculty', 'Date'); $pdf->Cell(72, 6, ' ', 0, 0); $pdf->appdate(); $pdf->Ln(8); $pdf->approve('Vice President Academic', 'Date'); $pdf->Cell(88, 6, ' ', 0, 0); $pdf->appdate(); $pdf->Ln(8); $pdf->Output();
function func_rekening($Arr_in) { // processing /* * creating balans/ resultaat relkening or een detail overzicht * * $Arr_in['mode'] 1= balans * $Arr_in['mode'] 2= resultaat * $Arr_in['mode'] 3= details * $Arr_in['vanaf'] vanaf * $Arr_in['totenmet'] tot en met */ require_once $place_incl . 'pdf.inc'; global $database; global $MOD_GSMOFF; global $LINETEMP; global $ICONTEMP; global $place; global $msg; $returnvalue = ""; $pdf_text = ''; $pdf_data = array(); $subtotals = array(); $Arr_local = array('n' => 0, 'm' => 0, 'text_budget' => '', 'rekeningnummer' => '', 'cum_rek' => 0, 'cum_group' => 0, 'cum_srt' => 0, 'cum_activa' => 0, 'cum_resultaat' => 0, 'cum_rek_previous' => 0, 'rekening_type' => ''); /* * initiatie pdf before starting the normal process */ $pdf = new PDF(); global $title; global $owner; $owner = $regelsArr['owner']; $title = $regelsArr['project']; $run = date("Ymd_His"); $pdf->AliasNbPages(); $pdf->AddPage(); $returnvalue .= $LINETEMP[20]; // kolombreedte instelling // end initiate pdf file //*************************** // Heading switch ($Arr_in['mode']) { case 1: // balans $returnvalue .= sprintf($LINETEMP[7], '', 3, 3, '<strong>' . $Arr_in['document'] . '</strong>' . ' ' . '<strong>' . $Arr_in['company'] . '</strong>', 'Datum : ' . $Arr_in['totenmet']); $returnvalue .= sprintf($LINETEMP[11], $MOD_GSMOFF['line_color'][4], '', $MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', $MOD_GSMOFF['SUR_BEDRAG']); $title .= sprintf(" %s %s, datum: %s", $Arr_in['document'], $Arr_in['company'], $Arr_in['totenmet']); $pdf->ChapterTitle(1, $title); $pdf->SetFont('Arial', '', 8); $pdf_text .= CH_CR . $title . CH_CR; $pdf_header = array($MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', '', $MOD_GSMOFF['SUR_BEDRAG']); break; case 2: // resultaat $Arr_local['text_budget'] = $Arr_in['budget_exist'] ? "Budget" : ""; $returnvalue .= sprintf($LINETEMP[7], '', 3, 3, '<strong>' . $Arr_in['document'] . '</strong>' . ' ' . '<strong>' . $Arr_in['company'] . '</strong>', $MOD_GSMOFF['SUR_PER'] . $Arr_in['vanaf'] . ' - ' . $Arr_in['totenmet']); $returnvalue .= sprintf($LINETEMP[11], $MOD_GSMOFF['line_color'][4], '', $MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], $Arr_local['text_budget'], '', $MOD_GSMOFF['SUR_BEDRAG']); $title = sprintf("%s %s, periode: %s - %s", $Arr_in['document'], $Arr_in['company'], $Arr_in['vanaf'], $Arr_in['totenmet']); $pdf->ChapterTitle(1, $title); $pdf->SetFont('Arial', '', 8); $pdf_text .= CH_CR . $title . CH_CR; $pdf_header = array($MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], $Arr_local['text_budget'], '', '', $MOD_GSMOFF['SUR_BEDRAG']); break; case 3: // details $returnvalue .= sprintf($LINETEMP[7], '', 3, 3, '<strong>' . $Arr_in['document'] . '</strong>' . ' ' . '<strong>' . $Arr_in['company'] . '</strong>', $MOD_GSMOFF['SUR_PER'] . $Arr_in['vanaf'] . ' - ' . $Arr_in['totenmet']); $returnvalue .= sprintf($LINETEMP[11], $MOD_GSMOFF['line_color'][4], ' ', $MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', $MOD_GSMOFF['SUR_BEDRAG']); $title = sprintf("%s %s, periode: %s - %s", $Arr_in['document'], $Arr_in['company'], $Arr_in['vanaf'], $Arr_in['totenmet']); $pdf->ChapterTitle(1, $title); $pdf->SetFont('Arial', '', 8); $pdf_text .= CH_CR . $title . CH_CR; $pdf_header = array($MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', '', $MOD_GSMOFF['SUR_BEDRAG']); break; default: // default list break; } // end of heading //*************************** // preload rekening details $rektypeArr = func_table_preload($Arr_in['table_rek'], 4); // preload data //$row = $results->fetchRow() // start processing // loop through rekening nummers // find associated booking records // level1 on balans en resultaten rekening // level2 op 1e positie van rekening nummer // level3 op rekening nummer //*************************** $Arr_level_L1 = array('vorig' => 0, 'count' => 0); // for levelbreak on type $Arr_level_L2 = array('vorig' => 0, 'count' => 0); // for levelbreak on rekening groep $Arr_level_L3 = array('vorig' => 0, 'count' => 0); // for levelbreak on rekening nummer $query = "SELECT * FROM `" . $Arr_in['table_rek'] . "` ORDER BY `rekening_type`, `rekeningnummer`"; $r_results = $database->query($query); if ($r_results && $r_results->numRows() > 0) { // there are records while ($r_row = $r_results->fetchRow()) { // loop through the records // alleen de volgende rekening nummers doen mee if (in_array($r_row['rekening_type'], $Arr_in['show_type'])) { // rekening nummer is to be processed the type matches if ($Arr_level_L2['vorig'] != substr($r_row['rekeningnummer'], 0, 1) || $Arr_level_L1['vorig'] != $r_row['rekening_type']) { // type of group chnage // afsluiten L2 vorige group afsluiten if ($Arr_level_L2['count'] != 0) { // alleen als er records geweest zijn in deze groep $Arr_local['cum_srt'] += $Arr_local['cum_group']; // bij type totaal voegen if ($Arr_in['result']) { // output onder bepaalde conditie $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '', '<b>' . $MOD_GSMOFF['grootboek'][$Arr_level_L2['vorig']] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_group'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['grootboek'][$Arr_level_L2['vorig']], '', '', '', Gsm_opmaak($Arr_local['cum_group'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', '', '', '', ''); $pdf_data[] = explode(';', trim($pdf_line)); } // resetten cumul values $Arr_local['cum_group'] = 0; // groep totaal op nul $Arr_local['cum_rek'] = 0; // een onderliggende rekening nummer totaal op nul zetten if (!$Arr_in['details']) { // blanco regel onder bepaalde conditie // blanco regel volgt $returnvalue .= sprintf($LINETEMP[11], '', ' ', '', '', '', '', ''); $Arr_local['m'] = 0; // reset kleur indicatie } } if ($Arr_level_L1['vorig'] != $r_row['rekening_type']) { // moet er rekening type totaal worden gemaakt // afsluiten L1 $subtotals[$Arr_level_L1['vorig']] = $Arr_local['cum_srt']; // totaal van het type vasthouden if ($Arr_level_L1['count'] != 0) { // acties nodig // zijn er records geweest if ($Arr_in['result']) { // output onder bepaalde conditie if ($Arr_level_L1['vorig'] == 2) { // type 2 processing $Arr_local['cum_resultaat'] = $subtotals[1] - $subtotals[2]; // bereken resultaat $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '', '<b>' . $MOD_GSMOFF['SUR_RES'] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_RES'], '', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 1)); $pdf_data[] = explode(';', trim($pdf_line)); $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']] . '</strong>', '', '', Gsm_opmaak($Arr_local['cum_activa'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']], '', '', '', Gsm_opmaak($subtotals[1], 2)); $pdf_data[] = explode(';', trim($pdf_line)); } elseif ($Arr_level_L1['vorig'] == 5) { // type 5 processing $Arr_local['cum_resultaat'] = $subtotals[5] - $subtotals[4]; // bereken resultaat $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']] . '</strong>', '', '', Gsm_opmaak($Arr_local['cum_srt'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']], '', '', '', Gsm_opmaak($subtotals[4], 2)); $pdf_data[] = explode(';', trim($pdf_line)); $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '', '<b>' . $MOD_GSMOFF['SUR_RES'] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_RES'], '', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); } else { // niet 2 of 5 2 = einde balans 5 = einde resultaat overzicht $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][$Arr_level_L1['vorig']] . '</strong>', '', '', Gsm_opmaak($subtotals[$Arr_level_L1['vorig']], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][$Arr_level_L1['vorig']], '', '', '', Gsm_opmaak($subtotals[$Arr_level_L1['vorig']], 2)); $pdf_data[] = explode(';', trim($pdf_line)); // blanco regel volgt $returnvalue .= sprintf($LINETEMP[11], '', ' ', '', '', '', '', ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', '', '', '', ''); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; // reset kleur indicatie } } $Arr_local['cum_srt'] = 0; // soort totaal op nul voor de volgende } //openen L1 $Arr_level_L1['vorig'] = $r_row['rekening_type']; // rekening type $Arr_level_L1['count'] = 0; // totaal voor level break uitzetten } //openen L2 $Arr_level_L2['vorig'] = substr($r_row['rekeningnummer'], 0, 1); // rekening groep $Arr_level_L2['count'] = 0; // totaal voor level break uitzetten } // process details L3 // selection depending on balans rekening $Arr_level_L3['vorig'] = isset($row['debet_id']) ? $row['debet_id'] : ' '; // waarde key volgende cycle $Arr_level_L3['count'] = 0; // totaal voor level break uitzetten // pick up openings balans van rekening rek $Arr_local['cum_rek'] = 0; if (abs($r_row['balans']) > 0.001 && $Arr_in['totenmet'] >= $r_row['balans_date']) { $Arr_local['cum_rek'] = $r_row['balans']; $Arr_level_L3['count']++; // om een openings balans te krijgen als er geen verdere boekingen zijn //dit kan er later uit $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][0], '', '', $r_row['balans_date'] . ' >> Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek'], 1), ""); // tot hier } $msql_search = $r_row['rekening_type'] == 1 || $r_row['rekening_type'] == 2 ? "`booking_date` <= '" . $Arr_in['totenmet'] . "' " : ($msql_search = "`booking_date` >= '" . $Arr_in['vanaf'] . "' AND `booking_date` <= '" . $Arr_in['totenmet'] . "' "); $msql_search .= " AND ( `debet_id`= '" . $r_row['id'] . "' OR `tegen1_id`= '" . $r_row['id'] . "' OR `tegen2_id`= '" . $r_row['id'] . "' )"; $query = "SELECT * FROM `" . $Arr_in['table'] . "` WHERE " . $msql_search . " ORDER BY `booking_date`, `project`"; $results = $database->query($query); if ($results && $results->numRows() > 0) { while ($row = $results->fetchRow()) { $hulp = sprintf('%s - %s%s', $row['booking_date'], strlen($row['name']) > 2 ? $row['name'] . ' - ' : '', strlen($row['project']) > 2 ? $row['project'] : ''); $col = $Arr_local['m'] % 2 == 0 ? $MOD_GSMOFF['line_color'][2] : ""; // data for display detail if ($row['debet_id'] == $r_row['id']) { $hulp_amt = $row['debet_amount']; $Arr_local['cum_rek'] += $hulp_amt; // display detailed lines if ($row['booking_date'] < $Arr_in['vanaf']) { $Arr_local['cum_rek_previous'] = $Arr_local['cum_rek']; } // voor een eventuele 0penings balans if ($hulp_amt != 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) { if ($row['booking_date'] >= $Arr_in['vanaf'] && $row['booking_date'] <= $Arr_in['totenmet']) { if (abs($Arr_local['cum_rek_previous']) > 0.001) { // er is nog een openings balans af te drukken $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][0], '', '', ' - Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 1), ""); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', ' - Openings Balans', '', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 2), ""); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; // reset kleur $col = $Arr_local['m'] % 2 == 0 ? $MOD_GSMOFF['line_color'][2] : ""; $Arr_local['cum_rek_previous'] = 0; //vergeet openingsbalans } // detailed line $returnvalue .= sprintf($LINETEMP[12], $col, '<small>' . $row['id'] . '</small>', '', $hulp, Gsm_opmaak($hulp_amt, 1), Gsm_opmaak($Arr_local['cum_rek'], 1), ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $hulp, '', Gsm_opmaak($hulp_amt, 2), Gsm_opmaak($Arr_local['cum_rek'], 2), ''); $pdf_data[] = explode(';', trim($pdf_line)); } // ($row['booking_date']>= $Arr_in['vanaf'] & $row['booking_date']<= $Arr_in['totenmet']) } //($hulp_amt <> 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) } if ($row['tegen1_id'] == $r_row['id']) { $hulp_amt = $row['tegen1_amount'] * $MOD_GSMOFF['rek_type_sign'][$rektypeArr[$row['debet_id']]] * $MOD_GSMOFF['rek_type_sign'][$rektypeArr[$row['tegen1_id']]] * -1; $Arr_local['cum_rek'] += $hulp_amt; // display detailed lines if ($row['booking_date'] < $Arr_in['vanaf']) { $Arr_local['cum_rek_previous'] = $Arr_local['cum_rek']; } // voor een eventuele 0penings balans if ($hulp_amt != 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) { if ($row['booking_date'] >= $Arr_in['vanaf'] && $row['booking_date'] <= $Arr_in['totenmet']) { if (abs($Arr_local['cum_rek_previous']) > 0.001) { // er is nog een openings balans af te drukken $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][0], '', '', $Arr_in['vanaf'] . ' - Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 1), ""); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $Arr_in['vanaf'] . ' - Openings Balans', '', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 2), ""); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; // reset kleur $col = $Arr_local['m'] % 2 == 0 ? $MOD_GSMOFF['line_color'][2] : ""; $Arr_local['cum_rek_previous'] = 0; //vergeet openingsbalans } // detailed line $returnvalue .= sprintf($LINETEMP[12], $col, '<small>' . $row['id'] . '</small>', '', $hulp, Gsm_opmaak($hulp_amt, 1), Gsm_opmaak($Arr_local['cum_rek'], 1), ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $hulp, '', Gsm_opmaak($hulp_amt, 2), Gsm_opmaak($Arr_local['cum_rek'], 2), ''); $pdf_data[] = explode(';', trim($pdf_line)); } // ($row['booking_date']>= $Arr_in['vanaf'] & $row['booking_date']<= $Arr_in['totenmet']) } //($hulp_amt <> 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) } if ($row['tegen2_id'] == $r_row['id']) { $hulp_amt = $row['tegen2_amount'] * $MOD_GSMOFF['rek_type_sign'][$rektypeArr[$row['debet_id']]] * $MOD_GSMOFF['rek_type_sign'][$rektypeArr[$row['tegen2_id']]] * -1; $Arr_local['cum_rek'] += $hulp_amt; // display detailed lines if ($row['booking_date'] < $Arr_in['vanaf']) { $Arr_local['cum_rek_previous'] = $Arr_local['cum_rek']; } // voor een eventuele 0penings balans if ($hulp_amt != 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) { if ($row['booking_date'] >= $Arr_in['vanaf'] && $row['booking_date'] <= $Arr_in['totenmet']) { if (abs($Arr_local['cum_rek_previous']) > 0.001) { // er is nog een openings balans af te drukken $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][0], '', '', $Arr_in['vanaf'] . ' - Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 1), ""); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', $r_row['balans_date'] . ' - Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 2), ""); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; // reset kleur $col = $Arr_local['m'] % 2 == 0 ? $MOD_GSMOFF['line_color'][2] : ""; $Arr_local['cum_rek_previous'] = 0; //vergeet openingsbalans } // detailed line $returnvalue .= sprintf($LINETEMP[12], $col, '<small>' . $row['id'] . '</small>', '', $hulp, Gsm_opmaak($hulp_amt, 1), Gsm_opmaak($Arr_local['cum_rek'], 1), ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $hulp, '', Gsm_opmaak($hulp_amt, 2), Gsm_opmaak($Arr_local['cum_rek'], 2), ''); $pdf_data[] = explode(';', trim($pdf_line)); } // ($row['booking_date']>= $Arr_in['vanaf'] & $row['booking_date']<= $Arr_in['totenmet']) } //($hulp_amt <> 0 && ($Arr_in['details'] || $Arr_in['search'] == $r_row['rekeningnummer'])) } // display line // set details for totals and levelbreak $Arr_local['m']++; if ($row['booking_date'] >= $Arr_in['vanaf'] && $row['booking_date'] <= $Arr_in['totenmet']) { $Arr_level_L3['count']++; } } // $row = $results->fetchRow() } //($results && $results->numRows() > 0) // totaal if ($Arr_level_L3['count'] != 0 || abs($Arr_local['cum_rek_previous']) > 0.001) { if (abs($Arr_local['cum_rek_previous']) > 0.001) { // er is nog een openings balans af te drukken $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][0], '', '', 'Openings Balans', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 1), ""); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', 'Openings Balans', '', '--', Gsm_opmaak($Arr_local['cum_rek_previous'], 2), ""); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; // reset kleur $col = $Arr_local['m'] % 2 == 0 ? $MOD_GSMOFF['line_color'][2] : ""; $Arr_local['cum_rek_previous'] = 0; //vergeet openingsbalans } if ($Arr_in['budget_exist'] && $r_row['budget_a'] > 0) { $help_b1 = Gsm_opmaak($r_row['budget_a'], 3); $help_b2 = $Arr_local['cum_rek'] == 0 ? "" : Gsm_opmaak(100 * $Arr_local['cum_rek'] / $r_row['budget_a'], 9); } else { $help_b1 = ""; $help_b2 = ""; } $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][2], '', '<b>' . $r_row['rekeningnummer'] . '</b>', '<b>' . $r_row['name'] . '</b>', $help_b1, $help_b2, Gsm_opmaak($Arr_local['cum_rek'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", $r_row['rekeningnummer'], $r_row['name'], $help_b1, $help_b2, '', Gsm_opmaak($Arr_local['cum_rek'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); // blanco regel volgt if ($Arr_in['details']) { $returnvalue .= sprintf($LINETEMP[11], '', ' ', '', '', '', '', ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', '', '', '', ''); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; } $Arr_local['cum_group'] += $Arr_local['cum_rek']; $Arr_local['cum_rek'] = 0; $Arr_level_L3['count'] = 0; $Arr_level_L2['count']++; $Arr_level_L1['count']++; } //($Arr_level_L3['count'] != 0) } // (in_array($r_row['rekening_type'], $Arr_in['show_type'] )) } //($r_row = $r_results->fetchRow()) // afsluiten L2 if ($Arr_level_L2['count'] != 0) { // acties nodig $Arr_local['cum_group'] += $Arr_local['cum_rek']; $Arr_local['cum_srt'] += $Arr_local['cum_group']; if ($Arr_in['result']) { $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '..', '', '<b>' . $MOD_GSMOFF['grootboek'][$Arr_level_L2['vorig']] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_group'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '..', $MOD_GSMOFF['grootboek'][$Arr_level_L2['vorig']], '', '', '', Gsm_opmaak($Arr_local['cum_group'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', '', '', '', ''); $pdf_data[] = explode(';', trim($pdf_line)); } // resetten cumul values $Arr_local['cum_group'] = 0; $Arr_local['cum_rek'] = 0; if (!$Arr_in['details']) { // blanco regel volgt $returnvalue .= sprintf($LINETEMP[11], '', ' ', '', '', '', '', ''); $Arr_local['m'] = 0; } } // afsluiten L1 if ($Arr_level_L1['count'] != 0) { // acties nodig if ($Arr_in['result']) { if ($Arr_level_L1['vorig'] == 2) { $subtotals[2] = $Arr_local['cum_srt']; $Arr_local['cum_resultaat'] = $subtotals[1] - $subtotals[2]; $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '', '<b>' . $MOD_GSMOFF['SUR_RES'] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_RES'], '', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][1] . '</strong>', '', '', Gsm_opmaak($subtotals[1], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][1], '', '', '', Gsm_opmaak($subtotals[1], 2)); $pdf_data[] = explode(';', trim($pdf_line)); } elseif ($Arr_level_L1['vorig'] == 5) { $subtotals[5] = $Arr_local['cum_srt']; $Arr_local['cum_resultaat'] = $subtotals[5] - $subtotals[4]; $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][5] . '</strong>', '', '', Gsm_opmaak($Arr_local['cum_srt'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][4], '', '', '', Gsm_opmaak($subtotals[4], 2)); $pdf_data[] = explode(';', trim($pdf_line)); $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '', '<b>' . $MOD_GSMOFF['SUR_RES'] . '</b>', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_RES'], '', '', '', Gsm_opmaak($Arr_local['cum_resultaat'], 2)); $pdf_data[] = explode(';', trim($pdf_line)); } else { $returnvalue .= sprintf($LINETEMP[12], $MOD_GSMOFF['line_color'][3], '', '<b>' . $MOD_GSMOFF['SUR_TOT'] . '</b>', '<strong>' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']] . '</strong>', '1', '', Gsm_opmaak($subtotals[$Arr_level_L1['vorig']], 1)); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', $MOD_GSMOFF['SUR_TOT'] . ' ' . $MOD_GSMOFF['rek_type'][$Arr_local['rekening_type']], '', '', '', Gsm_opmaak($subtotals[$Arr_level_L1['vorig']], 2)); $pdf_data[] = explode(';', trim($pdf_line)); } } if (!$Arr_in['details']) { // blanco regel volgt $returnvalue .= sprintf($LINETEMP[11], '', ' ', '', '', '', '', ''); $pdf_line = sprintf("%s;%s;%s;%s;%s;%s", '', '', '', '', '', ''); $pdf_data[] = explode(';', trim($pdf_line)); $Arr_local['m'] = 0; } } } else { $returnvalue .= $MOD_GSMOFF['SUR_NDATA']; $pdf_text .= $MOD_GSMOFF['SUR_NDATA'] . CH_CR; } if (isset($Arr_in['filename_pdf'])) { /* * the output to the pdf */ $pdf_cols = array(12, 85, 15, 25, 25, 25); $pdf_text .= CH_CR . $Arr_in['company']; $pdf_text .= CH_CR . CH_CR . $regelsArr['filename_pdf'] . CH_CR; $pdf_text .= "Document created on : " . str_replace("_", " ", $run) . CH_CR; if ($debug) { $pdf_text .= CH_CR . "Version : " . $regelsArr['module'] . $regelsArr['versie'] . CH_CR; } if (strlen($regelsArr['search']) > 1) { $pdf_text .= CH_CR . "Selection : " . $regelsArr['search']; } $pdf->DataTable($pdf_header, $pdf_data, $pdf_cols); $pdf->ChapterBody($pdf_text); $pdf->Output($Arr_in['dir_to'] . '/' . $Arr_in['filename_pdf'], 'F'); $msg['inf'] .= ' report created</br>'; } //isset( $Arr_local[ 'filename_pdf' ] ) return $returnvalue; }
} $results = $database->query($query); $regelsArr['n'] = $results->numRows(); /* * initiatie pdf before starting the normal process */ $regelsArr['cols'] = array(10, 60, 35, 20, 20, 20); $pdf = new PDF(); global $title; global $owner; $owner = $regelsArr['owner']; $title = $regelsArr['project']; $run = date("Ymd_His"); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->ChapterTitle(1, 'Open'); $pdf_text = ''; $pdf_data = array(); $notfirst = false; $subtotal0 = 0; $subtotal1 = 0; $subtotal2 = 0; $regelsArr['bucket'] = ""; $regelsArr['bucket1'] = ""; $pdf_header = array('', 'naam', 'omschrijving', 'betaald'); while ($row = $results->fetchRow()) { if ($row['datumist'] == "0000-00-00" || $row['datumist'] == "1970-01-01") { if ($debug) { $msg['bug'] .= __LINE__ . ' access <br/>'; } if ($regelsArr['bucket'] != $row['refer']) {
//$this->Cell($w[3],6,$totalReturn,'LR',0,'R',true); $this->Cell($w[3], 6, number_format($totalMissingsCost, 2, '.', ','), 'LR', 0, 'R', true); $this->Ln(); $fill = !$fill; $this->SetTextColor(0); // Closing line $this->Cell($margin); $this->Cell(array_sum($w), 0, '', 'T'); $this->Ln(0); } } // Instanciation of inherited class $pdf = new PDF('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->ChapterTitle("Performance Sheet"); $pdf->Ln(5); $pdf->Cell(15); $pdf->SetFont('Times', '', 11); $pdf->Cell(40, 0, "Employee Name", 0, 1); $pdf->Cell(50); $pdf->Cell(40, 0, ": Mr.{$name}", 0, 1); $pdf->Ln(5); $pdf->Cell(15); $pdf->Cell(40, 0, "Designation ", 0, 1); $pdf->Cell(50); $pdf->Cell(40, 0, ": Sales Representative", 0, 1); $pdf->Ln(5); $pdf->Cell(15); $pdf->Cell(40, 0, "Year & Month", 0, 1); $pdf->Cell(50);
// Mention in italics $this->SetFont('', 'I'); $this->Cell(0, 5, '(end of excerpt)'); } function PrintChapter($num, $title, $file) { $this->AddPage(); $this->ChapterTitle($num, $title); $this->ChapterBody($file); } } $pdf = new PDF(); $pdf->AddPage(); $title = $row2['shopnm']; $pdf->SetTitle($title); $pdf->ShopTitle($title); $pdf->SetTextColor(10); $pdf->ChapterTitle("Shop Details:"); $pdf->Cell(0, 9, 'Owner Name: ' . $row1['ownernm'], 1, 1); $pdf->Cell(100, 9, 'Category: ' . $row3['categorynm'], 1, 0); $pdf->Cell(90, 9, 'Specialization: ' . $row2['spl'], 1, 1); $pdf->Cell(0, 9, 'Address: ' . $row2['shopadd'], 1, 1); $pdf->Cell(100, 9, 'Mobile Number: ' . $row2['mobno'], 1, 0); $pdf->Cell(90, 9, 'Email-ID: ' . $row1['mailid'], 1, 1); $pdf->Ln(4); $pdf->ChapterTitle("SERVICES:"); $fi = $row1['serv']; $pdf->Services($fi); $pdf->ChapterTitle("SPECIAL OFFERS:"); $pdf->Image('images/discount.png', 17, 155, 170); $pdf->Output();
// Background color $this->SetFillColor(200, 220, 255); // Title $this->Cell(0, 6, "{$label}", 0, 1, 'L', TRUE); // Line break $this->Ln(4); } } $pdf = new PDF(); $region = $_GET['region']; $header = array('S/N', 'First Name', 'Last Name', 'Branch_office', 'No. Absenses', 'No. Presents'); $pdf->AddPage(); $pdf->SetFont('Arial', 'B', 12); $pdf->Image('../../img/bird.gif', 10, 0, 30); $pdf->Ln(30); $pdf->ChapterTitle(" REPORT ON LAST MONTH ATTENDANCE"); $pdf->Ln(); $sql = "SELECT * FROM security_officer_table WHERE base_region='{$region}'"; $result = $conn->query($sql); foreach ($header as $col) { $pdf->Cell(30, 6, $col, 1); } $pdf->Ln(); $count2 = 1; while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $count = 0; $count1 = 0; $id1 = $row['sec_off_id']; $sql1 = "SELECT * FROM attendance_table WHERE sec_off_id={$id1}"; $result1 = $conn->query($sql1); $pdf->Cell(30, 6, $count2, 1);
/** * Print table body from directory * * @param $pdf * @param $p_version_id * @param $work_packages * @param $no_work_package_bug_ids * @param $option_show_duration * @param $detail_flag * @return Array */ function generate_content(PDF $pdf, $p_version_id, $work_packages, $no_work_package_bug_ids, $option_show_duration, $detail_flag) { $specmanagement_database_api = new specmanagement_database_api(); $specmanagement_editor_api = new specmanagement_editor_api(); $directory_depth = $specmanagement_editor_api->calculate_directory_depth($work_packages); $chapter_counter_array = $specmanagement_editor_api->prepare_chapter_counter($directory_depth); $last_chapter_depth = 0; $version_id = $_POST['version_id']; $version = version_get($version_id); $version_date = $version->date_order; /** Iterate through defined work packages */ if (!is_null($work_packages)) { foreach ($work_packages as $work_package) { if (strlen($work_package) > 0) { $work_package_spec_bug_ids = $specmanagement_database_api->get_workpackage_spec_bugs($p_version_id, $work_package); $chapters = explode('/', $work_package); $chapter_depth = count($chapters); if ($chapter_depth == 1) { $specmanagement_editor_api->reset_chapter_counter($chapter_counter_array); } $chapter_prefix_data = $specmanagement_editor_api->generate_chapter_prefix($chapter_counter_array, $chapter_depth, $last_chapter_depth); $chapter_counter_array = $chapter_prefix_data[0]; $chapter_prefix = $chapter_prefix_data[1]; $chapter_suffix = $specmanagement_editor_api->generate_chapter_suffix($chapters, $chapter_depth); $chapter_duration = $specmanagement_database_api->get_workpackage_duration($p_version_id, $work_package); if ($detail_flag) { $pdf->ChapterTitle($chapter_prefix, utf8_decode($chapter_suffix), $option_show_duration, $chapter_duration); } else { $pdf->SetFont('Arial', 'B', 12); $pdf->SetFillColor(255, 255, 255); $pdf->Cell(95, 6, $chapter_prefix . ' ' . utf8_decode($chapter_suffix), 0, 0, 'L', 1); $pdf->Cell(95, 6, $pdf->PageNo(), 0, 0, 'R', 1); $pdf->SetFont('Arial', '', 12); $pdf->Ln(); } process_content($pdf, $work_package_spec_bug_ids, $version_date, $chapter_prefix, $option_show_duration, $detail_flag); $last_chapter_depth = $chapter_depth; } if ($detail_flag) { $pdf->Cell(0, 0, '', 'T'); } $pdf->Ln(7); } } /** Iterate through issues without defined work package */ $chapter_prefix = $chapter_counter_array[0] + 1; if (count($no_work_package_bug_ids) > 0) { $chapter_suffix = plugin_lang_get('editor_no_workpackage'); $chapter_duration = $specmanagement_database_api->get_workpackage_duration($p_version_id, ''); if ($detail_flag) { $pdf->ChapterTitle($chapter_prefix, utf8_decode($chapter_suffix), $option_show_duration, $chapter_duration); } else { $pdf->SetFont('Arial', 'B', 12); $pdf->SetFillColor(255, 255, 255); $pdf->Cell(0, 6, $chapter_prefix . ' ' . utf8_decode($chapter_suffix), 0, 0, 'L', 1); $pdf->SetFont('Arial', '', 12); $pdf->Ln(); } process_content($pdf, $no_work_package_bug_ids, $version_date, $chapter_prefix, $option_show_duration, $detail_flag); if ($detail_flag) { $pdf->Cell(0, 0, '', 'T'); } $pdf->Ln(7); $chapter_prefix++; } $content_package = array(); $content_package[0] = $pdf; $content_package[1] = $chapter_prefix; return $content_package; }
$regelsArr['head'] .= $LINETEMP[21]; $regelsArr['head'] .= sprintf($LINETEMP[22], "", "", '<strong>' . $regelsArr['Document'] . '</strong>', '<strong>' . $settingArr['company'] . '</strong>', $MOD_GSMOFF['SUR_PER'], $regelsArr['Vanaf'], $regelsArr['Totenmet']); $regelsArr['head'] .= sprintf($LINETEMP[22], $MOD_GSMOFF['line_color'][4], '', $MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', $MOD_GSMOFF['SUR_BEDRAG']); $title = sprintf("%s %s, periode: %s-%s", $regelsArr['Document'], $settingArr['company'], $regelsArr['Vanaf'], $regelsArr['Totenmet']); $pdf_text .= CH_CR . $title . CH_CR . CH_CR; $pdf_header = array($MOD_GSMOFF['SUR_REK'], $MOD_GSMOFF['SUR_OMS'], '', '', '', $MOD_GSMOFF['SUR_BEDRAG']); break; default: // default list $pdf_text .= '--'; $pdf_header = array('', '', '', '', '', ''); break; } //$regelsArr[ 'mode' ] if (isset($regelsArr['filename_pdf'])) { $pdf->ChapterTitle(1, $title); $pdf->SetFont('Arial', '', 10); $pdf_text .= CH_CR . $settingArr['company']; $pdf_text .= CH_CR . "Document created on : " . str_replace("_", " ", $run) . CH_CR; if ($debug) { $pdf_text .= CH_CR . "Version : " . $regelsArr['module'] . $regelsArr['versie'] . CH_CR; } if (strlen($regelsArr['search']) > 1) { $pdf_text .= CH_CR . "Selection : " . $regelsArr['search']; } $pdf_text .= CH_CR . $regelsArr['filename_pdf']; } //isset( $regelsArr[ 'filename_pdf' ] ) switch ($regelsArr['mode']) { default: // default list