From 3ac43c2d26e016ea776a68ba82dce9b7949487bb Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 5 Oct 2021 22:38:24 +0200 Subject: [PATCH] Use POST for delete supplier & customer (#3336) --- application/views/receivings/receiving.php | 22 +++++++++++++--- application/views/sales/register.php | 30 +++++++++++++++++++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index d67c05e5da..ce41f0fb7d 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -133,7 +133,7 @@ ?> 'form-horizontal', 'id'=>'cart_'.$line)); ?> - ');?> +
@@ -276,8 +276,10 @@ ?> -  ' . $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'), - array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_supplier_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier'))); ?> + + $(document).ready(function() { + const redirect = function() { + window.location.href = ""; + }; + + $("#remove_supplier_button").click(function() + { + $.post("", redirect); + }); + + $(".delete_item_button").click(function() { + const item_id = $(this).data('item-id'); + $.post("" + item_id, redirect); + }); + $("#item").autocomplete( { source: '', diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 1f3f97ee8c..4923ff3d30 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -136,8 +136,8 @@ 'form-horizontal', 'id'=>'cart_'.$line)); ?> + '); echo form_hidden('location', $item['item_location']); echo form_input(array('type'=>'hidden', 'name'=>'item_id', 'value'=>$item['item_id'])); ?> @@ -382,8 +382,10 @@ ?> -  ' . $this->lang->line('common_remove').' '.$this->lang->line('customers_customer'), - array('class'=>'btn btn-danger btn-sm', 'id'=>'remove_customer_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('customers_customer'))); ?> + + - '); ?> + @@ -662,6 +664,26 @@