} else { $bulkmailquiet = false; } setcookie("bulkmailquiet", $bulkmailquiet, time() + 60 * 60 * 24 * 90, "/"); $iBulkCode = 0; if ($bulkmailpresort) { $iBulkCode = 1; if (!$bulkmailquiet) { $iBulkCode = 2; } } $bToParents = (array_key_exists("toparents", $_GET) and $_GET["toparents"] == 1); setcookie("toparents", $bToParents, time() + 60 * 60 * 24 * 90, "/"); $bOnlyComplete = $_GET["onlyfull"] == 1; $sFileType = FilterInput($_GET["filetype"], 'char', 4); $aLabelList = unserialize(GenerateLabels($pdf, $mode, $iBulkCode, $bToParents, $bOnlyComplete)); if ($sFileType == "PDF") { header('Pragma: public'); // Needed for IE when using a shared SSL certificate if ($iPDFOutputType == 1) { $pdf->Output("Labels-" . date("Ymd-Gis") . ".pdf", 'D'); } else { $pdf->Output(); } } else { // File Type must be CSV $sCSVOutput = ""; if ($iBulkCode) { $sCSVOutput .= '"ZipBundle",'; } $sCSVOutput .= '"Greeting","Name","Address1","Address2","City","State","Zip"' . "\n";
$sAddress .= "\n" . $sAddress2; } if (!$bOnlyComplete || strlen($sAddress) && strlen($sCity) && strlen($sState) && strlen($sZip)) { $pdf->Add_PDF_Label(sprintf("%s\n%s\n%s, %s %s", $sName, $sAddress, $sCity, $sState, $sZip)); } } } $startcol = FilterInput($_GET["startcol"], 'int'); if ($startcol < 1) { $startcol = 1; } $startrow = FilterInput($_GET["startrow"], 'int'); if ($startrow < 1) { $startrow = 1; } $sLabelType = FilterInput($_GET["labeltype"], 'char', 8); // Standard format $pdf = new PDF_Label($sLabelType, $startcol, $startrow); $pdf->Open(); // Manually add a new page if we're using offsets if ($startcol > 1 || $startrow > 1) { $pdf->AddPage(); } $mode = $_GET["mode"]; $bOnlyComplete = $_GET["onlyfull"] == 1; GenerateLabels($pdf, $mode, $bOnlyComplete); if ($iPDFOutputType == 1) { $pdf->Output("Labels-" . date("Ymd-Gis") . ".pdf", true); } else { $pdf->Output(); }