예제 #1
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;
			}
예제 #2
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";
예제 #3
0
if ( $RUN['view']=='print' && $RUN['view0']!='print0'  ) {
	if ($op=="competition" || $op=="comp" || $op=="stat_flights" || $op=='pilot_profile_stats') {
		
		if ($RUN['remote']=='remote') {
			$url="http://".$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"].'0';
			echo "START PDF\n";
			echo "PDF URL:$url\n";	
			echo "END PDF\n";
			//echo "Will make pdf out of $url<BR>";			
		} else {
			require_once dirname(__FILE__)."/CL_pdf.php";
			$url="http://".$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"].'0';
			echo "Wil make pdf out of $url<BR>";
			
			$pdfFile=leoPdf::createPDF($url,md5($url));
			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;
	}
}
	
if ($op=="index_full") {
	require $LeoCodeBase."/GUI_index_full.php";