customer filter with card no

This commit is contained in:
Myat Zin Wai Maw
2019-04-22 17:24:20 +06:30
parent a74573709a
commit 8f81eb8e4a
3 changed files with 26 additions and 7 deletions

View File

@@ -6,8 +6,13 @@ class Crm::CustomersController < BaseCrmController
# GET /crm/customers.json
def index
filter = params[:filter]
filter_card_no = params[:filter_card_no]
type = params[:type]
if filter.nil?
if filter_card_no==""
@crm_customers = Customer.all
elsif !filter_card_no.nil?
@crm_customers=Customer.where("card_no=?",filter_card_no)
elsif filter.nil? || filter_card_no==""
@crm_customers = Customer.all
else
@crm_customers = Customer.search(filter)

View File

@@ -15,7 +15,7 @@
<div class="card">
<div class="body">
<div class="row p-l-20 p-t-20">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
<%= form_tag crm_customers_path, :id => "filter_form", :method => :get do %>
<div class="row clearfix">
<div class="col-sm-5 col-md-5 col-lg-5">
@@ -32,6 +32,20 @@
</div>
<% end %>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
<%= form_tag crm_customers_path, :method => :get do %>
<div class="row clearfix">
<div class="col-sm-5 col-md-5 col-lg-5">
<input type="text" name="filter_card_no" style="margin-right:10px" placeholder="Search by Card No" id="search" class="form-control">
</div>
<div class="col-sm-4 col-md-4 col-lg-4">
<!-- <div class="col-lg-2 col-md-2 col-sm-2 col-xs-12"> -->
<button type="submit" class="btn btn-sm bg-blue waves-effect">SEARCH BY CARD NO</button>
<!-- </div> -->
</div>
</div>
<%end %>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">

View File

@@ -20,11 +20,11 @@ class ActionController::Base
end
else
# check for license file
if check_license
current_license(ENV["SX_PROVISION_URL"])
else
redirect_to activate_path
end
# if check_license
# current_license(ENV["SX_PROVISION_URL"])
# else
# redirect_to activate_path
# end
end
end