diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 8be38df9f..957167f26 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -37,7 +37,7 @@ class Employees extends Persons */ public function suggest() { - $suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->post('term'), TRUE)); + $suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->get('term'), TRUE)); echo json_encode($suggestions); } diff --git a/application/views/sales/form.php b/application/views/sales/form.php index 40383b8e7..f7eeb52bf 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -160,14 +160,13 @@ $(document).ready(function() load->view('partial/datepicker_locale'); ?> - var fill_value_customer = function(event, ui) { + var fill_value_customer = function(event, ui) { event.preventDefault(); $("input[name='customer_id']").val(ui.item.value); $("input[name='customer_name']").val(ui.item.label); }; - $('#customer_name').autocomplete( - { + $('#customer_name').autocomplete( { source: "", minChars: 0, delay: 15, @@ -177,14 +176,13 @@ $(document).ready(function() focus: fill_value_customer }); - var fill_value_employee = function(event, ui) { + var fill_value_employee = function(event, ui) { event.preventDefault(); $("input[name='employee_id']").val(ui.item.value); $("input[name='employee_name']").val(ui.item.label); }; - $('#employee_name').autocomplete( - { + $('#employee_name').autocomplete( { source: "", minChars: 0, delay: 15, @@ -204,8 +202,7 @@ $(document).ready(function() table_support.do_restore("", ); }); - $('#sales_edit_form').validate($.extend( - { + $('#sales_edit_form').validate($.extend( { submitHandler: function(form) { $(form).ajaxSubmit({ success: function(response)