X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=assistants%2Fset-margin.inc.php;h=76478342298205f5a60f5956eaa917ff359dcc86;hb=5ad14c31c47a7707abb93bee7cab7372a41e65df;hp=90f8e1928edfcf03b48639169e530a5b81194b7b;hpb=8ea27618c55c56d753d76229ce3d04ec74fca791;p=mirrors%2FSokoMan.git diff --git a/assistants/set-margin.inc.php b/assistants/set-margin.inc.php index 90f8e19..7647834 100644 --- a/assistants/set-margin.inc.php +++ b/assistants/set-margin.inc.php @@ -1,14 +1,17 @@ html->form("$URL/2", 'GET', array( + echo $this->html->form("$URL/2", 'POST', array( array('margin','40','text',false,'autofocus','margin (%):'), array(false,'SET-MARGIN','submit') )); break; case 2: - $margin = 1+($_GET['margin']/100); - $this->db->safe_query("UPDATE model SET model_price_out = CEIL(model_price_in * $margin)"); - echo(T('Margin set to').' '.($margin*100-100).'%'); + if(isset($_POST['margin'])) { + $margin = 1+($_POST['margin']/100); + $this->db->safe_query("UPDATE model SET model_price_out = CEIL(model_price_in * $margin)"); + $this->post_redirect_get("$URL_INTERNAL/1", T('Margin set to').' '.($margin*100-100).'%'); + } + $this->post_redirect_get("$URL_INTERNAL/1","Set-margin: No value passed!", true); break; }