Exemplo n.º 1
0
        $tax_cat_id = NULL;
        if ($_POST['taxCatId'] !== "") {
            $tax_cat_id = $_POST['taxCatId'];
        }
        $custTax = new \Pasteque\CustTaxCat($_POST['label'], $tax_cat_id);
        $id = \Pasteque\CustTaxCatsService::create($custTax);
        if ($id !== FALSE) {
            $message = \i18n("Tax saved. <a href=\"%s\">Go to the tax page</a>.", PLUGIN_NAME, \Pasteque\get_module_url_action(PLUGIN_NAME, 'cust_tax_edit', array('id' => $id)));
        } else {
            $error = \i18n("Unable to save changes");
        }
    }
}
$custTax = NULL;
if (isset($_GET['id'])) {
    $custTax = \Pasteque\CustTaxCatsService::get($_GET['id']);
}
?>
<h1><?php 
\pi18n("Edit a customer tax", PLUGIN_NAME);
?>
</h1>

<?php 
\Pasteque\tpl_msg_box($message, $error);
?>

<form class="edit" action="<?php 
echo \Pasteque\get_current_url();
?>
" method="post">