diff --git a/resources/[tools]/okokBanking/.fxap b/resources/[tools]/okokBanking/.fxap deleted file mode 100644 index 8dc80b3b4..000000000 Binary files a/resources/[tools]/okokBanking/.fxap and /dev/null differ diff --git a/resources/[tools]/okokBanking/README.md b/resources/[tools]/okokBanking/README.md deleted file mode 100644 index 25ba2b89b..000000000 --- a/resources/[tools]/okokBanking/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Hi, thank you for buying okokBanking! :) - -If you need help contact me on discord: okok#3488 -Discord server: https://discord.gg/okok -Docs: https://docs.okokscripts.io/ - --> Installation Guide: https://docs.okokscripts.io/scripts/okokbanking \ No newline at end of file diff --git a/resources/[tools]/okokBanking/client.lua b/resources/[tools]/okokBanking/client.lua deleted file mode 100644 index b982924ee..000000000 --- a/resources/[tools]/okokBanking/client.lua +++ /dev/null @@ -1,977 +0,0 @@ -local QBCore = exports["qb-core"]:GetCoreObject() -local PlayerData = {} -local trans = {} -local societyTrans = {} -local societyIdent, societyDays -local didAction = false -local isBankOpened = false -local canAccessSociety = false -local society = '' -local societyInfo -local closestATM, atmPos -local playerName, playerBankMoney, playerIBAN, trsIdentifier, allDaysValues, walletMoney -local targetOptionsNames = { atm = 'okokBanking:ATM', bank = 'okokBanking:Bank'} -local BankZonesId, AtmModels = {}, {} - -function GenerateIBAN() - math.randomseed(GetGameTimer()) - local stringFormat = "%0"..Config.IBANNumbers.."d" - local number = math.random(0, 10^Config.IBANNumbers-1) - number = string.format(stringFormat, number) - local iban = Config.IBANPrefix..number:upper() - local isIBanUsed = true - local hasChecked = false - - while true do - Wait(10) - if isIBanUsed and not hasChecked then - isIBanUsed = false - QBCore.Functions.TriggerCallback("okokBanking:IsIBanUsed", function(isUsed) - if isUsed ~= nil then - isIBanUsed = true - number = math.random(0, 10^Config.IBANNumbers-1) - number = string.format("%03d", number) - iban = Config.IBANPrefix..number:upper() - elseif isUsed == nil then - hasChecked = true - isIBanUsed = false - end - canLoop = true - end, iban) - elseif not isIBanUsed and hasChecked then - break - end - end - TriggerServerEvent('okokBanking:SetIBAN', iban) -end - -function string.starts(string, start) - return string.sub(string, 1, string.len(start)) == start -end - -function openBank() - local isCreatingSociety = false - local hasJob = false - local playeJob = QBCore.Functions.GetPlayerData().job - local playerGang = QBCore.Functions.GetPlayerData().gang - local playerJobName = '' - local playerGangName = '' - local jobLabel = '' - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - - canAccessSociety = false - - if playeJob ~= nil or playerGang ~= nil then - hasJob = true - playerJobName = playeJob.name - jobLabel = playeJob.name - society = playerJobName - playerGangName = playerGang.name - end - - QBCore.Functions.TriggerCallback("okokBanking:GetPlayerInfo", function(data) - QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cb, identifier, allDays) - for k,v in pairs(Config.Societies) do - if playerJobName == v then - -- Check if job has configuration in JobBossRanks - if Config.JobBossRanks and Config.JobBossRanks[playerJobName] then - -- Check for specific ranks first - if Config.JobBossRanks[playerJobName].specificRanks and #Config.JobBossRanks[playerJobName].specificRanks > 0 then - for _, rank in ipairs(Config.JobBossRanks[playerJobName].specificRanks) do - if playeJob.grade.level == rank then - canAccessSociety = true - print("Boss access granted for " .. playerJobName .. " with specific rank " .. rank) - break - end - end - end - - -- If not already granted access and maxRank is enabled, check for highest rank - if not canAccessSociety and Config.JobBossRanks[playerJobName].maxRank then - -- Get all job grades for this job - if QBCore.Shared.Jobs[playerJobName] and QBCore.Shared.Jobs[playerJobName].grades then - local jobGrades = QBCore.Shared.Jobs[playerJobName].grades - local highestRank = -1 - - -- Find the highest rank number - for grade, _ in pairs(jobGrades) do - local gradeNum = tonumber(grade) - if gradeNum and gradeNum > highestRank then - highestRank = gradeNum - end - end - - -- Check if player has the highest rank - if playeJob.grade.level == highestRank then - canAccessSociety = true - print("Boss access granted for " .. playerJobName .. " with highest rank " .. highestRank) - else - print("Not highest rank for " .. playerJobName .. ", current rank: " .. playeJob.grade.level .. ", highest: " .. highestRank) - end - end - end - else - -- Fallback to original highest rank check if no configuration exists - if QBCore.Shared.Jobs[playerJobName] and QBCore.Shared.Jobs[playerJobName].grades then - local jobGrades = QBCore.Shared.Jobs[playerJobName].grades - local highestRank = -1 - - -- Find the highest rank number - for grade, _ in pairs(jobGrades) do - local gradeNum = tonumber(grade) - if gradeNum and gradeNum > highestRank then - highestRank = gradeNum - end - end - - -- Check if player has the highest rank - if playeJob.grade.level == highestRank then - canAccessSociety = true - print("Boss access granted for " .. playerJobName .. " with highest rank " .. highestRank) - else - print("Not highest rank for " .. playerJobName .. ", current rank: " .. playeJob.grade.level .. ", highest: " .. highestRank) - end - end - end - elseif playerGangName == v then - if data.isBossGang == true then - jobLabel = playerGangName - society = playerGangName - canAccessSociety = true - end - end - end - - if canAccessSociety then - isCreatingSociety = true - local societyIban = Config.IBANPrefix..jobLabel - QBCore.Functions.TriggerCallback("okokBanking:SocietyInfo", function(cb) - if cb ~= nil then - societyInfo = cb - isCreatingSociety = false - else - TriggerServerEvent("okokBanking:CreateSocietyAccount", society, jobLabel, 0, societyIban) - Wait(200) - while isCreatingSociety do - QBCore.Functions.TriggerCallback("okokBanking:SocietyInfo", function(cb) - if cb ~= nil then - societyInfo = cb - isCreatingSociety = false - end - end, society) - Wait(200) - end - end - end, society, societyIban) - end - - while isCreatingSociety do - Wait(100) - end - - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - trans = cb - playerName, playerBankMoney, playerIBAN, trsIdentifier, allDaysValues, walletMoney = data.playerName, data.playerBankMoney, data.playerIBAN, identifier, allDays, data.walletMoney - QBCore.Functions.TriggerCallback("okokBanking:GetSocietyTransactions", function(societyTranscb, societyID, societyAllDays) - societyIdent = societyID - societyDays = societyAllDays - societyTrans = societyTranscb - if data.playerIBAN ~= nil then - if string.starts(data.playerIBAN, Config.IBANPrefix) then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'bankmenu', - playerName = data.playerName, - playerSex = data.sex, - playerBankMoney = data.playerBankMoney, - walletMoney = walletMoney, - playerIBAN = data.playerIBAN, - db = trans, - identifier = trsIdentifier, - graphDays = allDaysValues, - isInSociety = canAccessSociety, - RequireCC = Config.RequireCreditCardForATM, - UseSound = Config.UseOkOkBankingSounds, - }) - else - GenerateIBAN() - Wait(1000) - QBCore.Functions.TriggerCallback("okokBanking:GetPlayerInfo", function(data) - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'bankmenu', - playerName = data.playerName, - playerSex = data.sex, - playerBankMoney = data.playerBankMoney, - walletMoney = walletMoney, - playerIBAN = data.playerIBAN, - db = trans, - identifier = trsIdentifier, - graphDays = allDaysValues, - isInSociety = canAccessSociety, - RequireCC = Config.RequireCreditCardForATM, - }) - end) - end - end - end, society) - end) - end) -end - -CreateThread(function() - while QBCore.Functions.GetPlayerData().job == nil do - Wait(10) - end - PlayerData = QBCore.Functions.GetPlayerData() -end) - -CreateThread(function() - if Config.ShowBankBlips then - Wait(2000) - for k,v in ipairs(Config.BankLocations)do - local blip = AddBlipForCoord(v.x, v.y, v.z) - SetBlipSprite(blip, v.blip) - SetBlipDisplay(blip, 4) - SetBlipScale(blip, v.blipScale) - SetBlipColour(blip, v.blipColor) - SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(v.blipText) - EndTextCommandSetBlipName(blip) - end - end -end) - -if Config.UseTargetOnBank then - RegisterNetEvent("okokBanking:OpenBank") - AddEventHandler("okokBanking:OpenBank", function() - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'loading_data' - }) - Wait(500) - openBank() - end) - - for k, v in ipairs(Config.BankLocations) do - local boxName = targetOptionsNames.bank .. k - if v.boxZone then - if Config.TargetSystem == 'qb-target' then - local zoneId = exports['qb-target']:AddBoxZone(boxName, v.boxZone.pos, v.boxZone.size.x, v.boxZone.size.y, { - name = boxName, - heading = v.boxZone.rotation, - debugPoly = Config.DebugTargetZones, - minZ = v.boxZone.pos.z , - maxZ = v.boxZone.maxZ, - useZ = false, - }, { - options = {{ - icon = 'fas fa-piggy-bank', - label = _L('open_banking_target').text, - canInteract = function(entity) return not isDead and not IsPedInAnyVehicle(PlayerPedId()) end, - action = function(entity) TriggerEvent('okokBanking:OpenBank') end - }}, - distance = Config.TargetBankDistance, - }) - elseif Config.TargetSystem == 'ox-target' then - local zoneId = exports.ox_target:addBoxZone({ - coords = v.boxZone.pos, - size = vec3(v.boxZone.size.x, v.boxZone.size.y, v.boxZone.maxZ - v.boxZone.pos.z), - rotation = v.boxZone.rotation, - debug = Config.DebugTargetZones, - options = { - { - icon = 'fas fa-piggy-bank', - label = _L('open_banking_target').text, - canInteract = function(entity, distance, coords, name) return not isDead and not IsPedInAnyVehicle(PlayerPedId()) end, - onSelect = function(data) TriggerEvent('okokBanking:OpenBank') end - } - }, - distance = Config.TargetBankDistance - }) - end - table.insert(BankZonesId, zoneId) - end - end -else - - local function NearBank() - local pos = GetEntityCoords(PlayerPedId()) - for k, v in pairs(Config.BankLocations) do - local dist = #(vector3(v.x, v.y, v.z) - pos) - if dist <= v.BankDistance then - return true - elseif dist <= v.BankDistance + 5 then - return "update" - end - end - end - - CreateThread(function() - local inRange = false - local shown = false - local notified = false - - while true do - local playerped = PlayerPedId() - inRange = false - Wait(0) - if NearBank() and not isBankOpened and NearBank() ~= "update" then - - inRange = true - - if IsControlJustReleased(0, 38) then - - if not isDead and not IsPedInAnyVehicle(playerped) then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'loading_data' - }) - Wait(500) - openBank() - else - if not notified then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('not_use_bank').title, _L('not_use_bank').text, _L('not_use_bank').time, _L('not_use_bank').type) - else - QBCore.Functions.Notify(_L('not_use_bank').text, _L('not_use_bank').type, _L('not_use_bank').time) - end - notified = true - end - end - end - elseif NearBank() == "update" then - Wait(300) - else - Wait(1000) - end - - if inRange and not shown then - shown = true - if Config.okokTextUI then - exports['okokTextUI']:Open(_L('open_banking').text, _L('open_banking').color, _L('open_banking').side) - else - exports['qb-core']:DrawText(_L('open_banking').text, _L('open_banking').side) - end - elseif not inRange and shown then - shown = false - if Config.okokTextUI then - exports['okokTextUI']:Close() - else - exports['qb-core']:HideText() - end - end - notified = false - end - end) -end - -if Config.UseTargetOnAtm then - - for k, v in ipairs(Config.ATM) do AtmModels[#AtmModels + 1] = v.model end - - RegisterNetEvent('okokBanking:TargetATM') - AddEventHandler('okokBanking:TargetATM', function() - local ped = PlayerPedId() - local dict = 'anim@amb@prop_human_atm@interior@male@enter' - local anim = 'enter' - - if Config.RequireCreditCardForATM then - QBCore.Functions.TriggerCallback("okokBanking:HasCreditCard", function(hasItem) - if not hasItem then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_creditcard').title, _L('no_creditcard').text, _L('no_creditcard').time, _L('no_creditcard').type) - else - QBCore.Functions.Notify(_L('no_creditcard').text, _L('no_creditcard').type, _L('no_creditcard').time) - end - return - else - QBCore.Functions.TriggerCallback("okokBanking:GetPIN", function(pin) - if pin then - if not isBankOpened then - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - RequestAnimDict(dict) - - while not HasAnimDictLoaded(dict) do - Wait(7) - end - - TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0) - Wait(Config.AnimTime * 1000) - ClearPedTasks(ped) - - TriggerEvent("okokBanking:OpenATM", pin) - Wait(3000) - RemoveAnimDict(dict) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_pin').title, _L('no_pin').text, _L('no_pin').time, _L('no_pin').type) - else - QBCore.Functions.Notify(_L('no_pin').text, _L('no_pin').type, _L('no_pin').time) - end - end - end) - end - end) - else - QBCore.Functions.TriggerCallback("okokBanking:GetPIN", function(pin) - if pin then - if not isBankOpened then - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - RequestAnimDict(dict) - - while not HasAnimDictLoaded(dict) do - Wait(7) - end - - TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0) - Wait(Config.AnimTime * 1000) - ClearPedTasks(ped) - - TriggerEvent("okokBanking:OpenATM", pin) - Wait(3000) - RemoveAnimDict(dict) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_pin').title, _L('no_pin').text, _L('no_pin').time, _L('no_pin').type) - else - QBCore.Functions.Notify(_L('no_pin').text, _L('no_pin').type, _L('no_pin').time) - end - end - end) - end - end) - - local options= {{ - name = targetOptionsNames.atm, - event = 'okokBanking:TargetATM', - icon = 'fas fa-piggy-bank', - label = _L('open_atm_target').text, - canInteract = function(entity) - return not isDead and not IsPedInAnyVehicle(PlayerPedId()) - end - }} - - if Config.TargetSystem == 'qb-target' then - exports['qb-target']:AddTargetModel(AtmModels, { - options = options, - distance = Config.ATMDistance - }) - elseif Config.TargetSystem == 'ox-target' then - exports.ox_target:addModel(AtmModels, { - name = targetOptionsNames.atm, - event = 'okokBanking:TargetATM', - icon = 'fas fa-piggy-bank', - label = _L('open_atm_target').text, - distance = Config.ATMDistance, - canInteract = function(entity) return not isDead and not IsPedInAnyVehicle(PlayerPedId()) end - }) - end -else - - function NearATM() - local ped = PlayerPedId() - local pos = GetEntityCoords(ped) - - for i = 1, #Config.ATM do - local atm = GetClosestObjectOfType(pos.x, pos.y, pos.z, Config.ATMDistance + 5, Config.ATM[i].model, false, false, false) - if DoesEntityExist(atm) then - if atm ~= closestATM then - closestATM = atm - atmPos = GetEntityCoords(atm) - end - local dist = #(pos - atmPos) - - if dist <= Config.ATMDistance then - return true - elseif dist <= Config.ATMDistance + 5 then - return "update" - end - end - end - end - - CreateThread(function() - local inRange = false - local shown = false - local notified = false - - local dict = 'anim@amb@prop_human_atm@interior@male@enter' - local anim = 'enter' - - while true do - local ped = PlayerPedId() - inRange = false - Wait(0) - if NearATM() and not isBankOpened and NearATM() ~= "update" then - - inRange = true - - if IsControlJustReleased(0, 38) then - if not isDead and not IsPedInAnyVehicle(ped) then - if Config.RequireCreditCardForATM then - QBCore.Functions.TriggerCallback("okokBanking:HasCreditCard", function(hasItem) - if not hasItem then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_creditcard').title, _L('no_creditcard').text, _L('no_creditcard').time, _L('no_creditcard').type) - else - QBCore.Functions.Notify(_L('no_creditcard').text, _L('no_creditcard').type, _L('no_creditcard').time) - end - return - else - QBCore.Functions.TriggerCallback("okokBanking:GetPIN", function(pin) - if pin then - if not isBankOpened then - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - RequestAnimDict(dict) - - while not HasAnimDictLoaded(dict) do - Wait(7) - end - - TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0) - Wait(Config.AnimTime * 1000) - ClearPedTasks(ped) - - TriggerEvent("okokBanking:OpenATM", pin) - Wait(3000) - RemoveAnimDict(dict) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_pin').title, _L('no_pin').text, _L('no_pin').time, _L('no_pin').type) - else - QBCore.Functions.Notify(_L('no_pin').text, _L('no_pin').type, _L('no_pin').time) - end - end - end) - end - end) - else - QBCore.Functions.TriggerCallback("okokBanking:GetPIN", function(pin) - if pin then - if not isBankOpened then - isBankOpened = true - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - RequestAnimDict(dict) - - while not HasAnimDictLoaded(dict) do - Wait(7) - end - - TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 0, 0, 0, 0, 0) - Wait(Config.AnimTime * 1000) - ClearPedTasks(ped) - - TriggerEvent("okokBanking:OpenATM", pin) - Wait(3000) - RemoveAnimDict(dict) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('no_pin').title, _L('no_pin').text, _L('no_pin').time, _L('no_pin').type) - else - QBCore.Functions.Notify(_L('no_pin').text, _L('no_pin').type, _L('no_pin').time) - end - end - end) - end - else - if not notified then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('not_use_bank').title, _L('not_use_bank').text, _L('not_use_bank').time, _L('not_use_bank').type) - else - QBCore.Functions.Notify(_L('not_use_bank').text, _L('not_use_bank').type, _L('not_use_bank').time) - end - notified = true - end - end - end - elseif NearATM() == "update" then - Wait(100) - else - Wait(1000) - end - - if inRange and not shown then - shown = true - if Config.okokTextUI then - exports['okokTextUI']:Open(_L('open_atm').text, _L('open_atm').color, _L('open_atm').side) - else - exports['qb-core']:DrawText(_L('open_atm').text, _L('open_atm').side) - end - elseif not inRange and shown then - shown = false - if Config.okokTextUI then - exports['okokTextUI']:Close() - else - exports['qb-core']:HideText() - end - end - notified = false - end - end) -end - -RegisterNetEvent("okokBanking:OpenATM") -AddEventHandler("okokBanking:OpenATM", function(pin) - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'atm', - pin = pin, - UseSound = Config.UseOkOkBankingSounds, - }) -end) - -RegisterNUICallback("action", function(data, cb) - if data.action == "close" then - isBankOpened = false - TriggerServerEvent('okokBanking:setMenuOpened', isBankOpened) - SetNuiFocus(false, false) - elseif data.action == "deposit" then - if tonumber(data.value) ~= nil then - if tonumber(data.value) > 0 then - if data.window == 'bankmenu' then - TriggerServerEvent('okokBanking:DepositMoney', tonumber(data.value)) - elseif data.window == 'societies' then - TriggerServerEvent('okokBanking:DepositMoneyToSociety', tonumber(data.value), societyInfo.society, societyInfo.society_name) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_amount').title, _L('invalid_amount').text, _L('invalid_amount').time, _L('invalid_amount').type) - else - QBCore.Functions.Notify(_L('invalid_amount').text, _L('invalid_amount').type, _L('invalid_amount').time) - end - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_amount').title, _L('invalid_amount').text, _L('invalid_amount').time, _L('invalid_amount').type) - else - QBCore.Functions.Notify(_L('invalid_amount').text, _L('invalid_amount').type, _L('invalid_amount').time) - end - end - elseif data.action == "withdraw" then - if tonumber(data.value) ~= nil then - if tonumber(data.value) > 0 then - if data.window == 'bankmenu' then - TriggerServerEvent('okokBanking:WithdrawMoney', tonumber(data.value)) - elseif data.window == 'societies' then - TriggerServerEvent('okokBanking:WithdrawMoneyToSociety', tonumber(data.value), societyInfo.society, societyInfo.society_name, societyInfo.value) - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_amount').title, _L('invalid_amount').text, _L('invalid_amount').time, _L('invalid_amount').type) - else - QBCore.Functions.Notify(_L('invalid_amount').text, _L('invalid_amount').type, _L('invalid_amount').time) - end - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_input').title, _L('invalid_input').text, _L('invalid_input').time, _L('invalid_input').type) - else - QBCore.Functions.Notify(_L('invalid_input').text, _L('invalid_input').type, _L('invalid_input').time) - end - end - elseif data.action == "transfer" then - if tonumber(data.value) ~= nil then - if tonumber(data.value) > 0 then - QBCore.Functions.TriggerCallback("okokBanking:IsIBanUsed", function(isUsed, isPlayer) - if isUsed ~= nil then - if isUsed.charinfo ~= nil then - if type(isUsed.charinfo) ~= "table" then - isUsed.charinfo = json.decode(isUsed.charinfo) - end - end - if data.window == 'bankmenu' then - if isPlayer then - TriggerServerEvent('okokBanking:TransferMoney', tonumber(data.value), data.iban:upper(), isUsed.citizenid, isUsed.money, isUsed.charinfo.firstname..' '..isUsed.charinfo.lastname) - elseif not isPlayer then - TriggerServerEvent('okokBanking:TransferMoneyToSociety', tonumber(data.value), isUsed.iban:upper(), isUsed.society_name, isUsed.society) - end - elseif data.window == 'societies' then - local toMyself = false - if data.iban:upper() == playerIBAN then - toMyself = true - end - - if isPlayer then - TriggerServerEvent('okokBanking:TransferMoneyToPlayerFromSociety', tonumber(data.value), data.iban:upper(), isUsed.citizenid, isUsed.money, isUsed.charinfo.firstname..' '..isUsed.charinfo.lastname, societyInfo.society, societyInfo.society_name, societyInfo.value, toMyself) - elseif not isPlayer then - TriggerServerEvent('okokBanking:TransferMoneyToSocietyFromSociety', tonumber(data.value), isUsed.iban:upper(), isUsed.society_name, isUsed.society, societyInfo.society, societyInfo.society_name, societyInfo.value) - end - end - elseif isUsed == nil then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('iban_not_exist').title, _L('iban_not_exist').text, _L('iban_not_exist').time, _L('iban_not_exist').type) - else - QBCore.Functions.Notify(_L('iban_not_exist').text, _L('iban_not_exist').type, _L('iban_not_exist').time) - end - end - end, data.iban:upper()) - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_amount').title, _L('invalid_amount').text, _L('invalid_amount').time, _L('invalid_amount').type) - else - QBCore.Functions.Notify(_L('invalid_amount').text, _L('invalid_amount').type, _L('invalid_amount').time) - end - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('invalid_input').title, _L('invalid_input').text, _L('invalid_input').time, _L('invalid_input').type) - else - QBCore.Functions.Notify(_L('invalid_input').text, _L('invalid_input').type, _L('invalid_input').time) - end - end - elseif data.action == "overview_page" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'overview_page', - playerBankMoney = playerBankMoney, - walletMoney = walletMoney, - playerIBAN = playerIBAN, - db = trans, - identifier = trsIdentifier, - graphDays = allDaysValues, - isInSociety = canAccessSociety, - RequireCC = Config.RequireCreditCardForATM, - }) - elseif data.action == "transactions_page" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'transactions_page', - db = trans, - identifier = trsIdentifier, - graph_values = allDaysValues, - isInSociety = canAccessSociety, - }) - elseif data.action == "society_transactions" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'society_transactions', - db = societyTrans, - identifier = societyIdent, - graph_values = societyDays, - isInSociety = canAccessSociety, - societyInfo = societyInfo, - }) - elseif data.action == "society_page" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'society_page', - playerBankMoney = playerBankMoney, - walletMoney = walletMoney, - playerIBAN = playerIBAN, - db = societyTrans, - identifier = societyIdent, - graphDays = societyDays, - isInSociety = canAccessSociety, - societyInfo = societyInfo, - }) - elseif data.action == "settings_page" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'settings_page', - isInSociety = canAccessSociety, - ibanCost = Config.IBANChangeCost, - ibanPrefix = Config.IBANPrefix, - ibanCharNum = Config.CustomIBANMaxChars, - pinCost = Config.PINChangeCost, - pinCharNum = 4, - }) - elseif data.action == "atm" then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'loading_data', - }) - Wait(500) - openBank() - elseif data.action == "change_iban" then - if Config.CustomIBANAllowLetters then - local iban = Config.IBANPrefix..data.iban:upper() - - QBCore.Functions.TriggerCallback("okokBanking:IsIBanUsed", function(isUsed, isPlayer) - - if isUsed == nil then - TriggerServerEvent('okokBanking:UpdateIbanDB', iban, Config.IBANChangeCost) - elseif isUsed ~= nil then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('iban_in_use').title, _L('iban_in_use').text, _L('iban_in_use').time, _L('iban_in_use').type) - else - QBCore.Functions.Notify(_L('iban_in_use').text, _L('iban_in_use').type, _L('iban_in_use').time) - end - end - end, iban) - elseif not Config.CustomIBANAllowLetters then - if tonumber(data.iban) ~= nil then - local iban = Config.IBANPrefix..data.iban:upper() - - QBCore.Functions.TriggerCallback("okokBanking:IsIBanUsed", function(isUsed, isPlayer) - - if isUsed == nil then - TriggerServerEvent('okokBanking:UpdateIbanDB', iban, Config.IBANChangeCost) - elseif isUsed ~= nil then - if Config.okokNotify then - exports['okokNotify']:Alert(_L('iban_in_use').title, _L('iban_in_use').text, _L('iban_in_use').time, _L('iban_in_use').type) - else - QBCore.Functions.Notify(_L('iban_in_use').text, _L('iban_in_use').type, _L('iban_in_use').time) - end - end - end, iban) - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('iban_only_numbers').title, _L('iban_only_numbers').text, _L('iban_only_numbers').time, _L('iban_only_numbers').type) - else - QBCore.Functions.Notify(_L('iban_only_numbers').text, _L('iban_only_numbers').type, _L('iban_only_numbers').time) - end - end - end - elseif data.action == "change_pin" then - if tonumber(data.pin) ~= nil then - if string.len(data.pin) == 4 then - QBCore.Functions.TriggerCallback("okokBanking:GetPIN", function(pin) - if pin then - TriggerServerEvent('okokBanking:UpdatePINDB', data.pin, Config.PINChangeCost) - else - TriggerServerEvent('okokBanking:UpdatePINDB', data.pin, 0) - end - end) - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('pin_digits').title, _L('pin_digits').text, _L('pin_digits').time, _L('pin_digits').type) - else - QBCore.Functions.Notify(_L('pin_digits').text, _L('pin_digits').type, _L('pin_digits').time) - end - end - else - if Config.okokNotify then - exports['okokNotify']:Alert(_L('pin_only_numbers').title, _L('pin_only_numbers').text, _L('pin_only_numbers').time, _L('pin_only_numbers').type) - else - QBCore.Functions.Notify(_L('pin_only_numbers').text, _L('pin_only_numbers').type, _L('pin_only_numbers').time) - end - end - elseif data.action == "buy_new_cc" then - TriggerServerEvent('okokBanking:GiveCC') - end - cb('ok') -end) - - -RegisterNetEvent("okokBanking:updateTransactions") -AddEventHandler("okokBanking:updateTransactions", function(money, wallet) - Wait(100) - if isBankOpened then - QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cb, id, allDays) - trans = cb - allDaysValues = allDays - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'overview_page', - playerBankMoney = playerBankMoney, - walletMoney = walletMoney, - playerIBAN = playerIBAN, - db = trans, - identifier = trsIdentifier, - graphDays = allDaysValues, - isInSociety = canAccessSociety, - isUpdate = true, - RequireCC = Config.RequireCreditCardForATM, - }) - TriggerEvent('okokBanking:updateMoney', money, wallet) - end) - end -end) - -RegisterNetEvent("okokBanking:updateMoney") -AddEventHandler("okokBanking:updateMoney", function(money, wallet) - if isBankOpened then - playerBankMoney = money - walletMoney = wallet - SendNUIMessage({ - action = 'updatevalue', - playerBankMoney = money, - walletMoney = wallet, - }) - end -end) - -RegisterNetEvent("okokBanking:updateIban") -AddEventHandler("okokBanking:updateIban", function(iban) - playerIBAN = iban - SendNUIMessage({ - action = 'updateiban', - iban = playerIBAN, - }) -end) - -RegisterNetEvent("okokBanking:updateIbanPinChange") -AddEventHandler("okokBanking:updateIbanPinChange", function() - Wait(100) - QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cbs, ids, allDays) - trans = cbs - end) -end) - -RegisterNetEvent("okokBanking:updateTransactionsSociety") -AddEventHandler("okokBanking:updateTransactionsSociety", function(wallet) - Wait(100) - QBCore.Functions.TriggerCallback("okokBanking:SocietyInfo", function(cb) - QBCore.Functions.TriggerCallback("okokBanking:GetSocietyTransactions", function(societyTranscb, societyID, societyAllDays) - QBCore.Functions.TriggerCallback("okokBanking:GetOverviewTransactions", function(cbs, ids, allDays) - trans = cbs - walletMoney = wallet - societyDays = societyAllDays - societyIdent = societyID - societyTrans = societyTranscb - societyInfo = cb - if cb ~= nil then - if isBankOpened then - SetNuiFocus(true, true) - end - SendNUIMessage({ - action = 'society_page', - walletMoney = wallet, - db = societyTrans, - graphDays = societyDays, - isInSociety = canAccessSociety, - societyInfo = societyInfo, - identifier = societyIdent, - isUpdate = true - }) - end - end) - end, society) - end, society) -end) - diff --git a/resources/[tools]/okokBanking/config.lua b/resources/[tools]/okokBanking/config.lua deleted file mode 100644 index 833986a45..000000000 --- a/resources/[tools]/okokBanking/config.lua +++ /dev/null @@ -1,163 +0,0 @@ -Config, Locales = {}, {} - -Config.Locale = 'de' -- en / pt / gr / fr / de - -Config.okokNotify = true -- true = okokNotify | false = QBCore Notify - -Config.okokTextUI = true -- true = okokTextUI | false = QBCore DrawText - -Config.UseOkOkBankingSounds = false -- true = Uses Sounds | false = No sounds - -Config.UseTargetOnAtm = false -- Using qb-target and not TextUI to access to the atms - -Config.UseTargetOnBank = false -- Using qb-target and not TextUI to access to the bank - -Config.TargetSystem = 'qb-target' -- qb-target | ox-target - -Config.TargetBankDistance = 1.5 -- Distance to target a bank from qb-target ( To change the distance to ATM check line 61) - -Config.DebugTargetZones = false -- Set to true only if you need to check the position of a zone - -Config.UseCashAsItem = false -- Set to true if you have cash as item on qb-core - -Config.IBANPrefix = "OK" -- IBAN prefix - -Config.IBANNumbers = 6 -- How many characters the IBAN has by default - -Config.CustomIBANMaxChars = 10 -- How many characters the IBAN can have when changing it to a custom one (on Settings tab) - -Config.CustomIBANAllowLetters = true -- If the custom IBAN can have letters or only numbers (on Settings tab) - -Config.IBANChangeCost = 5000 -- How much it costs to change the IBAN to a custom one (on Settings tab) - -Config.PINChangeCost = 1000 -- How much it costs to change the PIN (on Settings tab) - -Config.AnimTime = 2 -- Seconds (ATM animation) - -Config.UseQBManagement = false -- If true it will use the management_funds table | If false the okokbanking_societies table - -Config.UseQBBanking = true -- Useful for latest QBCore versions - -Config.RequireCreditCardForATM = true -- Set to true if you would like players to access the ATM with a card item | If false there is no item requirement - -Config.CreditCardItem = "creditcard" -- Required item to access the ATM - -Config.CreditCardPrice = 100 -- How much it costs to purchase a credit card - -Config.CharInfoUpdate = true -- If you have an error on server console saying 'bad argument #1 to decode ( string expected, got nil )' set this to true - -Config.Societies = { -- Which societies have bank accounts - "police", - "ambulance", - "cinema", - "fussion", - "kayas", - "sud", - "taxi", - "ammu", - "marshal"; - "cute" - - - - - -} - --- Add this new section below the Societies section -Config.JobBossRanks = { - ["police"] = { - maxRank = true, -- Automatically use the highest rank - specificRanks = {7, 8, 9} -- Or specify exact ranks that have boss access - }, - ["ambulance"] = { - maxRank = true, - specificRanks = {} - }, - ["cinema"] = { - maxRank = false, -- Will automatically detect the highest rank - specificRanks = {1} -- Or you can specify ranks like {3, 4} if needed - }, - ["kayas"] = { - maxRank = false, - specificRanks = {0} - }, - ["fussion"] = { - maxRank = false, -- Will automatically detect the highest rank - specificRanks = {4} -- Or you can specify ranks like {3, 4} if needed - }, - ["sud"] = { - maxRank = false, -- Will automatically detect the highest rank - specificRanks = {0} -- Or you can specify ranks like {3, 4} if needed - }, - ["taxi"] = { - maxRank = true, -- Will automatically detect the highest rank - specificRanks = {} -- Or you can specify ranks like {3, 4} if needed - }, - ["ammu"] = { - maxRank = false, -- Will automatically detect the highest rank - specificRanks = {0} -- Or you can specify ranks like {3, 4} if needed - }, - ["marshal"] = { - maxRank = true, -- Will automatically detect the highest rank - specificRanks = {0} -- Or you can specify ranks like {3, 4} if needed - }, - ["cute"] = { - maxRank = true, -- Will automatically detect the highest rank - specificRanks = {0} -- Or you can specify ranks like {3, 4} if needed - }, - -- Add other jobs as needed -} - - -Config.ShowBankBlips = true -- True = show bank blips on the map | false = don't show blips - -Config.BankLocations = { -- To get blips and colors check this: https://wiki.gtanet.work/index.php?title=Blips - {blip = 108, blipColor = 2, blipScale = 0.9, x = 150.266, y = -1040.203, z = 29.374, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(149.07, -1041.02, 29.55), size = vec3(2.85, 0.30, 1.30), rotation = 70, maxZ = 30.9}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = -1212.980, y = -330.841, z = 37.787, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(-1212.98, -331.53, 38.0), size = vec3(2.85, 0.40, 1.30), rotation = 117, maxZ = 39.25}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = -2962.582, y = 482.627, z = 15.703, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(-2962.00, 482.20, 15.92), size = vec3(2.85, 0.40, 1.30), rotation = 178, maxZ = 17.1}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = -112.202, y = 6469.295, z = 31.626, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(-111.69, 6469.5, 31.83), size = vec3(4.2, 0.40, 1.25), rotation = 45, maxZ = 33.15}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = 314.187, y = -278.621, z = 54.170, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(313.26, -279.38, 54.35), size = vec3(2.85, 0.40, 1.30), rotation = 250, maxZ = 55.7}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = -351.534, y = -49.529, z = 49.042, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(-351.81, -50.2, 49.24), size = vec3(2.85, 0.30, 1.30), rotation = 250, maxZ = 50.5}}, - {blip = 108, blipColor = 3, blipScale = 1.2, x = 253.38, y = 220.79, z = 106.29, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(252.8, 221.9, 106.20), size = vec3(3.6, 0.20, 1.70), rotation = 250, maxZ = 107.6}}, - {blip = 108, blipColor = 2, blipScale = 0.9, x = 1175.064, y = 2706.643, z = 38.094, blipText = "Bank", BankDistance = 3, boxZone = {pos = vec3(1175.72, 2707.36, 38.30), size = vec3(2.85, 0.40, 1.30), rotation = 270, maxZ = 39.5}}, -} - -Config.ATMDistance = 1.5 -- How close you need to be in order to access the ATM - -Config.ATM = { -- ATM models, do not remove any - {model = -870868698}, - {model = -1126237515}, - {model = -1364697528}, - {model = 506770882} -} - --------------------------- DISCORD LOGS - --- To set your Discord Webhook URL go to server.lua, line 2 - -Config.BotName = 'ServerName' -- Write the desired bot name - -Config.ServerName = 'ServerName' -- Write your server's name - -Config.IconURL = '' -- Insert your desired image link - -Config.DateFormat = '%d/%m/%Y [%X]' -- To change the date format check this website - https://www.lua.org/pil/22.1.html - --- To change a webhook color you need to set the decimal value of a color, you can use this website to do that - https://www.mathsisfun.com/hexadecimal-decimal-colors.html - -Config.TransferWebhookColor = '16127' - -Config.WithdrawWebhookColor = '16127' - -Config.DepositWebhookColor = '16127' - --------------------------- LOCALES (DON'T TOUCH) - -function _L(id) - if Locales[Config.Locale][id] then - return Locales[Config.Locale][id] - else - print("Locale '"..id.."' doesn't exist") - end -end \ No newline at end of file diff --git a/resources/[tools]/okokBanking/fxmanifest.lua b/resources/[tools]/okokBanking/fxmanifest.lua deleted file mode 100644 index 453713a60..000000000 --- a/resources/[tools]/okokBanking/fxmanifest.lua +++ /dev/null @@ -1,44 +0,0 @@ -fx_version 'cerulean' - -game 'gta5' - -author 'okok#3488' -description 'okokBanking' -version '1.1.2' - -ui_page 'web/ui.html' - -files { - 'web/*.*', - 'web/img/*.*' -} - -shared_scripts { - 'config.lua', - 'locales/*.lua' -} - -client_scripts { - 'client.lua' -} - -server_scripts { - '@oxmysql/lib/MySQL.lua', - 'server.lua' -} - -lua54 'yes' - -escrow_ignore { - 'config.lua', - 'server.lua', - 'client.lua', - 'locales/*.lua' -} - -server_exports { - 'AddMoney', - 'RemoveMoney', - 'GetAccount', -} -dependency '/assetpacks' \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/de.lua b/resources/[tools]/okokBanking/locales/de.lua deleted file mode 100644 index 23623b99a..000000000 --- a/resources/[tools]/okokBanking/locales/de.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['de'] = { - - -- PIN BEZOGEN LOCALES - - ['no_pin'] = { - title = 'BANKING', - text = 'Gehen Sie zuerst zu einer Bank, um einen PIN-Code festzulegen', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANKING', - text = 'PIN erfolgreich geändert in ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANKING', - text = 'Sie benötigen ${s1}$, um Ihre PIN zu ändern', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANKING', - text = 'Ihre PIN muss 4 Ziffern lang sein', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANKING', - text = 'Sie können nur Zahlen verwenden', - time = 5000, - type = 'error' - }, - - - -- IBAN BEZOGEN LOCALES - - ['iban_not_exist'] = { - title = 'BANKING', - text = 'Diese IBAN existiert nicht', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANKING', - text = 'Diese IBAN wird bereits verwendet', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANKING', - text = 'Sie können in Ihrer IBAN nur Zahlen verwenden', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANKING', - text = 'IBAN erfolgreich in ${s1} geändert', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANKING', - text = 'Sie benötigen ${s1}$, um Ihre IBAN zu ändern', - time = 5000, - type = 'error' - }, - - - -- ZURÜCKGEZOGEN / EINGEZAHLT / ÜBERTRAGEN / ERHALTEN - - ['deposited'] = { - title = 'BANKING', - text = 'Sie haben eingezahlt ${s1}$', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANKING', - text = 'Sie haben sich zurückgezogen ${s1}$', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANKING', - text = 'Sie erhielten ${s1}$ aus ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANKING', - text = 'Sie haben überwiesen ${s1}$ an ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANKING', - text = 'Sie haben eingezahlt ${s1}$ an ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANKING', - text = 'Jemand zieht sich bereits zurück', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANKING', - text = 'Sie haben sich zurückgezogen ${s1}$ aus ${s2}', - time = 5000, - type = 'success' - }, - - - -- ALLGEMEINES LOCALES - - ['no_creditcard'] = { - title = 'BANKING', - text = 'Ohne Kreditkarte ist der Zugang zum Geldautomaten nicht möglich', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANKING', - text = 'Ungültige Menge', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANKING', - text = 'Ungültige Eingang', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANKING', - text = 'Du hast nicht so viel Geld bei dir', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANKING', - text = 'Du hast nicht so viel Geld auf der Bank', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANKING', - text = 'Sie können kein Geld an sich selbst senden', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANKING', - text = 'Ihre Gesellschaft hat nicht so viel Geld auf der Bank', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANKING', - text = 'Sie können die Bank derzeit nicht verwenden', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANKING', - text = 'Sie haben eine Kreditkarte für ${s1}$ gekauft', - time = 5000, - type = 'success' - }, - - - -- TEXTUI LOCALES - - ['open_banking'] = { - text = '[E] Bank betreten', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Geldautomaten nutzen', - color = 'darkblue', - side = 'left' - }, - - -- QB-TARGET LOCALES - - ['open_banking_target'] = { - text = 'Bank betreten', - }, - - ['open_atm_target'] = { - text = 'Geldautomaten nutzen', - }, - -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/en.lua b/resources/[tools]/okokBanking/locales/en.lua deleted file mode 100644 index aee10bc04..000000000 --- a/resources/[tools]/okokBanking/locales/en.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['en'] = { - - -- PIN RELATED LOCALES - - ['no_pin'] = { - title = 'BANKING', - text = 'Head up to a bank first to set a PIN code', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANKING', - text = 'PIN successfully changed to ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANKING', - text = 'You need to have ${s1}€ in order to change your PIN', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANKING', - text = 'Your PIN needs to be 4 digits long', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANKING', - text = 'You can only use numbers', - time = 5000, - type = 'error' - }, - - - -- IBAN RELATED LOCALES - - ['iban_not_exist'] = { - title = 'BANKING', - text = 'This IBAN does not exist', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANKING', - text = 'This IBAN is already in use', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANKING', - text = 'You can only use numbers in your IBAN', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANKING', - text = 'IBAN successfully changed to ${s1}', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANKING', - text = 'You need to have ${s1}€ in order to change your IBAN', - time = 5000, - type = 'error' - }, - - - -- WITHDRAWN / DEPOSITED / TRANSFERRED / RECEIVED - - ['deposited'] = { - title = 'BANKING', - text = 'You have deposited ${s1}€', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANKING', - text = 'You have withdrawn ${s1}€', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANKING', - text = 'You have received ${s1}€ from ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANKING', - text = 'You have transferred ${s1}€ to ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANKING', - text = 'You have deposited ${s1}€ to ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANKING', - text = 'Someone is already withdrawing', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANKING', - text = 'You have withdrawn ${s1}€ from ${s2}', - time = 5000, - type = 'success' - }, - - - -- GENERAL LOCALES - - ['no_creditcard'] = { - title = 'BANKING', - text = 'You can not access the ATM without a credit card', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANKING', - text = 'Invalid amount', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANKING', - text = 'Invalid input', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANKING', - text = 'You don\'t have that much money on you', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANKING', - text = 'You don\'t have that much money in the bank', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANKING', - text = 'You can\'t send money to yourself', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANKING', - text = 'Your society doesn\'t have that much money in the bank', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANKING', - text = 'You can\'t use the bank at this moment', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANKING', - text = 'You bought a credit card for ${s1}€', - time = 5000, - type = 'success' - }, - - - -- TEXTUI LOCALES - - ['open_banking'] = { - text = '[E] Access Bank', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Access ATM', - color = 'darkblue', - side = 'left' - }, - - - -- QB-TARGET LOCALES - - ['open_banking_target'] = { - text = 'Access Bank', - }, - - ['open_atm_target'] = { - text = 'Access ATM', - }, -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/es.lua b/resources/[tools]/okokBanking/locales/es.lua deleted file mode 100644 index 3426e2ee9..000000000 --- a/resources/[tools]/okokBanking/locales/es.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['es'] = { - - -- PIN RELATED LOCALES - - ['no_pin'] = { - title = 'BANKING', - text = 'Diríjase primero a un banco para establecer un código PIN', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANKING', - text = 'El PIN se ha cambiado con éxito a ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANKING', - text = 'Es necesario tener ${s1}€ para cambiar su PIN', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANKING', - text = 'Su PIN debe tener 4 dígitos', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANKING', - text = 'Sólo se pueden utilizar números', - time = 5000, - type = 'error' - }, - - - -- IBAN RELATED LOCALES - - ['iban_not_exist'] = { - title = 'BANKING', - text = 'Este IBAN no existe', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANKING', - text = 'Este IBAN ya está en uso', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANKING', - text = 'Sólo puede utilizar números en su IBAN', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANKING', - text = 'El IBAN ha sido cambiado con éxito a ${s1}', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANKING', - text = 'Es necesario tener ${s1}€ para cambiar su IBAN', - time = 5000, - type = 'error' - }, - - - -- WITHDRAWN / DEPOSITED / TRANSFERRED / RECEIVED - - ['deposited'] = { - title = 'BANKING', - text = 'Has depositado ${s1}€', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANKING', - text = 'Has retirado ${s1}€', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANKING', - text = 'Has recibido ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANKING', - text = 'Has transferido ${s1}€ a ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANKING', - text = 'Has depositado ${s1}€ a ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANKING', - text = 'Alguien ya se está retirando dinero', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANKING', - text = 'Has retirado ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - - -- GENERAL LOCALES - - ['no_creditcard'] = { - title = 'BANKING', - text = 'No puedes acceder al cajero automático sin una tarjeta de crédito', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANKING', - text = 'Cantidad no válida', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANKING', - text = 'Entrada no válida', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANKING', - text = 'No tienes tanto dinero encima', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANKING', - text = 'No tienes tanto dinero en el banco', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANKING', - text = 'No puedes enviarte dinero a ti mismo', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANKING', - text = 'Su sociedad no tiene tanto dinero en el banco', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANKING', - text = 'No puedes acceder al banco en este momento', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANKING', - text = 'Has comprado una tarjeta de crédito por ${s1}€', - time = 5000, - type = 'success' - }, - - - -- TEXTUI LOCALES - - ['open_banking'] = { - text = '[E] Acceder al banco', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Acceder al ATM', - color = 'darkblue', - side = 'left' - }, - - -- QB-TARGET LOCALES - - ['open_banking_target'] = { - text = 'Acceder al banco', - }, - - ['open_atm_target'] = { - text = 'Acceder al ATM', - }, - -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/fr.lua b/resources/[tools]/okokBanking/locales/fr.lua deleted file mode 100644 index bba6d824f..000000000 --- a/resources/[tools]/okokBanking/locales/fr.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['fr'] = { - - -- LOCALES LIÉS AU PIN - - ['no_pin'] = { - title = 'BANKING', - text = 'Rendez-vous d\'abord dans une banque pour définir un code PIN', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANKING', - text = 'Le code PIN a été remplacé par ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANKING', - text = 'Vous devez disposer de ${s1}€ pour modifier votre code PIN', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANKING', - text = 'Votre code PIN doit comporter 4 chiffres', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANKING', - text = 'Vous ne pouvez utiliser que des chiffres', - time = 5000, - type = 'error' - }, - - - -- LOCALES LIÉES À L'IBAN - - ['iban_not_exist'] = { - title = 'BANKING', - text = 'Cet IBAN n\'existe pas', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANKING', - text = 'Cet IBAN est déjà utilisé', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANKING', - text = 'Vous ne pouvez utiliser que des chiffres dans votre IBAN', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANKING', - text = 'IBAN changé avec succès en ${s1}', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANKING', - text = 'Vous devez avoir ${s1}€ pour changer votre IBAN', - time = 5000, - type = 'error' - }, - - - -- RETIRÉ / DÉPOSÉ / TRANSFÉRÉ / REÇU - - ['deposited'] = { - title = 'BANKING', - text = 'Vous avez déposé ${s1}€', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANKING', - text = 'Vous avez retiré ${s1}€', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANKING', - text = 'Vous avez reçu ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANKING', - text = 'Vous avez transféré ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANKING', - text = 'Vous avez déposé ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANKING', - text = 'Quelqu\'un se retire déjà', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANKING', - text = 'Vous avez retiré ${s1}€ depuis ${s2}', - time = 5000, - type = 'success' - }, - - - -- LOCALES GÉNÉRAUX - - ['no_creditcard'] = { - title = 'BANKING', - text = 'Vous ne pouvez pas accéder au guichet automatique sans carte de crédit', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANKING', - text = 'Montant invalide', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANKING', - text = 'Entrée invalide', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANKING', - text = 'Vous n\'avez pas beaucoup d\'argent sur vous', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANKING', - text = 'Vous n\'avez pas beaucoup d\'argent à la banque', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANKING', - text = 'Vous ne pouvez pas vous envoyer d\'argent', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANKING', - text = 'Votre société n\'a pas autant d\'argent à la banque', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANKING', - text = 'Vous ne pouvez pas utiliser la banque pour le moment', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANKING', - text = 'Vous avez acheté une carte de crédit pour ${s1}€', - time = 5000, - type = 'success' - }, - - - -- TEXTUI LOCALES - - ['open_banking'] = { - text = '[E] Accéder à la banque', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Accéder au ATM', - color = 'darkblue', - side = 'left' - }, - - -- QB-TARGET LOCALES - - ['open_banking_target'] = { - text = 'Accéder à la banque', - }, - - ['open_atm_target'] = { - text = 'Accéder au ATM', - }, - -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/gr.lua b/resources/[tools]/okokBanking/locales/gr.lua deleted file mode 100644 index 7eed73940..000000000 --- a/resources/[tools]/okokBanking/locales/gr.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['gr'] = { - - -- ΣΧΕΤΙΚΟ ΤΟ PIN ΜΕΤΑΦΡΑΣΕΙΣ - - ['no_pin'] = { - title = 'BANKING', - text = 'Απευθυνθείτε πρώτα σε μια τράπεζα για να ορίσετε έναν κωδικό PIN', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANKING', - text = 'Το PIN άλλαξε με επιτυχία σε ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANKING', - text = 'Πρέπει να έχετε ${s1}€ για να αλλάξετε το PIN σας', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANKING', - text = 'Το PIN σας πρέπει να αποτελείται από 4 ψηφία', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANKING', - text = 'Μπορείτε να χρησιμοποιήσετε μόνο αριθμούς', - time = 5000, - type = 'error' - }, - - - -- ΣΧΕΤΙΚΟ IBAN ΜΕΤΑΦΡΑΣΕΙΣ - - ['iban_not_exist'] = { - title = 'BANKING', - text = 'Αυτό το IBAN δεν υπάρχει', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANKING', - text = 'Αυτό το IBAN χρησιμοποιείται ήδη', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANKING', - text = 'Μπορείτε να χρησιμοποιήσετε μόνο αριθμούς στον IBAN σας', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANKING', - text = 'Το IBAN άλλαξε με επιτυχία σε ${s1}', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANKING', - text = 'Πρέπει να έχετε ${s1}€ για να αλλάξετε τον IBAN σας', - time = 5000, - type = 'error' - }, - - - -- ΑΝΑΛΗΨΗ / ΚΑΤΑΘΕΣΗ / ΜΕΤΑΒΙΒΑΣΗ / ΛΗΨΗ - - ['deposited'] = { - title = 'BANKING', - text = 'Έχετε καταθέσει ${s1}€', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANKING', - text = 'Έχετε αποσυρθεί ${s1}€', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANKING', - text = 'Έχετε λάβει ${s1}€ από ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANKING', - text = 'Έχετε μεταφέρει ${s1}€ στο ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANKING', - text = 'Έχετε καταθέσει ${s1}€ στο ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANKING', - text = 'Κάποιος ήδη αποσύρεται', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANKING', - text = 'Έχετε κάνει ανάληψη ${s1}€ από ${s2}', - time = 5000, - type = 'success' - }, - - - -- ΓΕΝΙΚΕΣ ΜΕΤΑΦΡΑΣΕΙΣ - - ['no_creditcard'] = { - title = 'BANKING', - text = 'Δεν μπορείτε να έχετε πρόσβαση στο ΑΤΜ χωρίς πιστωτική κάρτα.', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANKING', - text = 'Μη έγκυρο ποσό', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANKING', - text = 'Μη έγκυρη εισαγωγή', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANKING', - text = 'Δεν έχεις τόσα χρήματα πάνω σου', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANKING', - text = 'Δεν έχεις τόσα χρήματα στην τράπεζα', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANKING', - text = 'Δεν μπορείτε να στείλετε χρήματα στον εαυτό σας', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANKING', - text = 'Η κοινωνία σας δεν έχει τόσα χρήματα στην τράπεζα', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANKING', - text = 'Δεν μπορείτε να χρησιμοποιήσετε την τράπεζα αυτή τη στιγμή', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANKING', - text = 'Αγοράσατε μια πιστωτική κάρτα για ${s1}€', - time = 5000, - type = 'success' - }, - - - -- TEXTUI ΜΕΤΑΦΡΑΣΕΙΣ - - ['open_banking'] = { - text = '[E] Να ανοίξω την τράπεζα', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Aνοίξτε το ΑΤΜ', - color = 'darkblue', - side = 'left' - }, - - -- QB-TARGET ΜΕΤΑΦΡΑΣΕΙΣ - - ['open_banking_target'] = { - text = 'Να ανοίξω την τράπεζα', - }, - - ['open_atm_target'] = { - text = 'Aνοίξτε το ΑΤΜ', - }, - -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/locales/pt.lua b/resources/[tools]/okokBanking/locales/pt.lua deleted file mode 100644 index 987c9f36b..000000000 --- a/resources/[tools]/okokBanking/locales/pt.lua +++ /dev/null @@ -1,221 +0,0 @@ -Locales['pt'] = { - - -- PIN - - ['no_pin'] = { - title = 'BANCO', - text = 'Desloca-te a um banco para definires um código PIN', - time = 5000, - type = 'error' - }, - - ['pin_changed'] = { - title = 'BANCO', - text = 'Código PIN alterado com sucesso para ${s1}', - time = 5000, - type = 'success' - }, - - ['pin_no_money'] = { - title = 'BANCO', - text = 'Necessitas de ${s1}€ para alterar o teu código PIN', - time = 5000, - type = 'error' - }, - - ['pin_digits'] = { - title = 'BANCO', - text = 'O código PIN deve ter 4 dígitos', - time = 5000, - type = 'error' - }, - - ['pin_only_numbers'] = { - title = 'BANCO', - text = 'Apenas podes usar números', - time = 5000, - type = 'error' - }, - - - -- IBAN - - ['iban_not_exist'] = { - title = 'BANCO', - text = 'Este IBAN não existe', - time = 5000, - type = 'error' - }, - - ['iban_in_use'] = { - title = 'BANCO', - text = 'Este IBAN já se encontra em uso', - time = 5000, - type = 'error' - }, - - ['iban_only_numbers'] = { - title = 'BANCO', - text = 'Apenas podes usar números no IBAN', - time = 5000, - type = 'error' - }, - - ['iban_changed'] = { - title = 'BANCO', - text = 'IBAN alterado com sucesso para ${s1}', - time = 5000, - type = 'success' - }, - - ['iban_no_money'] = { - title = 'BANCO', - text = 'Necessitas de ${s1}€ para alterar o teu IBAN', - time = 5000, - type = 'error' - }, - - - -- LEVANTAMENTO / DEPÓSITO / TRANSFERÊNCIA / RECEBIDO - - ['deposited'] = { - title = 'BANCO', - text = 'Depositaste ${s1}€', - time = 5000, - type = 'success' - }, - - ['withdrawn'] = { - title = 'BANCO', - text = 'Levantaste ${s1}€', - time = 5000, - type = 'success' - }, - - ['received_from'] = { - title = 'BANCO', - text = 'Recebeste ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - ['transferred_to'] = { - title = 'BANCO', - text = 'Transferiste ${s1}€ para ${s2}', - time = 5000, - type = 'success' - }, - - ['deposited_to'] = { - title = 'BANCO', - text = 'Depositaste ${s1}€ para ${s2}', - time = 5000, - type = 'success' - }, - - ['someone_withdrawing'] = { - title = 'BANCO', - text = 'Alguém já está a levantar dinheiro', - time = 5000, - type = 'error' - }, - - ['you_have_withdrawn'] = { - title = 'BANCO', - text = 'Levantaste ${s1}€ de ${s2}', - time = 5000, - type = 'success' - }, - - - -- GERAL - - ['no_creditcard'] = { - title = 'BANCO', - text = 'Não podes aceder ao multibanco sem um cartão de crédito', - time = 5000, - type = 'error' - }, - - ['invalid_amount'] = { - title = 'BANCO', - text = 'Valor inválido', - time = 5000, - type = 'error' - }, - - ['invalid_input'] = { - title = 'BANCO', - text = 'Input inválido', - time = 5000, - type = 'error' - }, - - ['no_money_pocket'] = { - title = 'BANCO', - text = 'Não tens dinheiro suficiente na mão', - time = 5000, - type = 'error' - }, - - ['no_money_bank'] = { - title = 'BANCO', - text = 'Não tens dinheiro suficiente no banco', - time = 5000, - type = 'error' - }, - - ['not_send_yourself'] = { - title = 'BANCO', - text = 'Não podes transferir dinheiro para ti próprio', - time = 5000, - type = 'error' - }, - - ['society_no_money'] = { - title = 'BANCO', - text = 'A tua organização não tem dinheiro suficiente no banco', - time = 5000, - type = 'error' - }, - - ['not_use_bank'] = { - title = 'BANCO', - text = 'Não podes usar o banco neste momento', - time = 5000, - type = 'error' - }, - - ['bought_cc'] = { - title = 'BANCO', - text = 'Compraste um cartão de crédito por ${s1}€', - time = 5000, - type = 'success' - }, - - - -- TEXTUI - - ['open_banking'] = { - text = '[E] Aceder ao Banco', - color = 'darkblue', - side = 'left' - }, - - ['open_atm'] = { - text = '[E] Aceder à ATM', - color = 'darkblue', - side = 'left' - }, - - -- QB-TARGET LOCALES - - ['open_banking_target'] = { - text = 'Aceder ao Banco', - }, - - ['open_atm_target'] = { - text = 'Aceder à ATM', - }, - -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/okokbanking.sql b/resources/[tools]/okokBanking/okokbanking.sql deleted file mode 100644 index 4624cab50..000000000 --- a/resources/[tools]/okokBanking/okokbanking.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE `okokbanking_transactions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `receiver_identifier` varchar(255) NOT NULL, - `receiver_name` varchar(255) NOT NULL, - `sender_identifier` varchar(255) NOT NULL, - `sender_name` varchar(255) NOT NULL, - `date` varchar(255) NOT NULL, - `value` int(50) NOT NULL, - `type` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -); - -CREATE TABLE `okokbanking_societies` ( - `society` varchar(255) NULL DEFAULT NULL, - `society_name` varchar(255) NULL DEFAULT NULL, - `value` int(50) NULL DEFAULT NULL, - `iban` varchar(255) NOT NULL, - `is_withdrawing` int(1) NULL DEFAULT NULL -); - -ALTER TABLE `players` ADD COLUMN `pincode` int(50) NULL DEFAULT NULL; -ALTER TABLE `management_funds` ADD COLUMN `iban` varchar(255) DEFAULT NULL; \ No newline at end of file diff --git a/resources/[tools]/okokBanking/server.lua b/resources/[tools]/okokBanking/server.lua deleted file mode 100644 index c09154ad2..000000000 --- a/resources/[tools]/okokBanking/server.lua +++ /dev/null @@ -1,1792 +0,0 @@ -local QBCore = exports["qb-core"]:GetCoreObject() - -local Webhook = '' - -local playerWithMenuOpen = {} - -RegisterServerEvent("okokBanking:setMenuOpened") -AddEventHandler("okokBanking:setMenuOpened", function(opened) - local source = source - if opened then - playerWithMenuOpen[source] = opened - else - playerWithMenuOpen[source] = nil - end -end) - -function interp(s, tab) - return (s:gsub('($%b{})', function(w) return tab[w:sub(3, -2)] or w end)) -end - -function AddMoney(society, amount) - -- Check if society exists, create it if it doesn't - local exists = MySQL.scalar.await("SELECT 1 FROM okokbanking_societies WHERE society = ?", { society }) - if not exists then - -- Create Iban - local iban = Config.IBANPrefix .. society - local societyName = QBCore.Shared.Jobs[society] and QBCore.Shared.Jobs[society].label or society - return MySQL.insert.await("INSERT INTO okokbanking_societies (society, society_name, iban, value) VALUES (?,?,?,?)",{ society, societyName, iban, amount }) - end - - MySQL.update.await('UPDATE okokbanking_societies SET value = value + @value WHERE society = @society OR society = @society2', { - ['@value'] = amount, - ['@society'] = 'society_' .. string.gsub(society, "society_", ""), - ['@society2'] = string.gsub(society, "society_", ""), - }) - return true -end - -function RemoveMoney(society, amount) - MySQL.update.await('UPDATE okokbanking_societies SET value = value - @value WHERE society = @society OR society = @society2', { - ['@value'] = amount, - ['@society'] = 'society_' .. string.gsub(society, "society_", ""), - ['@society2'] = string.gsub(society, "society_", ""), - }) - return true -end - -function GetAccount(society) - local done = false - local money = 0 - - MySQL.query('SELECT value FROM okokbanking_societies WHERE society = @society OR society = @society2', { - ['@society'] = 'society_'..string.gsub(society, "society_", ""), - ['@society2'] = string.gsub(society, "society_", "") - }, function(result) - local db = result[1] - done = true - if db ~= nil then - if db.value ~= nil then - money = tonumber(db.value) - end - end - end) - - while not done do - Citizen.Wait(1) - end - - return money -end - -if Config.UseCashAsItem then - QBCore.Functions.CreateCallback("okokBanking:GetPlayerInfo", function(source, cb) - local xPlayer = QBCore.Functions.GetPlayer(source) - local itemCash = xPlayer.Functions.GetItemByName("cash") - local itemCashAmount = 0 - if itemCash then - itemCashAmount = itemCash.amount - end - MySQL.query('SELECT * FROM players WHERE citizenid = @identifier', { - ['@identifier'] = xPlayer.PlayerData.citizenid - }, function(result) - local db = result[1] - local data = { - playerName = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, - playerBankMoney = xPlayer.PlayerData.money.bank, - playerIBAN = xPlayer.PlayerData.charinfo.account, - walletMoney = itemCashAmount, - sex = xPlayer.PlayerData.charinfo.gender, - isBoss = xPlayer.PlayerData.job.isboss, - isBossGang = xPlayer.PlayerData.gang.isboss - } - - cb(data) - end) - end) -else - QBCore.Functions.CreateCallback("okokBanking:GetPlayerInfo", function(source, cb) - local xPlayer = QBCore.Functions.GetPlayer(source) - MySQL.query('SELECT * FROM players WHERE citizenid = @identifier', { - ['@identifier'] = xPlayer.PlayerData.citizenid - }, function(result) - local db = result[1] - local data = { - playerName = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, - playerBankMoney = xPlayer.PlayerData.money.bank, - playerIBAN = xPlayer.PlayerData.charinfo.account, - walletMoney = xPlayer.PlayerData.money.cash, - sex = xPlayer.PlayerData.charinfo.gender, - isBoss = xPlayer.PlayerData.job.isboss, - isBossGang = xPlayer.PlayerData.gang.isboss - } - - cb(data) - end) - end) -end - -QBCore.Functions.CreateCallback("okokBanking:IsIBanUsed", function(source, cb, iban) - local xPlayer = QBCore.Functions.GetPlayer(source) - - MySQL.query('SELECT * FROM players WHERE JSON_EXTRACT(charinfo, "$.account") = @iban', { - ['@iban'] = iban - }, function(result) - local db = result[1] - - if db ~= nil then - cb(db, true, xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname) - else - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - MySQL.query('SELECT * FROM bank_accounts WHERE iban = @iban', { - ['@iban'] = iban - }, function(result2) - local db2 = result2[1] - local dbdata - if db2 ~= nil then - dbdata = { - iban = db2.iban, - value = db2.account_balance, - society_name = db2.account_name, - society = db2.account_name - } - end - - cb(dbdata, false) - end) - else - MySQL.query('SELECT * FROM management_funds WHERE iban = @iban', { - ['@iban'] = iban - }, function(result2) - local db2 = result2[1] - local dbdata - if db2 ~= nil then - dbdata = { - iban = db2.iban, - value = db2.amount, - society_name = db2.job_name, - society = db2.job_name - } - end - - cb(dbdata, false) - end) - end - else - MySQL.query('SELECT * FROM okokbanking_societies WHERE iban = @iban', { - ['@iban'] = iban - }, function(result2) - local db2 = result2[1] - - cb(db2, false) - end) - end - end - end) -end) - -QBCore.Functions.CreateCallback("okokBanking:GetPIN", function(source, cb) - local xPlayer = QBCore.Functions.GetPlayer(source) - - MySQL.query('SELECT pincode FROM players WHERE citizenid = @identifier', { - ['@identifier'] = xPlayer.PlayerData.citizenid, - }, function(result) - local pin = result[1] - - cb(pin.pincode) - end) -end) - -QBCore.Functions.CreateCallback("okokBanking:SocietyInfo", function(source, cb, society, iban) - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - MySQL.query('SELECT * FROM bank_accounts WHERE account_name = @account_name', { - ['@account_name'] = society, - }, function(result) - local db = result[1] - local aa - if db ~= nil then - if db.iban ~= nil then - aa = { - value = db.account_balance, - society_name = db.account_name, - society = db.account_name, - iban = db.iban - } - else - MySQL.query('UPDATE bank_accounts SET iban = @iban WHERE account_name = @account_name', { - ['@iban'] = string.gsub(iban:upper(), " ", ""), - ['@account_name'] = society, - }, function(result2) - local db2 = result2[1] - if db2 ~= nil then - aa = { - value = db2.account_balance, - society_name = db2.account_name, - society = db2.account_name, - iban = db2.iban - } - end - end) - end - end - cb(aa) - end) - else - MySQL.query('SELECT * FROM management_funds WHERE job_name = @job_name', { - ['@job_name'] = society, - }, function(result) - local db = result[1] - local aa - if db ~= nil then - if db.iban ~= nil then - aa = { - value = db.amount, - society_name = db.job_name, - society = db.job_name, - iban = db.iban - } - else - MySQL.query('UPDATE management_funds SET iban = @iban WHERE job_name = @job_name', { - ['@iban'] = string.gsub(iban:upper(), " ", ""), - ['@job_name'] = society, - }, function(result2) - local db2 = result2[1] - if db2 ~= nil then - aa = { - value = db2.amount, - society_name = db2.job_name, - society = db2.job_name, - iban = db2.iban - } - end - end) - end - end - cb(aa) - end) - end - else - MySQL.query('SELECT * FROM okokbanking_societies WHERE society = @society', { - ['@society'] = society - }, function(result) - local db = result[1] - cb(db) - end) - end -end) - -RegisterServerEvent("okokBanking:CreateSocietyAccount") -AddEventHandler("okokBanking:CreateSocietyAccount", function(society, society_name, value, iban) - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - MySQL.query('SELECT * FROM bank_accounts WHERE account_name = @account_name', { - ['@account_name'] = society, - }, function(result) - local db = result[1] - if db == nil then - MySQL.query('INSERT INTO bank_accounts (account_name, account_balance, iban) VALUES (@account_name, @account_balance, @iban)', { - ['@account_name'] = society, - ['@account_balance'] = value, - ['@iban'] = string.gsub(iban:upper(), "%s+", ""), - }, function (result) - end) - end - end) - else - MySQL.query('SELECT * FROM management_funds WHERE job_name = @job_name', { - ['@job_name'] = society, - }, function(result) - local db = result[1] - if db == nil then - MySQL.query('INSERT INTO management_funds (job_name, amount, iban) VALUES (@job_name, @amount, @iban)', { - ['@job_name'] = society, - ['@amount'] = value, - ['@iban'] = string.gsub(iban:upper(), "%s+", ""), - }, function (result) - end) - end - end) - end - else - MySQL.query('INSERT INTO okokbanking_societies (society, society_name, value, iban) VALUES (@society, @society_name, @value, @iban)', { - ['@society'] = society, - ['@society_name'] = society_name, - ['@value'] = value, - ['@iban'] = string.gsub(iban:upper(), "%s+", ""), - }, function (result) - end) - end -end) - -RegisterServerEvent("okokBanking:SetIBAN") -AddEventHandler("okokBanking:SetIBAN", function(iban) - local src = source - local Player = QBCore.Functions.GetPlayer(src) - - if not Player then - print("[okokBanking] Player not found") - return - end - - -- Debug-Ausgabe - print("[okokBanking] Setting IBAN for player: " .. Player.PlayerData.citizenid .. " to: " .. iban) - - -- Update the IBAN in the character info - local charinfo = Player.PlayerData.charinfo - charinfo.account = iban -- QBCore verwendet normalerweise 'account' für die IBAN - - -- Save to player data - Player.Functions.SetPlayerData('charinfo', charinfo) - - -- Direkte MySQL-Aktualisierung - MySQL.Async.execute('UPDATE players SET charinfo = @charinfo WHERE citizenid = @citizenid', { - ['@charinfo'] = json.encode(charinfo), - ['@citizenid'] = Player.PlayerData.citizenid - }, function(rowsChanged) - if rowsChanged > 0 then - print("[okokBanking] Successfully updated IBAN in database") - -- Aktualisiere die IBAN im Client - TriggerClientEvent('okokBanking:updateIban', src, iban) - else - print("[okokBanking] Failed to update IBAN in database") - end - end) -end) - - - - -QBCore.Functions.CreateCallback("okokBanking:HasCreditCard", function(source, cb) - local xPlayer = QBCore.Functions.GetPlayer(source) - if xPlayer ~= nil then - local item = xPlayer.Functions.GetItemByName(Config.CreditCardItem) - if item ~= nil then - cb(item.amount >= 1) - else - cb(false) - end - else - cb(false) - end -end) - -RegisterServerEvent("okokBanking:DepositMoney") -AddEventHandler("okokBanking:DepositMoney", function(amount) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoney = xPlayer.PlayerData.money.cash - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCash = 0 - if itemCash ~= nil then - playerMoneyCash = itemCash.amount - end - - if not playerWithMenuOpen[source] then - return - end - - if amount <= playerMoney and not Config.UseCashAsItem or amount <= playerMoneyCash and Config.UseCashAsItem then - if Config.UseCashAsItem then - xPlayer.Functions.RemoveItem('cash', amount) - else - xPlayer.Functions.RemoveMoney('cash', amount) - end - xPlayer.Functions.AddMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCashUpdated = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCashUpdated = 0 - if itemCashUpdated ~= nil then - playerMoneyCashUpdated = itemCashUpdated.amount - end - TriggerEvent('okokBanking:AddDepositTransaction', amount, _source) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, playerMoneyCashUpdated) - else - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('deposited').title, interp(_L('deposited').text, {s1 = amount}), _L('deposited').time, _L('deposited').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('deposited').text, {s1 = amount}), _L('deposited').type) - end - DepositMoneyWebhook({sender_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, value = GroupDigits(amount)}) - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_pocket').title, _L('no_money_pocket').text, _L('no_money_pocket').time, _L('no_money_pocket').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_pocket').text, _L('no_money_pocket').type) - end - end -end) - -RegisterServerEvent("okokBanking:WithdrawMoney") -AddEventHandler("okokBanking:WithdrawMoney", function(amount) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoney = xPlayer.PlayerData.money.bank - local playerMoneyCash = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCashAmount = 0 - if playerMoneyCash then - playerMoneyCashAmount = playerMoneyCash.amount - end - - if not playerWithMenuOpen[source] then - return - end - - if amount <= playerMoney then - if Config.UseCashAsItem then - xPlayer.Functions.AddItem('cash', amount) - else - xPlayer.Functions.AddMoney('cash', amount) - end - xPlayer.Functions.RemoveMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoneyCash = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCashAmount = 0 - if playerMoneyCash then - playerMoneyCashAmount = playerMoneyCash.amount - end - - TriggerEvent('okokBanking:AddWithdrawTransaction', amount, _source) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, playerMoneyCashAmount) - else - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('withdrawn').title, interp(_L('withdrawn').text, {s1 = amount}), _L('withdrawn').time, _L('withdrawn').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('withdrawn').text, {s1 = amount}), _L('withdrawn').type) - end - WithdrawMoneyWebhook({receiver_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, value = GroupDigits(amount)}) - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_bank').title, _L('no_money_bank').text, _L('no_money_bank').time, _L('no_money_bank').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_bank').text, _L('no_money_bank').type) - end - end -end) - -RegisterServerEvent("okokBanking:TransferMoney") -AddEventHandler("okokBanking:TransferMoney", function(amount, ibanNumber, targetIdentifier, acc, targetName) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local xTarget = QBCore.Functions.GetPlayerByCitizenId(targetIdentifier) - local xPlayers = QBCore.Functions.GetPlayers() - local playerMoney = xPlayer.PlayerData.money.bank - local itemCash = xPlayer.Functions.GetItemByName("cash") - local PlayerCashMoney = 0 - if itemCash ~= nil then - PlayerCashMoney = itemCash.amount - end - ibanNumber = ibanNumber:upper() - - if xPlayer.PlayerData.citizenid ~= targetIdentifier then - if amount <= playerMoney or amount <= PlayerCashMoney then - if xTarget ~= nil then - xPlayer.Functions.RemoveMoney('bank', amount) - xTarget.Functions.AddMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - - for i=1, #xPlayers, 1 do - local xForPlayer = QBCore.Functions.GetPlayer(xPlayers[i]) - - if xForPlayer.PlayerData.citizenid == targetIdentifier then - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', xPlayers[i], xTarget.PlayerData.money.bank, PlayerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactions', xPlayers[i], xTarget.PlayerData.money.bank, xTarget.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', xPlayers[i], _L('received_from').title, interp(_L('received_from').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('received_from').time, _L('received_from').type) - else - TriggerClientEvent('QBCore:Notify', xPlayers[i], interp(_L('received_from').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('received_from').type) - end - end - end - local tName = xTarget.PlayerData.charinfo.firstname..' '..xTarget.PlayerData.charinfo.lastname - TriggerEvent('okokBanking:AddTransferTransaction', amount, xTarget, _source, tName, targetIdentifier) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, PlayerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('transferred_to').time, _L('transferred_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, receiver_name = tName, value = amount}) - elseif xTarget == nil then - local playerAccount = json.decode(acc) - playerAccount.bank = playerAccount.bank + amount - playerAccount = json.encode(playerAccount) - xPlayer.Functions.RemoveMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - TriggerEvent('okokBanking:AddTransferTransaction', amount, 1, _source, targetName, targetIdentifier) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, PlayerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = targetName}), _L('transferred_to').time, _L('transferred_to').type) - - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = targetName}), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, receiver_name = targetName..' (Offline User)', value = amount}) - - MySQL.query('UPDATE players SET money = @playerAccount WHERE citizenid = @target', { - ['@playerAccount'] = playerAccount, - ['@target'] = targetIdentifier - }, function(changed) - end) - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_bank').title, _L('no_money_bank').text, _L('no_money_bank').time, _L('no_money_bank').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_bank').text, _L('no_money_bank').type) - end - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('not_send_yourself').title, _L('not_send_yourself').text, _L('not_send_yourself').time, _L('not_send_yourself').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('not_send_yourself').text, _L('not_send_yourself').type) - end - end -end) - -RegisterServerEvent("okokBanking:DepositMoneyToSociety") -AddEventHandler("okokBanking:DepositMoneyToSociety", function(amount, society, societyName) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoney = xPlayer.PlayerData.money.cash - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCash = 0 - if itemCash ~= nil then - playerMoneyCash = itemCash.amount - end - - if amount <= playerMoney and not Config.UseCashAsItem or amount <= playerMoneyCash and Config.UseCashAsItem then - if Config.UseQBManagement then - exports['qb-management']:AddMoney(society, amount) - elseif Config.UseQBBanking then - -- Direct database update for qb-banking since export isn't available - MySQL.query('UPDATE bank_accounts SET account_balance = account_balance + @amount WHERE account_name = @society', { - ['@amount'] = amount, - ['@society'] = society, - }, function(changed) - print("Updated bank account for " .. society .. " with amount " .. amount) - end) - else - MySQL.query('UPDATE okokbanking_societies SET value = value + @value WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - end) - end - - if Config.UseCashAsItem then - xPlayer.Functions.RemoveItem('cash', amount) - else - xPlayer.Functions.RemoveMoney('cash', amount) - end - xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCashUpdated = xPlayer.Functions.GetItemByName("cash") - local playerMoneyCashUpdated = 0 - if itemCashUpdated ~= nil then - playerMoneyCashUpdated = itemCashUpdated.amount - end - TriggerEvent('okokBanking:AddDepositTransactionToSociety', amount, _source, society, societyName) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, playerMoneyCashUpdated) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('deposited_to').title, interp(_L('deposited_to').text, {s1 = amount, s2 = societyName}), _L('deposited_to').time, _L('deposited_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('deposited_to').text, {s1 = amount, s2 = societyName}), _L('deposited_to').type) - end - TransferMoneyWebhook({sender_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, receiver_name = societyName..' ('..society..')', value = amount}) - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_pocket').title, _L('no_money_pocket').text, _L('no_money_pocket').time, _L('no_money_pocket').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_pocket').text, _L('no_money_pocket').type) - end - end -end) - - -RegisterServerEvent("okokBanking:WithdrawMoneyToSociety") -AddEventHandler("okokBanking:WithdrawMoneyToSociety", function(amount, society, societyName, societyMoney) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local db - local hasChecked = false - - if Config.UseQBManagement then - MySQL.Async.fetchAll('SELECT * FROM management_funds WHERE job_name = @job_name', { - ['@job_name'] = society, - }, function(result) - db = result[1] - hasChecked = true - db.value = db.amount - end) - elseif Config.UseQBBanking then - MySQL.Async.fetchAll('SELECT * FROM bank_accounts WHERE account_name = @account_name', { - ['@account_name'] = society, - }, function(result) - db = result[1] - hasChecked = true - db.value = db.account_balance - end) - else - MySQL.query('SELECT * FROM okokbanking_societies WHERE society = @society', { - ['@society'] = society - }, function(result) - db = result[1] - hasChecked = true - end) - end - - if not Config.UseQBManagement then - MySQL.query('UPDATE okokbanking_societies SET is_withdrawing = 1 WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - end) - end - - while not hasChecked do - Citizen.Wait(100) - end - - if amount <= db.value then - if db.is_withdrawing == 1 then - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('someone_withdrawing').title, _L('someone_withdrawing').text, _L('someone_withdrawing').time, _L('someone_withdrawing').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('someone_withdrawing').text, _L('someone_withdrawing').type) - end - else - if Config.UseQBManagement then - exports['qb-management']:RemoveMoney(society, amount) - elseif Config.UseQBBanking then - -- Direct database update for qb-banking since export isn't available - MySQL.query('UPDATE bank_accounts SET account_balance = account_balance - @amount WHERE account_name = @society', { - ['@amount'] = amount, - ['@society'] = society, - }, function(changed) - print("Updated bank account for " .. society .. " with withdrawal of " .. amount) - end) - else - MySQL.query('UPDATE okokbanking_societies SET value = value - @value WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - end) - end - - if Config.UseCashAsItem then - xPlayer.Functions.AddItem('cash', amount) - else - xPlayer.Functions.AddMoney('cash', amount) - end - xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCash = xPlayer.Functions.GetItemByName("cash") - local PlayerCashMoney = 0 - if itemCash ~= nil then - PlayerCashMoney = itemCash.amount - end - TriggerEvent('okokBanking:AddWithdrawTransactionToSociety', amount, _source, society, societyName) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, PlayerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('you_have_withdrawn').title, interp(_L('you_have_withdrawn').text, {s1 = amount, s2 = societyName}), _L('you_have_withdrawn').time, _L('you_have_withdrawn').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('you_have_withdrawn').text, {s1 = amount, s2 = societyName}), _L('you_have_withdrawn').type) - end - TransferMoneyWebhook({sender_name = societyName..' ('..society..')', receiver_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, value = amount}) - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('society_no_money').title, _L('society_no_money').text, _L('society_no_money').time, _L('society_no_money').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('society_no_money').text, _L('society_no_money').type) - end - end - - if not Config.UseQBManagement then - MySQL.query('UPDATE okokbanking_societies SET is_withdrawing = 0 WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - end) - end -end) - - - -RegisterServerEvent("okokBanking:TransferMoneyToSociety") -AddEventHandler("okokBanking:TransferMoneyToSociety", function(amount, ibanNumber, societyName, society) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoney = xPlayer.PlayerData.money.bank - - if amount <= playerMoney then - if Config.UseQBManagement then - exports['qb-management']:AddMoney(society, amount) - elseif Config.UseQBBanking then - -- Direct database update for qb-banking since export isn't available - MySQL.query('UPDATE bank_accounts SET account_balance = account_balance + @amount WHERE account_name = @society', { - ['@amount'] = amount, - ['@society'] = society, - }, function(changed) - print("Updated bank account for " .. society .. " with transfer of " .. amount) - end) - else - MySQL.query('UPDATE okokbanking_societies SET value = value + @value WHERE iban = @iban', { - ['@value'] = amount, - ['@iban'] = ibanNumber - }, function(changed) - end) - end - - xPlayer.Functions.RemoveMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - TriggerEvent('okokBanking:AddTransferTransactionToSociety', amount, _source, society, societyName) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, playerCashMoney) - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, playerCashMoney) - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - TriggerClientEvent('okokBanking:updateTransactions', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = societyName}), _L('transferred_to').time, _L('transferred_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = societyName}), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname, receiver_name = societyName..' ('..society..')', value = amount}) - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_bank').title, _L('no_money_bank').text, _L('no_money_bank').time, _L('no_money_bank').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_bank').text, _L('no_money_bank').type) - end - end -end) - - -function getSocietyInfo(society, iban) - local done = false - local societyInfo = nil - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - MySQL.query('SELECT * FROM bank_accounts WHERE account_name = @account_name', { - ['@account_name'] = society, - }, function(result) - local db = result[1] - local aa - if db ~= nil then - if db.iban ~= nil then - aa = { - value = db.account_balance, - society_name = db.account_name, - society = db.account_name, - iban = db.iban - } - else - MySQL.query('UPDATE bank_accounts SET iban = @iban WHERE account_name = @account_name', { - ['@iban'] = string.gsub(iban:upper(), " ", ""), - ['@account_name'] = society, - }, function(result2) - local db2 = result2[1] - if db2 ~= nil then - aa = { - value = db2.account_balance, - society_name = db2.account_name, - society = db2.account_name, - iban = db2.iban - } - end - end) - end - end - societyInfo = aa - done = true - end) - else - MySQL.query('SELECT * FROM management_funds WHERE job_name = @job_name', { - ['@job_name'] = society, - }, function(result) - local db = result[1] - local aa - if db ~= nil then - if db.iban ~= nil then - aa = { - value = db.amount, - society_name = db.job_name, - society = db.job_name, - iban = db.iban - } - else - MySQL.query('UPDATE management_funds SET iban = @iban WHERE job_name = @job_name', { - ['@iban'] = string.gsub(iban:upper(), " ", ""), - ['@job_name'] = society, - }, function(result2) - local db2 = result2[1] - if db2 ~= nil then - aa = { - value = db2.amount, - society_name = db2.job_name, - society = db2.job_name, - iban = db2.iban - } - end - end) - end - end - societyInfo = aa - done = true - end) - end - else - MySQL.query('SELECT * FROM okokbanking_societies WHERE society = @society', { - ['@society'] = society - }, function(result) - local db = result[1] - societyInfo = db - done = true - end) - end - while not done do - Citizen.Wait(100) - end - return societyInfo -end - - - -RegisterServerEvent("okokBanking:TransferMoneyToSocietyFromSociety") -AddEventHandler("okokBanking:TransferMoneyToSocietyFromSociety", function(amount, ibanNumber, societyNameTarget, societyTarget, society, societyName, societyMoney) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerJob = xPlayer.PlayerData.job.name - - if society ~= playerJob then - return - end - - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - local xTarget = QBCore.Functions.GetPlayerByCitizenId(targetIdentifier) - local xPlayers = QBCore.Functions.GetPlayers() - - local societyInfo = getSocietyInfo(society, ibanNumber) - - if amount <= societyInfo.value then - if Config.UseQBManagement then - exports['qb-management']:RemoveMoney(society, amount) - exports['qb-management']:AddMoney(societyTarget, amount) - elseif Config.UseQBBanking then - -- Direct database update for qb-banking since export isn't available - MySQL.query('UPDATE bank_accounts SET account_balance = account_balance - @amount WHERE account_name = @society', { - ['@amount'] = amount, - ['@society'] = society, - }, function(changed) - print("Updated source bank account for " .. society .. " with transfer of " .. amount) - - MySQL.query('UPDATE bank_accounts SET account_balance = account_balance + @amount WHERE account_name = @society', { - ['@amount'] = amount, - ['@society'] = societyTarget, - }, function(changed) - print("Updated target bank account for " .. societyTarget .. " with transfer of " .. amount) - end) - end) - else - MySQL.query('UPDATE okokbanking_societies SET value = value - @value WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - MySQL.query('UPDATE okokbanking_societies SET value = value + @value WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = societyTarget, - ['@society_name'] = societyNameTarget, - }, function(changed) - end) - end) - end - - TriggerEvent('okokBanking:AddTransferTransactionFromSociety', amount, society, societyName, societyTarget, societyNameTarget) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = societyNameTarget}), _L('transferred_to').time, _L('transferred_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = societyNameTarget}), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = societyName..' ('..society..')', receiver_name = societyNameTarget..' ('..societyTarget..')', value = amount}) - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('society_no_money').title, _L('society_no_money').text, _L('society_no_money').time, _L('society_no_money').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('society_no_money').text, _L('society_no_money').type) - end - end -end) - - - - - -RegisterServerEvent("okokBanking:TransferMoneyToPlayerFromSociety") -AddEventHandler("okokBanking:TransferMoneyToPlayerFromSociety", function(amount, ibanNumber, targetIdentifier, acc, targetName, society, societyName, societyMoney, toMyself) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - local xTarget = QBCore.Functions.GetPlayerByCitizenId(targetIdentifier) - local itemCashTarget = xTarget.Functions.GetItemByName("cash") - local playerCashMoneyTarget = 0 - if itemCashTarget ~= nil then - playerCashMoneyTarget = itemCashTarget.amount - end - local xPlayers = QBCore.Functions.GetPlayers() - - if amount <= societyMoney then - if Config.UseQBManagement or Config.UseQBBanking then - if Config.UseQBBanking then - exports['qb-banking']:RemoveMoney(society, amount) - else - exports['qb-management']:RemoveMoney(society, amount) - end - else - MySQL.query('UPDATE okokbanking_societies SET value = value - @value WHERE society = @society AND society_name = @society_name', { - ['@value'] = amount, - ['@society'] = society, - ['@society_name'] = societyName, - }, function(changed) - end) - end - if xTarget ~= nil then - xTarget.Functions.AddMoney('bank', amount) - if not toMyself then - for i=1, #xPlayers, 1 do - local xForPlayer = QBCore.Functions.GetPlayer(xPlayers[i]) - if xForPlayer.PlayerData.citizenid == targetIdentifier then - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', xPlayers[i], xTarget.PlayerData.money.bank, playerCashMoneyTarget) - else - TriggerClientEvent('okokBanking:updateTransactions', xPlayers[i], xTarget.PlayerData.money.bank, xTarget.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', xPlayers[i], _L('received_from').title, interp(_L('received_from').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('received_from').time, _L('received_from').type) - else - TriggerClientEvent('QBCore:Notify', xPlayers[i], interp(_L('received_from').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('received_from').type) - end - end - end - end - TriggerEvent('okokBanking:AddTransferTransactionFromSocietyToP', amount, society, societyName, targetIdentifier, targetName) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('transferred_to').time, _L('transferred_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname}), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = societyName..' ('..society..')', receiver_name = xTarget.PlayerData.charinfo.firstname..' '..xTarget.PlayerData.charinfo.lastname, value = amount}) - elseif xTarget == nil then - local playerAccount = json.decode(acc) - playerAccount.bank = playerAccount.bank + amount - playerAccount = json.encode(playerAccount) - - TriggerEvent('okokBanking:AddTransferTransactionFromSocietyToP', amount, society, societyName, targetIdentifier, targetName) - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactionsSociety', _source, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('transferred_to').title, interp(_L('transferred_to').text, {s1 = amount, s2 = targetName }), _L('transferred_to').time, _L('transferred_to').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('transferred_to').text, {s1 = amount, s2 = targetName }), _L('transferred_to').type) - end - TransferMoneyWebhook({sender_name = societyName..' ('..society..')', receiver_name = targetName..' (Offline User)', value = amount}) - - MySQL.query('UPDATE players SET money = @playerAccount WHERE citizenid = @target', { - ['@playerAccount'] = playerAccount, - ['@target'] = targetIdentifier - }, function(changed) - - end) - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('society_no_money').title, _L('society_no_money').text, _L('society_no_money').time, _L('society_no_money').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('society_no_money').text, _L('society_no_money').type) - end - end -end) - -QBCore.Functions.CreateCallback("okokBanking:GetOverviewTransactions", function(source, cb) - local xPlayer = QBCore.Functions.GetPlayer(source) - local playerIdentifier = xPlayer.PlayerData.citizenid - local allDays = {} - local income = 0 - local outcome = 0 - local totalIncome = 0 - local day1_total, day2_total, day3_total, day4_total, day5_total, day6_total, day7_total = 0, 0, 0, 0, 0, 0, 0 - - MySQL.query('SELECT * FROM okokbanking_transactions WHERE receiver_identifier = @identifier OR sender_identifier = @identifier ORDER BY id DESC', { - ['@identifier'] = playerIdentifier - }, function(result) - MySQL.query('SELECT *, DATE(date) = CURDATE() AS "day1", DATE(date) = CURDATE() - INTERVAL 1 DAY AS "day2", DATE(date) = CURDATE() - INTERVAL 2 DAY AS "day3", DATE(date) = CURDATE() - INTERVAL 3 DAY AS "day4", DATE(date) = CURDATE() - INTERVAL 4 DAY AS "day5", DATE(date) = CURDATE() - INTERVAL 5 DAY AS "day6", DATE(date) = CURDATE() - INTERVAL 6 DAY AS "day7" FROM `okokbanking_transactions` WHERE DATE(date) >= CURDATE() - INTERVAL 7 DAY AND receiver_identifier = @identifier OR sender_identifier = @identifier', { - ['@identifier'] = playerIdentifier - }, function(result2) - for k, v in pairs(result2) do - local type = v.type - local receiver_identifier = v.receiver_identifier - local sender_identifier = v.sender_identifier - local value = tonumber(v.value) - - if v.day1 == 1 then - if value ~= nil then - if type == "deposit" then - day1_total = day1_total + value - income = income + value - elseif type == "withdraw" then - day1_total = day1_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day1_total = day1_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day1_total = day1_total - value - outcome = outcome - value - end - end - - elseif v.day2 == 1 then - if value ~= nil then - if type == "deposit" then - day2_total = day2_total + value - income = income + value - elseif type == "withdraw" then - day2_total = day2_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day2_total = day2_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day2_total = day2_total - value - outcome = outcome - value - end - end - - elseif v.day3 == 1 then - if value ~= nil then - if type == "deposit" then - day3_total = day3_total + value - income = income + value - elseif type == "withdraw" then - day3_total = day3_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day3_total = day3_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day3_total = day3_total - value - outcome = outcome - value - end - end - - elseif v.day4 == 1 then - if value ~= nil then - if type == "deposit" then - day4_total = day4_total + value - income = income + value - elseif type == "withdraw" then - day4_total = day4_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day4_total = day4_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day4_total = day4_total - value - outcome = outcome - value - end - end - - elseif v.day5 == 1 then - if value ~= nil then - if type == "deposit" then - day5_total = day5_total + value - income = income + value - elseif type == "withdraw" then - day5_total = day5_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day5_total = day5_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day5_total = day5_total - value - outcome = outcome - value - end - end - - elseif v.day6 == 1 then - if value ~= nil then - if type == "deposit" then - day6_total = day6_total + value - income = income + value - elseif type == "withdraw" then - day6_total = day6_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day6_total = day6_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day6_total = day6_total - value - outcome = outcome - value - end - end - - elseif v.day7 == 1 then - if value ~= nil then - if type == "deposit" then - day7_total = day7_total + value - income = income + value - elseif type == "withdraw" then - day7_total = day7_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day7_total = day7_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day7_total = day7_total - value - outcome = outcome - value - end - end - - end - end - - totalIncome = day1_total + day2_total + day3_total + day4_total + day5_total + day6_total + day7_total - - table.remove(allDays) - table.insert(allDays, day1_total) - table.insert(allDays, day2_total) - table.insert(allDays, day3_total) - table.insert(allDays, day4_total) - table.insert(allDays, day5_total) - table.insert(allDays, day6_total) - table.insert(allDays, day7_total) - table.insert(allDays, income) - table.insert(allDays, outcome) - table.insert(allDays, totalIncome) - - cb(result, playerIdentifier, allDays) - end) - end) -end) - -QBCore.Functions.CreateCallback("okokBanking:GetSocietyTransactions", function(source, cb, society) - local playerIdentifier = society - local allDays = {} - local income = 0 - local outcome = 0 - local totalIncome = 0 - local day1_total, day2_total, day3_total, day4_total, day5_total, day6_total, day7_total = 0, 0, 0, 0, 0, 0, 0 - - MySQL.query('SELECT * FROM okokbanking_transactions WHERE receiver_identifier = @identifier OR sender_identifier = @identifier ORDER BY id DESC', { - ['@identifier'] = society - }, function(result) - MySQL.query('SELECT *, DATE(date) = CURDATE() AS "day1", DATE(date) = CURDATE() - INTERVAL 1 DAY AS "day2", DATE(date) = CURDATE() - INTERVAL 2 DAY AS "day3", DATE(date) = CURDATE() - INTERVAL 3 DAY AS "day4", DATE(date) = CURDATE() - INTERVAL 4 DAY AS "day5", DATE(date) = CURDATE() - INTERVAL 5 DAY AS "day6", DATE(date) = CURDATE() - INTERVAL 6 DAY AS "day7" FROM `okokbanking_transactions` WHERE DATE(date) >= CURDATE() - INTERVAL 7 DAY AND receiver_identifier = @identifier OR sender_identifier = @identifier ORDER BY id DESC', { - ['@identifier'] = society - }, function(result2) - for k, v in pairs(result2) do - local type = v.type - local receiver_identifier = v.receiver_identifier - local sender_identifier = v.sender_identifier - local value = tonumber(v.value) - - if v.day1 == 1 then - if value ~= nil then - if type == "deposit" then - day1_total = day1_total + value - income = income + value - elseif type == "withdraw" then - day1_total = day1_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day1_total = day1_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day1_total = day1_total - value - outcome = outcome - value - end - end - - elseif v.day2 == 1 then - if value ~= nil then - if type == "deposit" then - day2_total = day2_total + value - income = income + value - elseif type == "withdraw" then - day2_total = day2_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day2_total = day2_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day2_total = day2_total - value - outcome = outcome - value - end - end - - elseif v.day3 == 1 then - if value ~= nil then - if type == "deposit" then - day3_total = day3_total + value - income = income + value - elseif type == "withdraw" then - day3_total = day3_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day3_total = day3_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day3_total = day3_total - value - outcome = outcome - value - end - end - - elseif v.day4 == 1 then - if value ~= nil then - if type == "deposit" then - day4_total = day4_total + value - income = income + value - elseif type == "withdraw" then - day4_total = day4_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day4_total = day4_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day4_total = day4_total - value - outcome = outcome - value - end - end - - elseif v.day5 == 1 then - if value ~= nil then - if type == "deposit" then - day5_total = day5_total + value - income = income + value - elseif type == "withdraw" then - day5_total = day5_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day5_total = day5_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day5_total = day5_total - value - outcome = outcome - value - end - end - - elseif v.day6 == 1 then - if value ~= nil then - if type == "deposit" then - day6_total = day6_total + value - income = income + value - elseif type == "withdraw" then - day6_total = day6_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day6_total = day6_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day6_total = day6_total - value - outcome = outcome - value - end - end - - elseif v.day7 == 1 then - if value ~= nil then - if type == "deposit" then - day7_total = day7_total + value - income = income + value - elseif type == "withdraw" then - day7_total = day7_total - value - outcome = outcome - value - elseif type == "transfer" and receiver_identifier == playerIdentifier then - day7_total = day7_total + value - income = income + value - elseif type == "transfer" and sender_identifier == playerIdentifier then - day7_total = day7_total - value - outcome = outcome - value - end - end - - end - end - - totalIncome = day1_total + day2_total + day3_total + day4_total + day5_total + day6_total + day7_total - - table.remove(allDays) - table.insert(allDays, day1_total) - table.insert(allDays, day2_total) - table.insert(allDays, day3_total) - table.insert(allDays, day4_total) - table.insert(allDays, day5_total) - table.insert(allDays, day6_total) - table.insert(allDays, day7_total) - table.insert(allDays, income) - table.insert(allDays, outcome) - table.insert(allDays, totalIncome) - - cb(result, playerIdentifier, allDays) - end) - end) -end) - - -RegisterServerEvent("okokBanking:AddDepositTransaction") -AddEventHandler("okokBanking:AddDepositTransaction", function(amount, source_) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = 'bank', - ['@receiver_name'] = 'Bank Account', - ['@sender_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@sender_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@value'] = tonumber(amount), - ['@type'] = 'deposit' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddWithdrawTransaction") -AddEventHandler("okokBanking:AddWithdrawTransaction", function(amount, source_) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@receiver_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@sender_identifier'] = 'bank', - ['@sender_name'] = 'Bank Account', - ['@value'] = tonumber(amount), - ['@type'] = 'withdraw' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddTransferTransaction") -AddEventHandler("okokBanking:AddTransferTransaction", function(amount, xTarget, source_, targetName, targetIdentifier) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - if targetName == nil then - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = tostring(xTarget.PlayerData.citizenid), - ['@receiver_name'] = tostring(xTarget.PlayerData.charinfo.firstname..' '..xTarget.PlayerData.charinfo.lastname), - ['@sender_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@sender_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) - elseif targetName ~= nil and targetIdentifier ~= nil then - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = tostring(targetIdentifier), - ['@receiver_name'] = tostring(targetName), - ['@sender_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@sender_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) - end -end) - -RegisterServerEvent("okokBanking:AddTransferTransactionToSociety") -AddEventHandler("okokBanking:AddTransferTransactionToSociety", function(amount, source_, society, societyName) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = society, - ['@receiver_name'] = societyName, - ['@sender_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@sender_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddTransferTransactionFromSocietyToP") -AddEventHandler("okokBanking:AddTransferTransactionFromSocietyToP", function(amount, society, societyName, identifier, name) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = identifier, - ['@receiver_name'] = name, - ['@sender_identifier'] = society, - ['@sender_name'] = societyName, - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddTransferTransactionFromSociety") -AddEventHandler("okokBanking:AddTransferTransactionFromSociety", function(amount, society, societyName, societyTarget, societyNameTarget) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = societyTarget, - ['@receiver_name'] = societyNameTarget, - ['@sender_identifier'] = society, - ['@sender_name'] = societyName, - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddDepositTransactionToSociety") -AddEventHandler("okokBanking:AddDepositTransactionToSociety", function(amount, source_, society, societyName) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = society, - ['@receiver_name'] = societyName, - ['@sender_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@sender_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@value'] = tonumber(amount), - ['@type'] = 'deposit' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:AddWithdrawTransactionToSociety") -AddEventHandler("okokBanking:AddWithdrawTransactionToSociety", function(amount, source_, society, societyName) - local _source = nil - if source_ ~= nil then - _source = source_ - else - _source = source - end - - local xPlayer = QBCore.Functions.GetPlayer(_source) - - MySQL.query('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = tostring(xPlayer.PlayerData.citizenid), - ['@receiver_name'] = tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), - ['@sender_identifier'] = society, - ['@sender_name'] = societyName, - ['@value'] = tonumber(amount), - ['@type'] = 'withdraw' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:UpdateIbanDB") -AddEventHandler("okokBanking:UpdateIbanDB", function(iban, amount) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - - -- Debug-Ausgaben - print("[DEBUG] Versuch, IBAN zu aktualisieren auf: " .. iban) - print("[DEBUG] Spieler-Geld: " .. xPlayer.PlayerData.money.bank .. ", Kosten: " .. amount) - print("[DEBUG] Player charinfo vor Update: " .. json.encode(xPlayer.PlayerData.charinfo)) - - if amount <= xPlayer.PlayerData.money.bank then - -- Direkte Aktualisierung der charinfo mit der neuen IBAN - MySQL.query('SELECT charinfo FROM players WHERE citizenid = ?', { - xPlayer.PlayerData.citizenid - }, function(result) - local charinfo = json.decode(result[1].charinfo) - if not Config.CharInfoUpdate then charinfo = json.decode(result) end - - print("[DEBUG] Charinfo aus Datenbank: " .. json.encode(charinfo)) - - charinfo.account = iban - local updated = json.encode(charinfo) - - print("[DEBUG] Aktualisierte charinfo: " .. updated) - - MySQL.query('UPDATE players SET charinfo = ? WHERE citizenid = ?', { - updated, - xPlayer.PlayerData.citizenid - }, function(rowsChanged) - print("[DEBUG] Datenbankaktualisierung: " .. tostring(rowsChanged) .. " Zeilen geändert") - - -- Entferne den problematischen Code - -- if xPlayer.Functions.ChangeIban then - -- xPlayer.Functions.ChangeIban(iban) - -- else - -- TriggerClientEvent('okokNotify:Alert', _source, 'OKOKBANKING', 'Unable to locate or identify the function ChangeIban. Please refer to the documentation for correct usage and placement!', 5000, 'warning') - -- return - -- end - - -- Aktualisiere die Spielerdaten im Speicher - local updatedPlayer = QBCore.Functions.GetPlayer(_source) - if updatedPlayer then - updatedPlayer.PlayerData.charinfo.account = iban - updatedPlayer.Functions.SetPlayerData('charinfo', updatedPlayer.PlayerData.charinfo) - print("[DEBUG] Spielerdaten im Speicher aktualisiert: " .. json.encode(updatedPlayer.PlayerData.charinfo)) - end - - -- Ziehe das Geld ab - xPlayer.Functions.RemoveMoney('bank', amount) - - -- Aktualisiere den Client - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - - TriggerEvent('okokBanking:AddTransferTransactionToSociety', amount, _source, "bank", "Bank (IBAN)") - TriggerClientEvent('okokBanking:updateIban', _source, iban) - TriggerClientEvent('okokBanking:updateIbanPinChange', _source) - - print("[DEBUG] Client-Events ausgelöst") - - -- Benachrichtige den Spieler - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('iban_changed').title, interp(_L('iban_changed').text, {s1 = iban}), _L('iban_changed').time, _L('iban_changed').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('iban_changed').text, {s1 = iban}), _L('iban_changed').type) - end - end) - end) - else - print("[DEBUG] Nicht genug Geld für IBAN-Änderung") - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('iban_no_money').title, interp(_L('iban_no_money').text, {s1 = amount}), _L('iban_no_money').time, _L('iban_no_money').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('iban_no_money').text, {s1 = amount}), _L('iban_no_money').type) - end - end -end) - - -RegisterServerEvent("okokBanking:UpdatePINDB") -AddEventHandler("okokBanking:UpdatePINDB", function(pin, amount) - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - - if amount <= xPlayer.PlayerData.money.bank then - MySQL.query('UPDATE players SET pincode = @pin WHERE citizenid = @identifier', { - ['@pin'] = pin, - ['@identifier'] = xPlayer.PlayerData.citizenid, - }, function(changed) - end) - - xPlayer.Functions.RemoveMoney('bank', amount) - xPlayer = QBCore.Functions.GetPlayer(_source) - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateMoney', _source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - TriggerEvent('okokBanking:AddTransferTransactionToSociety', amount, _source, "bank", "Bank (PIN)") - TriggerClientEvent('okokBanking:updateIbanPinChange', _source) - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('pin_changed').title, interp(_L('pin_changed').text, {s1 = pin}), _L('pin_changed').time, _L('pin_changed').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L("pin_changed").text, {s1 = pin}), _L('pin_changed').type) - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('pin_no_money').title, interp(_L('pin_no_money').text, {s1 = amount}), _L('pin_no_money').time, _L('pin_no_money').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('pin_no_money').text, {s1 = amount}), _L('pin_no_money').type) - end - end -end) - -RegisterServerEvent("okokBanking:AddNewTransaction") -AddEventHandler("okokBanking:AddNewTransaction", function(receiver_name, receiver_identifier, sender_name, sender_identifier, amount, reason) - MySQL.Async.insert('INSERT INTO okokbanking_transactions (receiver_identifier, receiver_name, sender_identifier, sender_name, date, value, type) VALUES (@receiver_identifier, @receiver_name, @sender_identifier, @sender_name, CURRENT_TIMESTAMP(), @value, @type)', { - ['@receiver_identifier'] = receiver_identifier, - ['@receiver_name'] = receiver_name.." ("..reason..")", - ['@sender_identifier'] = sender_identifier, - ['@sender_name'] = sender_name.." ("..reason..")", - ['@value'] = tonumber(amount), - ['@type'] = 'transfer' - }, function (result) - end) -end) - -RegisterServerEvent("okokBanking:GiveCC") -AddEventHandler("okokBanking:GiveCC", function() - local _source = source - local xPlayer = QBCore.Functions.GetPlayer(_source) - local playerMoney = xPlayer.PlayerData.money.bank - local itemCash = xPlayer.Functions.GetItemByName("cash") - local playerCashMoney = 0 - if itemCash ~= nil then - playerCashMoney = itemCash.amount - end - - if Config.CreditCardPrice <= playerMoney then - xPlayer.Functions.RemoveMoney('bank', Config.CreditCardPrice) - xPlayer.Functions.AddItem(Config.CreditCardItem, 1) - TriggerEvent('okokBanking:AddNewTransaction', 'Bank', 'bank', tostring(xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname), xPlayer.PlayerData.citizenid, Config.CreditCardPrice, 'Buy CC') - if Config.UseCashAsItem then - TriggerClientEvent('okokBanking:updateTransactions', source, xPlayer.PlayerData.money.bank, playerCashMoney) - else - TriggerClientEvent('okokBanking:updateTransactions', source, xPlayer.PlayerData.money.bank, xPlayer.PlayerData.money.cash) - end - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('bought_cc').title, interp(_L('bought_cc').text, {s1 = Config.CreditCardPrice}), _L('bought_cc').time, _L('bought_cc').type) - else - TriggerClientEvent('QBCore:Notify', _source, interp(_L('bought_cc').text, {s1 = Config.CreditCardPrice}), _L('bought_cc').type) - end - else - if Config.okokNotify then - TriggerClientEvent('okokNotify:Alert', _source, _L('no_money_bank').title, _L('no_money_bank').text, _L('no_money_bank').time, _L('no_money_bank').type) - else - TriggerClientEvent('QBCore:Notify', _source, _L('no_money_bank').text, _L('no_money_bank').type) - end - end -end) - -function GroupDigits(value) - local left,num,right = string.match(value,'^([^%d]*%d)(%d*)(.-)$') - - return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right -end - --------------------------- WEBHOOK - -function TransferMoneyWebhook(data) - local information = { - { - ["color"] = Config.TransferWebhookColor, - ["author"] = { - ["icon_url"] = Config.IconURL, - ["name"] = Config.ServerName..' - Banking Logs', - }, - ["title"] = 'New Transaction', - ["description"] = '**Sender:** '..data.sender_name..'\n**Receiver:** '..data.receiver_name..'\n**Amount:** '..data.value..'€', - - ["footer"] = { - ["text"] = os.date(Config.DateFormat), - } - } - } - PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = Config.BotName, embeds = information}), {['Content-Type'] = 'application/json'}) -end - -function WithdrawMoneyWebhook(data) - local information = { - { - ["color"] = Config.WithdrawWebhookColor, - ["author"] = { - ["icon_url"] = Config.IconURL, - ["name"] = Config.ServerName..' - Banking Logs', - }, - ["title"] = 'New Withdrawal', - ["description"] = '**Receiver:** '..data.receiver_name..'\n**Amount:** '..data.value..'€', - - ["footer"] = { - ["text"] = os.date(Config.DateFormat), - } - } - } - PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = Config.BotName, embeds = information}), {['Content-Type'] = 'application/json'}) -end - -function DepositMoneyWebhook(data) - local information = { - { - ["color"] = Config.DepositWebhookColor, - ["author"] = { - ["icon_url"] = Config.IconURL, - ["name"] = Config.ServerName..' - Banking Logs', - }, - ["title"] = 'New Deposit', - ["description"] = '**Sender:** '..data.sender_name..'\n**Amount:** '..data.value..'€', - - ["footer"] = { - ["text"] = os.date(Config.DateFormat), - } - } - } - PerformHttpRequest(Webhook, function(err, text, headers) end, 'POST', json.encode({username = Config.BotName, embeds = information}), {['Content-Type'] = 'application/json'}) -end \ No newline at end of file diff --git a/resources/[tools]/okokBanking/web/atm.mp3 b/resources/[tools]/okokBanking/web/atm.mp3 deleted file mode 100644 index aa9599f9c..000000000 Binary files a/resources/[tools]/okokBanking/web/atm.mp3 and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/correct.mp3 b/resources/[tools]/okokBanking/web/correct.mp3 deleted file mode 100644 index 6c0af8701..000000000 Binary files a/resources/[tools]/okokBanking/web/correct.mp3 and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/img/avatar_female.png b/resources/[tools]/okokBanking/web/img/avatar_female.png deleted file mode 100644 index f0e9bca06..000000000 Binary files a/resources/[tools]/okokBanking/web/img/avatar_female.png and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/img/avatar_male.png b/resources/[tools]/okokBanking/web/img/avatar_male.png deleted file mode 100644 index b6a2f6573..000000000 Binary files a/resources/[tools]/okokBanking/web/img/avatar_male.png and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/img/classic.png b/resources/[tools]/okokBanking/web/img/classic.png deleted file mode 100644 index 774744362..000000000 Binary files a/resources/[tools]/okokBanking/web/img/classic.png and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/img/logo.png b/resources/[tools]/okokBanking/web/img/logo.png deleted file mode 100644 index 1e7587fba..000000000 Binary files a/resources/[tools]/okokBanking/web/img/logo.png and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/img/visa_white.svg b/resources/[tools]/okokBanking/web/img/visa_white.svg deleted file mode 100644 index afcb28021..000000000 --- a/resources/[tools]/okokBanking/web/img/visa_white.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/resources/[tools]/okokBanking/web/popup.mp3 b/resources/[tools]/okokBanking/web/popup.mp3 deleted file mode 100644 index 4bed79ac1..000000000 Binary files a/resources/[tools]/okokBanking/web/popup.mp3 and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/popupreverse.mp3 b/resources/[tools]/okokBanking/web/popupreverse.mp3 deleted file mode 100644 index c8a8895e0..000000000 Binary files a/resources/[tools]/okokBanking/web/popupreverse.mp3 and /dev/null differ diff --git a/resources/[tools]/okokBanking/web/scripts.js b/resources/[tools]/okokBanking/web/scripts.js deleted file mode 100644 index cd9f16189..000000000 --- a/resources/[tools]/okokBanking/web/scripts.js +++ /dev/null @@ -1,1374 +0,0 @@ -var table = [] -var selectedWindow = "none" -var data_graph = {} -var isLoggingOut = false -var useSound = false - -window.addEventListener('message', function(event) { - if (event.data.UseSound) { - useSound = event.data.UseSound; - } - switch (event.data.action) { - case 'loading_data': - if (selectedWindow == "none") { - $('#menu').html(` -
- -
-
Loading Data...
-
- `); - $("#menu").fadeIn(); - $(".main_card").fadeIn(); - selectedWindow = "loading_data"; - } - break - case 'bankmenu': - if (selectedWindow == "loading_data") { - if(useSound) { - var popup_sound = new Audio('popup.mp3'); - popup_sound.volume = 0.2; - popup_sound.play(); - } - $("#menu").fadeOut(); - - setTimeout(function(){ - if (event.data.playerSex == "m") { - avatar = ``; - } else { - avatar = ``; - } - - - $('#menu').html(` - -
-
- Overview -
- - ${avatar} - -
- Wallet: USD -
-
-
-
-
-
- `); - $("#menu").fadeIn(); - overview_page_function(event); - }, 400); - - } - break - case 'updatevalue': - $("#playerBankMoney").html(''); - $("#playerBankMoney").html(event.data.playerBankMoney.toLocaleString()); - $("#wallet_money").html(event.data.walletMoney.toLocaleString()); - break - case 'updateiban': - $("#playerIBAN").html(''); - $("#playerIBAN").html(event.data.iban); - break - case 'overview_page': - overview_page_function(event); - break - case 'transactions_page': - for(var i=0; iSociety - - `; - } else { - society = ''; - } - - $('#sidebar').html(` - - - - ${society} - `); - - var row = ''; - var num = event.data.db.length; - var numOfTransactions = 0 - - for(var i = 0; i < num; i++) { - numOfTransactions++ - var db = event.data.db[i]; - - // Received - if (db.type == 'transfer' && db.receiver_identifier == event.data.identifier) { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Received
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Sent - } else if (db.type == 'transfer' && db.sender_identifier == event.data.identifier) { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - To ${name} -
Sent
- `; - amount = `- ${db.value.toLocaleString()} USD`; - // Deposited - } else if (db.type == 'deposit') { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - Into ${name} -
Deposited
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Withdrawn - } else if (db.type == 'withdraw') { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Withdrawn
- `; - amount = `- ${db.value.toLocaleString()} USD`; - } - - row += ` - - ${icon} - ${data} - ${db.date} - ${amount} - - `; - } - - $('#page_info').removeClass('row'); - - $('#page_info').html(` -
-
-
-
-
TRANSACTIONS
-

${numOfTransactions}

-
-
-
-
-
-
-
INCOME
-

${event.data.graph_values[7].toLocaleString()}$

-
-
-
-
-
-
-
OUTCOME
-

${event.data.graph_values[8].toLocaleString()}$

-
-
-
-
-
-
-
EARNINGS
-

${event.data.graph_values[9].toLocaleString()}$

-
-
-
-
- - - -
- `); - - $('#transactionsData').html(row); - - var table_id = document.getElementById('transactionsTable'); - table.push(new simpleDatatables.DataTable(table_id, { - perPageSelect: false, - perPage: 5, - })); - - break - case 'society_transactions': - for(var i=0; iSociety - - `; - } else { - society = ''; - } - - $('#sidebar').html(` - - - - ${society} - `); - - var row = ''; - var num = event.data.db.length; - var numOfTransactions = 0 - - for(var i = 0; i < num; i++) { - numOfTransactions++ - var db = event.data.db[i]; - - // Received - if (db.type == 'transfer' && db.receiver_identifier == event.data.identifier) { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Received
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Sent - } else if (db.type == 'transfer' && db.sender_identifier == event.data.identifier) { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - To ${name} -
Sent
- `; - amount = `- ${db.value.toLocaleString()} USD`; - // Deposited - } else if (db.type == 'deposit') { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - Into ${name} -
Deposited
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Withdrawn - } else if (db.type == 'withdraw') { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Withdrawn
- `; - amount = `- ${db.value.toLocaleString()} USD`; - } - - row += ` - - ${icon} - ${data} - ${db.date} - ${amount} - - `; - } - - $('#page_info').removeClass('row'); - - $('#page_info').html(` -
-
-
-
-
TRANSACTIONS
-

${numOfTransactions}

-
-
-
-
-
-
-
INCOME
-

${event.data.graph_values[7].toLocaleString()}$

-
-
-
-
-
-
-
OUTCOME
-

${event.data.graph_values[8].toLocaleString()}$

-
-
-
-
-
-
-
EARNINGS
-

${event.data.graph_values[9].toLocaleString()}$

-
-
-
-
- - - -
- `); - - $('#transactionsData').html(row); - - var table_id = document.getElementById('transactionsTable'); - table.push(new simpleDatatables.DataTable(table_id, { - perPageSelect: false, - perPage: 5, - })); - - - break - case 'society_page': - society_page_function(event); - break - case 'settings_page': - settings_page_function(event); - break - case 'atm': - atm_numpad(event.data.pin); - - $(".atm_card").fadeIn(); - selectedWindow = "atm"; - break - } -}); - -// Overview -$(document).on('click', "#overview_page", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "overview_page", - })); -}); - -// Transactions -$(document).on('click', "#transactions_page", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "transactions_page", - })); -}); - -$(document).on('click', "#view_all_transactions", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "transactions_page", - })); -}); - -$(document).on('click', "#view_all_transactions_society", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "society_transactions", - })); -}); - -// Society -$(document).on('click', "#society_page", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "society_page", - })); -}); - -// Society transactions -$(document).on('click', "#society_transactions", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "society_transactions", - })); -}); - -// Settings -$(document).on('click', "#settings_page", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "settings_page", - })); -}); - -// End Pages - -$(document).on('click', ".depositMoneyModal", function() { - var modalId = $('#depositModal'); - var depositModal = new bootstrap.Modal(modalId); - depositModal.show() -}); - -$(document).on('click', ".withdrawMoneyModal", function() { - var modalId = $('#withdrawModal'); - var depositModal = new bootstrap.Modal(modalId); - depositModal.show() -}); - -$(document).on('click', ".transferMoneyModal", function() { - var modalId = $('#transferModal'); - var depositModal = new bootstrap.Modal(modalId); - depositModal.show() -}); - -// aqui -$(document).on('click', "#buy_new_cc", function() { - $.post('https://okokBanking/action', JSON.stringify({ - action: "buy_new_cc", - })); -}); - -$(document).on('click', ".logout", function() { - if(!isLoggingOut) { - isLoggingOut = true - logout_page() - } -}); - -// Close ESC Key -$(document).ready(function() { - document.onkeyup = function(data) { - if (data.which == 27) { - switch (selectedWindow) { - case 'bankmenu': - if(!isLoggingOut) { - isLoggingOut = true - logout_page() - } - break - case 'societies': - if(!isLoggingOut) { - isLoggingOut = true - logout_page() - } - break - case 'settings': - if(!isLoggingOut) { - isLoggingOut = true - logout_page() - } - break - case 'atm': - $(".atm_card").fadeOut(); - $.post('https://okokBanking/action', JSON.stringify({ - action: "close", - })); - selectedWindow = "none"; - - break - } - } - }; -}); - -$(document).on('click', '#depositMoney', function() { - var deposit_value = $('#deposit_value').val(); - - deposit_value = Math.trunc( deposit_value ); - - $.post('https://okokBanking/action', JSON.stringify({ - action: 'deposit', - value: deposit_value, - window: selectedWindow, - })); - $('#deposit_value').val(''); - document.getElementById('depositMoney').disabled = true; -}) - -$(document).on('click', '#withdrawMoney', function() { - var withdraw_value = $('#withdraw_value').val(); - - withdraw_value = Math.trunc( withdraw_value ); - - $.post('https://okokBanking/action', JSON.stringify({ - action: 'withdraw', - value: withdraw_value, - window: selectedWindow, - })); - $('#withdraw_value').val(''); - document.getElementById('withdrawMoney').disabled = true; -}) - -$(document).on('click', "#transferMoney", function() { - var transfer_value = $('#transfer_value').val(); - var iban_value = $('#transfer_iban').val(); - - $.post('https://okokBanking/action', JSON.stringify({ - action: 'transfer', - value: transfer_value, - iban: iban_value, - window: selectedWindow, - })); - $('#transfer_value').val(''); - $('#transfer_iban').val(''); - document.getElementById('transferMoney').disabled = true; -}); - -// Change iban -$(document).on('click', "#change_iban", function() { - var new_iban = $('#new_iban').val(); - - $.post('https://okokBanking/action', JSON.stringify({ - action: "change_iban", - iban: new_iban, - })); - $('#new_iban').val(''); - document.getElementById('change_iban').disabled = true; -}); - -// Change pin -$(document).on('click', "#change_pin", function() { - var new_pin = $('#new_pin').val(); - - $.post('https://okokBanking/action', JSON.stringify({ - action: "change_pin", - pin: new_pin, - })); - $('#new_pin').val(''); - document.getElementById('change_pin').disabled = true; -}); - -$(document).on('click', ".close-atm", function() { - if(useSound) { - var popuprev_sound = new Audio('popupreverse.mp3'); - popuprev_sound.volume = 0.2; - popuprev_sound.play(); - } - $('.atm_card').fadeOut(); - $.post('https://okokBanking/action', JSON.stringify({ - action: "close", - })); - selectedWindow = "none"; -}) - -function checkIfEmpty() { - // Deposit - if (document.getElementById("deposit_value").value === "") { - document.getElementById('depositMoney').disabled = true; - } else { - document.getElementById('depositMoney').disabled = false; - } - - // Withdraw - if(document.getElementById("withdraw_value").value === "") { - document.getElementById('withdrawMoney').disabled = true; - } else { - document.getElementById('withdrawMoney').disabled = false; - } - - // Transfer - if(document.getElementById("transfer_value").value === "" || document.getElementById("transfer_iban").value === "") { - document.getElementById('transferMoney').disabled = true; - } else { - document.getElementById('transferMoney').disabled = false; - } -} - -function checkIfEmptySettings() { - // New pin - if(document.getElementById("new_pin").value === "") { - document.getElementById('change_pin').disabled = true; - } else { - document.getElementById('change_pin').disabled = false; - } - - // New iban - if(document.getElementById("new_iban").value === "") { - document.getElementById('change_iban').disabled = true; - } else { - document.getElementById('change_iban').disabled = false; - } -} - -function overview_page_function(event) { - if(event.data.isUpdate && selectedWindow == "bankmenu" || !event.data.isUpdate){ - for(var i=0; iSociety - - `; - } else { - society = ''; - } - - $('#sidebar').html(` - - - - ${society} - `); - - if(event.data.RequireCC) { - informations = `Informations NEW`; - } else { - informations = `Informations`; - } - - $('#page_info').addClass('row'); - - $('#page_info').html(` -
-
-
- Statistics -
-
-
- -
-
-
-
-
-
-
- Last Transactions VIEW ALL -
-
- - - -
-
-
-
-
-
-
-
-
-
- ${informations} -
-
-
-
- okokBank Classic -
-
- Status -
-
- ACTIVE -
- VALID THRU - 08/25 -
-
-
-
-
-
-

Balance: USD

-

IBAN:

-
-
-
-
- Actions -
-
-
- -
-
- -
-
- -
-
-
-
-
- `); - - $("#playerName").html(event.data.playerName); - $("#playerBankMoney").html(event.data.playerBankMoney.toLocaleString()); - $("#playerIBAN").html(event.data.playerIBAN); - $("#wallet_money").html(event.data.walletMoney.toLocaleString()); - - var row = ''; - var num = event.data.db.length; - - if (num > 4) { - num = 4 - } - - for(var i = 0; i < num; i++) { - - var db = event.data.db[i]; - - // Received - if (db.type == 'transfer' && db.receiver_identifier == event.data.identifier) { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Received
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Sent - } else if (db.type == 'transfer' && db.sender_identifier == event.data.identifier) { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - To ${name} -
Sent
- `; - amount = `- ${db.value.toLocaleString()} USD`; - // Deposited - } else if (db.type == 'deposit') { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - Into ${name} -
Deposited
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Withdrawn - } else if (db.type == 'withdraw') { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Withdrawn
- `; - amount = `- ${db.value.toLocaleString()} USD`; - } - - row += ` - - ${icon} - ${data} - ${amount} - - `; - } - $('#lastTransactionsData').html(row); - - var table_id = document.getElementById('lastTransactionsTable'); - table.push(new simpleDatatables.DataTable(table_id, { - searchable: false, - perPageSelect: false, - paging: false, - })); - - const labels = []; - - const months = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]; - - for (i = 6; i > -1; i--) { - var days = i; - var date = new Date(); - var last = new Date(date.getTime() - (days * 24 * 60 * 60 * 1000)); - var day =last.getDate(); - var month=last.getMonth(); - - labels.push(day+" "+months[month]) - } - - var ctx = document.getElementById('myChart').getContext('2d'); - var gradient = ctx.createLinearGradient(0, 0, 0, 300); - - gradient.addColorStop(0, 'rgba(20, 75, 217, 0.5)'); - gradient.addColorStop(1, 'rgba(25, 70, 189, 0)'); - - const day_earnings = event.data.graphDays; - - var data_graph = { - labels: labels, - datasets: [{ - label: 'Earnings', - backgroundColor: gradient, - borderColor: '#1f5eff', - data: [day_earnings[6], day_earnings[5], day_earnings[4], day_earnings[3], day_earnings[2], day_earnings[1], day_earnings[0]], - tension: 0.25, - fill: 'start', - pointBackgroundColor: '#1f5eff', - pointRadius: 4, - pointHoverRadius: 6, - }] - }; - - var config = { - type: 'line', - data: data_graph, - options: { - plugins: { - legend: { - display: false - } - }, - animation: { - duration: 0 - }, - scales: { - y: { // y-axis configuration - grid: { - lineWidth: 1, - color: '#2e2f36', - drawBorder: false - }, - ticks: { - color: '#d5d6da' - } - }, - x: { // x-axis configuration - grid: { - display: false - }, - ticks: { - color: '#d5d6da' - } - } - } - } - }; - - var myChart = new Chart (document.getElementById('myChart'), config); - - selectedWindow = "bankmenu"; - } -} - -function society_page_function(event) { - if(event.data.isUpdate && selectedWindow == "societies" || !event.data.isUpdate){ - for(var i=0; iSociety - - `; - } else { - society = ''; - } - - $('#sidebar').html(` - - - - ${society} - `); - - $('#page_info').addClass('row'); - - $('#page_info').html(` -
-
-
- Statistics -
-
-
- -
-
-
-
-
-
-
- Last Transactions VIEW ALL -
-
- - - -
-
-
-
-
-
-
-
-
-
- Informations -
-
-
-
- okokBank Classic -
-
- Status -
-
- ACTIVE -
- VALID THRU - 08/25 -
-
-
-
-
-
-

Balance: USD

-

IBAN:

-
-
-
-
- Actions -
-
-
- -
-
- -
-
- -
-
-
-
-
- `); - - $("#playerBankMoney").html(event.data.societyInfo.value.toLocaleString()); - $("#wallet_money").html(event.data.walletMoney.toLocaleString()); - $("#playerIBAN").html(event.data.societyInfo.iban); - - var row = ''; - var num = event.data.db.length; - - if (num > 4) { - num = 4 - } - - for(var i = 0; i < num; i++) { - - var db = event.data.db[i]; - - // Received - if (db.type == 'transfer' && db.receiver_identifier == event.data.identifier) { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Received
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Sent - } else if (db.type == 'transfer' && db.sender_identifier == event.data.identifier) { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - To ${name} -
Sent
- `; - amount = `- ${db.value.toLocaleString()} USD`; - // Deposited - } else if (db.type == 'deposit') { - var name = db.receiver_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - Into ${name} -
Deposited
- `; - amount = `+ ${db.value.toLocaleString()} USD`; - // Withdrawn - } else if (db.type == 'withdraw') { - var name = db.sender_name; - if (name.length > 15){ - name = name.substring(0, 15)+"..." - } - icon = ''; - data = ` - From ${name} -
Withdrawn
- `; - amount = `- ${db.value.toLocaleString()} USD`; - } - - row += ` - - ${icon} - ${data} - ${amount} - - `; - } - $('#lastTransactionsData').html(row); - - var table_id = document.getElementById('lastTransactionsTable'); - table.push(new simpleDatatables.DataTable(table_id, { - searchable: false, - perPageSelect: false, - paging: false, - })); - - const labels = []; - - const months = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]; - - for (i = 6; i > -1; i--) { - var days = i; - var date = new Date(); - var last = new Date(date.getTime() - (days * 24 * 60 * 60 * 1000)); - var day =last.getDate(); - var month=last.getMonth(); - - labels.push(day+" "+months[month]) - } - - var ctx = document.getElementById('myChart').getContext('2d'); - var gradient = ctx.createLinearGradient(0, 0, 0, 300); - - gradient.addColorStop(0, 'rgba(20, 75, 217, 0.5)'); - gradient.addColorStop(1, 'rgba(25, 70, 189, 0)'); - - const day_earnings = event.data.graphDays; - - var data_graph = { - labels: labels, - datasets: [{ - label: 'Earnings', - backgroundColor: gradient, - borderColor: '#1f5eff', - data: [day_earnings[6], day_earnings[5], day_earnings[4], day_earnings[3], day_earnings[2], day_earnings[1], day_earnings[0]], - tension: 0.25, - fill: 'start', - pointBackgroundColor: '#1f5eff', - pointRadius: 4, - pointHoverRadius: 6, - }] - }; - - var config = { - type: 'line', - data: data_graph, - options: { - plugins: { - legend: { - display: false - } - }, - animation: { - duration: 0 - }, - scales: { - y: { // y-axis configuration - grid: { - lineWidth: 1, - color: '#2e2f36', - drawBorder: false - }, - ticks: { - color: '#d5d6da' - } - }, - x: { // x-axis configuration - grid: { - display: false - }, - ticks: { - color: '#d5d6da' - } - } - } - } - }; - - var myChart = new Chart (document.getElementById('myChart'), config); - - selectedWindow = "societies"; - } -} - -function settings_page_function(event) { - for(var i=0; iSociety - - `; - } else { - society = ''; - } - - $('#sidebar').html(` - - - - ${society} - `); - - $('#page_info').addClass('row'); - - $('#page_info').html(` -
-
-
- - Account IBAN - -
-
-
-
-
-
-
- Change IBAN - - -
-
-
-
-
-
- The IBAN has a change cost of ${event.data.ibanCost}€ -
- The IBAN always have the prefix "${event.data.ibanPrefix}" -
- The maximum number of characters is ${event.data.ibanCharNum} -
-
-
-
-
-
-
-
-
- - PIN Code - -
-
-
-
-
-
-
- Change PIN - - -
-
-
-
-
-
- The PIN has a change cost of ${event.data.pinCost}€ -
- The maximum number of characters is ${event.data.pinCharNum} -
- You can only use numbers -
-
-
-
-
-
-
-
- `); - - selectedWindow = "settings"; -} - -function logout_page() { - $("#menu").fadeOut(); - setTimeout(function () { - $('#menu').html(` -
- -
-
Logging out...
-
- `); - $("#menu").fadeIn(); - setTimeout(function(){ - $("#menu").fadeOut(); - $(".main_card").fadeOut(); - - selectedWindow = "none"; - setTimeout(function(){ - isLoggingOut = false - for(var i=0; i thead > tr > th { - border-bottom: none; -} - -.dataTable-wrapper.no-footer .dataTable-container { - border-bottom: none; -} - -.dataTable-top, .dataTable-bottom { - padding: 0 0; -} - -thead { - display: none; -} - -tr { - background-color: #2e2f36; - margin-bottom: 0.625rem; - font-size: 1.25rem; - transition: .25s; -} - -tr:hover { - background-color: #292a31; - transition: .25s; -} - - -td:first-child { - border-top-left-radius: 0.625rem; - border-bottom-left-radius: 0.625rem; -} - -td:last-child { - border-top-right-radius: 0.625rem; - border-bottom-right-radius: 0.625rem; -} - -.dataTable-table { - border-collapse:separate; - border-spacing: 0rem 0.4375rem; -} - -.sidebar-item { - color: #8f9094; - font-size: 1rem; - padding: 0.625rem; - border-radius: 0.625rem; - font-weight: 500; - transition: 0.4s; - width: 9.5rem; - margin-bottom: 0.75rem; -} - -.sidebar-item:hover { - background-color: #1f5eff; - cursor: pointer; - transition: 0.25s; - color: #fff; -} - -.sidebar-title { - color: #8d8d8d; - font-size: 0.875rem; - font-weight: 600; -} - -.selected { - color: #fff; - background-color: #1f5eff; - font-weight: 600; -} - -.bi-credit-card:hover { - fill: red; -} - -.selected-page { - color: #fff; - font-size: 1.75rem; - margin-left: 0.9375rem; -} - -.username { - color: #fff; - font-weight: 500; - font-size: 1.125rem; -} - -.avatar { - border-radius: 50%; - width: 2.5rem; - margin-left: 0.625rem; -} - -.fa-wifi { - transform: rotate(90deg); - color: #fff; - font-size: 0.875rem; -} - -.btn { - font-weight: 500; - font-size: 1.125rem; - padding: 0.8125rem 1.0625rem; - border: none; - border-radius: 0.125rem; - transition: 0.25s; - letter-spacing: 0.0125rem; -} - -.btn:focus { - box-shadow: none; -} - -.btn-blue { - background-color: #1f5eff; - color: #e6e6e6; -} - -.btn.btn-blue:hover { - background-color: #0a4df9; - color: #e6e6e6; -} - -.modal-content { - background-color: transparent; - border: none; -} - -.modal-body { - background-color: #292a31; - border-radius: 0.625rem; - color: #fff; -} - -.form-control { - border: none; - background-color: #1d1e24; - height: 5rem; - font-size: 1.875rem; - border-radius: 0.625rem; - color: #fff; -} - -.form-control:focus { - box-shadow: none; - border: none; - background-color: #1d1e24; - box-shadow: 0rem 0rem 0.3125rem 0.0625rem #1f5eff !important; - color: #fff; -} - -input::-webkit-outer-spin-button, -input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; -} - -.viewall-badge { - background-color: #1f5eff !important; - transition: 0.25s; -} - -.viewall-badge:hover { - background-color: #0a4df9 !important; - transition: 0.25s; - cursor: pointer; -} - -.close-button { - color: #c7c7c9; - position: absolute; - right: 1.25rem; - top: 0.9rem; - transition: .25s; - font-size: 1.6rem; - line-height: 1; -} - -.close-button:hover { - color: #fff; - transition: .25s; - cursor: pointer; -} - -.dataTable-input { - background-color: #2e2f36; - border: none; - border-radius: 0.625rem; - color: #fff; - padding: 0.375rem 0.75rem; - font-size: 1.3rem; -} - -.dataTable-pagination .active a, .dataTable-pagination .active a:focus, .dataTable-pagination .active a:hover { - background-color: #1f5eff; - cursor: pointer; - transition: .25s; -} - -.dataTable-pagination a { - border-radius: 0.313rem; - color: #fff; - background-color: #2e2f36; - transition: .25s; - padding: 0.375rem 0.75rem; - margin-left: 0.125rem; -} - -.dataTable-pagination a:hover { - background-color: #292a31; - transition: .25s; -} - -.dataTable-pagination { - position: fixed; - right: 1rem; - bottom: 1rem; -} - -.dataTable-bottom { - padding: 0rem 0rem; - font-size: 1.125rem; -} - -.dataTable-top > nav:last-child, .dataTable-top > div:last-child, .dataTable-bottom > nav:last-child, .dataTable-bottom > div:last-child { - float: none; -} - -.dataTable-top { - float: right; -} - -#new_iban { - text-transform: uppercase; -} - -::-webkit-input-placeholder { - text-transform: none; -} - -.atm_card { - width: 20rem; - border-radius: 1.25rem; - background-color: #202128; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - border: none; - display: none; - box-shadow: 0rem 0rem 0.313rem 0rem rgba(10, 10, 10, 0.3); -} - -.atm_card-body { - background-color: transparent; - color: #8f9094; - font-size: 0.9375rem; - font-weight: 500; - vertical-align: middle; - font-weight: 600; -} - -.dots { - width: 50%; - justify-content: space-around; - padding: 1em; - padding-top: 2em; -} - -.dot { - position: relative; - background: rgba(143, 144, 148, 0.5); - border-radius: 50%; - width: 1.6em; - height: 1.6em; - transform: scale3d(0.6, 0.6, 0.6); -} - -.dot.active { - -webkit-animation: growDot 0.5s ease; - animation: growDot 0.5s ease; - -webkit-animation-fill-mode: forwards; - animation-fill-mode: forwards; -} - -.dot.wrong { - -webkit-animation: wrong 0.9s ease; - animation: wrong 0.9s ease; -} - -.dot.correct { - -webkit-animation: correct 0.9s ease; - animation: correct 0.9s ease; -} - -.dot.clear { - -webkit-animation: clear 0.9s ease; - animation: clear 0.9s ease; -} - -.numbers { - display: flex; - flex-flow: row wrap; - align-items: center; - justify-content: space-around; - align-content: flex-end; - margin: 0em 0; -} - -.number { - position: relative; - width: 2.5em; - height: 2.5em; - margin: 0.5em; - text-align: center; - line-height: 2.5em; - font-weight: 400; - font-size: 1.8em; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - transition: all 0.5s ease; - border-radius: 0.625rem; - border: 0.125rem solid #1f5eff; -} -.number:hover { - background-color: #1f5eff; - color: #fff; - border-radius: 0.625rem; - cursor: pointer; -} - -.number:before { - content: ""; - position: absolute; - left: -0.125rem; - width: 2.5em; - height: 2.5em; - transition: all 0.5s ease; -} -.number.grow { - -webkit-animation: grow 0.6s ease; - animation: grow 0.6s ease; -} - -@keyframes growDot { - 100% { - background: white; - transform: scale3d(0.85, 0.85, 0.85); - } -} - -@keyframes grow { - 50% { - transform: scale3d(1.1, 1.1, 1.1); - } - 100% { - transform: scale3d(1, 1, 1); - } -} - -@keyframes wrong { - 20% { - background: #ff0000; - transform: scale3d(0.85, 0.85, 0.85); - left: 0; - } - 40% { - left: -0.3125rem; - } - 60% { - left: 0.625rem; - } - 80% { - left: -0.3125rem; - } -} - -@keyframes correct { - 20% { - background: #1ebc62; - transform: scale3d(0.85, 0.85, 0.85); - top: 0; - } - 40% { - top: -0.3125rem; - } - 60% { - top: 0.625rem; - } - 80% { - top: -0.3125rem; - } -} - -@keyframes clear { - 20% { - background: #1f5eff; - transform: scale3d(0.85, 0.85, 0.85); - left: 0; - } -} - -.load { - position: relative; - width: 9.375rem; - height: 9.375rem; - border-radius: 50%; - border: 0.625rem solid transparent; - border-top: 0.625rem solid #1f5eff; - border-bottom: 0.625rem solid #1f5eff; - animation: rotateAntiCW 1.8s linear infinite; -} - -.load::after { - content: ''; - position: absolute; - width: 8.125rem; - height: 8.125rem; - border-radius: 50%; - border: 0.625rem solid transparent; - border-left: 0.625rem solid #fff; - border-right: 0.625rem solid #fff; - animation: rotate 1s linear infinite; -} - -@keyframes rotate { - 0%{transform: rotate(0deg);} - 100%{transform: rotate(-360deg);} -} - -@keyframes rotateAntiCW { - 0%{transform: rotate(0deg);} - 100%{transform: rotate(360deg);} -} - -input[type=password]:not(:placeholder-shown) { - font-family: Verdana, sans-serif; - font-size: 2.5rem; -} - -.dataTable-table > tbody > tr > td, .dataTable-table > tbody > tr > th, .dataTable-table > tfoot > tr > td, .dataTable-table > tfoot > tr > th, .dataTable-table > thead > tr > td, .dataTable-table > thead > tr > th { - vertical-align: top; - padding: 0.5rem 0.625rem; -} - -.card-header:first-child { - border-radius: calc(0.25rem - 0.0625rem) calc(0.25rem - 0.0625rem) 0 0; -} - -.card-header { - border-bottom: none; -} - -#myChart { - margin-top: 0!important; - margin-top: 0.3125rem; - width: 100%; -} - -.dataTable-info { - display: none; -} - -#last-t-body .dataTable-bottom .dataTable-pagination { - margin-top: 0; -} - -.sidebar-s { - border-right: 0.0625rem solid rgba(62, 63, 75); - width: 11.0625rem; -} - -.tab-s { - width: 82%; - display: flex; - flex-direction: column; - padding-right: calc(var(--bs-gutter-x) * .45); -} - -.wallet-div { - font-size: 0.875rem; - margin-top: -0.75rem; - font-weight: 500; - position: absolute; - right: 7.1%; -} - -.chart-main { - border-right: 0.0625rem solid rgba(62, 63, 75); -} - -.chart-card, .settings-card { - background-color: transparent; - border-radius: 0.625rem; - box-shadow: 0rem 0rem 0.313rem 0rem rgba(10, 10, 10, 0.50); -} - -.card-o-header { - background-color: #292a31; - border-top-right-radius: 0.625rem !important; - border-top-left-radius: 0.625rem !important; -} - -.card-o-title { - color: #fff; - font-size: 1.125rem; -} - -.chart-card-body { - background-color: #1d1e24; - border-bottom-left-radius: 0.625rem; - border-bottom-right-radius: 0.625rem; - padding: 0.6rem 1rem 0.5rem 1rem; -} - -.chart-div { - height: 13.107rem; - min-height: 13.107rem; -} - -.last-t-card, .actions-card, .settings2-card { - background-color: transparent; - border-radius: 0.625rem; - box-shadow: 0rem 0rem 0.313rem 0rem rgba(10, 10, 10, 0.50); - margin-top: 0.75rem; -} - -#view_all_transactions, #view_all_transactions_society, .buy_new_card { - position: absolute; - font-size: 0.875rem; - right: 0.5625rem; - top: 0.625rem; -} - -#last-t-body { - background-color: #1d1e24; - border-bottom-left-radius: 0.625rem; - border-bottom-right-radius: 0.625rem; - padding: 0.6rem 1rem; - padding: 0.51rem 1rem 0.6rem 1rem; - height: 18.05rem; -} - -#text_atm { - font-size: 1.125rem; -} - -#depositMoney, #withdrawMoney, #transferMoney, .buyccbtn { - border-radius: 0.625rem; - flex-basis: 100%; - margin-top: 1.125rem; -} - -#transfer_iban { - margin-top: 1.125rem; - text-transform: uppercase; -} - -.w25 { - width: 25rem; -} - -.w20p { - width: 20%; -} - -.modal-t { - font-weight: 600; - font-size: 1.875rem; -} - -.ccard-card { - background-color: transparent; - border-radius: 0.625rem; - box-shadow: 0rem 0rem 0.313rem 0rem rgba(10, 10, 10, 0.50); -} - -.ccard-body { - background-color: #1d1e24; - border-bottom-left-radius: 0.625rem; - border-bottom-right-radius: 0.625rem; - font-size: 1rem; - height: 19.4375rem; -} - -.ccard-name { - color: #fff; - font-size: 0.75rem; - margin-left: 0.3125rem; - font-weight: 500; -} - -.mt38p { - margin-top: 38%; -} - -.ccard-status { - font-weight: 500; - color: #fff; - line-height: 1; -} - -.ccard-active { - color: #fff; - font-size: 1.5rem; - color: #fff; - line-height: 1; - text-shadow: 0rem 0rem 0.125rem rgba(255, 255, 255, 0.5); -} - -.ccard-valid { - width: 1.5625rem; - line-height: 1; - margin-right: 2.125rem; -} - -.ccard-thru { - color: #fff; - font-size: 0.5rem; - font-weight: 500; - margin-right: 0.1875rem; -} - -.ccard-exp { - color: #fff; - font-weight: 500; - font-size: 1rem; -} - -.ccard-fs { - font-size: 1.28rem; -} - -.fff { - color: #fff; -} - -.actions-card_body, .settings-card_body { - background-color: #1d1e24; - border-bottom-left-radius: 0.625rem; - border-bottom-right-radius: 0.625rem; -} - -#depositMoneyModal, #withdrawMoneyModal, #transferMoneyModal { - border-radius: 0.625rem; - flex-basis: 100%; -} - -.mt4375 { - margin-top: 0.4375rem; -} - -.lastT-action, .transactions-action { - background-color: #1d1e24; - padding: 0.3125rem 0.625rem 0.3125rem 0.625rem; - border-radius: 0.625rem; -} - -.lastT-name-div { - font-weight: 500; - font-size: 1rem; -} - -.lastT-name, .transactions-name { - color: #1f5eff; - text-transform: capitalize; - font-weight: 600; -} - -.mtm3125 { - margin-top: -0.3125rem; -} - -.fw500 { - font-weight: 500; -} - -.lastT-received, .transactions-received { - color: #2ecc71; -} - -.fs1125 { - font-size: 1.125rem; -} - -.fs1875 { - font-size: 1.875rem; -} - -.settings-col { - flex: 1 1 50%; -} - -.changeiban-card, .changepin-card { - background-color: #292a31; - border-radius: 0.625rem; - color: #fff; -} - -.fs15 { - font-size: 1.5rem; -} - -#new_iban { - margin-top: 0.75rem; - width: 100%; -} - -#change_iban { - border-radius: 0.625rem; - flex-basis: 100%; - margin-top: 0.75rem; - width: 100%; - font-size: 1.17rem; -} - -.settings_info-card { - background-color: #1f5eff; - border-radius: 0.625rem; - color: #fff; -} - -#new_pin { - margin-top: 0.75rem; - width: 100%; -} - -#change_pin { - border-radius: 0.625rem; - flex-basis: 100%; - margin-top: 0.75rem; - width: 100%; - font-size: 1.17rem; -} - -.pr05 { - padding-right: 0.5rem; -} - -.pl05 { - padding-left: 0.5rem; -} - -.stats-title { - background-color: #1f5eff; - border-radius: 0.625rem; - color: #fff; -} - -.card-title { - font-weight: 600; - font-size: 1.25rem; -} - -.fw125 { - font-size: 1.25rem; -} - -.transactions-name-div { - font-weight: 500; -} - -.ldata-txt { - font-size: 2.5rem; - color: #fff; -} - -.floatr { - float: right; -} - -.btn-dark { - background-color: #1d1e24; -} - -.btn-dark:hover { - background-color: #1b1c22; -} - -.modal-buycc { - width: 35rem; -} - -#transactionsTable { - max-width: 100.1%; - width: 100.1%; - border-spacing: 0rem 0.5rem; -} - -#transactionsData tr { - height: 4.55rem; -} \ No newline at end of file diff --git a/resources/[tools]/okokBanking/web/ui.html b/resources/[tools]/okokBanking/web/ui.html deleted file mode 100644 index d94405077..000000000 --- a/resources/[tools]/okokBanking/web/ui.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - -
-
- -
-
- -
-
- -
- -
-
-
-
-
-
-
- Enter your account's PIN code -
-
-
1
-
2
-
3
-
-
-
4
-
5
-
6
-
-
-
7
-
8
-
9
-
-
-
C
-
0
-
OK
-
-
-
-
- - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/resources/[tools]/okokBanking/web/wrong.mp3 b/resources/[tools]/okokBanking/web/wrong.mp3 deleted file mode 100644 index f118ac5d8..000000000 Binary files a/resources/[tools]/okokBanking/web/wrong.mp3 and /dev/null differ