275 lines
12 KiB
Plaintext
Executable File
275 lines
12 KiB
Plaintext
Executable File
<!-- Search Bar -->
|
|
<!-- <div class="search-bar">
|
|
<div class="search-icon">
|
|
<i class="material-icons">search</i>
|
|
</div>
|
|
<input type="text" placeholder="START TYPING...">
|
|
<div class="close-search">
|
|
<i class="material-icons">close</i>
|
|
</div>
|
|
</div> -->
|
|
<!-- #END# Search Bar -->
|
|
<!-- Top Bar -->
|
|
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
|
<% display_none = (food_court && current_user.role == 'cashier') ? 'd-none' : '' %>
|
|
<%if !request.path_info.include?('second_display') %>
|
|
<nav class="navbar">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<!-- <a href="javascript:void(0);" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> -->
|
|
<%if current_login_employee.role !="waiter" %>
|
|
<a href="javascript:void(0);" class="bars"></a>
|
|
<a class="navbar-brand mbl_view" href="<%= root_path %>" style="margin-left: 20px;">
|
|
<% else %>
|
|
<a class="navbar-brand m-0 mbl_view" href="<%= root_path %>">
|
|
<%end%>
|
|
<img src="<%= asset_path('SX-Logo-small.png') %>" width="40" height="40" alt="Logo", class="<%= display_none.present? ? 'm-0' : '' %>" />
|
|
<span class="navbar-brand-txt">SX Restaurant</span>
|
|
</a>
|
|
|
|
<span class="navbar-brand m-0">
|
|
<span id="others_payment"></span>
|
|
</span>
|
|
</div>
|
|
<!-- Start Shop Info -->
|
|
<div class="navbar-right m-auto">
|
|
<span class="navbar-brand navbar-brand-txt"><%= current_shop.name %></span>
|
|
</div>
|
|
<% if current_login_employee.role == "cashier" %>
|
|
<div class="mr-4">
|
|
<a class="pt-2" href="<%= settings_out_of_stock_index_path %>">
|
|
<i class="material-icons" style="margin:25%; color:white;">phonelink_erase</i>
|
|
</a>
|
|
</div>
|
|
<%end%>
|
|
<!-- End Shop Info -->
|
|
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
|
<% if !food_court %>
|
|
<div class="navbar-right m-auto">
|
|
<% if order_reservation %>
|
|
<div class="online_order">
|
|
<span class="navbar-brand navbar-brand-txt header-default-color">
|
|
<% if request.user_agent.include? "Mobile" %>
|
|
<img src="/assets/online_order_icon.png" alt="<%= t :order_reservation %>" />
|
|
<% else %>
|
|
<%= t :order_reservation %>
|
|
<% end %>
|
|
</span>
|
|
<span class="order_no"></span>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<!-- Start Quick Access for Cashier -->
|
|
<!-- <div class="navbar-right m-auto">
|
|
<a href="#" class="dropdown-toggle waves-block col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="flase">
|
|
<span><%= t :cashier %></span>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-20 m-b-5">
|
|
<a href="<%= origami_root_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">monetization_on</i>
|
|
<span class="font-15 shopinfo dinein" ><%= t :dine_in %></span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-20 m-b-5">
|
|
<a href="<%= origami_quick_service_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">restaurant_menu</i>
|
|
<span class="font-15 shopinfo quick_service" ><%= t :quick_service %></span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<% if order_reservation %>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-20 m-b-5">
|
|
<a href="<%= origami_order_reservation_index_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">room_service</i>
|
|
<span class="font-15 col-black online_order" ><%= t :order_reservation %></span>
|
|
<span class="order_no"></span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<% end %>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-20 m-b-5">
|
|
<a href="<%= origami_reservation_index_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">book</i>
|
|
<span class="font-15 col-black reservation" ><%= t :reservation %></span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-20 m-b-5">
|
|
<a href="<%= origami_food_court_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">restaurant</i>
|
|
<span class="font-15 col-black foodcourt" ><%= t :foodcourt %></span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
</div> -->
|
|
<!-- End Quick Access for Cashier -->
|
|
|
|
<!-- Start Delete confirrm text !-->
|
|
|
|
<div class="navbar-right toggle_mbl">
|
|
<a href="javascript:void(0);" class="dropdown-toggle waves-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
|
<% if current_login_employee %>
|
|
<span>
|
|
<% if request.user_agent.include? "Mobile" %>
|
|
<img src="/assets/user_icon.png" alt="<%= current_login_employee.name %>" />
|
|
<% else %>
|
|
<%= current_login_employee.name %>
|
|
<% end %>
|
|
</span>
|
|
<% end %>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<%if current_login_employee.role =="administrator" %>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-30 m-b-5">
|
|
<a href="<%= settings_shops_path %>" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
|
<span class="font-15 shopinfo" >Shop Info</span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<% end %>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-30 m-b-5 team_viewer">
|
|
<i class="material-icons font-7 logout_icon shopinfo">touch_app</i>
|
|
<span class="font-15 shopinfo" >Team Viewer</span>
|
|
</p>
|
|
</li>
|
|
<%if current_login_employee.role =="cashier"%>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-30 m-b-5">
|
|
<a href="/origami/second_display" onclick="window.open('/foodcourt/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
|
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
|
<span class="font-15 shopinfo" >Second Display</span>
|
|
</a>
|
|
</p>
|
|
</li>
|
|
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
|
|
<% if food_court && ShiftSale.current_open_shift(current_user)%>
|
|
<li>
|
|
<p class="waves-effect waves-block p-l-30 m-b-5 close_cashier">
|
|
<i class="material-icons font-7 logout_icon">close</i>
|
|
<span class="font-15">Close Cashier</span>
|
|
</p>
|
|
</li>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<li>
|
|
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
|
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
|
<span class="font-18">Logout</span>
|
|
</p> -->
|
|
<p class="delete waves-effect waves-block p-l-30 m-b-5 logout" data-ref="<%= logout_path %>" data-method="delete">
|
|
<i class="material-icons font-7 logout_icon">exit_to_app</i>
|
|
<span class="font-15">Logout</span>
|
|
</p>
|
|
<span class="hidden" id="delete_text">
|
|
<h6>Are you sure you want to Logout ?</h6>
|
|
<!-- <h6>This action can't be undo. </h6> -->
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
<!-- NO Need for color Change
|
|
<a href="javascript:void(0);" class="js-right-sidebar" data-close="true">
|
|
<i class="material-icons">more_vert</i>
|
|
</a> -->
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<%end%>
|
|
<script type="text/javascript">
|
|
$(function(){
|
|
$('.delete').click(function(){
|
|
var method = $(this).attr('data-method');
|
|
var url = $(this).attr('data-ref');
|
|
var html_text = $(this).siblings( "#delete_text" ).html();
|
|
//var page = url.substring(url.lastIndexOf('/') + 1);
|
|
swal({
|
|
title: "Confirmation",
|
|
text: html_text,
|
|
type: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonColor: "#DD6B55",
|
|
html: true
|
|
}, function (isConfirm) {
|
|
if (isConfirm) {
|
|
$.ajax({
|
|
type: method,
|
|
url: url ,
|
|
success: function(data) {
|
|
location.href = data.url;
|
|
}
|
|
});
|
|
} else {
|
|
swal("Cancelled", "Your imaginary file is safe :)", "error");
|
|
}
|
|
});
|
|
});
|
|
|
|
$('.online_order').on('click',function(){
|
|
window.location.href = '/origami/order_reservation';
|
|
});
|
|
|
|
if(parseInt(getOnlineOrderCount()) > 0){
|
|
$('.order_no').addClass("order-badge");
|
|
$('.order_no').html(parseInt(getOnlineOrderCount()));
|
|
}
|
|
|
|
$(".team_viewer").on('click',function(){
|
|
// /opt/teamviewer/tv_bin/script/teamviewer
|
|
$.ajax({
|
|
type: "POST",
|
|
data: {},
|
|
dataType: 'json',
|
|
url: "/run_teamviewer",
|
|
success: function(data){
|
|
if(!data.status){
|
|
window.open('https://www.teamviewer.com', '_blank');
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
});
|
|
$('.close_cashier').on('click',function(e){
|
|
e.preventDefault(); // Prevent the href from redirecting directly
|
|
var linkURL = '/foodcourt/shift/cashier/close';
|
|
var count = ''
|
|
var text = ''
|
|
$.ajax({
|
|
url: '/foodcourt/current_shift_order_count',
|
|
method: 'get',
|
|
success: function(data) {
|
|
count = JSON.stringify(data)
|
|
console.log(count)
|
|
if (count > 0) {
|
|
text = "<h5><span style=\"color: #CC0000\"> We have "+count+" pending orders and sales</span> </h5>.<br>Are you sure you want to close cashier? ";
|
|
}else{
|
|
text = "Are you sure you want to close cashier?";
|
|
}
|
|
swal({
|
|
title: "Alert!",
|
|
text: text,
|
|
type: "warning",
|
|
showCancelButton: true,
|
|
html: true
|
|
}, function() {
|
|
window.location.href = linkURL;
|
|
});
|
|
}
|
|
})
|
|
})
|
|
</script>
|