$invoice_states_option = ''; foreach ($lng['invoice']['states'] as $stateid => $statename) { if ((int) $result['state'] <= (int) $stateid) { $invoice_states_option .= makeoption($statename, $stateid, $result['state'], true); } } $contact = htmlentities_array($contact); eval('echo "' . getTemplate('billing/invoices_edit') . '";'); } } } if ($action == 'pdf') { $result = $db->query_first('SELECT * FROM `' . getModeDetails($mode, 'TABLE_BILLING_INVOICES', 'table') . '` WHERE `id` = \'' . $id . '\' '); if ($result['id'] == $id && $id != '0') { $invoice = new pdfInvoice(); if ((int) $result['state'] >= CONST_BILLING_INVOICESTATE_CANCELLED_NO_REINVOICE) { $invoice->cancellation = true; } $invoice->processData($result['xml'], $lng); $invoice->outputBrowser(); } } if ($action == 'reminder') { $result = $db->query_first('SELECT * FROM `' . getModeDetails($mode, 'TABLE_BILLING_INVOICES', 'table') . '` WHERE `id` = \'' . $id . '\' '); if ($result['id'] == $id && $id != '0') { $invoice = new pdfReminder(); $invoice->processData($result['xml'], $lng); $invoice->outputBrowser(); } } }