if (!has_rights(ACX_INVOICES)) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } getpost_ifset(array('id')); if (empty($id)) { Header("Location: A2B_entity_invoice.php?atmenu=payment§ion=13"); } $invoice = new invoice($id); if ($invoice->getCard() != $_SESSION["card_id"]) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } $items = $invoice->loadItems(); //load customer $DBHandle = DbConnect(); $card_table = new Table('cc_card', '*'); $card_clause = "id = " . $_SESSION["card_id"]; $card_result = $card_table->Get_list($DBHandle, $card_clause, 0); $card = $card_result[0]; if (empty($card)) { echo "Customer doesn't exist or is not correctly defined for this invoice !"; die; } $smarty->display('main.tpl'); //Load invoice conf $invoice_conf_table = new Table('cc_invoice_conf', 'value'); $conf_clause = "key_val = 'company_name'"; $result = $invoice_conf_table->Get_list($DBHandle, $conf_clause, 0);