var Slide = false; $(window).on('load', function() { $("#API").fadeIn("slow", function() {}); setTimeout(function() { $('#token').val('').attr('type', 'password'); }, 420); }); $(document).ready(function() { $(".Disabled").prop('disabled', true); $(".close, #Exit").click(function() { if ($(".Agenda").is(":visible")) { $(".modal-menu").hide('slide', { direction: 'left' }, 700); setTimeout(() => { $('.modal').delay(200).fadeOut('slow'); }, "300"); } else { $('.modal').delay(200).fadeOut('slow'); } }); $("#Scheduler").on("click", function() { $(".Emoticons").hide(); $(".modal, .Agenda").show(); setTimeout(() => { $(".modal-menu").show('slide', { direction: 'left' }, 700); }, "300"); }); $(".SendEmoji").on("click", function() { $(".Agenda").hide(); $(".modal, .Emoticons").show(); }); }); $(document).on('click', '.btn-emoji', (event) => { event.preventDefault(); $.ajax({ type: "POST", url: "/emoji", data: { find: $(event.target).attr('data-code'), in: 'key', out: 'emoji' }, success: function(data) { Emoji = data.Return; InsertEmotion(Emoji); } }); event.stopImmediatePropagation(); }); function InsertEmotion(Emoji) { $('.modal').fadeOut('fast'); if ($("#Message").is(":visible")) { $('#Message').val($('#Message').val() + Emoji).focus(); } if ($("#MSG_A01").is(":visible")) { $('#MSG_A01').val($('#MSG_A01').val() + Emoji).focus(); } if ($("#MSG_A02").is(":visible")) { $('#MSG_A02').val($('#MSG_A02').val() + Emoji).focus(); } if ($("#MSG_A03").is(":visible")) { $('#MSG_A03').val($('#MSG_A03').val() + Emoji).focus(); } if ($("#MSG_B01").is(":visible")) { $('#MSG_B01').val($('#MSG_B01').val() + Emoji).focus(); } if ($("#MSG_B02").is(":visible")) { $('#MSG_B02').val($('#MSG_B02').val() + Emoji).focus(); } if ($("#MSG_B03").is(":visible")) { $('#MSG_B03').val($('#MSG_B03').val() + Emoji).focus(); } if ($("#MSG_C01").is(":visible")) { $('#MSG_C01').val($('#MSG_C01').val() + Emoji).focus(); } if ($("#MSG_C02").is(":visible")) { $('#MSG_C02').val($('#MSG_C02').val() + Emoji).focus(); } if ($("#MSG_C03").is(":visible")) { $('#MSG_C03').val($('#MSG_C03').val() + Emoji).focus(); } if ($("#MSG_D01").is(":visible")) { $('#MSG_D01').val($('#MSG_D01').val() + Emoji).focus(); } if ($("#MSG_D02").is(":visible")) { $('#MSG_D02').val($('#MSG_D02').val() + Emoji).focus(); } if ($("#MSG_D03").is(":visible")) { $('#MSG_D03').val($('#MSG_D03').val() + Emoji).focus(); } if ($("#MSG_E01").is(":visible")) { $('#MSG_E01').val($('#MSG_E01').val() + Emoji).focus(); } if ($("#MSG_E02").is(":visible")) { $('#MSG_E02').val($('#MSG_E02').val() + Emoji).focus(); } if ($("#MSG_E03").is(":visible")) { $('#MSG_E03').val($('#MSG_E03').val() + Emoji).focus(); } if ($("#MSG_F01").is(":visible")) { $('#MSG_F01').val($('#MSG_F01').val() + Emoji).focus(); } if ($("#MSG_F02").is(":visible")) { $('#MSG_F02').val($('#MSG_F02').val() + Emoji).focus(); } if ($("#MSG_F03").is(":visible")) { $('#MSG_F03').val($('#MSG_F03').val() + Emoji).focus(); } if ($("#MSG_G01").is(":visible")) { $('#MSG_G01').val($('#MSG_G01').val() + Emoji).focus(); } if ($("#MSG_G02").is(":visible")) { $('#MSG_G02').val($('#MSG_G02').val() + Emoji).focus(); } if ($("#MSG_G03").is(":visible")) { $('#MSG_G03').val($('#MSG_G03').val() + Emoji).focus(); } if ($("#MSG_H01").is(":visible")) { $('#MSG_H01').val($('#MSG_H01').val() + Emoji).focus(); } if ($("#MSG_H02").is(":visible")) { $('#MSG_H02').val($('#MSG_H02').val() + Emoji).focus(); } if ($("#MSG_H03").is(":visible")) { $('#MSG_H03').val($('#MSG_H03').val() + Emoji).focus(); } if ($("#MSG_I01").is(":visible")) { $('#MSG_I01').val($('#MSG_I01').val() + Emoji).focus(); } if ($("#MSG_I02").is(":visible")) { $('#MSG_I02').val($('#MSG_I02').val() + Emoji).focus(); } if ($("#MSG_I03").is(":visible")) { $('#MSG_I03').val($('#MSG_I03').val() + Emoji).focus(); } if ($("#MSG_J01").is(":visible")) { $('#MSG_J01').val($('#MSG_J01').val() + Emoji).focus(); } if ($("#MSG_J02").is(":visible")) { $('#MSG_J02').val($('#MSG_J02').val() + Emoji).focus(); } if ($("#MSG_J03").is(":visible")) { $('#MSG_J03').val($('#MSG_J03').val() + Emoji).focus(); } if ($("#MSG_K01").is(":visible")) { $('#MSG_K01').val($('#MSG_K01').val() + Emoji).focus(); } if ($("#MSG_K02").is(":visible")) { $('#MSG_K02').val($('#MSG_K02').val() + Emoji).focus(); } if ($("#MSG_K03").is(":visible")) { $('#MSG_K03').val($('#MSG_K03').val() + Emoji).focus(); } } $(document).ready(function() { var Turno = $('#Turno').val(); var Select = $('#Select').val(); $(".MSG_Box").hide(); switch (Turno) { case "before": $("#Placeholder_001").text("Days Before"); switch (Select) { case "1": $("#MSG_A01, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "2": $("#MSG_A02, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "3": $("#MSG_A03, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; } break; case "day": $("#Placeholder_002").text("In Day"); switch (Select) { case "1": $("#MSG_B01, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "2": $("#MSG_B02, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "3": $("#MSG_B03, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; } break; case "later": $("#Placeholder_003").text("Days Later"); switch (Select) { case "1": $("#MSG_C01, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "2": $("#MSG_C02, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "3": $("#MSG_C03, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; } break; case "Pay": $("#Placeholder_004").text("Payment Received"); switch (Select) { case "1": $("#MSG_D01, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "2": $("#MSG_D02, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "3": $("#MSG_D03, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; } break; case "Lock": $("#Placeholder_005").text("Locked User"); switch (Select) { case "1": $("#MSG_E01, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "2": $("#MSG_E02, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "3": $("#MSG_E03, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; } break; case "Unlock": $("#Placeholder_006").text("Unlocked User"); switch (Select) { case "1": $("#MSG_F01, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "2": $("#MSG_F02, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "3": $("#MSG_F03, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; } break; case "Maintenance": $("#Placeholder_007").text("Maintenance"); switch (Select) { case "1": $("#MSG_G01, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "2": $("#MSG_G02, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "3": $("#MSG_G03, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; } break; case "Unistall": $("#Placeholder_008").text("Unistall Device"); switch (Select) { case "1": $("#MSG_H01, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "2": $("#MSG_H02, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "3": $("#MSG_H03, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; } break; case "Speed": $("#Placeholder_009").text("Low Speed"); switch (Select) { case "1": $("#MSG_I01, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "2": $("#MSG_I02, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "3": $("#MSG_I03, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; } break; case "Block": $("#Placeholder_010").text("Blocked User"); switch (Select) { case "1": $("#MSG_J01, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "2": $("#MSG_J02, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "3": $("#MSG_J03, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; } break; case "Support": $("#Placeholder_011").text("Support Opening"); switch (Select) { case "1": $("#MSG_K01, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "2": $("#MSG_K02, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "3": $("#MSG_K03, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; } break; } $("#Turno, #Select").on('change', function() { var Turno = $('#Turno').val(); var Select = $('#Select').val(); $(".MSG_Box").hide(); switch (Turno) { case "before": $("#Placeholder_001").text("Days Before"); switch (Select) { case "1": $("#MSG_A01, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "2": $("#MSG_A02, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "3": $("#MSG_A03, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; } break; case "day": $("#Placeholder_002").text("In Day"); switch (Select) { case "1": $("#MSG_B01, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "2": $("#MSG_B02, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "3": $("#MSG_B03, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; } break; case "later": $("#Placeholder_003").text("Days Later"); switch (Select) { case "1": $("#MSG_C01, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "2": $("#MSG_C02, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "3": $("#MSG_C03, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; } break; case "Pay": $("#Placeholder_004").text("Payment Received"); switch (Select) { case "1": $("#MSG_D01, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "2": $("#MSG_D02, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "3": $("#MSG_D03, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; } break; case "Lock": $("#Placeholder_005").text("Locked User"); switch (Select) { case "1": $("#MSG_E01, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "2": $("#MSG_E02, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "3": $("#MSG_E03, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; } break; case "Unlock": $("#Placeholder_006").text("Unlocked User"); switch (Select) { case "1": $("#MSG_F01, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "2": $("#MSG_F02, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "3": $("#MSG_F03, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; } break; case "Maintenance": $("#Placeholder_007").text("Maintenance"); switch (Select) { case "1": $("#MSG_G01, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "2": $("#MSG_G02, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "3": $("#MSG_G03, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; } break; case "Unistall": $("#Placeholder_008").text("Unistall Device"); switch (Select) { case "1": $("#MSG_H01, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "2": $("#MSG_H02, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "3": $("#MSG_H03, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; } break; case "Speed": $("#Placeholder_009").text("Low Speed"); switch (Select) { case "1": $("#MSG_I01, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "2": $("#MSG_I02, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "3": $("#MSG_I03, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; } break; case "Block": $("#Placeholder_010").text("Blocked User"); switch (Select) { case "1": $("#MSG_J01, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "2": $("#MSG_J02, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "3": $("#MSG_J03, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; } break; case "Support": $("#Placeholder_011").text("Support Opening"); switch (Select) { case "1": $("#MSG_K01, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "2": $("#MSG_K02, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "3": $("#MSG_K03, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; } break; } }); $("#TABLE").tooltip({ selector: '[data-toggle=tooltip]', position: { my: 'left center', at: 'right center' }, placement: 'right' }); }); $(document).ready(function() { $("#HASHTABLE, #HASHTABLESCHED").tooltip({ selector: '[data-toggle=tooltip]', position: { my: 'left center', at: 'right center' }, placement: 'right' }); }); function toCapitalize(str) { return str .toLowerCase() .split(' ') .map(word => word.charAt(0).toUpperCase() + word.substr(1)) .join(' '); } $(document).ready(function() { $("tbody.onClick").delegate('tr', 'click', function(event) { event.preventDefault(); const uID_Push = "#push_" + $(this).attr('data-code') + ""; const uID_Status = "#status_" + $(this).attr('data-code') + ""; const uID_Code = "#" + $(this).attr('data-code') + ""; var Cursor = "default"; if (($(uID_Status).text()).toLowerCase() != "finished") { $.ajax({ type: "POST", url: "/send-mkauth", data: { client: $(this).attr('data-client'), user: $(this).attr('data-user'), code: $(this).attr('data-code'), status: $(this).attr('data-status'), payment: $(this).attr('data-payment'), contact: $(this).attr('data-contact'), reward: $(this).attr('data-reward'), push: $(this).attr('data-push'), cash: $(this).attr('data-cash'), gateway: $(this).attr('data-gateway'), token: $("#token").val() }, beforeSend: function(data) { $("#MkSend").fadeIn("slow", function() { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { var Icon = "fa-check"; $(uID_Push).text(new Date(data.RPush).toLocaleString("pt-br").replace(",", "")); $(uID_Status).text(data.RStatus); } if (data.Status == "Fail") { var Icon = "fa-exclamation"; $(uID_Push).text(new Date(data.RPush).toLocaleString("pt-br").replace(",", "")); $(uID_Status).text(data.Status); } if ((data.RStatus).toLowerCase() == "finished") { Cursor = "no-drop"; } else { Cursor = "pointer"; } $(uID_Code).attr('style', 'cursor: ' + Cursor); $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $("#MkSend").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); } }); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { if ((data.RStatus).toLowerCase() == "finished") { Cursor = "no-drop"; } else { Cursor = "pointer"; } $(uID_Code).attr('style', 'cursor: ' + Cursor); $("#MkSend").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); } }); } }); } }); }); $(document).ready(function() { function ReloadRange(OPTION, SET) { $.ajax({ type: "POST", url: "/scheduler", data: { define: OPTION.replace(/[^a-zA-Z]+/g, ''), enable: SET }, success: function(data) { if (data.Option == SET) { ID = "#lfive, #lten, #lfifteen, #ltwenty, #ltwentyfive, #lthirty, #lthirtyfive, #lforty"; $(ID).prop('disabled', false); } switch (data.Option) { case 5: ID = "#lfive"; break; case 10: ID = "#lten"; break; case 15: ID = "#lfifteen"; break; case 20: ID = "#ltwenty"; break; case 25: ID = "#ltwentyfive"; break; case 30: ID = "#lthirty"; break; case 35: ID = "#lthirtyfive"; break; case 40: ID = "#lforty"; break; default: ID = "#lfive, #lten, #lfifteen, #ltwenty, #ltwentyfive, #lthirty, #lthirtyfive, #lforty"; } if ($("#OnSpeed").is(":checked")) { $(ID).prop('disabled', true); } else { $(ID).prop('disabled', false); } }, error: function(request, status, error) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); if (SET) { $(OPTION).prop("checked", false); } else { $(OPTION).prop("checked", true); } } }); } $("#tabs2").tabs({ activate: function(event, ui) { if (ui.newTab.find(".ui-tabs-anchor").attr('href') == "#tabs-2E" && $("#module").is(":checked")) { $("#Control").show("fast"); } else { $("#Control").hide("fast"); } }, }); $("#IntervalUP").on('click', function() { inGET = parseFloat($("#interval").val()); Min = parseFloat($("#interval").attr('min')); Max = parseFloat($("#interval").attr('max')); if (inGET < Max) { inGET = inGET + 1; $("#interval").val(inGET); } }); $("#IntervalDown").on('click', function() { inGET = parseFloat($("#interval").val()); Min = parseFloat($("#interval").attr('min')); Max = parseFloat($("#interval").attr('max')); if (inGET > Min) { inGET = inGET - 1; $("#interval").val(inGET); } }); $("#SpeedRangeUP").on('click', function() { inGET = parseFloat($("#LowSpeedRange").val()); Min = parseFloat($("#LowSpeedRange").attr('min')); Max = parseFloat($("#LowSpeedRange").attr('max')); if (inGET < Max) { inGET = inGET + 5; $("#LowSpeedRange").val(inGET); ReloadRange("speed", inGET); } }); $("#SpeedRangeDown").on('click', function() { inGET = parseFloat($("#LowSpeedRange").val()); Min = parseFloat($("#LowSpeedRange").attr('min')); Max = parseFloat($("#LowSpeedRange").attr('max')); if (inGET > Min) { inGET = inGET - 5; $("#LowSpeedRange").val(inGET); ReloadRange("speed", inGET); } }); $("#BlockRangeUP").on('click', function() { inGET = parseFloat($("#BlockRange").val()); Min = parseFloat($("#BlockRange").attr('min')); Max = parseFloat($("#BlockRange").attr('max')); if (inGET < Max) { inGET = inGET + 5; $("#BlockRange").val(inGET); ReloadRange("block", inGET); } }); $("#BlockRangeDown").on('click', function() { inGET = parseFloat($("#BlockRange").val()); Min = parseFloat($("#BlockRange").attr('min')); Max = parseFloat($("#BlockRange").attr('max')); if (inGET > Min) { inGET = inGET - 5; $("#BlockRange").val(inGET); ReloadRange("block", inGET); } }); $("#CrontabRangeUP").on('click', function() { inGET = parseFloat($("#Crontab").val()); Min = parseFloat($("#Crontab").attr('min')); Max = parseFloat($("#Crontab").attr('max')); if (inGET < Max) { inGET = inGET + 1; $("#Crontab").val(inGET); ReloadRange("cron", inGET); } }); $("#CrontabRangeDown").on('click', function() { inGET = parseFloat($("#Crontab").val()); Min = parseFloat($("#Crontab").attr('min')); Max = parseFloat($("#Crontab").attr('max')); if (inGET > Min) { inGET = inGET - 1; $("#Crontab").val(inGET); ReloadRange("cron", inGET); } }); $("#SendwaitUP").on('click', function() { inGET = parseFloat($("#sendwait").val()); Min = parseFloat($("#sendwait").attr('min')); Max = parseFloat($("#sendwait").attr('max')); if (inGET < Max) { inGET = inGET + 1; $("#sendwait").val(inGET); } }); $("#SendwaitDown").on('click', function() { inGET = parseFloat($("#sendwait").val()); Min = parseFloat($("#sendwait").attr('min')); Max = parseFloat($("#sendwait").attr('max')); if (inGET > Min) { inGET = inGET - 1; $("#sendwait").val(inGET); } }); $("#CountUP").on('click', function() { inGET = parseFloat($("#count").val()); Min = parseFloat($("#count").attr('min')); Max = parseFloat($("#count").attr('max')); if (inGET < Max) { inGET = inGET + 1; $("#count").val(inGET); } }); $("#CountDown").on('click', function() { inGET = parseFloat($("#count").val()); Min = parseFloat($("#count").attr('min')); Max = parseFloat($("#count").attr('max')); if (inGET > Min) { inGET = inGET - 1; $("#count").val(inGET); } }); $("#SleepCallUP").on('click', function() { inGET = parseFloat($("#SleepCall").val()); Min = parseFloat($("#SleepCall").attr('min')); Max = parseFloat($("#SleepCall").attr('max')); if (inGET < Max) { inGET = inGET + 1; $("#SleepCall").val(inGET); } }); $("#SleepCallDown").on('click', function() { inGET = parseFloat($("#SleepCall").val()); Min = parseFloat($("#SleepCall").attr('min')); Max = parseFloat($("#SleepCall").attr('max')); if (inGET > Min) { inGET = inGET - 1; $("#SleepCall").val(inGET); } }); $("#InSave").on('click', function() { if ($("#AutoBot").is(":checked") == false) { var MsgBox = $("." + $('#Turno').val().toLowerCase() + '_00' + $("#Select").val()).val().replace(/\n/g, '\\n'); if ((MsgBox != "") && (MsgBox.length >= 30) || MsgBox == "xxx".toLowerCase()) { $.ajax({ type: "POST", url: "/emoji", data: { find: MsgBox, in: 'emoji', out: 'key' }, success: function(emoji) { $.ajax({ type: "POST", url: "/message_mkauth", data: { database: $('#Turno').val().toLowerCase(), message: emoji.Return, select: $("#Select").val(), token: $("#token").val() }, beforeSend: function(data) { $("#inLoad").fadeIn("slow", function() { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); $(".MSG_Box").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { var Icon = "fa-check"; } if (data.Status == "Fail") { var Icon = "fa-exclamation"; } $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $("#inLoad").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".MSG_Box, #Turno").prop('disabled', false); }); } }); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $("#inLoad").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".MSG_Box, #Turno").prop('disabled', false); }); } }); } }); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $("#inLoad").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".MSG_Box, #Turno").prop('disabled', false); }); } }); } }); } else { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); $(".MSG_Box, #Turno").prop('disabled', true); setTimeout(function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".MSG_Box, #Turno").prop('disabled', false); $("." + $('#Turno').val().toLowerCase()).val("").focus(); }, 700); } } }); $("#001").on('click', function() { if ($("#tabs-2E4").is(":visible")) { $("#001, #002").prop('disabled', true); $("#tabs-2E4").fadeOut("slow", function() { $("#tabs-2E3").fadeIn("slow", function() { $(".isControls").fadeIn("fast", function() { $("#001, #002").prop('disabled', false); $(".isWait").text("Waiting Select Options..."); }); }); }); } else if ($("#tabs-2E3").is(":visible")) { $("#tabs-2E3, .isControls").fadeOut("slow", function() { $("#isTable").show(); $("#tabs-2E2").fadeIn("slow", function() { }); }); } else if ($("#tabs-2E2").is(":visible")) { $("#tabs-2E2").fadeOut("slow", function() { $("#tabs-2E1").fadeIn("slow", function() { }); }); } }); $(document).on('click', '#002', (event) => { var OnClick = true; if ($("#tabs-2E1").is(":visible")) { $("#tabs-2E1").fadeOut("slow", function() { $("#tabs-2E2").fadeIn("slow", function() {}); }); } else if ($("#tabs-2E2").is(":visible")) { $("#001, #002").prop('disabled', true); $("#tabs-2E2").fadeOut("slow", function() { $("#tabs-2E3").fadeIn("slow", function() { $(".isControls").fadeIn("fast", function() { $("#001, #002").prop('disabled', false); $(".isWait").text("Waiting Select Options..."); }); }); }); } else if ($("#tabs-2E3").is(":visible")) { event.preventDefault(); $(".isWaitSCHED").hide(); $("#isSCHED, .isLoader").show(); $("#tabs-2E3, .isControls").fadeOut("slow", function() { $("#001").prop('disabled', true); $("#tabs-2E4").fadeIn("slow", function() { if (OnClick) { OnClick = false; if ($(".FireX").parent().length == 0) { $.ajax({ type: "POST", url: "/scheduler_mkauth", data: { scheduler: 'true' }, beforeSend: function(data) { $("#001").prop('disabled', true); $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); }, success: function(data) { if (data.Status == "Fail") { setTimeout(() => { $(".isLoader").fadeOut("slow", function() { setTimeout(() => { $("#isSCHED, .isWaitSCHED").fadeIn("fast", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#001").prop('disabled', false); }); }, "100"); }); }, "1000"); } }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { setTimeout(() => { $(".isLoader").fadeOut("slow", function() { setTimeout(() => { $("#isSCHED, .isWaitSCHED").fadeIn("fast", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#001").prop('disabled', false); }); }, "100"); }); }, "1000"); } }); } }); } else { setTimeout(() => { $("#isSCHED").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#001").prop('disabled', false); }); }, "1000"); } } event.stopImmediatePropagation(); }); }); } }); $("#003").on('click', function() { var Process = true; $("#isYear, #isMonth, #isSearch, #003").prop('disabled', true); $(".isWait").fadeOut("fast", function() { $("#isTable, .isBoot").fadeIn("slow", function() { if (Process) { Process = false; $.ajax({ type: "POST", url: "/clients_mkauth", data: { year: $('#isYear').val(), month: $('#isMonth').val(), payment: $('#isSearch').val() }, beforeSend: function(data) { $("#isTable, .isBoot").fadeIn("slow", function() { $(".isWait").text("Loading MkAuth Data..."); $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { $(".isControls").fadeIn("slow", function() { $("#isTable").fadeOut("slow", function() { $(".isWait").show(); $(".isBoot").hide(); }); }); } if (data.Status == "Fail") { var Icon = "fa-exclamation"; $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".isWait").text("Waiting Select Options..."); $("#isYear, #isMonth, #isSearch, #003").prop('disabled', false); $(".isBoot").fadeOut("slow", function() { $(".isWait").fadeIn("slow", function() { }); }); } }); } $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#isYear, #isMonth, #isSearch, #003").prop('disabled', false); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $(".isWait").text("Waiting Select Options..."); $("#isYear, #isMonth, #isSearch, #003").prop('disabled', false); $("#isTable, .isWait").fadeIn("slow", function() { }); } }); } }); } }); }); }); }); $(document).ready(function() { $("input[type=password]").prop('type', 'text'); $("#bar").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } MkAuth("#bar", Enable); }); $("#pix").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } MkAuth("#pix", Enable); }); $("#qrpix").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } MkAuth("#qrpix", Enable); }); $("#qrlink").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } MkAuth("#qrlink", Enable); }); $("#pdf").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } MkAuth("#pdf", Enable); }); $("#monday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#monday", Enable); }); $("#tuesday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#tuesday", Enable); }); $("#wednesday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#wednesday", Enable); }); $("#thursday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#thursday", Enable); }); $("#friday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#friday", Enable); }); $("#saturday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#saturday", Enable); }); $("#sunday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#sunday", Enable); }); $("#morning").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#morning", Enable); }); $("#afternoon").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#afternoon", Enable); }); $("#night").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#night", Enable); }); $("#bfive").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#bfive", Enable); }); $("#inday").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#inday", Enable); }); $("#lfive").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lfive", Enable); }); $("#lten").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lten", Enable); }); $("#lfifteen").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lfifteen", Enable); }); $("#ltwenty").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#ltwenty", Enable); }); $("#ltwentyfive").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#ltwentyfive", Enable); }); $("#lthirty").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lthirty", Enable); }); $("#lthirtyfive").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lthirtyfive", Enable); }); $("#lforty").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#lforty", Enable); }); $("#OnPay").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnPay", Enable); }); $("#OnLock").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnLock", Enable); }); $("#OnUnlock").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnUnlock", Enable); }); $("#OnMaintenance").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnMaintenance", Enable); }); $("#OnUnistall").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnUnistall", Enable); }); $("#OnSpeed").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnSpeed", Enable); }); $("#OnBlock").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnBlock", Enable); }); $("#OnSupport").on('change', function() { if ($(this).is(":checked")) { Enable = true; } else { Enable = false; } Scheduler("#OnSupport", Enable); }); $("#inject").on('change', function() { var Range = $("#ranger").val(); $.ajax({ type: "POST", url: "/delay_mkauth", data: { range: Range, }, success: function(data) { if (data.Status == "Fail") { $("#inject").val(data.Return); } }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { $("#inject").val(Range); }); } }); } }); }); function Scheduler(OPTION, SET) { $.ajax({ type: "POST", url: "/scheduler", data: { define: OPTION.replace(/[^a-zA-Z]+/g, ''), enable: SET }, success: function(data) { if (data.Status == "Fail") { $(OPTION).prop("checked", data.Return); } switch (data.Option) { case 5: ID = "#lfive"; break; case 10: ID = "#lten"; break; case 15: ID = "#lfifteen"; break; case 20: ID = "#ltwenty"; break; case 25: ID = "#ltwentyfive"; break; case 30: ID = "#lthirty"; break; case 35: ID = "#lthirtyfive"; break; case 40: ID = "#lforty"; break; default: ID = "#lfive, #lten, #lfifteen, #ltwenty, #ltwentyfive, #lthirty, #lthirtyfive, #lforty"; } if ($("#OnSpeed").is(":checked")) { $(ID).prop('disabled', true); } else { $(ID).prop('disabled', false); } }, error: function(request, status, error) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); if (SET) { $(OPTION).prop("checked", false); } else { $(OPTION).prop("checked", true); } } }); } function MkAuth(OPTION, SET) { $.ajax({ type: "POST", url: "/options_mkauth", data: { define: OPTION.replace(/[^a-zA-Z]+/g, ''), enable: SET }, success: function(data) { if (data.Status == "Fail") { $(OPTION).prop("checked", data.Return); } }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { if (SET) { $(OPTION).prop("checked", false); } else { $(OPTION).prop("checked", true); } }); } }); } }); } var behavior = function(val) { return val.replace(/\D/g, '').length === 11 ? '(00) 9 0000-0000' : '(00) 0000-00009'; }, options = { onKeyPress: function(val, e, field, options) { field.mask(behavior.apply({}, arguments), options); } }; $('#WhatsApp').mask(behavior, options); $("#WhatsApp").on('input, focusin', function() { $("#WhatsApp").val(""); }); $("#Clear").on("click", function() { $("#Message").prop('disabled', true); $(over).show(); $("#WhatsApp").val(""); $("#WhatsApp").prop('disabled', false).focus(); }); var Simulator = "/force-message"; $("#Simulator").on('change', function() { if ($(this).is(":checked")) { Simulator = "/send-message"; } else { Simulator = "/force-message"; } }); $("#Zero").on("click", function() { if ($("#AutoBot").is(":checked") == false) { var Turno = $('#Turno').val(); var Select = $('#Select').val(); $("#Turno, .MSG_Box").prop('disabled', true); switch (Turno) { case "before": $("#Placeholder_001").text("Days Before"); switch (Select) { case "1": $("#MSG_A01").val(""); $("#MSG_A01, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "2": $("#MSG_A02").val(""); $("#MSG_A02, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; case "3": $("#MSG_A03").val(""); $("#MSG_A06, #Placeholder_001, #MSG_Box_001").fadeIn("slow", function() { }); break; } break; case "day": $("#Placeholder_002").text("In Day"); switch (Select) { case "1": $("#MSG_B01").val(""); $("#MSG_B01, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "2": $("#MSG_B02").val(""); $("#MSG_B01, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; case "3": $("#MSG_B03").val(""); $("#MSG_B01, #Placeholder_002, #MSG_Box_002").fadeIn("slow", function() { }); break; } break; case "later": $("#Placeholder_003").text("Days Later"); switch (Select) { case "1": $("#MSG_C01").val(""); $("#MSG_C01, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "2": $("#MSG_C02").val(""); $("#MSG_C02, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; case "3": $("#MSG_C03").val(""); $("#MSG_C03, #Placeholder_003, #MSG_Box_003").fadeIn("slow", function() { }); break; } break; case "Pay": $("#Placeholder_004").text("Payment Received"); switch (Select) { case "1": $("#MSG_D01").val(""); $("#MSG_D01, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "2": $("#MSG_D02").val(""); $("#MSG_D02, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; case "3": $("#MSG_D03").val(""); $("#MSG_D03, #Placeholder_004, #MSG_Box_004").fadeIn("slow", function() { }); break; } break; case "Lock": $("#Placeholder_005").text("Locked User"); switch (Select) { case "1": $("#MSG_E01").val(""); $("#MSG_E01, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "2": $("#MSG_E02").val(""); $("#MSG_E02, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; case "3": $("#MSG_E03").val(""); $("#MSG_E03, #Placeholder_005, #MSG_Box_005").fadeIn("slow", function() { }); break; } break; case "Unlock": $("#Placeholder_006").text("Unlocked User"); switch (Select) { case "1": $("#MSG_F01").val(""); $("#MSG_F01, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "2": $("#MSG_F02").val(""); $("#MSG_F02, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; case "3": $("#MSG_F03").val(""); $("#MSG_F03, #Placeholder_006, #MSG_Box_006").fadeIn("slow", function() { }); break; } break; case "Maintenance": $("#Placeholder_007").text("Maintenance"); switch (Select) { case "1": $("#MSG_G01").val(""); $("#MSG_G01, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "2": $("#MSG_G02").val(""); $("#MSG_G02, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; case "3": $("#MSG_G03").val(""); $("#MSG_G03, #Placeholder_007, #MSG_Box_007").fadeIn("slow", function() { }); break; } break; case "Unistall": $("#Placeholder_008").text("Unistall Device"); switch (Select) { case "1": $("#MSG_H01").val(""); $("#MSG_H01, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "2": $("#MSG_H02").val(""); $("#MSG_H02, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; case "3": $("#MSG_H03").val(""); $("#MSG_H03, #Placeholder_008, #MSG_Box_008").fadeIn("slow", function() { }); break; } break; case "Speed": $("#Placeholder_009").text("Low Speed"); switch (Select) { case "1": $("#MSG_I01").val(""); $("#MSG_I01, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "2": $("#MSG_I02").val(""); $("#MSG_I02, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; case "3": $("#MSG_I03").val(""); $("#MSG_I03, #Placeholder_009, #MSG_Box_009").fadeIn("slow", function() { }); break; } break; case "Blocked": $("#Placeholder_010").text("Blocked User"); switch (Select) { case "1": $("#MSG_J01").val(""); $("#MSG_J01, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "2": $("#MSG_J02").val(""); $("#MSG_J02, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; case "3": $("#MSG_J03").val(""); $("#MSG_J03, #Placeholder_010, #MSG_Box_010").fadeIn("slow", function() { }); break; } break; case "Support": $("#Placeholder_011").text("Support Opening"); switch (Select) { case "1": $("#MSG_K01").val(""); $("#MSG_K01, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "2": $("#MSG_K02").val(""); $("#MSG_K02, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; case "3": $("#MSG_K03").val(""); $("#MSG_K03, #Placeholder_011, #MSG_Box_011").fadeIn("slow", function() { }); break; } break; } setTimeout(function() { $("#Turno, .MSG_Box").prop('disabled', false); }, 500); } }); function ModuleOff() { $.ajax({ type: "POST", url: "/options_mkauth", data: { define: 'module', enable: 'false' }, success: function(data) { if (data.Status == "Success") { $("#module").prop("checked", false); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', false); } if (data.Status == "Fail") { setTimeout(() => { $("#module").prop("checked", true); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', true); }, "500"); } }, error: function(request, status, error) { setTimeout(() => { $("#module").prop("checked", true); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', true); }, "500"); } }); } $("#module").on('change', function() { if ($("#module").is(":checked") && $("#AutoBot").is(":checked")) { $("#backup, #Spam, #SpamOut, #MinTime, #MaxTime, #Shift").prop("disabled", true); } else { $("#backup, #Spam, #Shift").prop("disabled", false); if ($("#Spam").is(":checked")) { $("#SpamOut").prop('disabled', false); } else { $("#SpamOut").prop('disabled', true); } if ($("#Shift").is(":checked")) { $("#MinTime, #MaxTime").prop('disabled', false); } else { $("#MinTime, #MaxTime").prop('disabled', true); } } }); $("#isYear").on('change', function() { var Now = ((new Date()).getMonth() + 1); if (Now >= 1 && Now <= 9) { Now = "0" + Now; } if ($(this).val() == "0") { $("#isMonth").val(Now).change(); } if ($(this).val() == "1") { $("#isMonth").val("12").change(); } }); $("#module").on('change', function() { var User = $("#username").val(); var Pass = $("#password").val(); var Domain = $("#domain").val(); var Tunel = $("#tunel").val(); var Server = $("#iServer").val(); var Mode = $("#iPDF").val(); if ($(this).is(":checked")) { if (Tunel == "") { setTimeout(() => { $("#module").prop("checked", false); $("#tunel").focus().val(""); }, "500"); } else { if (User == "" || !User.includes("Client_Id_")) { setTimeout(() => { $("#module").prop("checked", false); $("#username").focus().val(""); }, "500"); } else { if (Pass == "" || !Pass.includes("Client_Secret_")) { setTimeout(() => { $("#module").prop("checked", false); $("#password").focus().val(""); }, "500"); } else { if (Domain == "") { setTimeout(() => { $("#module").prop("checked", false); $("#domain").focus().val(""); }, "500"); } else { $.ajax({ type: "POST", url: "/link_mkauth", data: { username: $("#username").val(), password: $("#password").val(), module: $("#module").prop('checked'), domain: $("#domain").val(), tunel: $("#tunel").val(), token: $("#token").val(), server: $("#iServer").val(), mode: $("#iPDF").val() }, beforeSend: function(data) { $("#Control").show("fast"); $("#Waiting").fadeIn("slow", function() { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { var Icon = "fa-check"; } if (data.Status == "Fail") { var Icon = "fa-exclamation"; } $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { if (data.Status == "Fail") { $("#module").prop("checked", false); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', false); $("#Control").hide("fast"); } }); } }); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { $("#module").prop("checked", false); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', false); }); } }); } }); } } } } } else { $("#Control").hide("fast"); ModuleOff(); } }); $("#Send").on("click", function() { if ($("#token").val() != "" && $("#Message").val() != "" && $("#WhatsApp").val().replace(/\D/g, '').length >= 11) { $.ajax({ type: "POST", url: "/token", data: { token: $("#token").val() }, beforeSend: function(data) { $("#Waiting").fadeIn("slow", function() { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { $.ajax({ type: "POST", url: "/emoji", data: { find: $("#Message").val(), in: 'emoji', out: 'key' }, success: function(emoji) { $.ajax({ type: "POST", dataType: 'json', contentType: 'application/x-www-form-urlencoded', headers: { to: '55' + $("#WhatsApp").val().replace(/\D/g, ''), msg: (emoji.Return).replace(/\n/g, '\\n'), p: $("#token").val(), auth: $("#AutoBot").prop('checked'), simulator: 'true' }, url: Simulator, data: { to: '55' + $("#WhatsApp").val().replace(/\D/g, ''), msg: (emoji.Return).replace(/\n/g, '\\n'), p: $("#token").val(), auth: $("#AutoBot").prop('checked'), simulator: 'true' }, success: function(data) { if (data.Status == "Success") { var Icon = "fa-check"; } if (data.Status == "Fail") { var Icon = "fa-exclamation"; } if (data.Status == "Error") { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { }); } else { $.jGrowl(' ' + data.message, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { }); } }); } }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { }); } }); } }); }, error: function(request, status, error) { var Icon = "fa-exclamation"; $.jGrowl(' ' + 'Failed: Server connection error', { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Waiting").fadeOut("slow", function() { }); } }); } }); } }, error: function(request, status, error) { var Icon = "fa-exclamation"; $("#Waiting").fadeIn("slow", function() { $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Locked").fadeIn("slow", function() { $("#token").val("").focus(); }); $("#Waiting").fadeOut("slow", function() { $("#token").val("").focus(); }); } }); }); } }); } else { if ($("#WhatsApp").val().replace(/\D/g, '').length < 11) { $("#WhatsApp").val("").focus(); } else { if ($("#Message").val() == "") { $("#Message").val("").focus(); } else { if ($("#token").val() == "") { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#Locked").fadeIn("slow", function() { $("#token").val("").focus(); }); $("#Waiting").fadeOut("slow", function() { $("#token").val("").focus(); }); } } } } }); $("#SendClear").on("click", function() { $("#Message").val("").focus(); }); var t = $("#Message"), over = $('
'); over.css({ position: "absolute", top: t.position().top, left: t.position().left, width: t.outerWidth(), height: t.outerHeight(), zIndex: 1000, backgroundColor: "#fff", cursor: "not-allowed", opacity: 0 }); t.after(over); $(over).on('click', function() { var Whats = $("#WhatsApp").val().replace(/\D/g, ''); if (Whats.length >= 11) { $(over).hide(); $("#Message").prop('disabled', false).focus(); } else { $(over).show(); $("#WhatsApp").val("").prop('disabled', false).focus(); } }); $("#Message").on('focusin', function() { $("#SendClear, .SendEmoji").fadeIn("slow", function() { }); }); $("#Message").on('focusout', function() { if ($("#Message").val() == "") { $("#SendClear, .SendEmoji").fadeOut("slow", function() { }); } }); $(".MSG_Box").on('focusin', function() { $(".SendEmoji").fadeIn("slow", function() { }); }); $(".MSG_Box").on('focusout', function() { if ($(".MSG_Box").val() == "") { $(".SendEmoji").fadeOut("slow", function() { }); } }); $("#Clear_001").on("click", function() { $("#MSG_001").val("").focus(); }); $("#MSG_001").on('focusin', function() { $("#Clear_001").fadeIn("slow", function() { }); }); $("#MSG_001").on('focusout', function() { if ($("#MSG_001").val() == "") { $("#Clear_001").fadeOut("slow", function() { }); } }); $("#Clear_002").on("click", function() { $("#MSG_002").val("").focus(); }); $("#MSG_002").on('focusin', function() { $("#Clear_002").fadeIn("slow", function() { }); }); $("#MSG_002").on('focusout', function() { if ($("#MSG_002").val() == "") { $("#Clear_002").fadeOut("slow", function() { }); } }); $("#Clear_003").on("click", function() { $("#MSG_003").val("").focus(); }); $("#MSG_003").on('focusin', function() { $("#Clear_003").fadeIn("slow", function() { }); }); $("#MSG_003").on('focusout', function() { if ($("#MSG_003").val() == "") { $("#Clear_003").fadeOut("slow", function() { }); } }); $("#Clear_004").on("click", function() { $("#MSG_004").val("").focus(); }); $("#MSG_004").on('focusin', function() { $("#Clear_004").fadeIn("slow", function() { }); }); $("#MSG_004").on('focusout', function() { if ($("#MSG_004").val() == "") { $("#Clear_004").fadeOut("slow", function() { }); } }); $("#Clear_005").on("click", function() { $("#MSG_005").val("").focus(); }); $("#MSG_005").on('focusin', function() { $("#Clear_005").fadeIn("slow", function() { }); }); $("#MSG_005").on('focusout', function() { if ($("#MSG_001").val() == "") { $("#Clear_005").fadeOut("slow", function() { }); } }); $("#Clear_006").on("click", function() { $("#MSG_006").val("").focus(); }); $("#MSG_006").on('focusin', function() { $("#Clear_006").fadeIn("slow", function() { }); }); $("#MSG_006").on('focusout', function() { if ($("#MSG_006").val() == "") { $("#Clear_006").fadeOut("slow", function() { }); } }); $("#Clear_007").on("click", function() { $("#MSG_007").val("").focus(); }); $("#MSG_007").on('focusin', function() { $("#Clear_007").fadeIn("slow", function() { }); }); $("#MSG_007").on('focusout', function() { if ($("#MSG_007").val() == "") { $("#Clear_007").fadeOut("slow", function() { }); } }); $("#Clear_008").on("click", function() { $("#MSG_008").val("").focus(); }); $("#MSG_008").on('focusin', function() { $("#Clear_008").fadeIn("slow", function() { }); }); $("#MSG_008").on('focusout', function() { if ($("#MSG_008").val() == "") { $("#Clear_008").fadeOut("slow", function() { }); } }); $("#domain").on('focusout', function() { var Dominio = $("#domain").val().split('//')[1].split('/')[0]; if (Dominio != "") { $("#domain").val(Dominio); } }); $("#tunel").on('focusout', function() { var Dominio = $("#tunel").val().split('//')[1].split('/')[0]; if (Dominio != "" && Dominio.includes('mk-auth.dev.br')) { $("#tunel").val(Dominio); } else { $("#tunel").val(""); } }); $("#WhatsApp").on('input propertychange keyup', function() { var Whats = $(this).val().replace(/\D/g, ''); if (Whats.length >= 11) { if ($("#Message").val() == "") { $("#Message").prop('disabled', false).val("").focus(); } $('#WhatsApp').mask("(00) 0 0000-0000"); $("#WhatsApp").val($("#WhatsApp").masked(Whats)).prop('disabled', true); } else { $('#WhatsApp').mask(behavior, options); } }); $("#WhatsApp").on('input, focusout', function() { var Whats = $(this).val().replace(/\D/g, ''); if (Whats.length == 10) { if ($("#Message").val() == "") { $("#Message").prop('disabled', false).val("").focus(); } Whats = Whats.substr(0, 2) + "9" + Whats.substr(2, 8); $('#WhatsApp').mask("(00) 0 0000-0000"); $("#WhatsApp").val($("#WhatsApp").masked(Whats)).prop('disabled', true); } }); $("#sendwait").mask('99'); $("#SleepCall").mask('99'); $("#interval").mask('99'); $("#access").mask('9999'); $("#limiter, #count").mask('999'); $("#token").mask('ZZZZZZZ', { translation: { 'Z': { pattern: /[A-Za-z0-9]/, optional: true } } }); $("#token").on("input propertychange", function() { var Keygen = $("#token").val(); if (Keygen.length >= 7) { $.ajax({ type: "POST", url: "/token", data: { token: $("#token").val(), }, beforeSend: function(data) { $("#token, .Reset").prop('disabled', true); $(".loader_trak").fadeIn("slow", function() { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); }); }, success: function(data) { if (data.Status == "Success") { var Icon = "fa-check"; } if (data.Status == "Fail") { var Icon = "fa-exclamation"; } $.jGrowl(' ' + data.Return, { header: '
Server:
', life: 2000, theme: 'Mwsm', speed: 'slow', close: function(e, m, o) { if (data.Status == "Success") { $("#Locked").fadeOut("slow", function() { $("#token").prop('disabled', false); $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); } if (data.Status == "Fail") { $("#token").prop('disabled', false).val("").focus(); $(".loader_trak").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); } } }); }, error: function(request, status, error) { $("#token").prop('disabled', false).val("").focus(); $(".loader_trak").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); } }); } else { } }); $('.host').text($(location).attr('host')); var socket = io(); socket.on('background', function(data) { $('#background').css({ 'background-image': 'url(' + data + ')' }); $('#background').show(); }); socket.on('update', function(data) { if (data) { setTimeout(() => { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = 'script.js'; head.appendChild(script); }, "2000"); } }); socket.on('upgrade', function(data) { if (data) { $("#Version").css({ "background": "#25D366", "color": "#FFF" }); $('.Version').removeClass("IsDefault IsUpgrade").addClass("IsUpdate"); } else { $("#Version").css({ "background": "#FF0000", "color": "#FFF" }); $('.Version').removeClass("IsDefault IsUpdate").addClass("IsUpgrade"); } }); socket.on('Wwjs', function(data) { if (data) { $("#wwjs").css({ "color": "#25D366" }); } else { $("#wwjs").css({ "color": "#FF0000" }); } }); socket.on('message', function(msg) { $('.logs').append($('
  • ').text(msg)); $("#Scroll").animate({ scrollTop: $("#Scroll")[0].scrollHeight }, 500); }); socket.on('qr', function(src) { $("#qrcode").fadeOut("fast", function() { $('#qrcode').attr('src', src); $("#qrcode").fadeIn("slow", function() { if ($('#Preload').is(':visible')) { $("#Preload").fadeOut("slow", function() { $.ajax({ type: "POST", url: '/authenticated', success: function(data) { if (data.Status == "Success") { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); } else { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); } }, error: function(jqXHR, textStatus, errorThrown) { $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); } }); }); } }); }); }); socket.on('ready', function(data) { $("#qrcode").fadeOut("fast", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }); setTimeout(() => { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }, "1000"); }); socket.on('Reset', function(data) { if (!data) { setTimeout(() => { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); }, "1000"); } else { if (!Slide) { $('#tabs a[href="#tabs-1"]')[0].click(); } $(".Reset").removeClass("change").addClass("fa-spin").prop('disabled', true); } }); socket.on('getlog', function(data) { if (data) { $(".inWait").text("Waiting for Authentication..."); } else { $(".inWait").text("Waiting for New Records..."); } }); socket.on('setlog', function(value) { var data = {}; data.d = value; var html = ''; $('#TABLE tr').empty(); for (var i = 0; i < data.d.length; i++) { var Numero = (data.d[i].TARGET).toString(); if (Numero.length >= 10) { $('#WhatsApp').mask("(00) 0 0000-0000"); data.d[i].TARGET = $("#WhatsApp").masked(Numero.substr(0, 2) + "9" + Numero.substr(2, 8)); } if (data.d[i].NAME == undefined || data.d[i].NAME == 'Mwsm') { data.d[i].NAME = ''; } else { data.d[i].NAME = ' - ' + data.d[i].NAME; } html += ''; html += '' + data.d[i].ID + ''; html += '' + new Date(data.d[i].START).toLocaleString("pt-br").replace(",", "") + ''; html += '' + new Date(data.d[i].END).toLocaleString("pt-br").replace(",", "") + ''; html += '' + data.d[i].TARGET + ''; html += '' + data.d[i].STATUS + ''; html += ''; } $('#TABLE tr').first().after(html); $("#inTable").fadeOut("slow", function() { }); }); socket.on('Emoji', function(value) { var data = {}; data.d = value; var Cursor = "default"; var html = ''; (data.d).sort(function(a, b) { var Nome = a.NAME.localeCompare(b.NAME); var Ordem = parseFloat(a.ID) - parseFloat(b.ID); return Ordem || Nome; }); for (var i = 0; i < data.d.length; i++) { html += ''; } $('#isEmoticons').first().after(html); }); socket.on('shedullers', function(value) { if (value.length >= 1) { $(".isWaitSCHED").fadeOut("slow", function() { if ($(".FireX:visible").parent().length >= 1) { FadeIn = "#MkSendSCHED"; } else { FadeIn = "#isSCHED"; } $(FadeIn).fadeIn("slow", function() { var data = {}; data.d = value; var Cursor = "default"; var html = ''; (data.d).sort(function(a, b) { var Nome = a.CLIENT.localeCompare(b.CLIENT); var Ordem = parseFloat((new Date(a.REWARD).toLocaleString("pt-br").split(",")[0]).split("/")[0]) - parseFloat((new Date(b.REWARD).toLocaleString("pt-br").split(",")[0]).split("/")[0]); return Ordem || Nome; }); $('#HASHTABLESCHED tr').empty(); for (var i = 0; i < data.d.length; i++) { Cursor = "default"; html += ''; html += '' + data.d[i].TITLE + ''; html += '' + new Date(data.d[i].REWARD).toLocaleString("pt-br").split(",")[0] + ''; html += '' + toCapitalize(data.d[i].CLIENT) + ''; html += ''; } $('#HASHTABLESCHED tr').first().after(html); $("#MkSendSCHED, #isSCHED").fadeOut("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#001").prop('disabled', false); }); }); }); } else { $(".isLoader").fadeOut("slow", function() { $("#isSCHED, .isWaitSCHED").fadeIn("slow", function() { $(".Reset").removeClass("fa-spin").addClass("change").prop('disabled', false); $("#001").prop('disabled', false); }); }); } }); socket.on('schedresume', function(data) { if (data == 'true') { $(".isLoader").hide(); $("#isSCHED, .isWaitSCHED").fadeIn("slow", function() { $(".FireX").remove(); }); } else if ($(".FireX:visible").parent().length >= 1) { $("#MkSendSCHED").fadeIn("slow", function() { $(".Shed_" + data.toString()).fadeOut("slow", function() { $(".Shed_" + data.toString()).remove(); $("#MkSendSCHED, .isLoader").fadeOut("slow", function() { if ($(".FireX:visible").parent().length == 0) { $("#isSCHED, .isWaitSCHED").fadeIn("slow", function() { }); } }); }); }); } else { $("#isSCHED, .isWaitSCHED").fadeIn("slow", function() { $("#MkSendSCHED, .Shed_" + data.toString()).hide(); $(".Shed_" + data.toString()).remove(); }); } }); socket.on('getclients', function(value) { var data = {}; data.d = value; var Cursor = "default"; var html = ''; (data.d).sort(function(a, b) { var Nome = a.CLIENT.localeCompare(b.CLIENT); var Ordem = parseFloat(a.ORDER) - parseFloat(b.ORDER); return Ordem || Nome; }); $('#HASHTABLE tr').empty(); for (var i = 0; i < data.d.length; i++) { if (data.d[i].PUSH != "" && data.d[i].PUSH != undefined) { data.d[i].PUSH = new Date(data.d[i].PUSH).toLocaleString("pt-br").replace(",", ""); } else if (data.d[i].PUSH == "" || data.d[i].PUSH == undefined) { data.d[i].PUSH = "00/00/0000 00:00:00"; } if (data.d[i].STATUS == "" || data.d[i].STATUS == undefined) { data.d[i].STATUS = "pending"; } if ((data.d[i].STATUS).toLowerCase() == "finished" && (data.d[i].PAYMENT).toLowerCase() == "paid") { Cursor = "no-drop"; } else { Cursor = "pointer"; } html += ''; html += '' + data.d[i].TITLE + ''; html += '' + data.d[i].USER + ''; html += '' + new Date(data.d[i].REWARD).toLocaleString("pt-br").split(",")[0] + ''; html += '' + data.d[i].PUSH + ''; html += '' + data.d[i].PAYMENT + ''; html += '' + data.d[i].STATUS + ''; html += ''; } $('#HASHTABLE tr').first().after(html); $("#isTable").fadeOut("slow", function() { }); }); socket.on('Speed', function(data) { $("#LowSpeedRange").val(data); }); socket.on('Crontab', function(data) { $("#Crontab").val(data); }); socket.on('Block', function(data) { $("#BlockRange").val(data); }); socket.on('A001', function(data) { $('.before_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A002', function(data) { $('.day_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A003', function(data) { $('.later_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A004', function(data) { $('.Pay_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A005', function(data) { $('.Lock_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A006', function(data) { $('.Unlock_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A007', function(data) { $('.Maintenance_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A008', function(data) { $('.Unistall_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A009', function(data) { $('.Speed_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A010', function(data) { $('.Block_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('A011', function(data) { $('.Support_001').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B001', function(data) { $('.before_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B002', function(data) { $('.day_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B003', function(data) { $('.later_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B004', function(data) { $('.Pay_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B005', function(data) { $('.Lock_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B006', function(data) { $('.Unlock_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B007', function(data) { $('.Maintenance_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B008', function(data) { $('.Unistall_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B009', function(data) { $('.Speed_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B010', function(data) { $('.Block_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('B011', function(data) { $('.Support_002').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C001', function(data) { $('.before_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C002', function(data) { $('.day_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C003', function(data) { $('.later_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C004', function(data) { $('.Pay_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C005', function(data) { $('.Lock_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C006', function(data) { $('.Unlock_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C007', function(data) { $('.Maintenance_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C008', function(data) { $('.Unistall_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C009', function(data) { $('.Speed_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C010', function(data) { $('.Block_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('C011', function(data) { $('.Support_003').val(data.replace(/\\n/g, String.fromCharCode(13, 10))); }); socket.on('domain', function(data) { $('#domain').val(data); if (data.length >= 5) { $('#domain').prop('disabled', true); } }); socket.on('tunel', function(data) { $('#tunel').val(data); if (data.length >= 5) { $('#tunel').prop('disabled', true); } }); socket.on('iserver', function(data) { $('#iServer').val(data); }); socket.on('imode', function(data) { $('#iPDF').val(data); }); socket.on('ismonth', function(data) { $('#isMonth').val(data); }); socket.on('isyear', function(data) { $('#YearBack').text(data - 1); $('#YearNow').text(data); $('#isYear').val(0).change(); }); socket.on('issearch', function(data) { $('#isSearch').val(data); }); socket.on('Version', function(data) { $('#Version').val('v' + data); $('#Build').text(data); }); socket.on('Manager', function(data) { switch (data) { case 'true': $('#Manager').text("Mwsm"); break; case 'false': $('#Manager').text("MkAuth"); break; } }); socket.on('username', function(data) { $('#username').val(data); if (data.length >= 5) { $('#username').prop('disabled', true); } }); socket.on('password', function(data) { $('#password').val(data); if (data.length >= 5) { $('#password').prop('disabled', true); } }); socket.on('interval', function(data) { data = (parseFloat(data) / 1000) $('#interval').val(data); }); socket.on('sleep', function(data) { data = (parseFloat(data) / 1000) $('#SleepCall').val(data); }); socket.on('sendwait', function(data) { data = (parseFloat(data) / 1000) $('#sendwait').val(data); }); socket.on('pixfail', function(data) { $('#pixfail').val(data); }); socket.on('response', function(data) { $('#response').val(data); }); socket.on('call', function(data) { $('#Call').val(data); }); socket.on('access', function(data) { $('#access').val(data); }); socket.on('limiter', function(data) { $('#limiter').val(data); }); socket.on('delay', function(data) { $('#inject, #ranger').val(data); }); socket.on('onbot', function(data) { switch (data) { case 'true': $("#onbot").prop("checked", true); $("#response, #replyes").prop('disabled', false); break; case 'false': $("#onbot").prop("checked", false); $("#response, #replyes").prop('disabled', true); break; } }); socket.on('reject', function(data) { switch (data) { case 'true': $("#Reject").prop("checked", true); $("#Alert").prop('disabled', false); if ($('#Alert').is(':checked')) { $("#Call").prop('disabled', false); } else { $("#Call").prop('disabled', true); } break; case 'false': $("#Reject").prop("checked", false); $("#Alert").prop('disabled', true); if ($('#Alert').is(':checked')) { $("#Call").prop('disabled', false); } else { $("#Call").prop('disabled', true); } break; } }); socket.on('debugger', function(data) { switch (data) { case 'true': $("#debugger").prop("checked", true); break; case 'false': $("#debugger").prop("checked", false); break; } }); socket.on('uptodate', function(data) { switch (data) { case 'true': case 1: $("#uptodate").prop("checked", true); $("#FUpdate").prop("disabled", true).attr('disabled'); break; case 'false': case 0: $("#uptodate").prop("checked", false); $("#FUpdate").prop("disabled", false).removeAttr('disabled'); break; } }); socket.on('protected', function(data) { switch (data) { case 'true': $("#protected").prop("checked", true); break; case 'false': $("#protected").prop("checked", false); break; } }); socket.on('Tag', function(data) { switch (data) { case 'true': $("#Tag").prop("checked", true); break; case 'false': $("#Tag").prop("checked", false); break; } }); socket.on('backup', function(data) { switch (data) { case 'true': $("#backup").prop("checked", true); if ($("#AutoBot").is(":checked")) { $("#FBackup").prop("disabled", true).attr('disabled'); } else { $("#FBackup").prop("disabled", false).removeAttr('disabled'); } break; case 'false': $("#backup").prop("checked", false); if ($("#AutoBot").is(":checked")) { $("#FBackup").prop("disabled", true).attr('disabled'); } else { $("#FBackup").prop("disabled", false).removeAttr('disabled'); } break; } }); socket.on('doublekill', function(data) { switch (data) { case 'true': $("#DoubleKill").prop("checked", true); break; case 'false': $("#DoubleKill").prop("checked", false); break; } }); socket.on('regex', function(data) { switch (data) { case 'true': $("#RegEx").prop("checked", true); break; case 'false': $("#RegEx").prop("checked", false); break; } }); socket.on('spam', function(data) { switch (data) { case 'direct': $("#Spam").prop("checked", false); $("#SpamOut, #Select").prop('disabled', true); break; case 'order': $("#Spam").prop("checked", true); $("#SpamOut, #Select").prop('disabled', false); break; case 'random': $("#Spam").prop("checked", true); $("#SpamOut, #Select").prop('disabled', false); break; } if (data != 'direct') { $('#SpamOut').val(data).change(); } }); socket.on('min', function(data) { if ($("#Shift").is(":checked")) { $("#MinTime").val(data).change(); } else { $("#MinTime").val("08").change(); } }); socket.on('max', function(data) { if ($("#Shift").is(":checked")) { $('#MaxTime').val(data).change(); } else { $("#MaxTime").val("21").change(); } }); socket.on('shift', function(data) { switch (data) { case 'true': $("#Shift").prop("checked", true); $("#MinTime, #MaxTime").prop('disabled', false); break; case 'false': $("#Shift").prop("checked", false); $("#MinTime, #MaxTime").prop('disabled', true); break; } if ($("#module").is(":checked") && $("#AutoBot").is(":checked")) { $("#MinTime, #MaxTime, #Shift").prop("disabled", true); } else { $("#Shift").prop("disabled", false); if ($("#Shift").is(":checked")) { $("#MinTime, #MaxTime").prop('disabled', false); } else { $("#MinTime, #MaxTime").prop('disabled', true); } } }); socket.on('aimbot', function(data) { if ($("#backup").is(":checked")) { $("#FBackup").prop("disabled", true).attr('disabled'); } else { $("#FBackup").prop("disabled", false).removeAttr('disabled'); } switch (data) { case 'true': $("#AutoBot").prop("checked", true); $(".MSG_Box, .Control").prop("disabled", true); $("#Zero, #InSave").prop('disabled', true).attr('disabled'); $('#Manager').text("Mwsm"); $('.Protects').show(); break; case 'false': $('.Protects').hide(); $('#Manager').text("MkAuth"); $("#AutoBot").prop("checked", false); $(".MSG_Box, .Control").prop("disabled", false); $("#Zero, #InSave").prop('disabled', false).removeAttr('disabled'); break; } if ($("#module").is(":checked") && $("#AutoBot").is(":checked")) { $("#backup, #Spam, #SpamOut, #MinTime, #MaxTime, #Shift, .Control").prop("disabled", true); $('.Protects').show(); } else { $('.Protects').hide(); $("#backup, #Spam, #Shift, .Control").prop("disabled", false); if ($("#Spam").is(":checked")) { $("#SpamOut").prop('disabled', false); } else { $("#SpamOut").prop('disabled', true); } if ($("#Shift").is(":checked")) { $("#MinTime, #MaxTime").prop('disabled', false); } else { $("#MinTime, #MaxTime").prop('disabled', true); } } }); socket.on('Patched', function(data) { $("#Patched").text(data); }); socket.on('bfive', function(data) { switch (data) { case 'true': $("#bfive").prop("checked", true); break; case 'false': $("#bfive").prop("checked", false); break; } }); socket.on('inday', function(data) { switch (data) { case 'true': $("#inday").prop("checked", true); break; case 'false': $("#inday").prop("checked", false); break; } }); socket.on('lfive', function(data) { switch (data) { case 'true': $("#lfive").prop("checked", true); break; case 'false': $("#lfive").prop("checked", false); break; } }); socket.on('lten', function(data) { switch (data) { case 'true': $("#lten").prop("checked", true); break; case 'false': $("#lten").prop("checked", false); break; } }); socket.on('lfifteen', function(data) { switch (data) { case 'true': $("#lfifteen").prop("checked", true); break; case 'false': $("#lfifteen").prop("checked", false); break; } }); socket.on('ltwenty', function(data) { switch (data) { case 'true': $("#ltwenty").prop("checked", true); break; case 'false': $("#ltwenty").prop("checked", false); break; } }); socket.on('ltwentyfive', function(data) { switch (data) { case 'true': $("#ltwentyfive").prop("checked", true); break; case 'false': $("#ltwentyfive").prop("checked", false); break; } }); socket.on('lthirty', function(data) { switch (data) { case 'true': $("#lthirty").prop("checked", true); break; case 'false': $("#lthirty").prop("checked", false); break; } }); socket.on('lthirtyfive', function(data) { switch (data) { case 'true': $("#lthirtyfive").prop("checked", true); break; case 'false': $("#lthirtyfive").prop("checked", false); break; } }); socket.on('lforty', function(data) { switch (data) { case 'true': $("#lforty").prop("checked", true); break; case 'false': $("#lforty").prop("checked", false); break; } }); socket.on('OnPay', function(data) { switch (data) { case 'true': $("#OnPay").prop("checked", true); break; case 'false': $("#OnPay").prop("checked", false); break; } }); socket.on('OnLock', function(data) { switch (data) { case 'true': $("#OnLock").prop("checked", true); break; case 'false': $("#OnLock").prop("checked", false); break; } }); socket.on('OnUnlock', function(data) { switch (data) { case 'true': $("#OnUnlock").prop("checked", true); break; case 'false': $("#OnUnlock").prop("checked", false); break; } }); socket.on('OnMaintenance', function(data) { switch (data) { case 'true': $("#OnMaintenance").prop("checked", true); break; case 'false': $("#OnMaintenance").prop("checked", false); break; } }); socket.on('OnUnistall', function(data) { switch (data) { case 'true': $("#OnUnistall").prop("checked", true); break; case 'false': $("#OnUnistall").prop("checked", false); break; } }); socket.on('OnSpeed', function(data) { switch (data) { case 'true': $("#OnSpeed").prop("checked", true); break; case 'false': $("#OnSpeed").prop("checked", false); break; } }); socket.on('OnBlock', function(data) { switch (data) { case 'true': $("#OnBlock").prop("checked", true); break; case 'false': $("#OnBlock").prop("checked", false); break; } }); socket.on('OnSupport', function(data) { switch (data) { case 'true': $("#OnSupport").prop("checked", true); break; case 'false': $("#OnSupport").prop("checked", false); break; } }); socket.on('Speed', function(data) { var ID; switch (data) { case 5: ID = "#lfive"; break; case 10: ID = "#lten"; break; case 15: ID = "#lfifteen"; break; case 20: ID = "#ltwenty"; break; case 25: ID = "#ltwentyfive"; break; case 30: ID = "#lthirty"; break; case 35: ID = "#lthirtyfive"; break; case 40: ID = "#lforty"; break; default: ID = "#lfive, #lten, #lfifteen, #ltwenty, #ltwentyfive, #lthirty, #lthirtyfive, #lforty"; } if ($("#OnSpeed").is(":checked")) { $(ID).prop('disabled', true); } else { $(ID).prop('disabled', false); } }); socket.on('module', function(data) { switch (data) { case 'true': $("#module").prop("checked", true); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', true); $("#backup").prop('disabled', false); break; case 'false': $("#module").prop("checked", false); $("#domain, #username, #password, #tunel, #iServer, #iPDF").prop('disabled', false); $("#backup").prop('disabled', true); break; } if ($("#module").is(":checked") && $("#AutoBot").is(":checked")) { $("#backup, #Spam, #SpamOut, #MinTime, #MaxTime, #Shift").prop("disabled", true); } else { $("#backup, #Spam, #Shift").prop("disabled", false); if ($("#Spam").is(":checked")) { $("#SpamOut").prop('disabled', false); } else { $("#SpamOut").prop('disabled', true); } if ($("#Shift").is(":checked")) { $("#MinTime, #MaxTime").prop('disabled', false); } else { $("#MinTime, #MaxTime").prop('disabled', true); } } }); socket.on('pdf', function(data) { switch (data) { case 'true': $("#pdf").prop("checked", true); break; case 'false': $("#pdf").prop("checked", false); break; } }); socket.on('qrpix', function(data) { switch (data) { case 'true': $("#qrpix").prop("checked", true); break; case 'false': $("#qrpix").prop("checked", false); break; } }); socket.on('qrlink', function(data) { switch (data) { case 'true': $("#qrlink").prop("checked", true); break; case 'false': $("#qrlink").prop("checked", false); break; } }); socket.on('pix', function(data) { switch (data) { case 'true': $("#pix").prop("checked", true); break; case 'false': $("#pix").prop("checked", false); break; } }); socket.on('bar', function(data) { switch (data) { case 'true': $("#bar").prop("checked", true); break; case 'false': $("#bar").prop("checked", false); break; } }); socket.on('monday', function(data) { switch (data) { case 'true': $("#monday").prop("checked", true); break; case 'false': $("#monday").prop("checked", false); break; } }); socket.on('tuesday', function(data) { switch (data) { case 'true': $("#tuesday").prop("checked", true); break; case 'false': $("#tuesday").prop("checked", false); break; } }); socket.on('wednesday', function(data) { switch (data) { case 'true': $("#wednesday").prop("checked", true); break; case 'false': $("#wednesday").prop("checked", false); break; } }); socket.on('thursday', function(data) { switch (data) { case 'true': $("#thursday").prop("checked", true); break; case 'false': $("#thursday").prop("checked", false); break; } }); socket.on('friday', function(data) { switch (data) { case 'true': $("#friday").prop("checked", true); break; case 'false': $("#friday").prop("checked", false); break; } }); socket.on('saturday', function(data) { switch (data) { case 'true': $("#saturday").prop("checked", true); break; case 'false': $("#saturday").prop("checked", false); break; } }); socket.on('sunday', function(data) { switch (data) { case 'true': $("#sunday").prop("checked", true); break; case 'false': $("#sunday").prop("checked", false); break; } }); socket.on('morning', function(data) { switch (data) { case 'true': $("#morning").prop("checked", true); break; case 'false': $("#morning").prop("checked", false); break; } }); socket.on('afternoon', function(data) { switch (data) { case 'true': $("#afternoon").prop("checked", true); break; case 'false': $("#afternoon").prop("checked", false); break; } }); socket.on('night', function(data) { switch (data) { case 'true': $("#night").prop("checked", true); break; case 'false': $("#night").prop("checked", false); break; } }); socket.on('replyes', function(data) { switch (data) { case 'true': $("#replyes").prop("checked", true); break; case 'false': $("#replyes").prop("checked", false); break; } }); socket.on('alert', function(data) { switch (data) { case 'true': $("#Alert").prop("checked", true); $("#Call").prop('disabled', false); break; case 'false': $("#Alert").prop("checked", false); $("#Call").prop('disabled', true); break; } }); socket.on('count', function(data) { data = parseFloat(data); $('#count').val(data); }); socket.on('donation', function(src) { $('#donation').attr('src', src); $('#donation').show(); }); socket.on('developer', function(src) { $('#developer').attr('src', src); $('#developer').show(); }); $("#tabs").tabs({ active: tabs - 1, show: { effect: "fade", duration: 500 } }); $("#tabs2").tabs({ active: tabs - 1, show: { effect: "fade", duration: 500 } }); }); $(document).ready(function() { (function($) { $.fn.Pix = function(element) { var textToCopy = $(element).val(); var tempTextarea = $('