getData($data['courseId'], $data['sessionId']); $termsAndConditions = $termsAndConditions['content']; $termsAndConditions = $plugin->renderTemplateString($termsAndConditions, $data); $tpl = new Template($plugin->get_lang('Terms')); $tpl->assign('session', $data['session']); $tpl->assign('student', $data['student']); $tpl->assign('sessionId', $data['sessionId']); $tpl->assign('termsContent', $termsAndConditions); $termsAndConditions = $tpl->fetch('/advanced_subscription/views/terms_and_conditions_to_pdf.tpl'); $pdf = new PDF(); $filename = 'terms'.sha1(rand(0, 99999)); $pdf->content_to_pdf($termsAndConditions, null, $filename, null, 'F'); $fileDir = api_get_path(WEB_ARCHIVE_PATH).$filename.'.pdf'; echo '
', print_r($fileDir, 1), ''; } }