Skip to content

Commit

Permalink
Use POST for delete supplier & customer (#3336)
Browse files Browse the repository at this point in the history
  • Loading branch information
jekkos committed Oct 5, 2021
1 parent 329f177 commit 5c37da0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions application/views/receivings/receiving.php
Expand Up @@ -276,8 +276,10 @@
?>
</table>

<?php echo anchor($controller_name."/remove_supplier", '<span class="glyphicon glyphicon-remove">&nbsp</span>' . $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'))); ?>
<button class="btn btn-danger btn-sm" id="remove_supplier_button" title="<?php echo $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier')?>">
<span class="glyphicon glyphicon-remove">&nbsp</span><? echo $this->lang->line('common_remove').' '.$this->lang->line('suppliers_supplier') ?>
</button>

<?php
}
else
Expand Down Expand Up @@ -402,6 +404,13 @@
<script type="text/javascript">
$(document).ready(function()
{
$("#remove_supplier_button").click(function() {
$.post("<?php echo site_url('receivings/remove_supplier'); ?>", function() {
window.location.href = "<?php echo site_url('receivings'); ?>";
});

});

$("#item").autocomplete(
{
source: '<?php echo site_url($controller_name."/stock_item_search"); ?>',
Expand Down
13 changes: 11 additions & 2 deletions application/views/sales/register.php
Expand Up @@ -382,8 +382,10 @@
?>
</table>

<?php echo anchor($controller_name."/remove_customer", '<span class="glyphicon glyphicon-remove">&nbsp</span>' . $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'))); ?>
<button class="btn btn-danger btn-sm" id="remove_customer_button" title="<?php echo $this->lang->line('common_remove').' '.$this->lang->line('customers_customer')?>">
<span class="glyphicon glyphicon-remove">&nbsp</span><? echo $this->lang->line('common_remove').' '.$this->lang->line('customers_customer') ?>
</button>

<?php
}
else
Expand Down Expand Up @@ -662,6 +664,13 @@
<script type="text/javascript">
$(document).ready(function()
{
$("#remove_customer_button").click(function() {
$.post("<?php echo site_url('sales/remove_customer'); ?>", function() {
window.location.href = "<?php echo site_url('sales'); ?>";
});

});

$("input[name='item_number']").change(function() {
var item_id = $(this).parents('tr').find("input[name='item_id']").val();
var item_number = $(this).val();
Expand Down

0 comments on commit 5c37da0

Please sign in to comment.