echo "printing $url"; require_once "CL_job.php"; $jobArgs=array('userID'=>$userID, 'jobType'=>'pdf', 'priority'=>(L_auth::isModerator($userID)?1:0), 'timeCreated'=>gmdate('Y-m-d H:i:s'), 'status'=>0, 'param1'=>$url, 'param2'=>$userEmail, ); $previousJobTime=leoJob::searchJob($jobArgs); if ($previousJobTime) { echo "You have ordered the same PDF on GMT $previousJobTime<BR>"; } else { leoJob::addJob($jobArgs); echo "PDF order has been send<BR><BR>Will send email to $userEmail when the pdf is created<BR><BR>"; } // $res=file_get_contents($url); // echo "#<pre>".$res."</pre>#"; echo "<BR><BR><a href='javascript:closePdfDiv();'>OK</a><br>"; } ?>
for ($k = $linesNum - 1; $k > 0; $k--) { if (substr($lines[$k], 0, 8) == 'PDF URL:') { $pdfUrls[] = 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($url); $pdfFile = leoPdf::createPDFmulti($pdfUrls, $tmpDir); // $pdfFile=$tmpDir.'/logbook.pdf'; $helperUrl = $CONF['pdf']['helperUrl']; if ($helperUrl) { $helperUrl = $helperUrl . '/'; } if ($pdfFile) { $pdfFile = $helperUrl . $CONF['pdf']['tmpPathRel'] . '/' . $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"; } } $mailBody = "PDF File is ready. <a href='{$pdfFile}'>Download it from here</a>\n"; echo "PDF FILE: {$pdfFile}\n"; LeonardoMail::sendMail("Your Leonardo PDF is ready", $mailBody, $userEmail, ''); leoJob::updateJob($job['jobID']); } }