示例#1
0
        echo "PDF URL:{$flightUrl}\n";
        $num++;
        if ($num > $CONF['pdf']['maxflightsPerPrint']) {
            break;
        }
    }
    if ($RUN['remote'] == 'remote') {
        // no real proccess is done here
        echo "END PDF\n";
        exit;
    }
    //do {
    //	$tmpDir=rand(0,10000000);
    //} while (is_dir($CONF['pdf']['tmpPath'].'/'.$tmpDir)) ;
    // print_r($flights);
    $pdfFile = leoPdf::createPDFmulti($flights, $tmpDir);
    // $pdfFile=$tmpDir.'/logbook.pdf';
    if ($pdfFile) {
        echo "<a href='" . $moduleRelPath . '/' . $CONF['pdf']['tmpPathRel'] . '/' . $pdfFile . "' target='_blank'>PDF is ready</a>";
        echo "\n\n" . $moduleRelPath . '/' . $CONF['pdf']['tmpPathRel'] . '/' . $pdfFile;
    } else {
        echo "ERROR: PDF creation failed";
    }
    exit;
}
// Add the limit
$query .= "LIMIT {$startNum}," . $PREFS->itemsPerPage;
// now the real query
$res = $db->sql_query($query);
if ($res <= 0) {
    echo "<H3> Error in query! </H3>\n";
示例#2
0
				$linesNum=count($lines);
				
				for($k=$linesNum-1;$k>0;$k--) {
					if (substr($lines[$k],0,8)=='PDF URL:') {
						$pdfUrls[$k]=substr($lines[$k],8);
					}
					if (substr($lines[$k],0,9)=='START PDF') {
						// echo "Found start of pdf list, breaking <br>";
						break;
					}
				}
				
				//print_r($pdfUrls);
				$tmpDir=md5($_SERVER['REQUEST_URI']);
				 
				$pdfFile=leoPdf::createPDFmulti($pdfUrls,$tmpDir);	
		
				// $pdfFile=$tmpDir.'/logbook.pdf';
				$helperUrl=$CONF['pdf']['helperUrl'];
				if ($helperUrl) { 
					$helperUrl=$helperUrl.'/';
				}	
								
				if ($pdfFile) {				
					echo "<a href='".$helperUrl.$CONF['pdf']['tmpPathRel'].'/'.$pdfFile."' target='_blank'>PDF is ready</a>";
					// echo "\n\n".$moduleRelPath.'/'.$CONF['pdf']['tmpPathRel'].'/'.$pdfFile;
				} else {				
					echo "ERROR: PDF creation failed";
				}
				return;
			}