$(document).ready(function() {
  var token = $('body').data('token');

  $('.js-btn-filter').on('click', function() {
    url = 'index.php?route=report/customer_online&token=' + token;

    var filter_customer = $("input[name='filter_customer']").attr('value');

    if (filter_customer) {
      url += '&filter_customer=' + encodeURIComponent(filter_customer);
    }

    var filter_ip = $("input[name='filter_ip']").attr('value');

    if (filter_ip) {
      url += '&filter_ip=' + encodeURIComponent(filter_ip);
    }

    location = url;
  });
});
