function latex_docs($db) { $messages = ""; // Instanciate a template object $tpl = new Template("."); $config = GetConfig($db); $tex_dir = $config['uploadDir'] . "/"; InstanciateConfigVars($config, $tpl); // OK, now load the template files $tpl->set_file(array("proceedings" => TPLDIR . "texProceedings.tpl", "latex" => TPLDIR . "latex.tpl", "booklet" => TPLDIR . "texBooklet.tpl")); // Extract the templates $tpl->set_block("latex", "PCMember", "PCMembers"); $tpl->set_var("PCMembers", ""); $messages .= "Now creating the PC committee list..."; // Output a file with the program committee $pclist = parsePC($tpl, "PCMember", $db); $messages .= write_tex($tex_dir, "pc.tex", $pclist); // Abstracts $messages .= "Now creating the list of abstracts..."; $abstracts = parseAbstracts($tpl, "texAbstracts.tpl", $db); $messages .= write_tex($tex_dir, "abstracts.tex", $abstracts); // Program of the conference $messages .= "Now creating the program of the conference..."; $program = parseProgram($tpl, "texProgram.tpl", $db); $messages .= write_tex($tex_dir, "program.tex", $program); // Booklet of abstracts $messages .= "Now creating the booklet of abstracts..."; $tpl->parse("BODY", "booklet"); $contents = $tpl->get_var("BODY"); $messages .= write_tex($tex_dir, "booklet.tex", $contents); // Papers for the proceedings $messages .= "Now creating the list of papers for the proceedings..."; $papers = parsePapers($tpl, "texProcPapers.tpl", $db, $messages); $messages .= write_tex($tex_dir, "papers.tex", $papers); // Output the proceedings $messages .= "Now creating the proceedings..."; $tpl->parse("BODY", "proceedings"); $contents = $tpl->get_var("BODY"); $messages .= write_tex($tex_dir, "proceedings.tex", $contents); // CD ROM $messages .= "Now creating the CD ROM..."; $tpl->set_file(array("CDROM" => TPLDIR . "texCDROM.tpl")); $tpl->parse("BODY", "CDROM"); $contents = $tpl->get_var("BODY"); $messages .= write_tex($tex_dir, "CDROM.tex", $contents); return $messages; }
function ShowInvoice($person, $db, &$tpl, $template) { // Show the invoice $tpl->set_file($template, TPLDIR . $template); $tpl->set_block($template, "ROW_CHOICE", "ROWS_CHOICES"); $tpl->set_block($template, "PAYPAL_PAYMENT"); $tpl->set_block($template, "OTHER_PAYMENT"); $tpl->set_block("PAYPAL_PAYMENT", "PAYPAL_ITEM", "PAYPAL_ITEMS"); $tpl->set_var("ROWS_CHOICES", ""); $tpl->set_var("PAYPAL_ITEMS", ""); // InstantiatePersonVars ($person, $tpl, $db); $config = GetConfig($db); InstanciateConfigVars($config, $tpl); $tpl->set_var("PAYPAL_BUSINESS", $config["paypal_account"]); $tpl->set_var("PAYPAL_CURRENCY", $config["currency"]); $tpl->set_var("REGISTRATION_ID", $person->id); $total = 0.0; $q_invoice = "SELECT c.id_question, question, choice, cost " . " FROM RegQuestion q, RegChoice c, PersonChoice p " . " WHERE q.id=p.id_question AND c.id_question=p.id_question " . " AND c.id_choice=p.id_choice AND p.id_person='{$person->id}'"; $r_invoice = $db->execRequete($q_invoice); while ($l_invoice = $db->objetSuivant($r_invoice)) { $tpl->set_var("REG_QUESTION", $l_invoice->question); $tpl->set_var("REG_CHOICE", $l_invoice->choice); $tpl->set_var("REG_COST", $l_invoice->cost); $tpl->set_var("ITEM_NAME", $l_invoice->question . " - " . $l_invoice->choice); $tpl->set_var("ITEM_ID", $l_invoice->id_question); $tpl->set_var("ITEM_AMOUNT", $l_invoice->cost); $total += $l_invoice->cost; $tpl->parse("ROWS_CHOICES", "ROW_CHOICE", true); $tpl->parse("PAYPAL_ITEMS", "PAYPAL_ITEM", true); } $tpl->set_var("TOTAL_COST", $total); if ($person->payment_mode != PAYPAL) { $tpl->set_var("PAYPAL_PAYMENT", ""); } else { $tpl->set_var("OTHER_PAYMENT", ""); } $tpl->parse("RESULT", $template); return $tpl->get_var("RESULT"); }