$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 = "Drawing Schedule"; $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 24); $pdf->SetTextColor(150, 150, 150); $pdf->SetDrawColor(150, 150, 150); $pdf->Cell(0, 10, $sheet_title); $pdf->SetXY(10, 55); $pdf->SetFont($format_font, '', 14); $sheet_subtitle = $proj_num . " " . $proj_name . ", printed " . $current_date; $pdf->Cell(0, 10, $sheet_subtitle, 0, 1, L, 0); $pdf->SetXY(10, 60); $pdf->SetLineWidth(0.5); // And now the list of drawings issued unset($current_drawing); //$sql_drawings = "SELECT * FROM intranet_drawings_issued, intranet_drawings LEFT JOIN intranet_drawings_revision ON revision_drawing = drawing_id WHERE issue_set = $set_id AND issue_drawing = drawing_id ORDER BY drawing_number"; $sql_drawings = "SELECT * FROM intranet_drawings, intranet_drawings_scale, intranet_drawings_paper WHERE drawing_project = {$proj_id} AND drawing_scale = scale_id AND drawing_paper = paper_id order by drawing_number"; $result_drawings = mysql_query($sql_drawings, $conn) or die(mysql_error()); $y = $pdf->GetY() + 10; $pdf->SetY($y); $pdf->SetTextColor(200, 200, 200); $pdf->SetLineWidth(0.3);
$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']; $proj_address_county = $array['proj_address_county']; $proj_address_postcode = $array['proj_address_postcode'];
} $ts_print_title = "Schedule for " . $proj_num . " " . $proj_name . "," . $print_submit_begin . " to " . $print_submit_end; $pdf->SetFont($format_font, '', 12); $pdf->MultiCell(0, 6, $ts_print_title, 0, L, 0); // Printed by, and on... $pdf->SetFont($format_font, '', 12); $pdf->SetTextColor(0, 0, 0); $sql = "SELECT user_name_first, user_name_second FROM intranet_user_details WHERE user_id = {$_COOKIE['user']}"; $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, '', 8); $printed_on = "Generated " . date("r") . " by " . $user_name_first . " " . $user_name_second; $pdf->SetFont($format_font, '', 6); $pdf->Cell(0, 4, $printed_on, 0, 1, L, 0); $pdf->Ln(); $legend = "Cost (Fa) = Factored cost\nCost (Ho) = Hourly cost\nCost (Fa Acc) = Factored accumulative cost\nCost (Ho Acc) = Hourly accumulative cost\n"; $pdf->MultiCell(0, 3, $legend); $pdf->SetFillColor(220, 220, 220); // Begin the array through all users $sql = "SELECT * FROM intranet_user_details, intranet_timesheet LEFT JOIN intranet_timesheet_fees ON ts_project = ts_fee_stage WHERE ts_user = user_id AND ts_project = '{$proj_submit}' AND ts_entry BETWEEN '{$time_submit_begin}' AND '{$time_submit_end}' ORDER BY ts_stage_fee, ts_fee_time_begin"; $result = mysql_query($sql, $conn) or die(mysql_error()); $current_fee_stage = NULL; $running_cost = 0; $current_id = NULL; $stage_total = 0; $hours_total = 0; function StageTotal() { global $pdf;
$pdf->useTemplate($tplidx, 0, 0, 210, 297); $pdf->AddFont($format_font, '', $format_font_2); // Begin creating the page //Page Title $sql_name = "SELECT user_name_first, user_name_second, user_initials FROM intranet_user_details WHERE user_id = {$user_id} LIMIT 1"; $result_name = mysql_query($sql_name, $conn) or die(mysql_error()); $array_name = mysql_fetch_array($result_name); $user_name_first = $array_name['user_name_first']; $user_name_second = $array_name['user_name_second']; $user_initials = $array_name['user_initials']; $sheet_title = "Expenses Claim, " . date("j F Y", time()); $user_name = $user_name_first . " " . $user_name_second . " (" . $user_initials . ")"; $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 16); $pdf->SetTextColor(0); $pdf->Cell(0, 7, $sheet_title, 0, 1); $pdf->Cell(0, 6, $user_name, 0, 1); $pdf->SetFont($format_font, '', 12); $pdf->Cell(0, 6, '', 0, 1); // Columnn Headings $pdf->SetTextColor(150); $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(100, 4, "Description", 0, 0, L, 0); $pdf->Cell(15, 4, "Net.", 0, 0, R, 0); $pdf->Cell(15, 4, "VAT", 0, 0, R, 0); $pdf->Cell(15, 4, "Gross.", 0, 1, R, 0); $pdf->SetTextColor(0, 0, 0); $pdf->SetFont($format_font, '', 9);
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); // Array through the projects and fee stages $bar_width_standard = 130;
// 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); $pdf->Cell(15, 4, "Gross.", 0, 1, R, 0); $pdf->SetTextColor(0, 0, 0);
$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); $pdf->SetFont('freeserif', '', 10); $pdf->setXY(59, 203.3); $pdf->Cell(9, 4, $filter_data['year'], $border, 1, 'C', 1); $pdf->SetFont('freeserif', '', 10); } if (isset($rows)) { $i = 0; $last_row = count($rows) - 1; $total_row = $last_row + 1; // // W3 form // //Control Number $pdf->setXY(46, 18); $pdf->Cell(15, 5, str_pad('0001', 4, 0, STR_PAD_LEFT), $border, 0, 'L');
// 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 = "Expenses Summary, " . date("j F Y", time()); $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); $sheet_subtitle = "For period " . TimeFormat($date_begin) . " to " . TimeFormat($date_end); $pdf->Cell(0, 6, $sheet_subtitle, 0, 1, L, 0); if ($_POST[show_p11d_only] == "1") { $pdf->Cell(0, 6, "Showing P11d Items Only", 0, 1, L, 0); $p11d = " AND ts_expense_p11d = 1 "; } $x = 10; $y = $pdf->GetY() + 10; $pdf->SetY($y); // Columnn Headings $pdf->SetTextColor(220, 220, 220); $pdf->SetFont($format_font, '', 8); $pdf->Cell(10, 4, "ID", 0, 0, L, 0);
$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; $count_rows = 1; $count_columns = 1; $total_cells = $label_g * $label_h; $count = 1; $page_count = 1;
$pdf->SetFont('freeserif', '', 10); $pages = array(1, 2, 4, 5); foreach ($pages as $page) { $pdf->AddPage(); if (isset($tplidx[$page])) { $pdf->useTemplate($tplidx[$page], 0, 0); } if ($show_background == TRUE) { $pdf->SetFont('freeserif', 'B', 24); $pdf->setFillColor(255, 255, 255); if ($page == 1) { $pdf->setXY(Misc::AdjustXY(152, $adjust_x), Misc::AdjustXY(28, $adjust_y)); } elseif (in_array($page, array(2, 4, 5))) { $pdf->setXY(Misc::AdjustXY(151, $adjust_x), Misc::AdjustXY(28, $adjust_y)); } $pdf->Cell(10, 7, date('y', $filter_data['transaction_end_date']), $border, 0, 'C', 1); $pdf->SetFont('freeserif', '', 10); } //Company Info $pdf->setXY(25, 30); $pdf->Cell(65, 5, $current_company->getName(), $border, 0, 'L'); $pdf->setXY(25, 35); $pdf->Cell(65, 5, $current_company->getAddress1() . ' ' . $current_company->getAddress2(), $border, 0, 'L'); $pdf->setXY(25, 40); $pdf->Cell(65, 5, $current_company->getCity() . ', ' . $current_company->getProvince() . ' ' . $current_company->getPostalCode(), $border, 0, 'L'); $pdf->setXY(25, 45); $pdf->Cell(65, 5, $current_company->getWorkPhone(), $border, 0, 'L'); //Payers federal identifcation number $pdf->setXY(17, 63); $pdf->Cell(40, 5, $ein, $border, 0, 'L'); //Recipient identifcation number
$invoice_value_novat_month_all = 0; $invoice_value_vat_month_all = 0; $invoice_value_novat_total_all = 0; $invoice_value_vat_total_all = 0; $thismonth = 0; $thisyear = 0; $invoice_year_novat = 0; $invoice_year_vat = 0; $total_12month_novat = array("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"); $total_12month_vat = array("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"); //Page Title $sheet_title = "Invoice Summary, " . date("j F Y", time()); $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 26); $pdf->SetTextColor(200, 200, 200); $pdf->Cell(0, 10, $sheet_title); $pdf->SetXY(10, 60); // Get the relevant infomation from the Invoice Database $sql_invoice = "SELECT * FROM intranet_timesheet_invoice ORDER BY {$date_type}, invoice_ref"; $result_invoice = mysql_query($sql_invoice, $conn) or die(mysql_error()); while ($array_invoice = mysql_fetch_array($result_invoice)) { $invoice_id = $array_invoice['invoice_id']; $invoice_ref = $array_invoice['invoice_ref']; $invoice_date = $array_invoice['invoice_date']; $invoice_due = $array_invoice['invoice_due']; $invoice_project = $array_invoice['invoice_project']; $invoice_paid = $array_invoice['invoice_paid']; $invoice_account = $array_invoice['invoice_account']; $invoice_month = date("n", $invoice_date); $invoice_year = date("Y", $invoice_date); $invoice_id_print = $invoice_id;
$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 $sql = "SELECT * FROM intranet_projects, intranet_timesheet LEFT JOIN intranet_timesheet_fees ON ts_fee_id = ts_stage_fee WHERE ts_project = proj_id AND ts_user = {$user_id} ORDER BY ts_entry, proj_num, ts_fee_stage "; $result = mysql_query($sql, $conn) or die(mysql_error()); unset($current_day); unset($current_project); while ($array = mysql_fetch_array($result)) { $user_name_first = $array['user_name_first']; $user_name_second = $array['user_name_second']; $proj_id = $array['proj_id']; $proj_num = $array['proj_num']; $proj_name = $array['proj_name']; $ts_entry = TimeFormat($array['ts_entry']); $ts_desc = $array['ts_desc'];
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->SetFont('Helvetica', '', 6);
$set_checked = $array_set['set_checked']; if ($set_checked > 0) { $sql_set_checked = "SELECT user_initials FROM intranet_user_details WHERE user_id = {$set_checked} LIMIT 1"; $result_set_checked = mysql_query($sql_set_checked, $conn) or die(mysql_error()); $array_set_checked = mysql_fetch_array($result_set_checked); $user_checked_initials = $array_set_checked['user_initials']; } else { $user_checked_initials = "None"; } $user_name = $array_set['user_initials']; $sheet_title = "Drawing Issue Sheet"; $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 . ", " . $set_date; $pdf->Cell(0, 10, $sheet_subtitle, 0, 1, L, 0); $pdf->SetXY(10, 70); $pdf->SetDrawColor(0, 0, 0); $pdf->SetFont("Helvetica", 'B', 8); $pdf->Cell(40, 5, "Purpose of Issue", 0, 0, L, 0); $pdf->Cell(30, 5, "Method of Issue", 0, 0, L, 0); $pdf->Cell(30, 5, "Format", 0, 0, L, 0); $pdf->Cell(30, 5, "Issued By", 0, 0, L, 0); $pdf->Cell(30, 5, "Checked By", 0, 0, L, 0); $pdf->Cell(30, 5, "ID", 0, 1, L, 0); $pdf->SetTextColor(0, 0, 0); $pdf->SetLineWidth(0.4);
$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);
$qms_date = date("d M Y", $qms_timestamp); $number = $qms_toc4; if ($_GET[proj_id] != NULL && $qms_text == "[project name]") { $qms_text = ProjectData($_GET[proj_id], $type); } if ($_GET[proj_id] != NULL && substr($qms_text, 0, 1) == "#") { $qms_text = ChecklistDate($_GET[proj_id], $qms_text); } if ($qms_toc4 > 0 && $qms_type == "code") { if ($pdf->GetY() > 270) { $pdf->addPage(); } UpDate($qms_date); $pdf->SetTextColor(180); $pdf->SetFont('Helvetica', '', 5); $pdf->Cell(15, 5, $number, 0, 0, R); $pdf->SetFont('Courier', '', 10); $pdf->SetTextColor(0); $pdf->Cell(150, 2, '', 0, 2, '', 1); $pdf->MultiCell(150, 4.5, $qms_text, 0, '', true); $pdf->SetX(25); $pdf->Cell(150, 2, '', 0, 2, '', 1); $pdf->Cell(0, 3, '', 0, 1); } elseif ($qms_toc4 > 0 && $qms_type == "comp") { if ($pdf->GetY() > 260) { $pdf->addPage(); } UpDate($qms_date); $pdf->SetTextColor(180); $pdf->SetFont('Helvetica', '', 5); $pdf->Cell(15, 5, $number, 0, 0, R);
$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); $pdf->SetXY(10, 80); $pdf->Cell(0, 4, "from");
$project_counter = 1; $page_count = 1; $current_date = TimeFormat(time()); $proj_id = CleanUp($_GET[proj_id]); $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']; $proj_desc = $array_proj['proj_desc']; $sheet_title = "Project Contacts"; $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->SetFont($format_font, '', 12); $pdf->Cell(0, 5, $sheet_date, 0, 1, L, 0); $pdf->SetXY(10, 70); $pdf->SetLineWidth(0.5); $y_current = 80; $x_current = 10; // Project Address $proj_address_1 = $array_proj['proj_address_1']; $proj_address_2 = $array_proj['proj_address_2']; $proj_address_3 = $array_proj['proj_address_3'];
$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); $pdf->SetTextColor(0, 0, 0); $pdf->SetLineWidth(0.3); $pdf->SetFont("Helvetica", 'B', 7);
$contact_address_print = $contact_address_print . "\n" . $contact_address; } 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; } //Invoice Title $pdf->SetXY(10, 45); $pdf->SetFont($format_font, '', 26); $pdf->SetTextColor(200, 200, 200); $pdf->Cell(0, 10, $invoice_ref_print); //Invoice Title $pdf->SetXY(10, 55); $pdf->SetFont($format_font, '', 20); $pdf->SetTextColor(200, 200, 200); $pdf->Cell(0, 10, $invoice_project_print); //Invoice Date $pdf->SetXY(10, 62); $pdf->SetFont($format_font, '', 20); $pdf->SetTextColor(200, 200, 200); $pdf->Cell(0, 10, $invoice_date_print); //Heading Titles Heading $pdf->SetFont($format_font, '', 9); $pdf->SetTextColor(200, 200, 200); $pdf->SetXY(10, 80); $pdf->Cell(0, 4, "from");
$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)) { //Line A $pdf->setXY(173, 69); $pdf->Cell(25, 6, Misc::getBeforeDecimal(Misc::MoneyFormat('0.00', FALSE)), $border, 0, 'R'); $pdf->setXY(198, 69); $pdf->Cell(6, 6, Misc::getAfterDecimal(Misc::MoneyFormat('0.00', FALSE)), $border, 0, 'L'); //State
$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; $next_month = $timestart + 7889184; $prev_month = $_SERVER['HTTP_HOST'] . "/pdf_resourcing.php?timestart={$prev_month}"; $this_month = $_SERVER['HTTP_HOST'] . "/pdf_resourcing.php"; $next_month = $_SERVER['HTTP_HOST'] . "/pdf_resourcing.php?timestart={$next_month}"; $print_date = "Date: " . date("r", time()); $pdf->Cell(25, 4, $print_date, 0, 0, R, 0); $pdf->SetTextColor(200, 200, 200); $pdf->SetDrawColor(200, 200, 200); $pdf->Cell(2.5, 4, '', 0, 0, C, 0); $pdf->Cell(25, 4, 'Previous quarter', 1, 0, C, 0, $prev_month); $pdf->Cell(2.5, 4, '', 0, 0, C, 0); $pdf->Cell(25, 4, 'This quarter', 1, 0, C, 0, $this_month); $pdf->Cell(2.5, 4, '', 0, 0, C, 0);