finished customer and join membership in crm
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
|
||||
<% @i = 0 %>
|
||||
<% @booking.each do |booking| %>
|
||||
<% if booking.booking_status == "assign" %>
|
||||
<% if booking.booking_status == "new" %>
|
||||
<div class="card">
|
||||
<div class="card-block booking_click" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;">
|
||||
<div class="card-block booking_click" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;" data="<%= booking.id %>">
|
||||
<h4 class="card-title">
|
||||
<%= @i += 1 %> . <%= booking.dining_facility.name %>
|
||||
- <%= booking.id %>
|
||||
@@ -36,14 +36,20 @@
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
|
||||
|
||||
$(".booking_click").on("click", function(){
|
||||
$(".summary-items tbody tr").remove();
|
||||
$("#cancel").removeAttr("disabled");
|
||||
$("#assign").removeAttr("disabled");
|
||||
var url = $(this).attr('data-ref');alert(url);
|
||||
$("#crm_print").removeAttr("disabled");
|
||||
$("#crm_print").attr('data',$(this).attr('data'));
|
||||
var url = $(this).attr('data-ref');
|
||||
show_details(url);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.assign').click(function(e){
|
||||
var booking_id = $(this).val()
|
||||
var type = $(this).attr("data-type")
|
||||
@@ -58,6 +64,8 @@ $(function(){
|
||||
update_booking(booking_id,type)
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function show_details(url_item){
|
||||
@@ -97,7 +105,7 @@ function show_details(url_item){
|
||||
function update_booking(booking_id,type) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "crm/update_booking/" ,
|
||||
url: "update_booking/" ,
|
||||
data: {booking_id:booking_id,type:type},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
|
||||
@@ -92,10 +92,37 @@
|
||||
<!-- Column Three--->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print</button>
|
||||
<button type="button" id="crm_print" value="" class="btn btn-primary btn-lg btn-block" disabled="disabled">
|
||||
Print
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Print <br/>Order<br/>Summary</button>
|
||||
<button id="assign" value="" disabled="disabled" data-type="assign" class="btn assign btn-primary btn-lg btn-block">ASSIGN</button>
|
||||
<button id="cancel" value="" disabled="disabled" data-type="cancel" class="btn btn-danger cancel btn-lg btn-block">CANCLE</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
$('#crm_print').click(function() {
|
||||
var id = $(this).attr('data');
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "print/"+id ,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
/*if(data.status == true && data.type == "cancel")
|
||||
{
|
||||
alert('Booking has canceled!');
|
||||
}else{
|
||||
alert('Booking has completed!');
|
||||
}
|
||||
location.reload();*/
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user