File: /var/www/vhost/disk-apps/comfama.sports-crowd.com/public/js/ux.js
$(document).ready(function () {
$.ajax({
url: "/orders/notAccepted",
type: "GET",
contentType: 'application/json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
'Content-Type': 'application/json'
},
success: function (r) {
if (r.r) {
if(r.c > 0){
$('#cant-orders-notAccepted').text(r.c);
$('#cant-orders-notAccepted').css('display','block');
$('#message-orders-notAccepted').css('display','flex');
$('#text-orders-notAccepted').text('Hay '+ r.c +' pedidos pendientes por aceptar');
}
}
}
});
$.ajax({
url: "/mailbox/notRead",
type: "GET",
contentType: 'application/json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
'Content-Type': 'application/json'
},
success: function (r) {
if (r.r) {
if(r.c > 0){
$('#cant-messages-notRead').text(r.c);
$('#cant-messages-notRead').css('display','block');
}
}
}
});
});
// estilo input tipo material
$('input').blur(function(){
if($(this).val().length !== 0) {
$(this).addClass('filled');
}
else {
$(this).removeClass('filled');
}
});
//carga asincronac
// $(function(){
// // $(document).ajaxStart(function() { Pace.restart(); });
// $(".main-sidebar .sidebar-menu li a.asyncLink").click(function(e){
// e.preventDefault();
// console.log($(this).attr("href"));
// asyncLoadThis($(this).attr("href"),"#asyncLoadArea");
// });
// /**
// */
// function asyncLoadThis(resource,where){
// $.ajax({
// url: resource,
// method: "GET",
// }).done(function(response){
// $(where).html(response);
// });
// }
// });
if($("#selectHeader").length>0){
$("#selectHeader").change( function(){
var info = {
"db_name": $("#selectHeader").val()
}
$('#modalLoader').modal('show');
$('#modalLoader').css('display', 'flex');
$.ajax({
url:"/admins/update/currentDB",
type: "PUT",
contentType: 'application/json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
'Content-Type': 'application/json'
},
data: JSON.stringify(info),
success: function(r){
$('#modalLoader').modal('hide');
$('#modalLoader').css('display', 'none');
location.reload(true);
}, error: function (e){
console.log(e);
}
})
});
}