3 // Put this on the page only once, e.g. print_hidden_script(systypes::sales_order());
5 function print_hidden_script($type_no)
8 include_once($path_to_root . "/includes/types.inc");
13 case systypes::sales_order() :
14 $action = "$path_to_root/reporting/rep109.php";
16 'PARAM_0' => 0, // from - these values are updated in print_document_link()
18 'PARAM_2' => "", // currency
19 'PARAM_3' => "", // bank account
20 'PARAM_4' => 0, // email
21 'PARAM_5' => 0, // quote
22 'PARAM_6' => ""); // comments
24 case systypes::cust_dispatch() :
25 $action = "$path_to_root/reporting/rep110.php";
27 'PARAM_0' => 0, // from - these values are updated in print_document_link()
29 'PARAM_2' => 0, // email
30 'PARAM_3' => ""); // comments
32 case 10 : // Sales Invoice
33 case 11 : // Customer Credit Note
34 $action = "$path_to_root/reporting/rep107.php";
36 'PARAM_0' => 0, // from - these values are updated in print_document_link()
38 'PARAM_2' => "", // currency
39 'PARAM_3' => "", // bank account
40 'PARAM_4' => 0, // email
41 'PARAM_5' => "", // paylink
42 'PARAM_6' => ""); // comments
45 $action = "$path_to_root/reporting/rep209.php";
47 'PARAM_0' => 0, // from - these values are updated in print_document_link()
49 'PARAM_2' => "", // currency
50 'PARAM_3' => "", // bank account
51 'PARAM_4' => 0, // email
52 'PARAM_5' => ""); // comments
55 $st = "<form method='post' name='pdf_form' action='$action'>";
56 foreach ($ar as $key => $value)
58 $st .= "<input type='hidden' name='$key' value='$value' />";
61 $st .= "<script type='text/javascript'>
63 function printDocument(docno) {
64 document.pdf_form.PARAM_0.value = document.pdf_form.PARAM_1.value = docno;
65 window.open('','REP_WINDOW','toolbar=no,scrollbar=no,resizable=yes,menubar=no');
66 document.pdf_form.target='REP_WINDOW';
67 document.pdf_form.submit();
75 // Ex. label_cell(print_document_link($myrow['order_no'], _("Print")));
76 // or display_note(print_document_link($order_no, _("Print this order")));
78 // button("button", _("Print this order"), print_document_link($order_no, "", false))";
79 // or if a button inside a TD
80 // button_cell("button", _("Print this order"), print_document_link($order_no, "", false))";
82 function print_document_link($doc_no, $link_text, $link=true)
85 return "<a href=\"javascript:printDocument('$doc_no');\">$link_text</a>";
87 return "javascript:printDocument('$doc_no');";