$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); $pdf->SetTextColor(0, 0, 0); $pdf->SetLineWidth(0.3);
$pdf->SetTextColor(255, 0, 0); $contact_address_print = "Client Details Required"; } $pdf->MultiCell(45, 4, $contact_address_print, 0, L); $pdf->SetTextColor(0, 0, 0); $y = $pdf->GetY(); $pdf->SetXY(105, 88); $pdf->Cell(0, 4, $invoice_ref); $pdf->SetXY(152.5, 88); $pdf->Cell(0, 4, $invoice_date_print); //if ($invoice_purchase_order != NULL) { $pdf->SetXY(105, 108); $pdf->Cell(0, 4, $invoice_purchase_order); //} $y = $y + 10; $pdf->SetDrawColor(0, 0, 0); $pdf->SetLineWidth(0.1); $pdf->SetXY(40, $y); $pdf->SetFont($format_font, '', 10); $pdf->Cell(150, 6, 'Description of Work Undertaken', 'B', '', '', false); $x = 40; $y = $pdf->GetY() + 7; $pdf->SetXY($x, $y); $invoice_novat_total = 0; $invoice_vat_total = 0; $invoice_novat_total = 0; $invoice_total = 0; $ts_expense_total_vat = 0; $ts_disbursement_total = 0; $grand_total = 0; // Pull the corresponding results from the Invoice Item list
$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($format_font, '', 9); $y = 15; } $pdf->SetY($y); $pdf->SetDrawColor("230"); $pdf->Cell(190, 3, "", "B", 0, "", 0); $y = $y + 3; $pdf->SetXY($x, $y); $ts_expense_id = $array_expense['ts_expense_id']; $ts_expense_value = CashFormat($array_expense['ts_expense_value']); $ts_expense_date = TimeFormatBrief($array_expense['ts_expense_date']); $ts_expense_p11d = $array_expense['ts_expense_p11d']; $ts_expense_notes = $array_expense['ts_expense_notes']; $ts_expense_desc = RemoveShit($array_expense['ts_expense_desc']); $ts_expense_desc = html_entity_decode($ts_expense_desc); $ts_expense_desc = str_replace("\n\n", "\n", $ts_expense_desc); if ($ts_expense_p11d == "1") { $ts_expense_desc = $ts_expense_desc . " (P11d Item)"; } $invoice_ref = $array_expense['invoice_ref'];
$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 = "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);
// . ","; $entry_cost = $ts_cost_factored; $line_cost = "= £" . number_format($entry_cost * $ts_hours, 2); $entry_cost_print = "£" . number_format($entry_cost, 2); $ts_cost_nf_print = "(£" . number_format($ts_cost_nf, 2) . ")"; $view_hours = $ts_hours; // . ","; $running_cost = $running_cost + $ts_cost_factored; $running_cost_nf = $running_cost_nf + $ts_cost_nf; $total_cost_nf = $total_cost_nf + $ts_cost_nf; $stage_total = $stage_total + $ts_cost_factored; $running_cost_print = "£" . number_format($stage_total, 2); $running_cost_nf_print = "(£" . number_format($running_cost_nf, 2) . ")"; $pdf->SetFont($format_font, '', 8); $pdf->SetTextColor(0, 0, 0); $pdf->SetDrawColor(220, 220, 220); $pdf->Cell(0, 1, '', T, 1); $ts_link = $pref_location . "popup_timesheet.php?week=" . BeginWeek($ts_entry) . "&ts_id=" . $ts_id . "&user_view=" . $user_id; $pdf->Cell(20, 4, $entry_day, 0, 0, L, 0, $ts_link); $pdf->Cell(8, 4, $view_hours, 0, 0, R, 0); if ($_POST[separate_pages] != 1) { $pdf->Cell(5, 4, 'hrs', 0, 0, C, 0); $pdf->Cell(15, 4, $entry_cost_print, 0, 0, R, 0); $pdf->Cell(15, 4, $ts_cost_nf_print, 0, 0, R, 0); $pdf->Cell(8, 4, $user_initials, 0, 0, C, 0); $pdf->Cell(20, 4, $running_cost_print, 0, 0, R, 0); $pdf->Cell(20, 4, $running_cost_nf_print, 0, 0, R, 0); } else { if ($view_hours <= 1) { $print_hours = "hour"; } else {
$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); $pdf->SetTextColor(0); $pdf->SetLineWidth(0.5); $pdf->SetDrawColor(100); $pdf->Cell(1, 3, '', 0, 0); $pdf->SetFont('Helvetica', '', 12); $pdf->Cell(149, 15, $qms_text, 1, 1); $pdf->Cell(0, 3, '', 0, 1); } elseif ($qms_toc4 > 0 && $qms_type == "image") { $max_width = 150; $image = "images/" . $qms_text; $image_size = GetImagesize($image); $image_height = $image_size[1]; $image_width = $image_size[0]; $height = $image_height / $image_width * $max_width; if ($pdf->GetY() + $height > 270) { $pdf->addPage(); } UpDate($qms_date);
// 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(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); $y = 15; } $pdf->SetY($y); $pdf->SetDrawColor(0); $pdf->Cell(190, 3, "", "B", 0, "", 0); $y = $y + 3; $pdf->SetXY($x, $y); $ts_expense_id = $array_expense['ts_expense_id']; $ts_expense_value = CashFormat($array_expense['ts_expense_value']); $ts_expense_date = TimeFormatBrief($array_expense['ts_expense_date']); $ts_expense_p11d = $array_expense['ts_expense_p11d']; $ts_expense_notes = $array_expense['ts_expense_notes']; $ts_expense_desc = RemoveShit($array_expense['ts_expense_desc']); $ts_expense_desc = html_entity_decode($ts_expense_desc); $ts_expense_desc = str_replace("\n\n", "\n", $ts_expense_desc); $ts_expense_reimburse = $array_expense['ts_expense_reimburse']; if ($ts_expense_p11d == "1") { $ts_expense_desc = $ts_expense_desc . " (P11d Item)"; }
$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); $pdf->Cell(25, 4, 'Next quarter', 1, 1, C, 0, $next_month); $pdf->SetTextColor(0, 0, 0); $pdf->SetY(50); $pdf->SetFont('Helvetica', 'b', 18); DrawGrid(); // Begin listing the projects //$sql_proj = "SELECT * FROM intranet_projects, intranet_timesheet_fees WHERE ts_fee_project = proj_id AND proj_active = 1 AND proj_fee_track = 1 AND ts_fee_value > 0 ORDER BY proj_num, ts_fee_commence"; $sql_proj = "SELECT * FROM intranet_projects, intranet_timesheet_fees WHERE ts_fee_project = proj_id AND proj_fee_track = 1 AND ts_fee_prospect > 0 AND ts_fee_value > 0 AND (((UNIX_TIMESTAMP(ts_fee_commence) + ts_fee_time_end) > {$capture_start}) OR ((UNIX_TIMESTAMP(ts_datum_commence) + ts_datum_length) > {$capture_start})) AND proj_active = 1 ORDER BY proj_num, ts_fee_commence"; $result_proj = mysql_query($sql_proj, $conn) or die(mysql_error()); $pdf->SetFont('Helvetica', '', 7);