$preview = true; } else { $preview = false; } if (!count($warning)) { $invoice = new invoice(); } if (!count($warning) && $preview) { if (!$invoice->doDaChecking($TMP_invoice_extra_content['invoice_time_due'], $TMP_invoice_extra_content['invoice_time'], $TMP_invoice_content, $TMP_invoice_extra_content)) { if ($invoice->error_code != '100') { require "include/invoice_menu.php"; echo '<h1>Opprett faktura - feilmelding</h1>' . chr(10); echo 'Problemer med faktura. Vennligst ta kontakt.'; echo '<br><br>'; echo 'Feilmelding:<br>'; echo $invoice->error(); exit; } else { $error_msg = $invoice->error(); $error = $invoice->inndata_error; // array $preview = false; } } } elseif (!count($warning)) { if (!$invoice->create($TMP_invoice_extra_content['invoice_time_due'], $TMP_invoice_extra_content['invoice_time'], $TMP_invoice_content, $TMP_invoice_extra_content)) { if ($invoice->error_code != '100') { require "include/invoice_menu.php"; echo '<h1>Opprett faktura - feilmelding</h1>' . chr(10); echo 'Problemer med faktura. Vennligst ta kontakt.'; echo '<br><br>';
$return2 = 'returnToInvoice'; } else { $return = 'invoice_payed_not.php'; $return2 = ''; } if ($invoice->invoice_payed == '1') { echo 'Allerede registert som betalt.'; exit; } if (isset($_GET['reg_payment']) && isset($_POST['payment_amount']) && isset($_POST['payment_time'])) { if (isset($_POST['payment_comment'])) { $payment_comment = $_POST['payment_comment']; } if (!$invoice->register_payment($_POST['payment_time'], $_POST['payment_amount'], $payment_comment)) { echo 'Problemer med å registere betalingen.<br><br>'; echo '<b>Feilmelding:</b><br>' . $invoice->error(); exit; } header('Location: ' . $return); exit; } $section = 'payed_not'; require "include/invoice_menu.php"; $smarty = new Smarty(); templateAssignInvoice('smarty', $invoice); templateAssignSystemvars('smarty'); $smarty->assign('return', $return); $smarty->assign('return2', $return2); $smarty->display('file:invoice_payment.tpl'); /* require "topp.php";