function Header212($pdf, $Page_Width, $Left_Margin, $Right_Margin, $Yloc) { $pdf->selectFont('helvetica-Bold'); $FontSize = 10; $YPos = $Yloc; $pdf->SetDrawColor(192, 192, 192); $pdf->SetLineWidth(0.5); $pdf->Line($Left_Margin, $YPos, $Page_Width - $Right_Margin, $YPos); $L1 = $Yloc - 12; $L2 = $Yloc - 24; $L3 = $Yloc - 36; $XPos = $Left_Margin; $YPos = $YLoc - 18; centerText($pdf, $XPos, $XPos + 40, $L2, $FontSize, 'District'); $XPos += 40; centerText($pdf, $XPos, $XPos + 120, $L2, $FontSize, 'Jurisdiction'); $XPos += 120; centerText($pdf, $XPos, $XPos + 40, $L1, $FontSize, 'Monthly'); centerText($pdf, $XPos, $XPos + 40, $L2, $FontSize, 'Man'); centerText($pdf, $XPos, $XPos + 40, $L3, $FontSize, 'Hours'); $XPos += 40; centerText($pdf, $XPos, $XPos + 40, $L1, $FontSize, 'Contrib'); centerText($pdf, $XPos, $XPos + 40, $L2, $FontSize, 'Dollar'); centerText($pdf, $XPos, $XPos + 40, $L3, $FontSize, 'Value'); $XPos += 40; centerText($pdf, $XPos, $XPos + 40, $L1, $FontSize, 'Total #'); centerText($pdf, $XPos, $XPos + 40, $L2, $FontSize, 'ARES'); centerText($pdf, $XPos, $XPos + 40, $L3, $FontSize, 'mbrs'); $XPos += 40; centerText($pdf, $XPos, $XPos + 40, $L2, $FontSize, 'Change'); $XPos += 40; centerText($pdf, $XPos, $XPos + 78, $L1, $FontSize, 'Net'); centerText($pdf, $XPos, $XPos + 39, $L2 - 5, $FontSize, 'Num'); centerText($pdf, $XPos + 39, $XPos + 78, $L2, $FontSize, 'Man'); centerText($pdf, $XPos + 39, $XPos + 78, $L3, $FontSize, 'Hours'); $XPos += 78; centerText($pdf, $XPos, $XPos + 78, $L1, $FontSize, 'Public Service'); centerText($pdf, $XPos, $XPos + 39, $L2 - 5, $FontSize, 'Num'); centerText($pdf, $XPos + 39, $XPos + 78, $L2, $FontSize, 'Man'); centerText($pdf, $XPos + 39, $XPos + 78, $L3, $FontSize, 'Hours'); $XPos += 78; centerText($pdf, $XPos, $XPos + 78, $L1, $FontSize, 'Emergency'); centerText($pdf, $XPos, $XPos + 39, $L2 - 5, $FontSize, 'Num'); centerText($pdf, $XPos + 39, $XPos + 78, $L2, $FontSize, 'Man'); centerText($pdf, $XPos + 39, $XPos + 78, $L3, $FontSize, 'Hours'); $pdf->Line($Left_Margin, $L3 - 3, $Page_Width - $Right_Margin, $L3 - 3); $pdf->Line($Left_Margin, $Yloc, $Left_Margin, $L3 - 3); $pdf->Line($Page_Width - $Right_Margin, $Yloc, $Page_Width - $Right_Margin, $L3 - 3); $pdf->Line($Left_Margin + 40, $Yloc, $Left_Margin + 40, $L3 - 3); $pdf->Line($Left_Margin + 160, $Yloc, $Left_Margin + 160, $L3 - 3); $pdf->Line($Left_Margin + 200, $Yloc, $Left_Margin + 200, $L3 - 3); $pdf->Line($Left_Margin + 240, $Yloc, $Left_Margin + 240, $L3 - 3); $pdf->Line($Left_Margin + 280, $Yloc, $Left_Margin + 280, $L3 - 3); $pdf->Line($Left_Margin + 320, $Yloc, $Left_Margin + 320, $L3 - 3); $pdf->Line($Left_Margin + 399, $Yloc, $Left_Margin + 399, $L3 - 3); $pdf->Line($Left_Margin + 478, $Yloc, $Left_Margin + 478, $L3 - 3); $pdf->Line($Left_Margin + 320, $L1 - 3, $Page_Width - $Right_Margin, $L1 - 3); $pdf->Line($Left_Margin + 359, $L1 - 3, $Left_Margin + 359, $L3 - 3); $pdf->Line($Left_Margin + 438, $L1 - 3, $Left_Margin + 438, $L3 - 3); $pdf->Line($Left_Margin + 517, $L1 - 3, $Left_Margin + 517, $L3 - 3); $pdf->selectFont('helvetica'); }
*/ echo "\n\n==============================================\n\n\n\n\n```\n" . $output . "\n```\n\n"; mkdir(__DIR__ . "/standup-logs"); $filename = __DIR__ . "/standup-logs/log-" . strtolower(date("Y-m-M")) . ".txt"; $date = date("F j, Y"); $time = date("g:i a"); function centerText($text) { $count = (AppTrello::LINE_LENGTH - (strlen($text) + 2)) / 2; $mod = $count % 1; $count = floor($count); $divider = str_repeat("-", $count); $out = $divider . " " . $text . " " . $divider; if ($mod) { $out .= "-"; } return $out; } $dateHeader = centerText($date); $timeHeader = centerText($time); $line = str_repeat("-", AppTrello::LINE_LENGTH); $data = "\n\n{$timeHeader}\n{$line}\n{$dateHeader}\n{$line}\n\n" . $output; $check = "{$line}\n{$dateHeader}\n{$line}"; $currentFile = @file_get_contents($filename); if (stristr($currentFile, $check) === FALSE) { file_put_contents($filename, $data, FILE_APPEND); } else { $parts = explode($check, $currentFile); $data = $parts[0] . " ... UPDATED " . $data; file_put_contents($filename, $data); }