add new file
This commit is contained in:
@@ -5,32 +5,7 @@
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row top-content">
|
||||
<% flash.each do |name, msg| %>
|
||||
<div class="alert alert-danger">
|
||||
<a class="close" data-dismiss="alert">×</a>
|
||||
<%= msg %>
|
||||
</div>
|
||||
<% end %>
|
||||
<br><br>
|
||||
<%= form_tag export_path(:format => :csv),:method => :post do%>
|
||||
<div class="col-lg-4">
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<%= select_tag "client", options_from_collection_for_select(@clients, "id", "name"),:class => 'form-control'%>
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<label><strong>Choose Batch:</strong></label>
|
||||
<select class='selectpicker' id='batch' name='batch[]' multiple= "multiple" >
|
||||
<!--<% @batches.each do |batch| %>
|
||||
<option value="<%= batch.id %>"><%= batch.order_ref %></option>
|
||||
<% end %> -->
|
||||
</select>
|
||||
|
||||
<%= button_tag "Export CSV",:class =>'btn btn-primary btn-sm',:id =>"btnexport" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="row content">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
@@ -68,34 +43,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
client_id=$("#client").val();
|
||||
get_batch(client_id)
|
||||
$('#client').on('change', function() {
|
||||
client_id=$(this).val()
|
||||
get_batch(client_id)
|
||||
});
|
||||
function get_batch(client_id){
|
||||
$('#batch').multiselect('disable');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '<%= get_batch_path %>',
|
||||
dataType: "json",
|
||||
data : {'client_id':client_id },
|
||||
success: function(result){
|
||||
if (result.status){
|
||||
$('#batch').multiselect('enable');
|
||||
$("#batch").empty();
|
||||
$("#batch").append("<option value='all'>ALL</option>")
|
||||
$.each(result.data, function (i, item){
|
||||
$("#batch").append("<option value="+item.id+">"+ item.order_ref +"</option>")
|
||||
});
|
||||
$('#batch').multiselect("refresh");
|
||||
$("#batch").multiselect('rebuild');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@@ -16,25 +16,18 @@
|
||||
<label for="name" class="string optional control-label">Name:</label>
|
||||
<%= f.input :name ,:label =>false,:error => false,:placeholder =>'Please enter client name',input_html: { class: "form-control" } %>
|
||||
<%= f.error :name ,style: 'color: red' %>
|
||||
</div>
|
||||
<div class ="form-group" >
|
||||
<label for="nrc" class="string optional control-label">NRC:</label>
|
||||
<%= f.input :nrc ,:error=>false,:label =>false,:placeholder =>'Please enter client NRC',input_html: { class: "form-control" } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class ="form-group" >
|
||||
<label for="email" class="string optional control-label">Email:</label>
|
||||
<%= f.input :email ,:error=>false,:label =>false ,:placeholder =>'Please enter client email',input_html: { class: "form-control" } %>
|
||||
<%= f.error :email ,style: 'color: red' %>
|
||||
<%= f.input :email ,:error=>false,:label =>false ,:placeholder =>'Please enter client email',input_html: { class: "form-control" } %>
|
||||
</div>
|
||||
<div class ="form-group" >
|
||||
<label for="phone" class="string optional control-label">Phone:</label>
|
||||
<%= f.input :phone,:error=>false,:label =>false,:placeholder =>'Please enter client phone',input_html: { class: "form-control" } %>
|
||||
<%= f.error :phone ,style: 'color: red' %>
|
||||
<%= f.input :phone,:error=>false,:label =>false,:placeholder =>'Please enter client phone',input_html: { class: "form-control" } %>
|
||||
</div>
|
||||
<div class ="form-group" >
|
||||
<label for="address" class="string optional control-label">Address:</label>
|
||||
<%= f.input :address,:error=>false,:label =>false,:placeholder =>'Please enter client address',input_html: { class: "form-control" } %>
|
||||
<%= f.error :address ,style: 'color: red' %>
|
||||
<%= f.input :address,:error=>false,:label =>false,:placeholder =>'Please enter client address',input_html: { class: "form-control" } %>
|
||||
</div>
|
||||
<div class ="form-group" >
|
||||
<label for="product_type" class="string optional control-label">Product Type:</label>
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
<table class="table" style="border-top:none">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Nrc</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Phone</th>
|
||||
<th>Address</th>
|
||||
@@ -31,8 +30,7 @@
|
||||
<tbody>
|
||||
<% @clients.each do |client| %>
|
||||
<tr>
|
||||
<td><%= client.name rescue '' %></td>
|
||||
<td><%= client.nrc rescue '' %></td>
|
||||
<td><%= client.name rescue '' %></td>
|
||||
<td><%= client.email rescue '' %></td>
|
||||
<td><%= client.phone rescue '' %></td>
|
||||
<td><%= client.address rescue '' %></td>
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-4"><strong>Name:</strong></div>
|
||||
<div class="col-lg-8 uppercase"><%= @client.name %></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4"><strong>NRC:</strong></div>
|
||||
<div class="col-lg-8"><%= @client.nrc %></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-4"><strong>Email:</strong></div>
|
||||
<div class="col-lg-8"><%= @client.email %></div>
|
||||
|
||||
@@ -12,14 +12,22 @@
|
||||
<%= link_to "Batches",batches_path, :class => "nav-link" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Issued Batch Item",batch_line_items_path, :class => "nav-link" %>
|
||||
</li>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Batch Line Item</a>
|
||||
<div class="dropdown-menu">
|
||||
|
||||
<%= link_to "List", batch_line_items_path, :class => "dropdown-item" %>
|
||||
<%= link_to "Export CSV", export_path, :class => "dropdown-item" %>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "User",users_path, :class => "nav-link" %>
|
||||
</li>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to "Client",clients_path, :class => "nav-link" %>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="float-xs-right">
|
||||
<ul class="nav navbar-nav right">
|
||||
|
||||
Reference in New Issue
Block a user