$amount = 0; if ($item_type = "invoice" && is_numeric($item_id)) { $table_invoice = new Table("cc_invoice", "status,paid_status"); $clause_invoice = "id = " . $item_id; $result = $table_invoice->Get_list($DBHandle, $clause_invoice); if (is_array($result) && $result[0]['status'] == 1 && $result[0]['paid_status'] == 0) { $table_invoice_item = new Table("cc_invoice_item", "COALESCE(SUM(price*(1+(vat/100))),0)"); $clause_invoice_item = "id_invoice = " . $item_id; $result = $table_invoice_item->Get_list($DBHandle, $clause_invoice_item); $amount = $result[0][0]; $static_amount = true; } } $smarty->display('main.tpl'); $HD_Form->create_toppage($form_action); $payment_modules = new payment; ?> <script language="javascript"> function checkamount() { if (document.checkout_amount.amount == "") { alert('Please enter some amount.'); return false; } return true; } </script> <script language="javascript"><!--