From 19cbf1cb4937423b899c110a020c3399f4e5032e Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Wed, 14 Dec 2011 05:29:11 +0100 Subject: [PATCH] Assistent na nastaveni prirazky je nyni hezci a bezpecnejsi --- assistants/set-margin.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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; } -- 2.30.2