| Server IP : 162.214.74.102 / Your IP : 216.73.217.111 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_projetos/sopizzas/assets/js/ |
Upload File : |
var webroot = "http://www.enotoneinteractive.com/dine2you/",
cntrlUrl = webroot + "dashboard/";
/*var webroot = "http://localhost/FosCI/",
cntrlUrl = webroot + "dashboard/";*/
$(document).ready(function() {
//LiveFeed();
});
function LiveFeed()
{
url=cntrlUrl+'live_feed/';
$.ajax({
type: "post",
url: url,
cache: false,
dataType: 'json',
success: function(feeddata){
//OVERVIEW : User
document.getElementById("TotalUsers").innerHTML = feeddata.TotalUsers;
document.getElementById("TotalUsers2").innerHTML = feeddata.TotalUsers;
document.getElementById("ActiveUsers").innerHTML = feeddata.ActiveUsers;
document.getElementById("InactiveUsers").innerHTML = feeddata.InactiveUsers;
document.getElementById("UserJoinedThisWeek").innerHTML = feeddata.UserJoinedThisWeek;
document.getElementById("UserJoinedThisMonth").innerHTML = feeddata.UserJoinedThisMonth;
document.getElementById("UserJoinedThisYear").innerHTML = feeddata.UserJoinedThisYear;
//***********************************************************************************
//OVERVIEW : Restaurants
document.getElementById("TotalOrder").innerHTML = feeddata.TotalOrder;
document.getElementById("TotalMerchant").innerHTML = feeddata.TotalMerchant;
document.getElementById("TotalMerchant2").innerHTML = feeddata.TotalMerchant;
document.getElementById("ActiveRestaurants").innerHTML = feeddata.ActiveRestaurants;
document.getElementById("InactiveRestaurants").innerHTML = feeddata.InactiveRestaurants;
document.getElementById("PendingRestaurants").innerHTML = feeddata.PendingRestaurants;
document.getElementById("RestaurantsJoinedWeek").innerHTML = feeddata.RestaurantsJoinedWeek;
document.getElementById("RestaurantsJoinedMonth").innerHTML = feeddata.RestaurantsJoinedMonth;
document.getElementById("RestaurantsJoinedYear").innerHTML = feeddata.RestaurantsJoinedYear;
//************************************************************************************
//#Dashboard Order List
document.getElementById("DashboardLastOrders").innerHTML = feeddata.DashboardLastOrders;
document.getElementById("DashboardtopDiscountRestaurants").innerHTML = feeddata.DashboardtopDiscountRestaurants;
//Order Statistics - today
document.getElementById("OrdersToday").innerHTML = feeddata.OrdersToday;
document.getElementById("SalesToday").innerHTML = "$"+feeddata.SalesToday;
document.getElementById("DeliveredOrderToday").innerHTML = feeddata.DeliveredOrderToday;
document.getElementById("PendingOrderToday").innerHTML = feeddata.PendingOrderToday;
//Order Statistics - week
document.getElementById("OrdersWeek").innerHTML = feeddata.OrdersWeek;
document.getElementById("SalesWeek").innerHTML = "$"+feeddata.SalesWeek;
document.getElementById("DeliveredOrderWeek").innerHTML = feeddata.DeliveredOrderWeek;
document.getElementById("PendingOrderWeek").innerHTML = feeddata.PendingOrderWeek;
//Order Statistics - month
document.getElementById("OrdersMonth").innerHTML = feeddata.OrdersMonth;
document.getElementById("SalesMonth").innerHTML = "$"+feeddata.SalesMonth;
document.getElementById("DeliveredOrderMonth").innerHTML = feeddata.DeliveredOrderMonth;
document.getElementById("PendingOrderMonth").innerHTML = feeddata.PendingOrderMonth;
//Order Statistics - year
document.getElementById("OrdersYear").innerHTML = feeddata.OrdersYear;
document.getElementById("SalesYear").innerHTML = "$"+feeddata.SalesYear;
document.getElementById("DeliveredOrderYear").innerHTML = feeddata.DeliveredOrderYear;
document.getElementById("PendingOrderYear").innerHTML = feeddata.PendingOrderYear;
},error:function(jqXHR,exception){if (jqXHR.status === 0) {
msg = 'Not connected.\n Verify Network.';
} else if (jqXHR.status == 404) {
msg = 'Requested page not found. [404]';
} else if (jqXHR.status == 500) {
msg = 'Internal Server Error [500].';
} else if (exception === 'parsererror') {
msg = 'Requested JSON parse failed.';
} else if (exception === 'timeout') {
msg = 'Time out error.';
} else if (exception === 'abort') {
msg = 'Ajax request aborted.';
} else {
msg = 'Uncaught Error.\n' + jqXHR.responseText;
}
alert(msg);
}
});
}
function only_num(e,f)
{
if(window.e<8 ||(window.e>8 && window.e<46)||(window.e>46 && window.e<48)||window.e>57)
{
return false;
}
else if(e.which<8 ||(e.which>8 && e.which<46)||(e.which>46 && e.which<48)||e.which>57)
{
return false;
}
}
$(function(){
$("#myonoffswitchDine").change(function(){
test = $("#myonoffswitchDine").val();
$(".dine2you").toggleClass('hide');
});
})
function ChangeActiveInactive(table,status,id, myThis)
{
url=cntrlUrl+'ChangeActiveInactive/';
$.ajax({
method: "POST",
url: url,
data: { table: table,id: id,status: status},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
$(myThis).parents('td').find('button').removeClass('active');
$(myThis).addClass('active');
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}
function ChangePopuler(table,status,id, myThis)
{
url=cntrlUrl+'ChangePopuler/';
$.ajax({
method: "POST",
url: url,
data: { table: table,id: id,status: status},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
$(myThis).parents('td').find('button').removeClass('active');
$(myThis).addClass('active');
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}
function DeleteNow(table,id)
{
url=cntrlUrl+'DeleteNow/';
$.ajax({
method: "POST",
url: url,
data: { table: table,id: id},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
$('#'+id+'_row').hide('slow');
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}
$(document).ready(function() {
//resetcheckbox();
$('#selecctall').click(function(event) { //on click
if (this.checked) { // check select status
$('.minimal').each(function() { //loop through each checkbox
this.checked = true; //select all checkboxes with class "checkbox1"
});
} else {
$('.minimal').each(function() { //loop through each checkbox
this.checked = false; //deselect all checkboxes with class "checkbox1"
});
}
});
$("#del_all").on('click', function(e) {
e.preventDefault();
var checkValues = $('.checkbox1:checked').map(function()
{
return $(this).val();
}).get();
console.log(checkValues);
$.each( checkValues, function( i, val ) {
$("#"+val).remove();
});
// return false;
$.ajax({
url: '<?php echo base_url() ?>home/delete',
type: 'post',
data: 'ids=' + checkValues
}).done(function(data) {
$("#respose").html(data);
$('#selecctall').attr('checked', false);
});
});
$(".addrecord").click(function(e) {
e.preventDefault();
var url = $(this).attr('href');
$.ajax({
type: 'POST',
url: url
}).done(function() {
window.location.reload();
});
});
function resetcheckbox(){
$('input:checkbox').each(function() { //loop through each checkbox
this.checked = false; //deselect all checkboxes with class "checkbox1"
});
}
});
function GetCityByState(state_id)
{
url=cntrlUrl+'GetCityByState/';
$.ajax({
type: "post",
url: url,
cache: false,
data:'state_id=' + state_id,
success: function(data){
document.getElementById("CityList").innerHTML = data;
}
});
}
function isDecimal(evt) {
evt = (evt) ? evt : window.event;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode == 46 && evt.srcElement.value.split('.').length>1) {
return false;
}
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
return true;
}
function editContent(my_id) {
url=webroot+'contentmanagement/showContent';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
$('#content_title').val(data.ShowPageContent.content_title);
$('#metatagtitle').val(data.ShowPageContent.metatagtitle);
$('#metatagkeyword').val(data.ShowPageContent.metatagkeyword);
$('#metatagdescription').val(data.ShowPageContent.metatagdescription);
//$('#editor2').html(data.ShowPageContent.content);
//CKEDITOR.instances['editor2'].setData(content)
CKEDITOR.instances.editor2.setData(data.ShowPageContent.content);
$('#ContentEditId').val(data.ShowPageContent.content_id);
},
error: function(data) {
alert(error);
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom1").animate({
'top': 0
}, 1000);
}
function update_order_status(orderid,status)
{
//alert(orderid);
url=cntrlUrl+'ChangeOrderStatus/';
$.ajax({
method: "POST",
url: url,
data: { order_id: orderid,order_status: status},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
//$(myThis).parents('td').find('button').removeClass('active');
//$(myThis).addClass('active');
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}
/*Added by Arkaprova 18th July 2016*/
function editState(state_id, statecode, statename) {
document.getElementById('addcbutton').click();
document.getElementById('StateEditId').value = state_id;
document.getElementById('statecode').value = statecode;
document.getElementById('statename').value = statename;
$('button').removeClass('disabled');
}
function editCity(city_id, statecode, cityname) {
document.getElementById('addcbutton').click();
document.getElementById('CityEditId').value = city_id;
document.getElementById('statecode').value = statecode;
document.getElementById('cityname').value = cityname;
$('button').removeClass('disabled');
}
function editCuisine(cuisine_id, cuisine_name, cuisine_photo, cuisine_description) {
document.getElementById('CuisineEditId').value = cuisine_id;
document.getElementById('cuisine_name').value = cuisine_name;
if(cuisine_photo!=''){
$('#uploaded_img').attr('src', webroot+'assets/uploaded_image/cuisine/thumbs/'+cuisine_photo).height(95);
document.getElementById('cuisine_description').value = cuisine_description;
$('#uploaded_img_wrap').show();
}
else {
$('#uploaded_img_wrap').hide();
}
$('button').removeClass('disabled');
var drawerTop = '0px';
$('body').css('overflow', 'hidden');
$("#testPopupBottom").animate({
'top': drawerTop
}, 1000);
}
function editCategory(maincateid, maincatename, status) {
document.getElementById('addcbutton').click();
document.getElementById('CategoryEditId').value = maincateid;
document.getElementById('maincatename').value = maincatename;
$('.CategoryStatusActive').removeClass('active');
$('.CategoryStatusInactive').removeClass('active');
if (status == '0') {
$('.CategoryStatusInactive').addClass('active');
}
else {
$('.CategoryStatusActive').addClass('active');
}
$('button').removeClass('disabled');
}
function ChangeCategoryStatus(myStatus, myThis) {
$(myThis).parents('.btn-group-circle').find('button').removeClass('active');
$(myThis).addClass('active');
$('#CategoryStatus').val(myStatus);
}
function editOffer(offer_id, offer_percentage, offer_price, offer_valid_from, offer_valid_to, restaurant_id) {
$('#addCopen').show('slow');
document.getElementById('OfferEditId').value = offer_id;
//document.getElementById('offer_percentage').value = offer_percentage;
//document.getElementById('offer_price').value = offer_price;
if (offer_percentage > 0) {
document.getElementById('my_offer_amount').value = offer_percentage;
$('#my_offer_per').iCheck('check');
$('#my_offer_type').val('per');
}
else if (offer_price > 0) {
document.getElementById('my_offer_amount').value = offer_price;
$('#my_offer_fix').iCheck('check');
$('#my_offer_type').val('fix');
}
document.getElementById('offer_valid_from').value = offer_valid_from;
document.getElementById('offer_valid_to').value = offer_valid_to;
document.getElementById('restaurant_id').value = restaurant_id;
$('button').removeClass('disabled');
}
function editCustomer(customer_id, customer_name, customer_lastname, customer_buildtype, customer_street, customer_state, customer_city, customer_phone, customer_landline, customer_landmark, customer_addresslabel, customer_email, customer_password) {
document.getElementById('CustomerEditId').value = customer_id;
document.getElementById('customer_name').value = customer_name;
document.getElementById('customer_lastname').value = customer_lastname;
document.getElementById('customer_buildtype').value = customer_buildtype;
document.getElementById('customer_street').value = customer_street;
document.getElementById('StateList').value = customer_state;
GetCityByState(customer_state);
document.getElementById('CityList').value = customer_city;
document.getElementById('customer_phone').value = customer_phone;
document.getElementById('customer_landline').value = customer_landline;
document.getElementById('customer_landmark').value = customer_landmark;
if (customer_addresslabel == "home") {
$('#adrsHome').iCheck('check');
}
else if (customer_addresslabel == "office") {
$('#adrsOffice').iCheck('check');
}
else if (customer_addresslabel == "other") {
$('#adrsOther').iCheck('check');
}
document.getElementById('customer_addresslabel').value = customer_addresslabel;
document.getElementById('customer_email').value = customer_email;
document.getElementById('customer_password').value = customer_password;
var drawerTop = '0px';
$('body').css('overflow', 'hidden');
$("#testPopupBottom").animate({
'top': drawerTop
}, 1000);
$('button').removeClass('disabled');
}
function editZipcode(zipcode_id, statecode, cityid, zipcode, areaname) {
document.getElementById('addcbutton').click();
document.getElementById('ZipcodeEditId').value = zipcode_id;
document.getElementById('StateList').value = statecode;
GetCityByState(statecode);
document.getElementById('CityList').value = cityid;
document.getElementById('zipcode').value = zipcode;
document.getElementById('areaname').value = areaname;
$('button').removeClass('disabled');
}
function viewDriver(driver_id) {
//console.log(data);
url=webroot+'drivermanagement/getDriverData';
$.ajax({
url: url,
type: 'POST',
data: {driver_id: driver_id},
dataType: 'json',
success: function(data) {
if (data) {
document.getElementById('show_driver_first_name').innerHTML = data.driver_first_name;
document.getElementById('show_driver_middle_name').innerHTML = data.driver_middle_name;
document.getElementById('show_driver_last_name').innerHTML = data.driver_last_name;
//document.getElementById('show_driver_dob').innerHTML = data.driver_birth_day+"-"+data.driver_birth_month+"-"+data.driver_birth_year;
document.getElementById('show_driver_dob').innerHTML = data.driver_dob;
document.getElementById('show_driver_mobile_number').innerHTML = data.driver_mobile_number;
document.getElementById('show_driver_device').innerHTML = data.driver_device;
document.getElementById('show_driver_city').innerHTML = data.cityname;
document.getElementById('show_driver_vehicle_type').innerHTML = data.driver_vehicle_type;
document.getElementById('show_driver_vehicle_make').innerHTML = data.driver_vehicle_make;
document.getElementById('show_driver_vehicle_model').innerHTML = data.driver_vehicle_model;
document.getElementById('show_driver_vehicle_year').innerHTML = data.driver_vehicle_year;
$('#show_driver_photo').attr('src', webroot+'assets/uploaded_image/driver/thumbs/'+data.driver_photo);
document.getElementById('show_driver_license_number').innerHTML = data.driver_license_number;
document.getElementById('show_driver_license_plate_number').innerHTML = data.driver_license_plate_number;
document.getElementById('show_driver_license_state').innerHTML = data.statename;
document.getElementById('show_license_doe').innerHTML = data.driver_license_expire_day+"-"+data.driver_license_expire_month+"-"+data.driver_license_expire_year;
document.getElementById('show_driver_insurance_provider').innerHTML = data.driver_insurance_provider;
document.getElementById('show_driver_insurance_number').innerHTML = data.driver_insurance_number;
}
},
error: function(data) {
alert('error');
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom").animate({'top': 0},1000);
}
function editDriver(driver_id) {
//console.log(data);
document.getElementById('DriverEditId').value = driver_id;
url=webroot+'drivermanagement/getDriverData';
$.ajax({
url: url,
type: 'POST',
data: {driver_id: driver_id},
dataType: 'json',
success: function(data) {
if (data) {
document.getElementById('driver_first_name').value = data.driver_first_name;
document.getElementById('driver_middle_name').value = data.driver_middle_name;
document.getElementById('driver_last_name').value = data.driver_last_name;
document.getElementById('driver_dob').value = data.driver_dob;
// document.getElementById('driver_birth_month').value = data.driver_birth_month;
// document.getElementById('driver_birth_day').value = data.driver_birth_day;
// document.getElementById('driver_birth_year').value = data.driver_birth_year;
document.getElementById('driver_mobile_number').value = data.driver_mobile_number;
document.getElementById('driver_device').value = data.driver_device;
document.getElementById('driver_city').value = data.driver_city;
document.getElementById('driver_vehicle_type').value = data.driver_vehicle_type;
document.getElementById('driver_vehicle_make').value = data.driver_vehicle_make;
document.getElementById('driver_vehicle_model').value = data.driver_vehicle_model;
document.getElementById('driver_vehicle_year').value = data.driver_vehicle_year;
document.getElementById('driver_license_first_name').value = data.driver_license_first_name;
document.getElementById('driver_license_last_name').value = data.driver_license_last_name;
document.getElementById('driver_license_middle_name').value = data.driver_license_middle_name;
document.getElementById('driver_license_dob').value = data.driver_license_dob;
// document.getElementById('driver_license_birth_month').value = data.driver_license_birth_month;
// document.getElementById('driver_license_birth_day').value = data.driver_license_birth_day;
// document.getElementById('driver_license_birth_year').value = data.driver_license_birth_year;
document.getElementById('driver_license_number').value = data.driver_license_number;
document.getElementById('driver_license_plate_number').value = data.driver_license_plate_number;
document.getElementById('driver_license_state').value = data.driver_license_state;
document.getElementById('driver_license_expire_dob').value = data.driver_license_expire_dob;
// document.getElementById('driver_license_expire_month').value = data.driver_license_expire_month;
// document.getElementById('driver_license_expire_day').value = data.driver_license_expire_day;
// document.getElementById('driver_license_expire_year').value = data.driver_license_expire_year;
document.getElementById('driver_insurance_provider').value = data.driver_insurance_provider;
document.getElementById('driver_insurance_number').value = data.driver_insurance_number;
if (data.driver_license_photo != '') {
$('#uploaded_license_img').attr('src', webroot+'assets/uploaded_image/driver_license/thumbs/'+data.driver_license_photo).height(95);
$('#uploaded_license_img_wrap').show();
}
if (data.driver_insurance_photo != '') {
$('#uploaded_insurance_img').attr('src', webroot+'assets/uploaded_image/driver_insurance/thumbs/'+data.driver_insurance_photo).height(95);
$('#uploaded_insurance_img_wrap').show();
}
}
},
error: function(data) {
alert('error occurred');
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom1").animate({'top': 0},1000);
}
function editAddon(my_id) {
$('.EditSubAddonsRow').remove();
url=webroot+'addonsmanagement/showEditAddons';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
//$('#testPopupBottom1').html(data);
//console.log(data.EditMainAddOns.restaurant_id);
$('#AddOnEditId').val(data.EditMainAddOns.id);
$('#edit_restaurant_name').val(data.EditMainAddOns.restaurant_id);
$('#edit_category_name').val(data.EditMainAddOns.category_id);
$('#edit_addons_name').val(data.EditMainAddOns.addonsname);
$('#edit_mainaddoncnt').val(data.EditMainAddOns.addonscount);
$('#EditootZ1').append(data.EditAddOnsHtml);
},
error: function(data) {
alert(error);
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom1").animate({
'top': 0
}, 1000);
}
function removeRowMEdit(removeNum) {
jQuery('#adddonsX'+removeNum).remove();
var my_id = removeNum;
url=webroot+'addonsmanagement/deleteAddons';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(data) {
alert(error);
console.log(data);
}
})
}
function fetchCatAddons(catid) {
url = webroot+'menumanagement/fetchCatAddons';
$.ajax({
url: url,
type: 'POST',
data: {catid: catid},
dataType: 'json',
success: function(data) {
console.log(data);
$('#accordion').html(data.myHtml);
$(".panel-show").show();
/*$('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue'
});*/
},
error: function(data) {
alert(data);
console.log(data);
}
})
}
function editMenu(menuid) {
$('.EditMenuRow').remove();
url=webroot+'menumanagement/showEditMenu';
$.ajax({
url: url,
type: 'POST',
data: {menuid: menuid},
dataType: 'json',
success: function(data) {
$('#MenuEditId').val(data.menuDetails.id);
$('#restaurant_name').val(data.menuDetails.restaurant_id);
$('#menu_name').val(data.menuDetails.menu_name);
$('#menu_category').val(data.menuDetails.menu_category);
fetchCatAddons(data.menuDetails.menu_category)
$('#menu_type').val(data.menuDetails.menu_type);
$('#menu_cuisine').val(data.menuDetails.menu_cuisine);
$('#menu_price').val(data.menuDetails.menu_price);
$('#menu_addons').val(data.menuDetails.menu_addons);
$('#menu_spl_instruction').val(data.menuDetails.menu_spl_instruction);
//$('#menu_description').val(data.menuDetails.menu_description);
CKEDITOR.instances.menu_description.setData(data.menuDetails.menu_description);
$('#menu_popular_dish').val(data.menuDetails.menu_popular_dish);
$('#menu_spicy').val(data.menuDetails.menu_spicy);
$('#sizeoption').val(data.menuDetails.sizeoption);
$('#menu_nut').val(data.menuDetails.menu_nut);
$('#menu_hot').val(data.menuDetails.menu_hot);
if (data.menuDetails.menu_type == 'veg') {
$('#menu_type_veg').attr('checked', true);
}
else if (data.menuDetails.menu_type == 'nonveg') {
$('#menu_type_non_veg').attr('checked', true);
}
if (data.menuDetails.menu_popular_dish == 'Yes') {
$('#menu_populer_grp').attr('checked', true);
}
if (data.menuDetails.menu_nut == 'Yes') {
$('#menu_nut_grp').attr('checked', true);
}
if (data.menuDetails.menu_hot == 'medium') {
$('#hot_grp_medium').attr('checked', true);
}
else if (data.menuDetails.menu_hot == 'fair') {
$('#hot_grp_fair').attr('checked', true);
}
else if (data.menuDetails.menu_hot == 'very') {
$('#hot_grp_very').attr('checked', true);
}
else if (data.menuDetails.menu_hot == 'extreme') {
$('#hot_grp_extreme').attr('checked', true);
}
if (data.menuDetails.sizeoption == 'size') {
$('#normalslice').attr('checked', true);
$('#show_menuoption2').hide();
$('#show_menuoption1').show();
}
if (data.menuDetails.menu_spl_instruction == 'Yes') {
$('.EditSplInsYes').removeClass('active');
$('.EditSplInsNo').removeClass('active');
$('.EditSplInsYes').addClass('active');
}
else if (data.menuDetails.menu_spl_instruction == 'No') {
$('.EditSplInsYes').removeClass('active');
$('.EditSplInsNo').removeClass('active');
$('.EditSplInsNo').addClass('active');
}
if (data.menuDetails.menu_addons == 'Yes') {
$('#advanceshow').removeClass('active');
$('#advancehide').removeClass('active');
$('#advanceshow').addClass('active');
}
else if (data.menuDetails.menu_addons == 'No') {
$('#advanceshow').removeClass('active');
$('#advancehide').removeClass('active');
$('#advancehide').addClass('active');
}
$('input').iCheck('update');
if (data.menuDetails.menu_photo != '') {
$('#uploaded_img').attr('src', webroot+'assets/uploaded_image/menu/thumbs/'+data.menuDetails.menu_photo).height(95);
$('#uploaded_img_wrap').show();
}
if (data.menuDetails.sizeoption == 'size') {
$('#custom-table1').html(data.sizeHtml);
}
if (data.menuDetails.menu_addons == 'Yes') {
$('#show_advance').html(data.addonHtml);
}
$('button').removeClass('disabled');
},
error: function(data) {
alert('error');
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom").animate({
'top': 0
}, 1000);
}
function removeMainAddon(removeNum, menuaddons_id) {
jQuery('#ootZ' + removeNum + '_' + menuaddons_id).remove();
var my_id = menuaddons_id;
url=webroot+'menumanagement/deleteMenuAddons';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(data) {
alert('error');
console.log(data);
}
})
}
function removeSubAddon(removeNum, menuaddons_id) {
jQuery('#adddonsX' + removeNum + '_' + menuaddons_id).remove();
var my_id = menuaddons_id;
url=webroot+'menumanagement/deleteMenuAddons';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(data) {
alert('error');
console.log(data);
}
})
}
function removeMenuSize(removeNum, menu_slice_id) {
jQuery('#ootY' + removeNum).remove();
var my_id = menu_slice_id;
url=webroot+'menumanagement/deleteMenuSize';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
console.log(data);
},
error: function(data) {
alert('error');
console.log(data);
}
})
}
function editFaq(my_id) {
url=webroot+'faqmanagement/showFaq';
$.ajax({
url: url,
type: 'POST',
data: {id: my_id},
dataType: 'json',
success: function(data) {
$('#question').val(data.ShowPageFaq.question);
CKEDITOR.instances.answer.setData(data.ShowPageFaq.answer);
$('#FaqEditId').val(data.ShowPageFaq.faq_id);
},
error: function(data) {
alert('error');
console.log(data);
}
})
$('body').css('overflow', 'hidden');
$("#testPopupBottom1").animate({
'top': 0
}, 1000);
}
function changeRestFeature(my_id, myThis) {
var old_status = $(myThis).attr('data-status');
var my_status = '';
if (old_status == 'Yes') {
my_status = 'No';
$(myThis).attr('class', 'fa fa-star-o');
}
else {
my_status = 'Yes';
$(myThis).attr('class', 'fa fa-star');
}
$(myThis).attr('data-status', my_status);
url=cntrlUrl+'changeRestFeature/';
$.ajax({
method: "POST",
url: url,
data: { restaurant_id: my_id,restaurant_feature_status: my_status},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}
function changeRestFooter(my_id, myThis) {
var old_status = $(myThis).attr('data-status');
var my_status = '';
if (old_status == 'Yes') {
my_status = 'No';
$(myThis).attr('class', 'fa fa-star-o');
}
else {
my_status = 'Yes';
$(myThis).attr('class', 'fa fa-star');
}
$(myThis).attr('data-status', my_status);
url=cntrlUrl+'changeRestFooter/';
$.ajax({
method: "POST",
url: url,
data: { restaurant_id: my_id,restaurant_footer_status: my_status},
beforeSend: function(){
/*$('<?php echo $this->loading; ?>').show();*/
},
success: function(data){
/*$('<?php echo $this->loading; ?>').hide();
$('<?php echo $this->target; ?>').html(data);*/
}
});
}