unset($static_column_key, $static_column_val); } } foreach ($filter_data['column_ids'] as $column_key) { $filter_columns[Misc::trimSortPrefix($column_key)] = $columns[$column_key]; } if ($action == 'display_form' or $action == 'print_form') { Debug::Text('Generating PDF: ', __FILE__, __LINE__, __METHOD__, 10); //Get company information $clf = TTnew('CompanyListFactory'); $company_obj = $clf->getById($current_company->getId())->getCurrent(); $border = 0; $pdf = new fpdi(); $pdf->setMargins(5, 5, 5, 5); $pdf->SetAutoPageBreak(FALSE); $pdf->SetFont('freeserif', '', 10); if ($show_background == TRUE) { //Import original Gov't supplied PDF. $pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'w3.pdf'); $tplidx_summary = $pdf->ImportPage(1); } $pdf->AddPage(); if (isset($tplidx_summary)) { $pdf->useTemplate($tplidx_summary, 0, 0); } //Form year if ($show_background == TRUE) { $pdf->SetFont('freeserif', '', 18); $pdf->setFillColor(255, 255, 255); $pdf->setXY(135, 154); $pdf->Cell(20, 7, $filter_data['year'], $border, 1, 'C', 1);
if (isset($lines_arr)) { $lines_arr['total'] = Misc::ArrayAssocSum($lines_arr, NULL, 6); Debug::Arr($lines_arr, 'Lines Array: ', __FILE__, __LINE__, __METHOD__, 10); //Line 8 $p1_line8 = $lines_arr['total']['p1_6'] - 0; } $border = 0; $pdf = new fpdi(); //Import original Gov't supplied PDF. if ($show_background == TRUE) { $pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'f940ez.pdf'); $tplidx = $pdf->ImportPage(1); } $pdf->setMargins(0, 0, 0, 0); $pdf->SetAutoPageBreak(FALSE); $pdf->SetFont('freeserif', '', 10); $pdf->AddPage(); if (isset($tplidx)) { $pdf->useTemplate($tplidx, 0, 0); } $pdf->setXY(40, 39); $pdf->Cell(75, 6, $current_company->getName(), $border, 0, 'L'); $pdf->setXY(157, 39); $pdf->Cell(10, 6, $filter_data['year'], $border, 0, 'R'); $pdf->setXY(122, 47); $pdf->Cell(45, 6, $current_company->getBusinessNumber(), $border, 0, 'R'); $pdf->setXY(40, 56); $pdf->Cell(75, 6, $current_company->getAddress1() . ' ' . $current_company->getAddress2(), $border, 0, 'L'); $pdf->setXY(122, 56); $pdf->Cell(45, 6, $current_company->getCity() . ', ' . $current_company->getProvince() . ' ' . $current_company->getPostalCode(), $border, 0, 'R'); if (isset($lines_arr)) {
header("Location: index2.php"); } // Use FDPI to get the template define('FPDF_FONTPATH', 'fpdf/font/'); require 'fpdf/fpdi.php'; $pdf = new fpdi(); $pagecount = $pdf->setSourceFile("pdf/template.pdf"); $tplidx = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx, 0, 0, 210, 297); $pdf->AddFont($format_font, '', $format_font_2); // Begin creating the page //Page Title $sheet_title = "Verified Expenses, " . date("j F Y, g:i a", $ts_expense_verified); $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 26); $pdf->SetTextColor(200, 200, 200); $pdf->Cell(0, 10, $sheet_title); $pdf->SetXY(10, 55); $pdf->SetFont($format_font, '', 12); // Columnn Headings $pdf->SetTextColor(220, 220, 220); $pdf->SetFont($format_font, '', 8); $pdf->Cell(10, 4, "ID", 0, 0, L, 0); $pdf->Cell(20, 4, "Date", 0, 0, L, 0); $pdf->Cell(15, 4, "Project", 0, 0, L, 0); $pdf->Cell(55, 4, "Description", 0, 0, L, 0); $pdf->Cell(20, 4, "Date Verified", 0, 0, L, 0); $pdf->Cell(25, 4, "Invoice (ID)", 0, 0, L, 0); $pdf->Cell(15, 4, "Net.", 0, 0, R, 0); $pdf->Cell(15, 4, "VAT", 0, 0, R, 0);
$format_bg_b = "220"; $format_ln_r = "220"; $format_ln_g = "220"; $format_ln_b = "220"; $current_date = TimeFormat(time()); $proj_id = CleanUp($_GET[proj_id]); // Begin creating the page //Page Title $sql_proj = "SELECT * FROM intranet_projects WHERE proj_id = {$proj_id} LIMIT 1"; $result_proj = mysql_query($sql_proj, $conn) or die(mysql_error()); $array_proj = mysql_fetch_array($result_proj); $proj_num = $array_proj['proj_num']; $proj_name = $array_proj['proj_name']; $sheet_title = "Project Checklist"; $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 24); $pdf->SetTextColor(0, 0, 0); $pdf->SetDrawColor(0, 0, 0); $pdf->Cell(0, 10, $sheet_title); $pdf->SetXY(10, 55); $pdf->SetFont($format_font, '', 14); $sheet_subtitle = $proj_num . " " . $proj_name; $sheet_date = "Current at " . $current_date; $pdf->Cell(0, 7.5, $sheet_subtitle, 0, 1, L, 0); $pdf->Cell(0, 7.5, $sheet_date, 0, 1, L, 0); $pdf->SetXY(10, 70); $pdf->SetLineWidth(0.5); $sql_checklist = "SELECT * FROM intranet_project_checklist_items LEFT JOIN intranet_project_checklist ON checklist_item = item_id AND checklist_project = {$proj_id} WHERE checklist_required != 1 ORDER BY item_group, item_order, checklist_date DESC, item_name"; $result_checklist = mysql_query($sql_checklist, $conn) or die(mysql_error()); $y = $pdf->GetY() + 10; $pdf->SetY($y);
$user_name_first = $array_project['user_name_first']; $user_name_second = $array_project['user_name_second']; if ($blog_type == "phone") { $blog_type_view = "Telephone Call"; } elseif ($blog_type == "filenote") { $blog_type_view = "File Note"; } elseif ($blog_type == "meeting") { $blog_type_view = "Meeting Note"; } elseif ($blog_type == "email") { $blog_type_view = "Email Message"; } else { $blog_type_view = NULL; $type = 0; } $blog_type_view = $blog_type_view . " - " . $user_name_first . " " . $user_name_second; $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 14); $pdf->SetTextColor(200, 200, 200); $sheet_subtitle = $proj_num . " " . $proj_name . ", " . TimeFormat($blog_date); $pdf->Cell(0, 7.5, $sheet_subtitle, 0, 1, L, 0); $pdf->Cell(0, 7.5, $blog_type_view, 0, 1, L, 0); $pdf->SetFont($format_font, '', 24); $pdf->SetTextColor(150, 150, 150); $pdf->MultiCell(0, 8, $blog_title, 0, L); $pdf->SetXY(40, 85); $pdf->SetFont($format_font, '', 11); $pdf->SetTextColor(0, 0, 0); $pdf->MultiCell(0, 5, $blog_text, 0, L); // and send to output $file_name = $proj_num . "_" . Date("Y", $blog_date) . "-" . Date("m", $blog_date) . "-" . Date("d", $blog_date) . "_" . $blog_type . ".pdf"; $pdf->Output($file_name, I);
} if ($contact_city) { $contact_address_print = $contact_address_print . "\n" . $contact_city; } if ($contact_county) { $contact_address_print = $contact_address_print . "\n" . $contact_county; } if ($contact_postcode) { $contact_address_print = $contact_address_print . "\n" . $contact_postcode; } if ($country_printable_name) { $contact_address_print = $contact_address_print . "\n" . $country_printable_name; } //Invoice Title $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 26); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, $invoice_ref_print); //Invoice Title $pdf->SetXY(10, 55); $pdf->SetFont($format_font, '', 20); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, $invoice_project_print); //Invoice Date $pdf->SetXY(10, 62); $pdf->SetFont($format_font, '', 20); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, $invoice_date_print); //Heading Titles Heading $pdf->SetFont($format_font, '', 9); $pdf->SetTextColor(0, 0, 0);
$y_current = $y_right + 5; } $x_current = 10; $pdf->SetXY($x_current, $y_current); StyleBody(10); $pdf->SetFillColor(220, 220, 220); $pdf->Cell(0, 5, $input, 0, 2, L, true); $pdf->Cell(0, 5, '', 0, 2, L, false); $x_current = 10; $y_current = $pdf->GetY(); } // Begin creating the page $project_counter = 1; $page_count = 1; $pdf->SetY(35); $pdf->SetFont('Helvetica', '', 18); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(0, 10, "Planning Conditions Tracker"); $pdf->SetY(50); $pdf->SetFont('Helvetica', 'b', 18); // Determine name of project $sql = "SELECT * FROM intranet_projects WHERE proj_id = '{$proj_id}'"; $result = mysql_query($sql, $conn) or die(mysql_error()); $array = mysql_fetch_array($result); $proj_num = $array['proj_num']; $proj_name = $array['proj_name']; $proj_desc = $array['proj_desc']; $proj_address_1 = $array['proj_address_1']; $proj_address_2 = $array['proj_address_2']; $proj_address_3 = $array['proj_address_3']; $proj_address_town = $array['proj_address_town'];
$format_font_2 = $settings_pdffont . ".php"; } else { $format_font = "franklingothicbook"; $format_font_2 = "franklingothicbook.php"; } // Use FDPI to get the template define('FPDF_FONTPATH', 'fpdf/font/'); require 'fpdf/fpdi.php'; $pdf = new fpdi(); $pagecount = $pdf->setSourceFile("pdf/template.pdf"); $tplidx = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx, 0, 0, 210, 297); $pdf->AddFont($format_font, '', $format_font_2); $pdf->SetY(50); $pdf->SetFont($format_font, '', 14); // Determine name of project $sql = "SELECT proj_num, proj_name FROM intranet_projects WHERE proj_id = '{$proj_submit}'"; $result = mysql_query($sql, $conn) or die(mysql_error()); $array = mysql_fetch_array($result); $proj_num = $array['proj_num']; $proj_name = $array['proj_name']; $print_submit_begin = date("l, jS F Y", $_POST[submit_begin]); $print_submit_begin = "from " . $print_submit_begin; if ($_POST[submit_end] > 0) { $print_submit_end = $_POST[submit_end]; } else { $print_submit_end = time(); } $print_submit_end = date("l jS F Y", $print_submit_end); if ($_POST[submit_begin] == NULL or $_POST[submit_begin] == 0) {
$s1 = " WHERE qms_toc1 = {$s1} "; } else { unset($s1); } if ($_GET[s2] > 0) { $s2 = intval($_GET[s2]); $section = "Section " . $_GET[s1] . "." . $_GET[s2] . " only - " . $qms_firstpage; $s2 = " AND qms_toc2 = {$s2} "; } else { unset($s2); } $pdf->AddFont($format_font, '', $format_font_2); $pdf->SetXY(10, 175); $pdf->SetTextColor(0, 0, 0); $pdf->SetFillColor(220, 220, 220); $pdf->SetFont('Helvetica', '', 18); $pdf->MultiCell(0, 10, $settings_companyname, 0, L); $pdf->SetFont('Helvetica', 'B', 32); $pdf->MultiCell(0, 20, 'Quality Management System', 0, L); $pdf->SetFont($format_font, '', 14); $printed_date = "Current at " . date("g.ia, jS F Y", time()); $pdf->MultiCell(0, 25, '', 0, L); $pdf->MultiCell(0, 8, $printed_date, 0, L); $pdf->SetLineWidth(0.1); $pdf->SetFont($format_font, '', 11); $width = $pdf->GetStringWidth($printed_date) + 20; if ($s1 != NULL or $s2 != NULL) { $pdf->MultiCell(0, 8, $section, T, L); } $sql = "SELECT * FROM intranet_qms {$s1} {$s2} ORDER BY qms_toc1, qms_toc2, qms_toc3, qms_toc4"; $result = mysql_query($sql, $conn) or die(mysql_error());
//} // Use FDPI to get the template define('FPDF_FONTPATH', 'fpdf/font/'); require 'fpdf/fpdi.php'; $pdf = new fpdi(); $pagecount = $pdf->setSourceFile("pdf/template.pdf"); $tplidx = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx); $pdf->SetAutoPageBreak(0, 1.5); $pdf->AddFont($format_font, '', $format_font_2); // Page headers $project_counter = 1; $page_count = 1; $pdf->SetY(35); $pdf->SetFont('Helvetica', 'b', 24); $pdf->SetTextColor($format_bg_r, $format_bg_g, $format_bg_b); $pdf->Cell(0, 10, "Timesheet Analysis"); $pdf->SetTextColor(0, 0, 0); $pdf->SetY(50); $pdf->SetFont('Helvetica', 'b', 18); $print_title = "Generated " . TimeFormatDetailed(time()); $print_envelope = "Timesheet Datum: " . TimeFormat($settings_timesheetstart); $pdf->SetFillColor(220, 220, 220); $pdf->MultiCell(0, 8, $print_title, 0, L, 0); $pdf->SetFont('Helvetica', 'b', 12); $pdf->MultiCell(0, 5, $print_envelope, 0, L, 0); $pdf->MultiCell(0, 5, $print_profit_text, 0, L, 0); $pdf->Cell(0, 5, '', 0, 2); $pdf->SetFont($format_font, '', 10); $pdf->SetTextColor(0, 0, 0);
if ($import_template == "1") { $pdf->setSourceFile("library/background.pdf"); $tplidx = $pdf->ImportPage(1); } // Now add the first page $pdf->addPage(); if ($import_template == "1") { $pdf->useTemplate($tplidx, 0, 0, 210, 297); } $pdf->AddFont('century', '', 'Century.php'); $pdf->AddFont('franklingothicbook', '', 'franklingothicbook.php'); $pdf->AddFont('gillsans', '', 'gillsans.php'); $pdf->SetMargins(0, 0); $pdf->SetAutoPageBreak("no"); // Create the sheet header $pdf->SetFont("arial", '', $label_j); $label_print_date = $label_title . ", created " . date("jS M y", time()); $label_url = "http://labelstudio.redcitrus.com"; $pdf->SetFontSize(8); $pdf->SetTextColor(190, 190, 190); $pdf->Cell(0, 5, $label_print_date, 0, 1, L, 0, $label_url); $pdf->SetFont($font, '', $label_j); $pdf->SetTextColor(0, 0, 0); $pdf->SetFontSize($label_j); if ($_GET[labeltype] != NULL) { $labeltype = $_GET[labeltype]; } else { $labeltype = 1; } // Begin the array $count_cells = 0;
} // //Figure out state/locality wages/taxes. // $cdlf = new CompanyDeductionListFactory(); $cdlf->getByCompanyIdAndStatusIdAndTypeId($current_company->getId(), array(10, 20), 10); if ($cdlf->getRecordCount() > 0) { foreach ($cdlf as $cd_obj) { $tax_deductions[] = array('id' => $cd_obj->getId(), 'province' => $cd_obj->getProvince(), 'district' => $cd_obj->getDistrict(), 'pay_stub_entry_account_id' => $cd_obj->getPayStubEntryAccount(), 'include' => $cd_obj->getIncludePayStubEntryAccount(), 'exclude' => $cd_obj->getExcludePayStubEntryAccount(), 'user_ids' => $cd_obj->getUser()); } } $border = 0; $adjust_x = 0; $adjust_y = 0; $pdf = new fpdi(); $pdf->SetFont('freeserif', '', 10); if ($show_background == TRUE) { $pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'f1099misc.pdf'); //Import original Gov't supplied PDF. $tplidx[1] = $pdf->ImportPage(1); $tplidx[2] = $pdf->ImportPage(2); $tplidx[3] = $pdf->ImportPage(3); $tplidx[4] = $pdf->ImportPage(4); $tplidx[5] = $pdf->ImportPage(5); $tplidx[6] = $pdf->ImportPage(6); } if (isset($raw_rows)) { $ulf = new UserListFactory(); $x = 0; foreach ($raw_rows as $user_id => $raw_row) { $user_obj = $ulf->getById($user_id)->getCurrent();
$format_font_2 = $settings_pdffont . ".php"; } else { $format_font = "franklingothicbook"; $format_font_2 = "franklingothicbook.php"; } // Use FDPI to get the template define('FPDF_FONTPATH', 'fpdf/font/'); require 'fpdf/fpdi.php'; $pdf = new fpdi(); $pagecount = $pdf->setSourceFile("pdf/template.pdf"); $tplidx = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx, 0, 0, 210, 297); $pdf->AddFont($format_font, '', $format_font_2); $pdf->SetY(50); $pdf->SetFont($format_font, '', 16); // Printed by, and on... $pdf->SetTextColor(180, 180, 180); $ts_print_title = "Timesheets"; $pdf->MultiCell(0, 6, $ts_print_title, 0, L, 0); $sql = "SELECT user_name_first, user_name_second FROM intranet_user_details WHERE user_id = {$user_id}"; $result = mysql_query($sql, $conn) or die(mysql_error()); $array = mysql_fetch_array($result); $user_name_first = $array['user_name_first']; $user_name_second = $array['user_name_second']; $pdf->SetFont($format_font, '', 10); $printed_on = "Generated " . date("r") . " by " . $user_name_first . " " . $user_name_second; $pdf->Cell(0, 10, $printed_on, 0, 1, L, 0); $pdf->SetFillColor(220, 220, 220); $pdf->SetTextColor(0, 0, 0); // Begin the array through all users
$this_type = $this_type_array[2]; if ($pdf->GetStringWidth($drawing_title) > 55) { $drawing_title = substr($drawing_title, 0, 65) . "..."; } $sql_issued = "SELECT issue_id FROM intranet_drawings_issued WHERE issue_drawing = '{$drawing_id}' LIMIT 1"; $result_issued = mysql_query($sql_issued, $conn) or die(mysql_error()); if (mysql_num_rows($result_issued) > 0) { $pdf->SetTextColor(0, 0, 0); } else { $pdf->SetTextColor(150, 150, 150); $not_issued = "*Drawings shown in light grey have not yet been issued."; $drawing_number = $drawing_number . "*"; } $link = $pref_practice . "/public_drawing_issue.php?drawing_id=" . $drawing_id . "&hash=" . md5($drawing_number); if ($current_drawing != $drawing_id) { $pdf->SetFont($format_font, '', 6); $pdf->Cell(20, 4.5, $drawing_number, TBL, 0, L, $fill, $link); $pdf->SetFont($format_font, '', 5); $pdf->Cell(60, 4.5, $drawing_title, TB, 0, L, $fill); // Drawing Issues by date $counter = 0; $count_issues = count($issues_array); while ($counter < $count_issues) { $sql_issues = "SELECT revision_letter FROM intranet_drawings_issued LEFT JOIN intranet_drawings_revision ON issue_revision = revision_id WHERE issue_set = {$issues_array[$counter]} AND issue_drawing = {$drawing_id} LIMIT 1"; $result_issues = mysql_query($sql_issues, $conn) or die(mysql_error()); $array_set = mysql_fetch_array($result_issues); $revision_letter = strtoupper($array_set['revision_letter']); if ($revision_letter == NULL and mysql_num_rows($result_issues) > 0) { $pdf->SetFont('ZapfDingbats', '', 5); $revision_letter = "l"; } else {
$pdf->SetDrawColor($color_array[0], $color_array[1], $color_array[2]); } if ($datum_start < 230 && $datum_start + $duration > 0) { $pdf->Cell($duration, $rowheight, '', T, 1, L, FALSE); } else { $pdf->Cell(0, $rowheight, '', 0, 1, L, FALSE); } $pdf->SetLineWidth(0.2); $pdf->SetX(10); } $array_total = array(); // Header $project_counter = 1; $page_count = 1; $pdf->SetY(10); $pdf->SetFont('Helvetica', 'b', 14); if (date("n", $timestart) < 4) { $quarter = "Q1"; } elseif (date("n", $timestart) < 7) { $quarter = "Q2"; } elseif (date("n", $timestart) < 10) { $quarter = "Q3"; } else { $quarter = "Q4"; } $quarter = $quarter . " " . date("Y", $timestart); $sheet_title = "Project Resourcing, " . $quarter; $pdf->SetTextColor($format_bg_r, $format_bg_g, $format_bg_b); $pdf->Cell(169.5, 10, $sheet_title, 0, 0); $pdf->SetFont('Helvetica', '', 8); $prev_month = $timestart - 7889184;