diff --git a/client/cl_impound.lua b/client/cl_impound.lua new file mode 100644 index 00000000..288b236c --- /dev/null +++ b/client/cl_impound.lua @@ -0,0 +1,75 @@ +local currentGarage = 1 + +local function doCarDamage(currentVehicle, veh) + local smash = false + local damageOutside = false + local damageOutside2 = false + local engine = veh.engine + 0.0 + local body = veh.body + 0.0 + + if engine < 200.0 then engine = 200.0 end + if engine > 1000.0 then engine = 950.0 end + if body < 150.0 then body = 150.0 end + if body < 950.0 then smash = true end + if body < 920.0 then damageOutside = true end + if body < 920.0 then damageOutside2 = true end + + Citizen.Wait(100) + SetVehicleEngineHealth(currentVehicle, engine) + + if smash then + SmashVehicleWindow(currentVehicle, 0) + SmashVehicleWindow(currentVehicle, 1) + SmashVehicleWindow(currentVehicle, 2) + SmashVehicleWindow(currentVehicle, 3) + SmashVehicleWindow(currentVehicle, 4) + end + + if damageOutside then + SetVehicleDoorBroken(currentVehicle, 1, true) + SetVehicleDoorBroken(currentVehicle, 6, true) + SetVehicleDoorBroken(currentVehicle, 4, true) + end + + if damageOutside2 then + SetVehicleTyreBurst(currentVehicle, 1, false, 990.0) + SetVehicleTyreBurst(currentVehicle, 2, false, 990.0) + SetVehicleTyreBurst(currentVehicle, 3, false, 990.0) + SetVehicleTyreBurst(currentVehicle, 4, false, 990.0) + end + + if body < 1000 then + SetVehicleBodyHealth(currentVehicle, 985.1) + end +end + +local function TakeOutImpound(vehicle) + local coords = Config.ImpoundLocations[currentGarage] + if coords then + QBCore.Functions.SpawnVehicle(vehicle.vehicle, function(veh) + QBCore.Functions.TriggerCallback('qb-garage:server:GetVehicleProperties', function(properties) + QBCore.Functions.SetVehicleProperties(veh, properties) + SetVehicleNumberPlateText(veh, vehicle.plate) + SetEntityHeading(veh, coords.w) + exports[Config.Fuel]:SetFuel(veh, vehicle.fuel) + doCarDamage(veh, vehicle) + TriggerServerEvent('police:server:TakeOutImpound',vehicle.plate) + TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(veh)) + SetVehicleEngineOn(veh, true, true) + end, vehicle.plate) + end, coords, true) + end +end + +RegisterNetEvent('qb-mdt:client:TakeOutImpound', function(data) + local pos = GetEntityCoords(PlayerPedId()) + currentGarage = data.currentSelection + local takeDist = Config.ImpoundLocations[data.currentSelection] + takeDist = vector3(takeDist.x, takeDist.y, takeDist.z) + if #(pos - takeDist) <= 15.0 then + local vehicle = data.vehicle + TakeOutImpound(data) + else + QBCore.Functions.Notify("You are too far away from the impound location!") + end +end) \ No newline at end of file diff --git a/client/main.lua b/client/main.lua new file mode 100644 index 00000000..a7fd2b20 --- /dev/null +++ b/client/main.lua @@ -0,0 +1,853 @@ +QBCore = exports['qb-core']:GetCoreObject() +local PlayerData = {} +local CurrentCops = 0 +local isOpen = false +local callSign = "" + +local tablet = 0 +local tabletDict = "amb@code_human_in_bus_passenger_idles@female@tablet@base" +local tabletAnim = "base" +local tabletProp = `prop_cs_tablet` +local tabletBone = 60309 +local tabletOffset = vector3(0.03, 0.002, -0.0) +local tabletRot = vector3(10.0, 160.0, 0.0) + +-- Events from qbcore +RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() + PlayerData = QBCore.Functions.GetPlayerData() + callSign = PlayerData.metadata.callsign +end) + +RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo) + PlayerData.job = JobInfo +end) + +RegisterNetEvent('QBCore:Client:OnGangUpdate', function(GangInfo) + PlayerData.gang = GangInfo +end) + +RegisterNetEvent('police:SetCopCount', function(amount) + CurrentCops = amount +end) + +RegisterNetEvent('QBCore:Player:SetPlayerData', function(val) + PlayerData = val +end) + +AddEventHandler('onResourceStart', function(resourceName) + if GetCurrentResourceName() ~= resourceName then return end + Wait(150) + PlayerData = QBCore.Functions.GetPlayerData() + callSign = PlayerData.metadata.callsign +end) + +--==================================================================================== +------------------------------------------ +-- Functions -- +------------------------------------------ +--====================================================================================\ + +RegisterKeyMapping('mdt', 'Open Police MDT', 'keyboard', 'k') + +RegisterCommand('mdt', function() + if GetJobType(PlayerData.job.name) ~= nil then + TriggerServerEvent('mdt:server:openMDT') + end +end, false) + +Citizen.CreateThread(function() + TriggerEvent('chat:addSuggestion', '/mdt', 'Open the emergency services MDT', {}) +end) + +local function doAnimation() + if not isOpen then return end + -- Animation + RequestAnimDict(tabletDict) + while not HasAnimDictLoaded(tabletDict) do Citizen.Wait(100) end + -- Model + RequestModel(tabletProp) + while not HasModelLoaded(tabletProp) do Citizen.Wait(100) end + + local plyPed = PlayerPedId() + local tabletObj = CreateObject(tabletProp, 0.0, 0.0, 0.0, true, true, false) + local tabletBoneIndex = GetPedBoneIndex(plyPed, tabletBone) + + AttachEntityToEntity(tabletObj, plyPed, tabletBoneIndex, tabletOffset.x, tabletOffset.y, tabletOffset.z, tabletRot.x, tabletRot.y, tabletRot.z, true, false, false, false, 2, true) + SetModelAsNoLongerNeeded(tabletProp) + + CreateThread(function() + while isOpen do + Wait(0) + if not IsEntityPlayingAnim(plyPed, tabletDict, tabletAnim, 3) then + TaskPlayAnim(plyPed, tabletDict, tabletAnim, 3.0, 3.0, -1, 49, 0, 0, 0, 0) + end + end + + + ClearPedSecondaryTask(plyPed) + Citizen.Wait(250) + DetachEntity(tabletObj, true, false) + DeleteEntity(tabletObj) + end) +end + + +local function CurrentDuty(duty) + if duty == 1 then + return "10-41" + end + return "10-42" +end + +local function EnableGUI(enable) + SetNuiFocus(enable, enable) + SendNUIMessage({ type = "show", enable = enable, job = PlayerData.job.name, rosterLink = Config.RosterLink[PlayerData.job.name] }) + isOpen = enable + doAnimation() +end + +local function RefreshGUI() + SetNuiFocus(false, false) + SendNUIMessage({ type = "show", enable = false, job = PlayerData.job.name, rosterLink = Config.RosterLink[PlayerData.job.name] }) + isOpen = false +end + + +--==================================================================================== +------------------------------------------ +-- MAIN PAGE -- +------------------------------------------ +--==================================================================================== + + +RegisterCommand("restartmdt", function(source, args, rawCommand) + RefreshGUI() +end, false) + +RegisterNUICallback("deleteBulletin", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:deleteBulletin', id, data.title) + cb(true) +end) + +RegisterNUICallback("newBulletin", function(data, cb) + local title = data.title + local info = data.info + local time = data.time + TriggerServerEvent('mdt:server:NewBulletin', title, info, time) + cb(true) +end) + +RegisterNUICallback('escape', function(data, cb) + EnableGUI(false) + cb(true) +end) + +RegisterNetEvent('mdt:client:dashboardbulletin', function(sentData) + SendNUIMessage({ type = "bulletin", data = sentData }) +end) + +RegisterNetEvent('mdt:client:dashboardWarrants', function() + QBCore.Functions.TriggerCallback("mdt:server:getWarrants", function(data) + if data then + SendNUIMessage({ type = "warrants", data = data }) + end + end) + -- SendNUIMessage({ type = "warrants",}) +end) + +RegisterNUICallback("getAllDashboardData", function(data, cb) + TriggerEvent("mdt:client:dashboardWarrants") + cb(true) +end) + + +RegisterNetEvent('mdt:client:dashboardReports', function(sentData) + SendNUIMessage({ type = "reports", data = sentData }) +end) + +RegisterNetEvent('mdt:client:dashboardCalls', function(sentData) + SendNUIMessage({ type = "calls", data = sentData }) +end) + +RegisterNetEvent('mdt:client:newBulletin', function(ignoreId, sentData, job) + if ignoreId == GetPlayerServerId(PlayerId()) then return end; + if PlayerData.job.name == 'police' then + SendNUIMessage({ type = "newBulletin", data = sentData }) + elseif PlayerData.job.name == 'ambulance' then + SendNUIMessage({ type = "newBulletin", data = sentData }) + end +end) + +RegisterNetEvent('mdt:client:deleteBulletin', function(ignoreId, sentData, job) + if ignoreId == GetPlayerServerId(PlayerId()) then return end; + if PlayerData.job.name == 'police' or PlayerData.job.name == 'ambulance'then + SendNUIMessage({ type = "deleteBulletin", data = sentData }) + end +end) + +RegisterNetEvent('mdt:client:open', function(bulletin, activeUnits) + EnableGUI(true) + local x, y, z = table.unpack(GetEntityCoords(PlayerPedId())) + + local currentStreetHash, intersectStreetHash = GetStreetNameAtCoord(x, y, z) + local currentStreetName = GetStreetNameFromHashKey(currentStreetHash) + local intersectStreetName = GetStreetNameFromHashKey(intersectStreetHash) + local zone = tostring(GetNameOfZone(x, y, z)) + local area = GetLabelText(zone) + local playerStreetsLocation = area + + if not zone then zone = "UNKNOWN" end; + + if intersectStreetName ~= nil and intersectStreetName ~= "" then playerStreetsLocation = currentStreetName .. ", " .. intersectStreetName .. ", " .. area + elseif currentStreetName ~= nil and currentStreetName ~= "" then playerStreetsLocation = currentStreetName .. ", " .. area + else playerStreetsLocation = area end + + -- local grade = PlayerData.job.grade.name + + SendNUIMessage({ type = "data", activeUnits = activeUnits, name = "Welcome, " ..PlayerData.job.grade.name..' '..PlayerData.charinfo.lastname:sub(1,1):upper()..PlayerData.charinfo.lastname:sub(2), location = playerStreetsLocation, fullname = PlayerData.charinfo.firstname..' '..PlayerData.charinfo.lastname, bulletin = bulletin }) + TriggerEvent("mdt:client:dashboardWarrants") +end) + +RegisterNetEvent('mdt:client:exitMDT', function() + EnableGUI(false) +end) + +--==================================================================================== +------------------------------------------ +-- PROFILE PAGE -- +------------------------------------------ +--==================================================================================== + +RegisterNUICallback("searchProfiles", function(data, cb) + local p = promise.new() + + QBCore.Functions.TriggerCallback('mdt:server:SearchProfile', function(result) + p:resolve(result) + end, data.name) + + local data = Citizen.Await(p) + + cb(data) +end) + + +RegisterNetEvent('mdt:client:searchProfile', function(sentData, isLimited) + SendNUIMessage({ type = "profiles", data = sentData, isLimited = isLimited }) +end) + +RegisterNUICallback("saveProfile", function(data, cb) + local profilepic = data.pfp + local information = data.description + local cid = data.id + local fName = data.fName + local sName = data.sName + local tags = data.tags + local gallery = data.gallery + local fingerprint = data.fingerprint + local licenses = data.licenses + + TriggerServerEvent("mdt:server:saveProfile", profilepic, information, cid, fName, sName, tags, gallery, fingerprint, licenses) + cb(true) +end) + +RegisterNUICallback("getProfileData", function(data, cb) + local id = data.id + local p = nil + local getProfileDataPromise = function(data) + if p then return end + p = promise.new() + QBCore.Functions.TriggerCallback('mdt:server:GetProfileData', function(result) + p:resolve(result) + end, data) + return Citizen.Await(p) + end + local pP = nil + local result = getProfileDataPromise(id) + + --[[ local getProfileProperties = function(data) + if pP then return end + pP = promise.new() + QBCore.Functions.TriggerCallback('qb-phone:server:MeosGetPlayerHouses', function(result) + pP:resolve(result) + end, data) + return Citizen.Await(pP) + end + local propertiesResult = getProfileProperties(id) + result.properties = propertiesResult + ]] + local vehicles=result.vehicles + for i=1,#vehicles do + local vehicle=result.vehicles[i] + result.vehicles[i]['model'] = GetLabelText(GetDisplayNameFromVehicleModel(vehicle['vehicle'])) + end + p = nil + return cb(result) +end) + +RegisterNUICallback("newTag", function(data, cb) + if data.id ~= "" and data.tag ~= "" then + TriggerServerEvent('mdt:server:newTag', data.id, data.tag) + end + cb(true) +end) + +RegisterNUICallback("removeProfileTag", function(data, cb) + local cid = data.cid + local tagtext = data.text + TriggerServerEvent('mdt:server:removeProfileTag', cid, tagtext) + cb(removeProfileTag) +end) + +RegisterNUICallback("updateLicence", function(data, cb) + local type = data.type + local status = data.status + local cid = data.cid + TriggerServerEvent('mdt:server:updateLicense', cid, type, status) + cb(true) +end) + +RegisterNUICallback("searchIncidents", function(data, cb) + local incident = data.incident + TriggerServerEvent('mdt:server:searchIncidents', incident) + cb(true) +end) + +RegisterNUICallback("getIncidentData", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:getIncidentData', id) + cb(true) +end) + +RegisterNUICallback("incidentSearchPerson", function(data, cb) + local name = data.name + TriggerServerEvent('mdt:server:incidentSearchPerson', name ) + cb(true) +end) + +RegisterNetEvent('mdt:client:getProfileData', function(sentData, isLimited) + if not isLimited then + local vehicles = sentData['vehicles'] + for i=1, #vehicles do + sentData['vehicles'][i]['plate'] = string.upper(sentData['vehicles'][i]['plate']) + local tempModel = vehicles[i]['model'] + if tempModel and tempModel ~= "Unknown" then + local DisplayNameModel = GetDisplayNameFromVehicleModel(tempModel) + local LabelText = GetLabelText(DisplayNameModel) + if LabelText == "NULL" then LabelText = DisplayNameModel end + sentData['vehicles'][i]['model'] = LabelText + end + end + end + SendNUIMessage({ type = "profileData", data = sentData, isLimited = isLimited }) +end) + +RegisterNetEvent('mdt:client:getIncidents', function(sentData) + SendNUIMessage({ type = "incidents", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getIncidentData', function(sentData, sentConvictions) + SendNUIMessage({ type = "incidentData", data = sentData, convictions = sentConvictions }) +end) + +RegisterNetEvent('mdt:client:incidentSearchPerson', function(sentData) + SendNUIMessage({ type = "incidentSearchPerson", data = sentData }) +end) + + +RegisterNUICallback('SetHouseLocation', function(data, cb) + local coords = {} + for word in data.coord[1]:gmatch('[^,%s]+') do + coords[#coords+1] = tonumber(word) + end + SetNewWaypoint(coords[1], coords[2]) + QBCore.Functions.Notify('GPS has been set!', 'success') +end) + +--==================================================================================== +------------------------------------------ +-- BOLO PAGE -- +------------------------------------------ +--==================================================================================== + +RegisterNUICallback("searchBolos", function(data, cb) + local searchVal = data.searchVal + TriggerServerEvent('mdt:server:searchBolos', searchVal) + cb(true) +end) + +RegisterNUICallback("getAllBolos", function(data, cb) + TriggerServerEvent('mdt:server:getAllBolos') + cb(true) +end) + +RegisterNUICallback("getAllIncidents", function(data, cb) + TriggerServerEvent('mdt:server:getAllIncidents') + cb(true) +end) + +RegisterNUICallback("getBoloData", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:getBoloData', id) + cb(true) +end) + +RegisterNUICallback("newBolo", function(data, cb) + local existing = data.existing + local id = data.id + local title = data.title + local plate = data.plate + local owner = data.owner + local individual = data.individual + local detail = data.detail + local tags = data.tags + local gallery = data.gallery + local officers = data.officers + local time = data.time + TriggerServerEvent('mdt:server:newBolo', existing, id, title, plate, owner, individual, detail, tags, gallery, officers, time) + cb(true) +end) + +RegisterNUICallback("deleteBolo", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:deleteBolo', id) + cb(true) +end) + +RegisterNUICallback("deleteICU", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:deleteICU', id) + cb(true) +end) + +RegisterNetEvent('mdt:client:getBolos', function(sentData) + SendNUIMessage({ type = "bolos", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getAllIncidents', function(sentData) + SendNUIMessage({ type = "incidents", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getAllBolos', function(sentData) + SendNUIMessage({ type = "bolos", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getBoloData', function(sentData) + SendNUIMessage({ type = "boloData", data = sentData }) +end) + +RegisterNetEvent('mdt:client:boloComplete', function(sentData) + SendNUIMessage({ type = "boloComplete", data = sentData }) +end) + +--==================================================================================== +------------------------------------------ +-- REPORTS PAGE -- +------------------------------------------ +--==================================================================================== + +RegisterNUICallback("getAllReports", function(data, cb) + TriggerServerEvent('mdt:server:getAllReports') + cb(true) +end) + +RegisterNUICallback("getReportData", function(data, cb) + local id = data.id + TriggerServerEvent('mdt:server:getReportData', id) + cb(true) +end) + +RegisterNUICallback("searchReports", function(data, cb) + local name = data.name + TriggerServerEvent('mdt:server:searchReports', name) + cb(true) +end) + +RegisterNUICallback("newReport", function(data, cb) + local existing = data.existing + local id = data.id + local title = data.title + local reporttype = data.type + local details = data.details + local tags = data.tags + local gallery = data.gallery + local officers = data.officers + local civilians = data.civilians + local time = data.time + + TriggerServerEvent('mdt:server:newReport', existing, id, title, reporttype, details, tags, gallery, officers, civilians, time) + cb(true) +end) + +RegisterNetEvent('mdt:client:getAllReports', function(sentData) + SendNUIMessage({ type = "reports", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getReportData', function(sentData) + SendNUIMessage({ type = "reportData", data = sentData }) +end) + +RegisterNetEvent('mdt:client:reportComplete', function(sentData) + SendNUIMessage({ type = "reportComplete", data = sentData }) +end) + +--==================================================================================== +------------------------------------------ +-- DMV PAGE -- +------------------------------------------ +--==================================================================================== +RegisterNUICallback("searchVehicles", function(data, cb) + + local p = promise.new() + + QBCore.Functions.TriggerCallback('mdt:server:SearchVehicles', function(result) + p:resolve(result) + end, data.name) + + local result = Citizen.Await(p) + for i=1, #result do + local vehicle = result[i] + local mods = json.decode(result[i].mods) + result[i]['plate'] = string.upper(result[i]['plate']) + result[i]['color'] = Config.ColorInformation[mods['color1']] + result[i]['colorName'] = Config.ColorNames[mods['color1']] + result[i]['model'] = GetLabelText(GetDisplayNameFromVehicleModel(vehicle['vehicle'])) + end + cb(result) + +end) + +RegisterNUICallback("getVehicleData", function(data, cb) + local plate = data.plate + TriggerServerEvent('mdt:server:getVehicleData', plate) + cb(true) +end) + +RegisterNUICallback("saveVehicleInfo", function(data, cb) + local dbid = data.dbid + local plate = data.plate + local imageurl = data.imageurl + local notes = data.notes + local stolen = data.stolen + local code5 = data.code5 + local impound = data.impound + local JobType = GetJobType(PlayerData.job.name) + if JobType == 'police' and impound.impoundChanged == true then + if impound.inpoundActive then + local found = 0 + local plate = string.upper(string.gsub(data['plate'], "^%s*(.-)%s*$", "%1")) + local vehicles = GetGamePool('CVehicle') + + for k,v in pairs(vehicles) do + local plt = string.upper(string.gsub(GetVehicleNumberPlateText(v), "^%s*(.-)%s*$", "%1")) + if plt == plate then + local dist = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(v)) + if dist < 5.0 then + found = VehToNet(v) + SendNUIMessage({ type = "greenImpound" }) + end + break + end + end + + if found == 0 then + QBCore.Functions.Notify('Vehicle not found!', 'error') + SendNUIMessage({ type = "redImpound" }) + end + --TriggerServerEvent('mdt:server:impoundVehicle', data, found) + --cb('ok') + else + local ped = PlayerPedId() + local playerPos = GetEntityCoords(ped) + for k, v in pairs(Config.ImpoundLocations) do + if (#(playerPos - vector3(v.x, v.y, v.z)) < 20.0) then + --TriggerServerEvent('mdt:server:removeImpound', data['plate'], k) + impound.CurrentSelection = k + break + end + end + end + end + print(impound.CurrentSelection) + TriggerServerEvent('mdt:server:saveVehicleInfo', dbid, plate, imageurl, notes, stolen, code5, impound) + cb(true) +end) + +RegisterNUICallback("getAllLogs", function(data, cb) + TriggerServerEvent('mdt:server:getAllLogs') + cb(true) +end) + +RegisterNUICallback("getPenalCode", function(data, cb) + TriggerServerEvent('mdt:server:getPenalCode') + cb(true) +end) + +RegisterNUICallback("toggleDuty", function(data, cb) + -- TriggerServerEvent('QBCore:ToggleDuty') + TriggerEvent("qb-policejob:ToggleDuty") + cb(true) +end) + +RegisterNUICallback("setCallsign", function(data, cb) + TriggerServerEvent('mdt:server:setCallsign', data.cid, data.newcallsign) + cb(true) +end) + +RegisterNUICallback("setRadio", function(data, cb) + TriggerServerEvent('mdt:server:setRadio', data.cid, data.newradio) + cb(true) +end) + +RegisterNUICallback("saveIncident", function(data, cb) + TriggerServerEvent('mdt:server:saveIncident', data.ID, data.title, data.information, data.tags, data.officers, data.civilians, data.evidence, data.associated, data.time) + cb(true) +end) + +RegisterNUICallback("removeIncidentCriminal", function(data, cb) + TriggerServerEvent('mdt:server:removeIncidentCriminal', data.cid, data.incidentId) + cb(true) +end) + +RegisterNetEvent('mdt:client:getVehicleData', function(sentData) + if sentData and sentData[1] then + local vehicle = sentData[1] + local vehData = json.decode(vehicle['vehicle']) + vehicle['color'] = Config.ColorInformation[vehicle['color1']] + vehicle['colorName'] = Config.ColorNames[vehicle['color1']] + vehicle['model'] = GetLabelText(GetDisplayNameFromVehicleModel(vehicle['vehicle'])) + vehicle['class'] = Config.ClassList[GetVehicleClassFromName(vehicle['vehicle'])] + vehicle['vehicle'] = nil + SendNUIMessage({ type = "getVehicleData", data = vehicle }) + end +end) + +RegisterNetEvent('mdt:client:updateVehicleDbId', function(sentData) + SendNUIMessage({ type = "updateVehicleDbId", data = tonumber(sentData) }) +end) + +RegisterNetEvent('mdt:client:getAllLogs', function(sentData) + SendNUIMessage({ type = "getAllLogs", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getPenalCode', function(titles, penalcode) + SendNUIMessage({ type = "getPenalCode", titles = titles, penalcode = penalcode }) +end) + +RegisterNetEvent('mdt:client:setRadio', function(radio) + if type(tonumber(radio)) == "number" then + exports["pma-voice"]:setVoiceProperty("radioEnabled", true) + exports["pma-voice"]:setRadioChannel(tonumber(radio)) + QBCore.Functions.Notify("You have set your radio frequency to "..radio..".", "success") + else + QBCore.Functions.Notify("Invalid Station(Please enter a number)", "error") + end +end) + +RegisterNetEvent('mdt:client:sig100', function(radio, type) + local job = PlayerData.job.name + local duty = PlayerData.job.onduty + if (job == "police" or job == "ambulance") and duty == 1 then + if type == true then + exports['erp_notifications']:PersistentAlert("START", "signall100-"..radio, "inform", "Radio "..radio.." is currently signal 100!") + end + end + if not type then + exports['erp_notifications']:PersistentAlert("END", "signall100-"..radio) + end +end) + +RegisterNetEvent('mdt:client:updateCallsign', function(callsign) + callSign = tostring(callsign) +end) + +RegisterNetEvent('mdt:client:updateIncidentDbId', function(sentData) + SendNUIMessage({ type = "updateIncidentDbId", data = tonumber(sentData) }) +end) + + +--==================================================================================== +------------------------------------------ +-- DISPATCH PAGE -- +------------------------------------------ +--==================================================================================== + +RegisterNetEvent('dispatch:clNotify', function(sNotificationData, sNotificationId) + SendNUIMessage({ type = "call", data = sNotificationData }) +end) + +RegisterNUICallback("setWaypoint", function(data, cb) + TriggerServerEvent('mdt:server:setWaypoint', data.callid) + cb(true) +end) + +RegisterNUICallback("callDetach", function(data, cb) + TriggerServerEvent('mdt:server:callDetach', data.callid) + cb(true) +end) + +RegisterNUICallback("callAttach", function(data, cb) + TriggerServerEvent('mdt:server:callAttach', data.callid) + cb(true) +end) + +RegisterNUICallback("attachedUnits", function(data, cb) + TriggerServerEvent('mdt:server:attachedUnits', data.callid) + cb(true) +end) + +RegisterNUICallback("callDispatchDetach", function(data, cb) + TriggerServerEvent('mdt:server:callDispatchDetach', data.callid, data.cid) + cb(true) +end) + +RegisterNUICallback("setDispatchWaypoint", function(data, cb) + TriggerServerEvent('mdt:server:setDispatchWaypoint', data.callid, data.cid) + cb(true) +end) + +RegisterNUICallback("callDragAttach", function(data, cb) + TriggerServerEvent('mdt:server:callDragAttach', data.callid, data.cid) + cb(true) +end) + +RegisterNUICallback("setWaypointU", function(data, cb) + TriggerServerEvent('mdt:server:setWaypoint:unit', data.cid) + cb(true) +end) + +RegisterNUICallback("dispatchMessage", function(data, cb) + TriggerServerEvent('mdt:server:sendMessage', data.message, data.time) + cb(true) +end) + +RegisterNUICallback("refreshDispatchMsgs", function(data, cb) + TriggerServerEvent('mdt:server:refreshDispatchMsgs') + cb(true) +end) + +RegisterNUICallback("dispatchNotif", function(data, cb) + local info = data['data'] + local mentioned = false + if callSign ~= "" then if string.find(string.lower(info['message']),string.lower(string.gsub(callSign,'-','%%-'))) then mentioned = true end end + if mentioned then + + -- Send notification to phone?? + TriggerEvent('erp_phone:sendNotification', {img = info['profilepic'], title = "Dispatch (Mention)", content = info['message'], time = 7500, customPic = true }) + + PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", false) + PlaySoundFrontend(-1, "Event_Start_Text", "GTAO_FM_Events_Soundset", 0) + else + TriggerEvent('erp_phone:sendNotification', {img = info['profilepic'], title = "Dispatch ("..info['name']..")", content = info['message'], time = 5000, customPic = true }) + end + cb(true) +end) + +RegisterNUICallback("getCallResponses", function(data, cb) + TriggerServerEvent('mdt:server:getCallResponses', data.callid) + cb(true) +end) + +RegisterNUICallback("sendCallResponse", function(data, cb) + TriggerServerEvent('mdt:server:sendCallResponse', data.message, data.time, data.callid) + cb(true) +end) + +--[[ RegisterNUICallback("impoundVehicle", function(data, cb) + local JobType = GetJobType(PlayerData.job.name) + if JobType == 'police' then + local found = 0 + local plate = string.upper(string.gsub(data['plate'], "^%s*(.-)%s*$", "%1")) + local vehicles = GetGamePool('CVehicle') + + for k,v in pairs(vehicles) do + local plt = string.upper(string.gsub(GetVehicleNumberPlateText(v), "^%s*(.-)%s*$", "%1")) + if plt == plate then + local dist = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(v)) + if dist < 5.0 then + found = VehToNet(v) + end + break + end + end + + if found == 0 then + QBCore.Functions.Notify('Vehicle not found!', 'error') + return + end + + SendNUIMessage({ type = "greenShit" }) + TriggerServerEvent('mdt:server:impoundVehicle', data, found) + cb('ok') + end +end) ]] + +RegisterNUICallback("removeImpound", function(data, cb) + local ped = PlayerPedId() + local playerPos = GetEntityCoords(ped) + for k, v in pairs(Config.ImpoundLocations) do + if (#(playerPos - vector3(v.x, v.y, v.z)) < 20.0) then + TriggerServerEvent('mdt:server:removeImpound', data['plate'], k) + break + end + end + cb('ok') +end) + +RegisterNUICallback("statusImpound", function(data, cb) + TriggerServerEvent('mdt:server:statusImpound', data['plate']) + cb('ok') +end) + +RegisterNetEvent('mdt:client:attachedUnits', function(sentData, callid) + SendNUIMessage({ type = "attachedUnits", data = sentData, callid = callid }) +end) + +RegisterNetEvent('mdt:client:setWaypoint', function(callInformation) + SetNewWaypoint(callInformation['origin']['x'], callInformation['origin']['y']) +end) + +RegisterNetEvent('mdt:client:callDetach', function(callid, sentData) + local job = PlayerData.job.name + if job == "police" or job == 'ambulance' then SendNUIMessage({ type = "callDetach", callid = callid, data = tonumber(sentData) }) end +end) +RegisterNetEvent('mdt:client:callAttach', function(callid, sentData) + local job = PlayerData.job.name + if job == "police" or job == 'ambulance' then + SendNUIMessage({ type = "callAttach", callid = callid, data = tonumber(sentData) }) + end +end) + +RegisterNetEvent('mdt:client:setWaypoint:unit', function(sentData) + SetNewWaypoint(sentData.x, sentData.y) +end) + +RegisterNetEvent('mdt:client:dashboardMessage', function(sentData) + local job = PlayerData.job.name + if job == "police" or job == 'ambulance' then + SendNUIMessage({ type = "dispatchmessage", data = sentData }) + end +end) + +RegisterNetEvent('mdt:client:dashboardMessages', function(sentData) + SendNUIMessage({ type = "dispatchmessages", data = sentData }) +end) + +RegisterNetEvent('mdt:client:getCallResponses', function(sentData, sentCallId) + SendNUIMessage({ type = "getCallResponses", data = sentData, callid = sentCallId }) +end) + +RegisterNetEvent('mdt:client:sendCallResponse', function(message, time, callid, name) + SendNUIMessage({ type = "sendCallResponse", message = message, time = time, callid = callid, name = name }) +end) + +RegisterNetEvent('mdt:client:notifyMechanics', function(sentData) + --[[if exports["erp-jobsystem"]:CanTow() then + TriggerServerEvent('erp-sounds:PlayWithinDistance', 1.5, 'beep', 0.4) + TriggerEvent('erp_phone:sendNotification', {img = 'vehiclenotif.png', title = "Impound", content = "New vehicle is ready to be impounded!", time = 5000 }) + end]] +end) + +RegisterNetEvent('mdt:client:statusImpound', function(data, plate) + SendNUIMessage({ type = "statusImpound", data = data, plate = plate }) +end) \ No newline at end of file diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 00000000..76aeee8f --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,43 @@ +fx_version 'cerulean' +game 'gta5' + +author 'Flawws, Flakey, Idris and the Project Sloth team' +description 'EchoRP MDT Rewrite for QBCore' +version '0.9.9' + +lua54 'yes' + +shared_script 'shared/config.lua' + +server_scripts { + '@oxmysql/lib/MySQL.lua', + 'server/utils.lua', + 'server/dbm.lua', + 'server/main.lua' +} +client_scripts{ + 'client/main.lua', + 'client/cl_impound.lua' +} + +ui_page 'ui/dashboard.html' + +files { + 'ui/img/sasp_badge.png', + 'ui/img/ems_badge.png', + 'ui/img/court.png', + 'ui/img/warrant_pfp.png', + 'ui/img/profile_pic.png', + 'ui/img/not-found.jpg', + 'ui/img/male.png', + 'ui/img/female.png', + 'ui/dashboard.html', + 'ui/dmv.html', + 'ui/bolos.html', + 'ui/incidents.html', + 'ui/penalcode.html', + 'ui/reports.html', + 'ui/warrants.html', + 'ui/app.js', + 'ui/style.css', +} \ No newline at end of file diff --git a/mdt.sql b/mdt.sql new file mode 100644 index 00000000..03bb0ae9 --- /dev/null +++ b/mdt.sql @@ -0,0 +1,111 @@ +CREATE TABLE IF NOT EXISTS `mdt_data` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` VARCHAR(20) DEFAULT NULL, + `information` MEDIUMTEXT DEFAULT NULL, + `tags` TEXT NOT NULL, + `gallery` TEXT NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + `pfp` TEXT DEFAULT NULL, + `fingerprint` VARCHAR(50) DEFAULT NULL, + PRIMARY KEY (`cid`), + KEY `id` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_bulletin` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `title` TEXT NOT NULL, + `desc` TEXT NOT NULL, + `author` varchar(50) NOT NULL, + `time` varchar(20) NOT NULL, + `jobtype` VARCHAR(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_reports` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + `type` varchar(50) DEFAULT NULL, + `details` text DEFAULT NULL, + `tags` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `civsinvolved` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_bolos` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) DEFAULT NULL, + `title` varchar(50) DEFAULT NULL, + `plate` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `individual` varchar(50) DEFAULT NULL, + `detail` text DEFAULT NULL, + `tags` text DEFAULT NULL, + `gallery` text DEFAULT NULL, + `officersinvolved` text DEFAULT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_convictions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cid` varchar(50) DEFAULT NULL, + `linkedincident` int(11) NOT NULL DEFAULT 0, + `warrant` varchar(50) DEFAULT NULL, + `guilty` varchar(50) DEFAULT NULL, + `processed` varchar(50) DEFAULT NULL, + `associated` varchar(50) DEFAULT '0', + `charges` text DEFAULT NULL, + `fine` int(11) DEFAULT 0, + `sentence` int(11) DEFAULT 0, + `recfine` int(11) DEFAULT 0, + `recsentence` int(11) DEFAULT 0, + `time` varchar(20) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_incidents` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` varchar(50) NOT NULL DEFAULT '', + `title` varchar(50) NOT NULL DEFAULT '0', + `details` text NOT NULL, + `tags` text NOT NULL, + `officersinvolved` text NOT NULL, + `civsinvolved` text NOT NULL, + `evidence` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) NOT NULL DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_logs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `text` text NOT NULL, + `time` varchar(20) DEFAULT NULL, + `jobtype` varchar(25) DEFAULT 'police', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_vehicleinfo` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `plate` varchar(50) DEFAULT NULL, + `information` text NOT NULL DEFAULT '', + `stolen` tinyint(1) NOT NULL DEFAULT 0, + `code5` tinyint(1) NOT NULL DEFAULT 0, + `image` text NOT NULL DEFAULT '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `mdt_impound` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `vehicleid` int(11) NOT NULL, + `linkedreport` int(11) NOT NULL, + `fee` int(11) DEFAULT NULL, + `time` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..98392104 --- /dev/null +++ b/readme.md @@ -0,0 +1,10 @@ +# Beta Released + +## EchoRP MDT QBCore Edit (WIP) + +EchoRP MDT Released by Flawws#9999 from Echo RP rewritten and restructured for QBCore. + +## Dependencies + +- QBCore +- OxMySQL V1.9.0 (will release docs on how to use an older version) diff --git a/server/dbm.lua b/server/dbm.lua new file mode 100644 index 00000000..b9655174 --- /dev/null +++ b/server/dbm.lua @@ -0,0 +1,153 @@ +local QBCore = exports['qb-core']:GetCoreObject() + +-- (Start) Opening the MDT and sending data +function AddLog(text) + --print(text) + return MySQL.insert.await('INSERT INTO `mdt_logs` (`text`, `time`) VALUES (?,?)', {text, os.time() * 1000}) + -- return exports.oxmysql:execute('INSERT INTO `mdt_logs` (`text`, `time`) VALUES (:text, :time)', { text = text, time = os.time() * 1000 }) +end + +function GetNameFromId(cid) + -- Should be a scalar? + local result = MySQL.scalar.await('SELECT charinfo FROM players WHERE citizenid = @citizenid', { ['@citizenid'] = cid }) + if result ~= nil then + local charinfo = json.decode(result) + local fullname = charinfo['firstname']..' '..charinfo['lastname'] + return fullname + else + --print('Player does not exist') + return nil + end + -- return exports.oxmysql:executeSync('SELECT firstname, lastname FROM `users` WHERE id = :id LIMIT 1', { id = cid }) +end + +-- idk what this is used for either +function GetPersonInformation(cid, jobtype) + local result = MySQL.query.await('SELECT information, tags, gallery, pfp, fingerprint FROM mdt_data WHERE cid = ? and jobtype = ?', { cid, jobtype}) + return result[1] + -- return exports.oxmysql:executeSync('SELECT information, tags, gallery FROM mdt WHERE cid= ? and type = ?', { cid, jobtype }) +end + +-- idk but I guess sure? +function GetIncidentName(id) + -- Should also be a scalar + return MySQL.query.await('SELECT title FROM `mdt_incidents` WHERE id = :id LIMIT 1', { id = id }) + -- return exports.oxmysql:executeSync('SELECT title FROM `mdt_incidents` WHERE id = :id LIMIT 1', { id = id }) +end + +function GetConvictions(cids) + return MySQL.query.await('SELECT * FROM `mdt_convictions` WHERE `cid` IN(?)', { cids }) + -- return exports.oxmysql:executeSync('SELECT * FROM `mdt_convictions` WHERE `cid` IN(?)', { cids }) +end + +function GetLicenseInfo(cid) + local result = MySQL.query.await('SELECT * FROM `licenses` WHERE `cid` = ?', { cid }) + return result + -- return exports.oxmysql:executeSync('SELECT * FROM `licenses` WHERE `cid`=:cid', { cid = cid }) +end + +function CreateUser(cid, tableName) + AddLog("A user was created with the CID: "..cid) + -- return exports.oxmysql:insert("INSERT INTO `"..dbname.."` (cid) VALUES (:cid)", { cid = cid }) + return MySQL.insert.await("INSERT INTO `"..tableName.."` (cid) VALUES (:cid)", { cid = cid }) +end + +function GetPlayerVehicles(cid, cb) + return MySQL.query.await('SELECT id, plate, vehicle FROM player_vehicles WHERE citizenid=:cid', { cid = cid }) +end + +function GetBulletins(JobType) + return MySQL.query.await('SELECT * FROM `mdt_bulletin` WHERE `jobtype` = ? LIMIT 10', { JobType }) + -- return exports.oxmysql:executeSync('SELECT * FROM `mdt_bulletin` WHERE `type`= ? LIMIT 10', { JobType }) +end + +function GetPlayerProperties(cid, cb) + local result = MySQL.query.await('SELECT houselocations.label, houselocations.coords FROM player_houses INNER JOIN houselocations ON player_houses.house = houselocations.name where player_houses.citizenid = ?', {cid}) + return result +end + +function GetPlayerDataById(id) + local Player = QBCore.Functions.GetPlayerByCitizenId(id) + if Player ~= nil then + local response = {citizenid = Player.PlayerData.citizenid, charinfo = Player.PlayerData.charinfo, metadata = Player.PlayerData.metadata, job = Player.PlayerData.job} + return response + else + return MySQL.single.await('SELECT citizenid, charinfo, job, metadata FROM players WHERE citizenid = ? LIMIT 1', { id }) + end + + -- return exports.oxmysql:executeSync('SELECT citizenid, charinfo, job FROM players WHERE citizenid = ? LIMIT 1', { id }) +end + +-- Probs also best not to use +--[[ function GetImpoundStatus(vehicleid, cb) + cb( #(exports.oxmysql:executeSync('SELECT id FROM `impound` WHERE `vehicleid`=:vehicleid', {['vehicleid'] = vehicleid })) > 0 ) +end ]] + +function GetBoloStatus(plate) + local result = MySQL.scalar.await('SELECT id FROM `mdt_bolos` WHERE LOWER(`plate`)=:plate', { plate = string.lower(plate)}) + return result + -- return exports.oxmysql:scalarSync('SELECT id FROM `mdt_bolos` WHERE LOWER(`plate`)=:plate', { plate = string.lower(plate)}) +end + +function GetOwnerName(cid) + local result = MySQL.scalar.await('SELECT charinfo FROM `players` WHERE LOWER(`citizenid`) = ? LIMIT 1', {cid}) + return result + -- return exports.oxmysql:scalarSync('SELECT charinfo FROM `players` WHERE id=:cid LIMIT 1', { cid = cid}) +end + +function GetVehicleInformation(plate, cb) + local result = MySQL.query.await('SELECT id, information FROM `mdt_vehicleinfo` WHERE plate=:plate', { plate = plate}) + cb(result) +end + +function GetPlayerLicenses(identifier) + local response = false + local Player = QBCore.Functions.GetPlayerByCitizenId(identifier) + if Player ~= nil then + return Player.PlayerData.metadata.licences + else + local result = MySQL.scalar.await('SELECT metadata FROM players WHERE citizenid = @identifier', {['@identifier'] = identifier}) + if result ~= nil then + local metadata = json.decode(result) + if metadata["licences"] ~= nil and metadata["licences"] then + return metadata["licences"] + end + end + end +end + +function ManageLicense(identifier, type, status) + local Player = QBCore.Functions.GetPlayerByCitizenId(identifier) + local licenseStatus = nil + if status == "give" then licenseStatus = true elseif status == "revoke" then licenseStatus = false end + if Player ~= nil then + local licences = Player.PlayerData.metadata["licences"] + local newLicenses = {} + for k, v in pairs(licences) do + local status = v + if k == type then + status = licenseStatus + end + newLicenses[k] = status + end + Player.Functions.SetMetaData("licences", newLicenses) + else + local licenseType = '$.licences.'..type + local result = MySQL.query.await('UPDATE `players` SET `metadata` = JSON_REPLACE(`metadata`, ?, ?) WHERE `citizenid` = ?', {licenseType, licenseStatus, identifier}) --seems to not work on older MYSQL versions, think about alternative + end +end + +function ManageLicenses(identifier, incomingLicenses) + local Player = QBCore.Functions.GetPlayerByCitizenId(identifier) + if Player ~= nil then + Player.Functions.SetMetaData("licences", incomingLicenses) + + else + local result = MySQL.scalar.await('SELECT metadata FROM players WHERE citizenid = @identifier', {['@identifier'] = identifier}) + result = json.decode(result) + for k, v in pairs(result.licences) do + result.licences[k] = incomingLicenses[k] + end + MySQL.query.await('UPDATE `players` SET `metadata` = @metadata WHERE citizenid = @citizenid', {['@metadata'] = json.encode(result), ['@citizenid'] = identifier}) + end +end \ No newline at end of file diff --git a/server/main.lua b/server/main.lua new file mode 100644 index 00000000..e7e2fede --- /dev/null +++ b/server/main.lua @@ -0,0 +1,1265 @@ +local QBCore = exports['qb-core']:GetCoreObject() +-- Maybe cache? +local incidents = {} +local convictions = {} +local bolos = {} + +-- TODO make it departments compatible +local activeUnits = {} + +local impound = {} +local dispatchMessages = {} + +local function IsPolice(job) + for k, v in pairs(Config.PoliceJobs) do + if job == k then + return true + end + end + return false +end + +AddEventHandler("onResourceStart", function(resourceName) + if (resourceName == 'qb-mdt') then + activeUnits = {} + end +end) + +RegisterNetEvent('mdt:server:openMDT', function() + local src = source + local PlayerData = GetPlayerData(src) + if not PermCheck(src, PlayerData) then return end + local Radio = Player(src).state.radioChannel or 0 + --[[ if Radio > 100 then + Radio = 0 + end ]] + + activeUnits[PlayerData.citizenid] = { + cid = PlayerData.citizenid, + callSign = PlayerData.metadata['callsign'], + firstName = PlayerData.charinfo.firstname:sub(1,1):upper()..PlayerData.charinfo.firstname:sub(2), + lastName = PlayerData.charinfo.lastname:sub(1,1):upper()..PlayerData.charinfo.lastname:sub(2), + radio = Radio, + unitType = PlayerData.job.name, + duty = PlayerData.job.onduty + } + + local JobType = GetJobType(PlayerData.job.name) + local bulletin = GetBulletins(JobType) + + --TriggerClientEvent('mdt:client:dashboardbulletin', src, bulletin) + TriggerClientEvent('mdt:client:open', src, bulletin, activeUnits) + --TriggerClientEvent('mdt:client:GetActiveUnits', src, activeUnits) +end) + +QBCore.Functions.CreateCallback('mdt:server:SearchProfile', function(source, cb, sentData) + if not sentData then return cb({}) end + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType ~= nil then + local people = MySQL.query.await("SELECT p.citizenid, p.charinfo, md.pfp FROM players p LEFT JOIN mdt_data md on p.citizenid = md.cid WHERE LOWER(`charinfo`) LIKE :query OR LOWER(`citizenid`) LIKE :query OR LOWER(`fingerprint`) LIKE :query AND jobtype = :jobtype LIMIT 20", { query = string.lower('%'..sentData..'%'), jobtype = JobType }) + local citizenIds = {} + local citizenIdIndexMap = {} + if not next(people) then cb({}) return end + + for index, data in pairs(people) do + people[index]['warrant'] = false + people[index]['convictions'] = 0 + people[index]['licences'] = GetPlayerLicenses(data.citizenid) + people[index]['pp'] = ProfPic(data.gender, data.pfp) + citizenIds[#citizenIds+1] = data.citizenid + citizenIdIndexMap[data.citizenid] = index + end + + local convictions = GetConvictions(citizenIds) + + if next(convictions) then + for _, conv in pairs(convictions) do + if conv.warrant then people[citizenIdIndexMap[conv.cid]].warrant = true end + + local charges = json.decode(conv.charges) + people[citizenIdIndexMap[conv.cid]].convictions = people[citizenIdIndexMap[conv.cid]].convictions + #charges + end + end + + + return cb(people) + end + end + + return cb({}) +end) + +QBCore.Functions.CreateCallback("mdt:server:getWarrants", function(source, cb) + local WarrantData = {} + local data = MySQL.query.await("SELECT * FROM mdt_convictions", {}) + for _, value in pairs(data) do + if value.warrant == "1" then + WarrantData[#WarrantData+1] = { + cid = value.cid, + linkedincident = value.linkedincident, + name = GetNameFromId(value.cid), + time = value.time + } + end + end + cb(WarrantData) +end) + +QBCore.Functions.CreateCallback('mdt:server:OpenDashboard', function(source, cb) + local PlayerData = GetPlayerData(source) + if not PermCheck(source, PlayerData) then return end + local JobType = GetJobType(PlayerData.job.name) + local bulletin = GetBulletins(JobType) + cb(bulletin) +end) + +RegisterNetEvent('mdt:server:NewBulletin', function(title, info, time) + local src = source + local PlayerData = GetPlayerData(src) + if not PermCheck(src, PlayerData) then return end + local JobType = GetJobType(PlayerData.job.name) + local playerName = GetNameFromPlayerData(PlayerData) + local newBulletin = MySQL.insert.await('INSERT INTO `mdt_bulletin` (`title`, `desc`, `author`, `time`, `jobtype`) VALUES (:title, :desc, :author, :time, :jt)', { + title = title, + desc = info, + author = playerName, + time = tostring(time), + jt = JobType + }) + + AddLog(("A new bulletin was added by %s with the title: %s!"):format(playerName, title)) + TriggerClientEvent('mdt:client:newBulletin', -1, src, {id = newBulletin, title = title, info = info, time = time, author = PlayerData.CitizenId}, JobType) +end) + +RegisterNetEvent('mdt:server:deleteBulletin', function(id, title) + if not id then return false end + local src = source + local PlayerData = GetPlayerData(src) + if not PermCheck(src, PlayerData) then return end + local JobType = GetJobType(PlayerData.job.name) + + local deletion = MySQL.query.await('DELETE FROM `mdt_bulletin` where title = ?', {title}) + AddLog("Bulletin with Title: "..title.." was deleted by " .. GetNameFromPlayerData(PlayerData) .. ".") +end) + +QBCore.Functions.CreateCallback('mdt:server:GetProfileData', function(source, cb, sentId) + if not sentId then return cb({}) end + + local src = source + local PlayerData = GetPlayerData(src) + if not PermCheck(src, PlayerData) then return cb({}) end + local JobType = GetJobType(PlayerData.job.name) + local target = GetPlayerDataById(sentId) + local JobName = PlayerData.job.name + + if not target or not next(target) then return cb({}) end + + -- Convert to string because bad code, yes? + if type(target.job) == 'string' then target.job = json.decode(target.job) end + if type(target.charinfo) == 'string' then target.charinfo = json.decode(target.charinfo) end + if type(target.metadata) == 'string' then target.metadata = json.decode(target.metadata) end + + local job, grade = UnpackJob(target.job) + + local person = { + cid = target.citizenid, + firstname = target.charinfo.firstname, + lastname = target.charinfo.lastname, + job = job.label, + grade = grade.name, + pp = ProfPic(target.charinfo.gender, null), + licences = target.metadata['licences'], + dob = target.charinfo.birthdate, + mdtinfo = '', + fingerprint = '', + tags = {}, + vehicles = {}, + properties = {}, + gallery = {}, + isLimited = false + } + + if Config.PoliceJobs[JobName] then + local convictions = GetConvictions({person.cid}) + person.convictions = {} + if next(convictions) then + for _, conv in pairs(convictions) do + if conv.warrant then person.warrant = true end + local charges = json.decode(conv.charges) + for _, charge in pairs(charges) do + person.convictions[_] = charge + end + end + end + local vehicles = GetPlayerVehicles(person.cid) + + if vehicles then + person.vehicles = vehicles + end + local Coords = {} + local Houses = {} + local properties= GetPlayerProperties(person.cid) + for k, v in pairs(properties) do + Coords[#Coords+1] = { + coords = json.decode(v["coords"]), + } + end + for index = 1, #Coords, 1 do + Houses[#Houses+1] = { + label = properties[index]["label"], + coords = tostring(Coords[index]["coords"]["enter"]["x"]..",".. Coords[index]["coords"]["enter"]["y"].. ",".. Coords[index]["coords"]["enter"]["z"]), + } + end + -- if properties then + person.properties = Houses + -- end + end + + local mdtData = GetPersonInformation(sentId, JobType) + if mdtData then + person.mdtinfo = mdtData.information + person.fingerprint = mdtData.fingerprint + person.profilepic = mdtData.pfp + person.tags = json.decode(mdtData.tags) + person.gallery = json.decode(mdtData.gallery) + end + + return cb(person) +end) + +RegisterNetEvent("mdt:server:saveProfile", function(pfp, information, cid, fName, sName, tags, gallery, fingerprint, licenses) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + ManageLicenses(cid, licenses) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'doj' then JobType = 'police' end + MySQL.Async.insert('INSERT INTO mdt_data (cid, information, pfp, jobtype, tags, gallery, fingerprint) VALUES (:cid, :information, :pfp, :jobtype, :tags, :gallery, :fingerprint) ON DUPLICATE KEY UPDATE cid = :cid, information = :information, pfp = :pfp, tags = :tags, gallery = :gallery, fingerprint = :fingerprint', { + cid = cid, + information = information, + pfp = pfp, + jobtype = JobType, + tags = json.encode(tags), + gallery = json.encode(gallery), + fingerprint = fingerprint, + }) + end +end) + +RegisterNetEvent("mdt:server:updateLicense", function(cid, type, status) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + ManageLicense(cid, type, status) + end + end +end) + +-- Incidents + + +RegisterNetEvent('mdt:server:getAllIncidents', function() + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local matches = MySQL.query.await("SELECT * FROM `mdt_incidents` ORDER BY `id` DESC LIMIT 30", {}) + + TriggerClientEvent('mdt:client:getAllIncidents', src, matches) + end + end +end) + +RegisterNetEvent('mdt:server:searchIncidents', function(query) + if query then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local matches = MySQL.query.await("SELECT * FROM `mdt_incidents` WHERE `id` LIKE :query OR LOWER(`title`) LIKE :query OR LOWER(`author`) LIKE :query OR LOWER(`details`) LIKE :query OR LOWER(`tags`) LIKE :query OR LOWER(`officersinvolved`) LIKE :query OR LOWER(`civsinvolved`) LIKE :query OR LOWER(`author`) LIKE :query ORDER BY `id` DESC LIMIT 50", { + query = string.lower('%'..query..'%') -- % wildcard, needed to search for all alike results + }) + + TriggerClientEvent('mdt:client:getIncidents', src, matches) + end + end + end +end) + +RegisterNetEvent('mdt:server:getIncidentData', function(sentId) + if sentId then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local matches = MySQL.query.await("SELECT * FROM `mdt_incidents` WHERE `id` = :id", { + id = sentId + }) + local data = matches[1] + data['tags'] = json.decode(data['tags']) + data['officersinvolved'] = json.decode(data['officersinvolved']) + data['civsinvolved'] = json.decode(data['civsinvolved']) + data['evidence'] = json.decode(data['evidence']) + + + local convictions = MySQL.query.await("SELECT * FROM `mdt_convictions` WHERE `linkedincident` = :id", { + id = sentId + }) + if convictions ~= nil then + for i=1, #convictions do + local res = GetNameFromId(convictions[i]['cid']) + if res ~= nil then + convictions[i]['name'] = res + else + convictions[i]['name'] = "Unknown" + end + convictions[i]['charges'] = json.decode(convictions[i]['charges']) + end + end + TriggerClientEvent('mdt:client:getIncidentData', src, data, convictions) + end + end + end +end) + +RegisterNetEvent('mdt:server:getAllBolos', function() + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + MySQL.query.await("SELECT * FROM `mdt_bolos` WHERE jobtype = :jobtype", { + jobtype = JobType + }, function(matches) + TriggerClientEvent('mdt:client:getAllBolos', src, matches) + end) + end +end) + +RegisterNetEvent('mdt:server:searchBolos', function(sentSearch) + if sentSearch then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + local matches = MySQL.query.await("SELECT * FROM `mdt_bolos` WHERE `id` LIKE :query OR LOWER(`title`) LIKE :query OR `plate` LIKE :query OR LOWER(`owner`) LIKE :query OR LOWER(`individual`) LIKE :query OR LOWER(`detail`) LIKE :query OR LOWER(`officersinvolved`) LIKE :query OR LOWER(`tags`) LIKE :query OR LOWER(`author`) LIKE :query AND jobtype = :jobtype", { + query = string.lower('%'..sentSearch..'%'), -- % wildcard, needed to search for all alike results + jobtype = JobType + }) + TriggerClientEvent('mdt:client:getBolos', src, matches) + end + end +end) + +RegisterNetEvent('mdt:server:getBoloData', function(sentId) + if sentId then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + local matches = MySQL.query.await("SELECT * FROM `mdt_bolos` WHERE `id` = :id AND jobtype = :jobtype LIMIT 1", { + id = sentId, + jobtype = JobType + }) + + local data = matches[1] + data['tags'] = json.decode(data['tags']) + data['officersinvolved'] = json.decode(data['officersinvolved']) + data['gallery'] = json.decode(data['gallery']) + TriggerClientEvent('mdt:client:getBoloData', src, data) + end + end +end) + +RegisterNetEvent('mdt:server:newBolo', function(existing, id, title, plate, owner, individual, detail, tags, gallery, officersinvolved, time) + if id then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + + local function InsertBolo() + MySQL.insert('INSERT INTO `mdt_bolos` (`title`, `author`, `plate`, `owner`, `individual`, `detail`, `tags`, `gallery`, `officersinvolved`, `time`, `jobtype`) VALUES (:title, :author, :plate, :owner, :individual, :detail, :tags, :gallery, :officersinvolved, :time, :jobtype)', { + title = title, + author = fullname, + plate = plate, + owner = owner, + individual = individual, + detail = detail, + tags = json.encode(tags), + gallery = json.encode(gallery), + officersinvolved = json.encode(officersinvolved), + time = tostring(time), + jobtype = JobType + }, function(r) + if r then + TriggerClientEvent('mdt:client:boloComplete', src, r) + TriggerEvent('mdt:server:AddLog', "A new BOLO was created by "..fullname.." with the title ("..title..") and ID ("..id..")") + end + end) + end + + local function UpdateBolo() + MySQL.update.await("UPDATE mdt_bolos SET `title`=:title, plate=:plate, owner=:owner, individual=:individual, detail=:detail, tags=:tags, gallery=:gallery, officersinvolved=:officersinvolved WHERE `id`=:id AND jobtype = :jobtype LIMIT 1", { + title = title, + plate = plate, + owner = owner, + individual = individual, + detail = detail, + tags = json.encode(tags), + gallery = json.encode(gallery), + officersinvolved = json.encode(officersinvolved), + id = id, + jobtype = JobType + }, function(r) + if r then + TriggerClientEvent('mdt:client:boloComplete', src, id) + TriggerEvent('mdt:server:AddLog', "A BOLO was updated by "..fullname.." with the title ("..title..") and ID ("..id..")") + end + end) + end + + if existing then + UpdateBolo() + elseif not existing then + InsertBolo() + end + end + end +end) + +RegisterNetEvent('mdt:server:deleteBolo', function(id) + if id then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' then + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + MySQL.update("DELETE FROM `mdt_bolos` WHERE id=:id", { id = id, jobtype = JobType }) + TriggerEvent('mdt:server:AddLog', "A BOLO was deleted by "..fullname.." with the ID ("..id..")") + end + end +end) + +RegisterNetEvent('mdt:server:deleteICU', function(id) + if id then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'ambulance' then + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + MySQL.update("DELETE FROM `mdt_bolos` WHERE id=:id", { id = id, jobtype = JobType }) + TriggerEvent('mdt:server:AddLog', "A ICU Check-in was deleted by "..fullname.." with the ID ("..id..")") + end + end +end) + +RegisterNetEvent('mdt:server:incidentSearchPerson', function(query) + if query then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local function ProfPic(gender, profilepic) + if profilepic then return profilepic end; + if gender == "f" then return "img/female.png" end; + return "img/male.png" + end + + local result = MySQL.query.await("SELECT p.citizenid, p.charinfo, md.pfp from players p LEFT JOIN mdt_data md on p.citizenid = md.cid WHERE LOWER(`charinfo`) LIKE :query OR LOWER(`citizenid`) LIKE :query AND `jobtype` = :jobtype LIMIT 30", { + query = string.lower('%'..query..'%'), -- % wildcard, needed to search for all alike results + jobtype = JobType + }) + local data = {} + for i=1, #result do + local charinfo = json.decode(result[i].charinfo) + data[i] = {id = result[i].citizenid, firstname = charinfo.firstname, lastname = charinfo.lastname, profilepic = ProfPic(charinfo.gender, result[i].pfp)} + end + TriggerClientEvent('mdt:client:incidentSearchPerson', src, data) + end + end + end +end) + +RegisterNetEvent('mdt:server:getAllReports', function() + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' or JobType == 'ambulance' then + if JobType == 'doj' then JobType = 'police' end + local matches = MySQL.query.await("SELECT * FROM `mdt_reports` WHERE jobtype = :jobtype ORDER BY `id` DESC LIMIT 30", { + jobtype = JobType + }) + TriggerClientEvent('mdt:client:getAllReports', src, matches) + end + end +end) + +RegisterNetEvent('mdt:server:getReportData', function(sentId) + if sentId then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' or JobType == 'ambulance' then + if JobType == 'doj' then JobType = 'police' end + local matches = MySQL.query.await("SELECT * FROM `mdt_reports` WHERE `id` = :id AND `jobtype` = :jobtype LIMIT 1", { + id = sentId, + jobtype = JobType + }) + local data = matches[1] + data['tags'] = json.decode(data['tags']) + data['officersinvolved'] = json.decode(data['officersinvolved']) + data['civsinvolved'] = json.decode(data['civsinvolved']) + data['gallery'] = json.decode(data['gallery']) + TriggerClientEvent('mdt:client:getReportData', src, data) + end + end + end +end) + +RegisterNetEvent('mdt:server:searchReports', function(sentSearch) + if sentSearch then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' or JobType == 'ambulance' then + if JobType == 'doj' then JobType = 'police' end + local matches = MySQL.query.await("SELECT * FROM `mdt_reports` WHERE `id` LIKE :query OR LOWER(`author`) LIKE :query OR LOWER(`title`) LIKE :query OR LOWER(`type`) LIKE :query OR LOWER(`details`) LIKE :query OR LOWER(`tags`) LIKE :query AND `jobtype` = :jobtype ORDER BY `id` DESC LIMIT 50", { + query = string.lower('%'..sentSearch..'%'), -- % wildcard, needed to search for all alike results + jobtype = JobType + }) + + TriggerClientEvent('mdt:client:getAllReports', src, matches) + end + end + end +end) + +RegisterNetEvent('mdt:server:newReport', function(existing, id, title, reporttype, details, tags, gallery, officers, civilians, time) + if id then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType ~= nil then + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + local function InsertReport() + MySQL.insert('INSERT INTO `mdt_reports` (`title`, `author`, `type`, `details`, `tags`, `gallery`, `officersinvolved`, `civsinvolved`, `time`, `jobtype`) VALUES (:title, :author, :type, :details, :tags, :gallery, :officersinvolved, :civsinvolved, :time, :jobtype)', { + title = title, + author = fullname, + type = reporttype, + details = details, + tags = json.encode(tags), + gallery = json.encode(gallery), + officersinvolved = json.encode(officers), + civsinvolved = json.encode(civilians), + time = tostring(time), + jobtype = JobType, + }, function(r) + if r then + TriggerClientEvent('mdt:client:reportComplete', src, r) + TriggerEvent('mdt:server:AddLog', "A new report was created by "..fullname.." with the title ("..title..") and ID ("..id..")") + end + end) + end + + local function UpdateReport() + MySQL.update("UPDATE `mdt_reports` SET `title` = :title, type = :type, details = :details, tags = :tags, gallery = :gallery, officersinvolved = :officersinvolved, civsinvolved = :civsinvolved, jobtype = :jobtype WHERE `id` = :id LIMIT 1", { + title = title, + type = reporttype, + details = details, + tags = json.encode(tags), + gallery = json.encode(gallery), + officersinvolved = json.encode(officers), + civsinvolved = json.encode(civilians), + jobtype = JobType, + id = id, + }, function(affectedRows) + if affectedRows > 0 then + TriggerClientEvent('mdt:client:reportComplete', src, id) + TriggerEvent('mdt:server:AddLog', "A report was updated by "..fullname.." with the title ("..title..") and ID ("..id..")") + end + end) + end + + if existing then + UpdateReport() + elseif not existing then + InsertReport() + end + end + end + end +end) + +QBCore.Functions.CreateCallback('mdt:server:SearchVehicles', function(source, cb, sentData) + if not sentData then return cb({}) end + local src = source + local PlayerData = GetPlayerData(src) + if not PermCheck(source, PlayerData) then return cb({}) end + + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local vehicles = MySQL.query.await("SELECT pv.id, pv.citizenid, pv.plate, pv.vehicle, pv.mods, pv.state, p.charinfo FROM `player_vehicles` pv LEFT JOIN players p ON pv.citizenid = p.citizenid WHERE LOWER(`plate`) LIKE :query OR LOWER(`vehicle`) LIKE :query LIMIT 25", { + query = string.lower('%'..sentData..'%') + }) + + if not next(vehicles) then cb({}) return end + + for _, value in ipairs(vehicles) do + if value.state == 0 then + value.state = "Out" + elseif value.state == 1 then + value.state = "Garaged" + elseif value.state == 2 then + value.state = "Impounded" + end + + value.bolo = false + local boloResult = GetBoloStatus(value.plate) + if boloResult then + value.bolo = true + end + + value.code = false + value.stolen = false + value.image = "img/not-found.jpg" + local info = GetVehicleInformation(value.plate) + if info then + value.code = info['code5'] + value.stolen = info['stolen'] + value.image = info['image'] + end + + local ownerResult = json.decode(value.charinfo) + + value.owner = ownerResult['firstname'] .. " " .. ownerResult['lastname'] + end + -- idk if this works or I have to call cb first then return :shrug: + return cb(vehicles) + end + + return cb({}) + end + +end) + +RegisterNetEvent('mdt:server:getVehicleData', function(plate) + if plate then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'doj' then + local vehicle = MySQL.query.await("select pv.*, p.charinfo from player_vehicles pv LEFT JOIN players p ON pv.citizenid = p.citizenid where pv.plate = :plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")}) + if vehicle and vehicle[1] then + vehicle[1]['impound'] = false + if vehicle[1].state == 2 then + vehicle[1]['impound'] = true + end + + vehicle[1]['bolo'] = false + vehicle[1]['information'] = "" + + -- Bolo Status + GetBoloStatus(vehicle[1]['plate'], function(boloStatus) + if boloStatus and boloStatus[1] then vehicle[1]['bolo'] = true end + end) -- Used to get BOLO status. + + vehicle[1]['name'] = "Unknown Person" + + local ownerResult = json.decode(vehicle[1].charinfo) + vehicle[1]['name'] = ownerResult['firstname'] .. " " .. ownerResult['lastname'] + + local color1 = json.decode(vehicle[1].mods) + vehicle[1]['color1'] = color1['color1'] + + vehicle[1]['dbid'] = 0 + + local info = GetVehicleInformation(vehicle[1]['plate']) + if info then + vehicle[1]['information'] = info['information'] + vehicle[1]['dbid'] = info['id'] + vehicle[1]['image'] = info['image'] + vehicle[1]['code'] = info['code5'] + vehicle[1]['stolen'] = info['stolen'] + end + + if vehicle[1]['image'] == nil then vehicle[1]['image'] = "img/not-found.jpg" end -- Image + end + + TriggerClientEvent('mdt:client:getVehicleData', src, vehicle) + end + end + end +end) + +RegisterNetEvent('mdt:server:saveVehicleInfo', function(dbid, plate, imageurl, notes, stolen, code5, impound) + print(dbid, plate, imageurl, notes, stolen, code5, impound) + if plate then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + if dbid == nil then dbid = 0 end; + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + TriggerEvent('mdt:server:AddLog', "A vehicle with the plate ("..plate..") has a new image ("..imageurl..") edited by "..fullname) + if tonumber(dbid) == 0 then + MySQL.insert('INSERT INTO `mdt_vehicleinfo` (`plate`, `information`, `image`, `code5`, `stolen`) VALUES (:plate, :information, :image, :code5, :stolen)', { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1"), information = notes, image = imageurl, code5 = code5, stolen = stolen }, function(infoResult) + if infoResult then + TriggerClientEvent('mdt:client:updateVehicleDbId', src, infoResult) + TriggerEvent('mdt:server:AddLog', "A vehicle with the plate ("..plate..") was added to the vehicle information database by "..fullname) + end + end) + elseif tonumber(dbid) > 0 then + MySQL.update("UPDATE mdt_vehicleinfo SET `information`= :information, `image`= :image, `code5`= :code5, `stolen`= :stolen WHERE `plate`= :plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1"), information = notes, image = imageurl, code5 = code5, stolen = stolen }) + end + + if impound.impoundChanged then + local vehicle = MySQL.single.await("SELECT p.id, p.plate, i.vehicleid AS impoundid FROM `player_vehicles` p LEFT JOIN `mdt_impound` i ON i.vehicleid = p.id WHERE plate=:plate", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1") }) + if impound.impoundActive then + local plate, linkedreport, fee, time = impound['plate'], impound['linkedreport'], impound['fee'], impound['time'] + if (plate and linkedreport and fee and time) then + if vehicle.impoundid == nil then + local data = vehicle + MySQL.insert('INSERT INTO `mdt_impound` (`vehicleid`, `linkedreport`, `fee`, `time`) VALUES (:vehicleid, :linkedreport, :fee, :time)', { + vehicleid = data['id'], + linkedreport = linkedreport, + fee = fee, + time = os.time() + (time * 60) + }, function(res) + -- notify? + local data = { + vehicleid = data['id'], + plate = plate, + beingcollected = 0, + vehicle = sentVehicle, + officer = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + number = Player.PlayerData.charinfo.phone, + time = os.time() * 1000, + src = src, + } + local vehicle = NetworkGetEntityFromNetworkId(sentVehicle) + FreezeEntityPosition(vehicle, true) + impound[#impound+1] = data --what does inputting into this table do? + + --TriggerClientEvent("police:client:ImpoundVehicle", src, false, tonumber(args[1])) + TriggerClientEvent("police:client:ImpoundVehicle", src, true, fee) + end) + end + end + else + if vehicle.impoundid ~= nil then + local data = vehicle + local result = MySQL.single.await("SELECT id, vehicle, fuel, engine, body FROM `player_vehicles` WHERE plate=:plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")}) + if result then + print("comes here?") + local data = result + MySQL.update("DELETE FROM `mdt_impound` WHERE vehicleid=:vehicleid", { vehicleid = data['id'] }) + + result.currentSelection = impound.CurrentSelection + result.plate = plate + print(json.encode(result)) + TriggerClientEvent('qb-mdt:client:TakeOutImpound', src, result) + end + + end + end + end + end + end + end +end) + +RegisterNetEvent('mdt:server:getAllLogs', function() + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if Config.LogPerms[Player.PlayerData.job.name] then + if Config.LogPerms[Player.PlayerData.job.name][Player.PlayerData.job.grade.level] then + local JobType = GetJobType(Player.PlayerData.job.name) + local infoResult = MySQL.query.await('SELECT * FROM mdt_logs WHERE `jobtype` = :jobtype ORDER BY `id` DESC LIMIT 250', {jobtype = JobType}) + + TriggerLatentClientEvent('mdt:client:getAllLogs', src, 30000, infoResult) + end + end + end +end) + +-- Penal Code + +local function IsCidFelon(sentCid, cb) + if sentCid then + local convictions = MySQL.query.await('SELECT charges FROM mdt_convictions WHERE cid=:cid', { cid = sentCid }) + local Charges = {} + for i=1, #convictions do + local currCharges = json.decode(convictions[i]['charges']) + for x=1, #currCharges do + Charges[#Charges+1] = currCharges[x] + end + end + for i=1, #Charges do + for p=1, #PenalCode do + for x=1, #PenalCode[p] do + if PenalCode[p][x]['title'] == Charges[i] then + if PenalCode[p][x]['class'] == 'Felony' then + cb(true) + return + end + break + end + end + end + end + cb(false) + end +end + +exports('IsCidFelon', IsCidFelon) -- exports['erp_mdt']:IsCidFelon() + +RegisterCommand("isfelon", function(source, args, rawCommand) + IsCidFelon(1998, function(res) + end) +end, false) + +RegisterNetEvent('mdt:server:getPenalCode', function() + local src = source + TriggerClientEvent('mdt:client:getPenalCode', src, Config.PenalCodeTitles, Config.PenalCode) +end) + +RegisterNetEvent('mdt:server:setCallsign', function(cid, newcallsign) + local Player = QBCore.Functions.GetPlayerByCitizenId(cid) + Player.Functions.SetMetaData("callsign", newcallsign) +end) + +RegisterNetEvent('mdt:server:saveIncident', function(id, title, information, tags, officers, civilians, evidence, associated, time) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + if id == 0 then + local fullname = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname + MySQL.insert('INSERT INTO `mdt_incidents` (`author`, `title`, `details`, `tags`, `officersinvolved`, `civsinvolved`, `evidence`, `time`, `jobtype`) VALUES (:author, :title, :details, :tags, :officersinvolved, :civsinvolved, :evidence, :time, :jobtype)', + { + author = fullname, + title = title, + details = information, + tags = json.encode(tags), + officersinvolved = json.encode(officers), + civsinvolved = json.encode(civilians), + evidence = json.encode(evidence), + time = time, + jobtype = 'police', + }, function(infoResult) + if infoResult then + for i=1, #associated do + MySQL.insert('INSERT INTO `mdt_convictions` (`cid`, `linkedincident`, `warrant`, `guilty`, `processed`, `associated`, `charges`, `fine`, `sentence`, `recfine`, `recsentence`, `time`) VALUES (:cid, :linkedincident, :warrant, :guilty, :processed, :associated, :charges, :fine, :sentence, :recfine, :recsentence, :time)', { + cid = associated[i]['Cid'], + linkedincident = infoResult, + warrant = associated[i]['Warrant'], + guilty = associated[i]['Guilty'], + processed = associated[i]['Processed'], + associated = associated[i]['Isassociated'], + charges = json.encode(associated[i]['Charges']), + fine = tonumber(associated[i]['Fine']), + sentence = tonumber(associated[i]['Sentence']), + recfine = tonumber(associated[i]['recfine']), + recsentence = tonumber(associated[i]['recsentence']), + time = time + }) + end + TriggerClientEvent('mdt:client:updateIncidentDbId', src, infoResult) + --TriggerEvent('mdt:server:AddLog', "A vehicle with the plate ("..plate..") was added to the vehicle information database by "..player['fullname']) + end + end) + elseif id > 0 then + MySQL.update("UPDATE mdt_incidents SET title=:title, details=:details, civsinvolved=:civsinvolved, tags=:tags, officersinvolved=:officersinvolved, evidence=:evidence WHERE id=:id", { + title = title, + details = information, + tags = json.encode(tags), + officersinvolved = json.encode(officers), + civsinvolved = json.encode(civilians), + evidence = json.encode(evidence), + id = id + }) + for i=1, #associated do + TriggerEvent('mdt:server:handleExistingConvictions', associated[i], id, time) + end + end + end + end +end) + +RegisterNetEvent('mdt:server:handleExistingConvictions', function(data, incidentid, time) + MySQL.query.await('SELECT * FROM mdt_convictions WHERE cid=:cid AND linkedincident=:linkedincident', { + cid = data['Cid'], + linkedincident = incidentid + }, function(convictionRes) + if convictionRes and convictionRes[1] and convictionRes[1]['id'] then + MySQL.update('UPDATE mdt_convictions SET cid=:cid, linkedincident=:linkedincident, warrant=:warrant, guilty=:guilty, processed=:processed, associated=:associated, charges=:charges, fine=:fine, sentence=:sentence, recfine=:recfine, recsentence=:recsentence WHERE cid=:cid AND linkedincident=:linkedincident', { + cid = data['Cid'], + linkedincident = incidentid, + warrant = data['Warrant'], + guilty = data['Guilty'], + processed = data['Processed'], + associated = data['Isassociated'], + charges = json.encode(data['Charges']), + fine = tonumber(data['Fine']), + sentence = tonumber(data['Sentence']), + recfine = tonumber(data['recfine']), + recsentence = tonumber(data['recsentence']), + }) + else + MySQL.insert('INSERT INTO `mdt_convictions` (`cid`, `linkedincident`, `warrant`, `guilty`, `processed`, `associated`, `charges`, `fine`, `sentence`, `recfine`, `recsentence`, `time`) VALUES (:cid, :linkedincident, :warrant, :guilty, :processed, :associated, :charges, :fine, :sentence, :recfine, :recsentence, :time)', { + cid = data['Cid'], + linkedincident = incidentid, + warrant = data['Warrant'], + guilty = data['Guilty'], + processed = data['Processed'], + associated = data['Isassociated'], + charges = json.encode(data['Charges']), + fine = tonumber(data['Fine']), + sentence = tonumber(data['Sentence']), + recfine = tonumber(data['recfine']), + recsentence = tonumber(data['recsentence']), + time = time + }) + end + end) +end) + +RegisterNetEvent('mdt:server:removeIncidentCriminal', function(cid, incident) + MySQL.update('DELETE FROM mdt_convictions WHERE cid=:cid AND linkedincident=:linkedincident', { + cid = cid, + linkedincident = incident + }) +end) + +-- Dispatch + +RegisterNetEvent('mdt:server:setWaypoint', function(callid) + local src = source + local Player = QBCore.Functions.GetPlayer(source) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + local calls = exports['qb-dispatch']:GetDispatchCalls() + TriggerClientEvent('mdt:client:setWaypoint', src, calls[callid]) + end + end +end) + +RegisterNetEvent('mdt:server:callDetach', function(callid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local playerdata = { + fullname = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + job = Player.PlayerData.job, + cid = Player.PlayerData.citizenid, + callsign = Player.PlayerData.metadata.callsign + } + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + TriggerEvent('dispatch:removeUnit', callid, playerdata, function(newNum) + TriggerClientEvent('mdt:client:callDetach', -1, callid, newNum) + end) + end + end +end) + +RegisterNetEvent('mdt:server:callAttach', function(callid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local playerdata = { + fullname = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + job = Player.PlayerData.job, + cid = Player.PlayerData.citizenid, + callsign = Player.PlayerData.metadata.callsign + } + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + TriggerEvent('dispatch:addUnit', callid, playerdata, function(newNum) + TriggerClientEvent('mdt:client:callAttach', -1, callid, newNum) + end) + end + end + +end) + +RegisterNetEvent('mdt:server:attachedUnits', function(callid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + local calls = exports['qb-dispatch']:GetDispatchCalls() + TriggerClientEvent('mdt:client:attachedUnits', src, calls[callid]['units'], callid) + end + end +end) + +RegisterNetEvent('mdt:server:callDispatchDetach', function(callid, cid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local playerdata = { + fullname = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + job = Player.PlayerData.job, + cid = Player.PlayerData.citizenid, + callsign = Player.PlayerData.metadata.callsign + } + local callid = tonumber(callid) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + TriggerEvent('dispatch:removeUnit', callid, playerdata, function(newNum) + TriggerClientEvent('mdt:client:callDetach', -1, callid, newNum) + end) + end + end +end) + +RegisterNetEvent('mdt:server:setDispatchWaypoint', function(callid, cid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local callid = tonumber(callid) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + local calls = exports['qb-dispatch']:GetDispatchCalls() + TriggerClientEvent('mdt:client:setWaypoint', src, calls[callid]) + end + end + +end) + +RegisterNetEvent('mdt:server:callDragAttach', function(callid, cid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local playerdata = { + name = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + job = Player.PlayerData.job.name, + cid = Player.PlayerData.citizenid, + callsign = Player.PlayerData.metadata.callsign + } + local callid = tonumber(callid) + local JobType = GetJobType(Player.PlayerData.job.name) + if JobType == 'police' or JobType == 'ambulance' then + if callid then + TriggerEvent('dispatch:addUnit', callid, playerdata, function(newNum) + TriggerClientEvent('mdt:client:callAttach', -1, callid, newNum) + end) + end + end +end) + +RegisterNetEvent('mdt:server:setWaypoint:unit', function(cid) + local src = source + local Player = QBCore.Functions.GetPlayerByCitizenId(cid) + local PlayerCoords = GetEntityCoords(GetPlayerPed(Player.PlayerData.source)) + TriggerClientEvent("mdt:client:setWaypoint:unit", src, PlayerCoords) +end) + +-- Dispatch chat + +RegisterNetEvent('mdt:server:sendMessage', function(message, time) + if message and time then + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + MySQL.scalar("SELECT pfp FROM `mdt_data` WHERE cid=:id LIMIT 1", { + id = Player.PlayerData.citizenid -- % wildcard, needed to search for all alike results + }, function(data) + if data and data[1] then + local ProfilePicture = ProfPic(Player.PlayerData.charinfo.gender, data[1]['profilepic']) + local callsign = GetResourceKvpString(Player.PlayerData.metadata.callsign..'-callsign') or "000" + local Item = { + profilepic = ProfilePicture, + callsign = Player.PlayerData.metadata.callsign, + cid = Player.PlayerData.citizenid, + name = '('..callsign..') '..Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + message = message, + time = time, + job = Player.PlayerData.job.name + } + dispatchMessages[#dispatchMessages+1] = item + TriggerClientEvent('mdt:client:dashboardMessage', -1, Item) + -- Send to all clients, for auto updating stuff, ya dig. + end + end) + end + end +end) + +RegisterNetEvent('mdt:server:refreshDispatchMsgs', function() + local src = source + local PlayerData = GetPlayerData(src) + if IsJobAllowedToMDT(PlayerData.job.name) then + TriggerClientEvent('mdt:client:dashboardMessages', src, dispatchMessages) + end +end) + +RegisterNetEvent('mdt:server:getCallResponses', function(callid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if IsPolice(Player.PlayerData.job.name) then + local calls = exports['qb-dispatch']:GetDispatchCalls() + TriggerClientEvent('mdt:client:getCallResponses', src, calls[callid]['responses'], callid) + end +end) + +RegisterNetEvent('mdt:server:sendCallResponse', function(message, time, callid) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + local name = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname + if IsPolice(Player.PlayerData.job.name) then + TriggerEvent('dispatch:sendCallResponse', src, callid, message, time, function(isGood) + if isGood then + TriggerClientEvent('mdt:client:sendCallResponse', -1, message, time, callid, name) + end + end) + end +end) + +RegisterNetEvent('mdt:server:setRadio', function(cid, newRadio) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player.PlayerData.citizenid ~= cid then + TriggerClientEvent("QBCore:Notify", src, 'You can only change your radio!', 'error') + return + else + local radio = Player.Functions.GetItemByName("phone") + if radio ~= nil then + TriggerClientEvent('mdt:client:setRadio', src, newRadio) + else + TriggerClientEvent("QBCore:Notify", src, 'You do not have a radio!', 'error') + end + end + +end) + +local function isRequestVehicle(vehId) + local found = false + for i=1, #impound do + if impound[i]['vehicle'] == vehId then + found = true + impound[i] = nil + break + end + end + return found +end +exports('isRequestVehicle', isRequestVehicle) -- exports['erp_mdt']:isRequestVehicle() + +RegisterNetEvent('mdt:server:impoundVehicle', function(sentInfo, sentVehicle) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + if sentInfo and type(sentInfo) == 'table' then + local plate, linkedreport, fee, time = sentInfo['plate'], sentInfo['linkedreport'], sentInfo['fee'], sentInfo['time'] + if (plate and linkedreport and fee and time) then + local vehicle = MySQL.query.await("SELECT id, plate FROM `player_vehicles` WHERE plate=:plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1") }) + if vehicle and vehicle[1] then + local data = vehicle[1] + MySQL.insert('INSERT INTO `mdt_impound` (`vehicleid`, `linkedreport`, `fee`, `time`) VALUES (:vehicleid, :linkedreport, :fee, :time)', { + vehicleid = data['id'], + linkedreport = linkedreport, + fee = fee, + time = os.time() + (time * 60) + }, function(res) + -- notify? + local data = { + vehicleid = data['id'], + plate = plate, + beingcollected = 0, + vehicle = sentVehicle, + officer = Player.PlayerData.charinfo.firstname.. " "..Player.PlayerData.charinfo.lastname, + number = Player.PlayerData.charinfo.phone, + time = os.time() * 1000, + src = src, + } + local vehicle = NetworkGetEntityFromNetworkId(sentVehicle) + FreezeEntityPosition(vehicle, true) + impound[#impound+1] = data + + --TriggerClientEvent("police:client:ImpoundVehicle", src, false, tonumber(args[1])) + TriggerClientEvent("police:client:ImpoundVehicle", src, true, fee) + end) + end + end + end + end + end +end) + +RegisterNetEvent('mdt:server:getImpoundVehicles', function() + TriggerClientEvent('mdt:client:getImpoundVehicles', source, impound) +end) + +RegisterNetEvent('mdt:server:removeImpound', function(plate, currentSelection) + print("Removing impound", plate, currentSelection) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + local result = MySQL.single.await("SELECT id, vehicle FROM `player_vehicles` WHERE plate=:plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")}) + if result and result[1] then + local data = result[1] + MySQL.update("DELETE FROM `mdt_impound` WHERE vehicleid=:vehicleid", { vehicleid = data['id'] }) + TriggerClientEvent('police:client:TakeOutImpound', src, currentSelection) + end + end + end +end) + +RegisterNetEvent('mdt:server:statusImpound', function(plate) + local src = source + local Player = QBCore.Functions.GetPlayer(src) + if Player then + if GetJobType(Player.PlayerData.job.name) == 'police' then + local vehicle = MySQL.query.await("SELECT id, plate FROM `player_vehicles` WHERE plate=:plate LIMIT 1", { plate = string.gsub(plate, "^%s*(.-)%s*$", "%1")}) + if vehicle and vehicle[1] then + local data = vehicle[1] + local impoundinfo = MySQL.query.await("SELECT * FROM `mdt_impound` WHERE vehicleid=:vehicleid LIMIT 1", { vehicleid = data['id'] }) + if impoundinfo and impoundinfo[1] then + TriggerClientEvent('mdt:client:statusImpound', src, impoundinfo[1], plate) + end + end + end + end +end) + +function GetBoloStatus(plate) + MySQL.query.await("SELECT * FROM mdt_bolos where plate = ?", {plate}, function(bolo) + if bolo and bolo[1] then + return true + else + return false + end + end) +end + +function GetVehicleInformation(plate) + local result = MySQL.query.await('SELECT * FROM mdt_vehicleinfo WHERE plate = @plate', {['@plate'] = plate}) + if result[1] then + return result[1] + else + return false + end +end diff --git a/server/utils.lua b/server/utils.lua new file mode 100644 index 00000000..ed898fbd --- /dev/null +++ b/server/utils.lua @@ -0,0 +1,51 @@ +local QBCore = exports['qb-core']:GetCoreObject() + +function GetPlayerData(source) + local Player = QBCore.Functions.GetPlayer(source) + return Player.PlayerData +end + +function UnpackJob(data) + local job = { + name = data.name, + label = data.label + } + local grade = { + name = data.grade.name, + } + + return job, grade +end + +function PermCheck(src, PlayerData) + local result = true + + if not Config.AllowedJobs[PlayerData.job.name] then + print(("UserId: %s(%d) tried to access the mdt even though they are not authorised (server direct)"):format(GetPlayerName(src), src)) + result = false + end + + return result +end + +function ProfPic(gender, profilepic) + if profilepic then return profilepic end; + if gender == "f" then return "img/female.png" end; + return "img/male.png" +end + +function IsJobAllowedToMDT(job) + if Config.PoliceJobs[job] then + return true + elseif Config.AmbulanceJobs[job] then + return true + elseif Config.DojJobs[job] then + return true + else + return false + end +end + +function GetNameFromPlayerData(PlayerData) + return ('%s %s'):format(PlayerData.charinfo.firstname, PlayerData.charinfo.lastname) +end diff --git a/shared/config.lua b/shared/config.lua new file mode 100644 index 00000000..b06501ac --- /dev/null +++ b/shared/config.lua @@ -0,0 +1,637 @@ +Config = Config or {} + +Config.RosterLink = { + ['police'] = '', + ['ambulance'] = '', + ['bcso'] = '', + ['doj'] = '', +} + +Config.Fuel = "lj-fuel" -- "LegacyFuel", "lj-fuel" + +Config.PenalCodeTitles = { + [1] = 'OFFENSES AGAINST PERSONS', + [2] = 'OFFENSES INVOLVING THEFT', + [3] = 'OFFENSES INVOLVING FRAUD', + [4] = 'OFFENSES INVOLVING DAMAGE TO PROPERTY', + [5] = 'OFFENSES AGAINST PUBLIC ADMINISTRATION', + [6] = 'OFFENSES AGAINST PUBLIC ORDER', + [7] = 'OFFENSES AGAINST HEALTH AND MORALS', + [8] = 'OFFENSES AGAINST PUBLIC SAFETY', + [9] = 'OFFENSES INVOLVING THE OPERATION OF A VEHICLE', + [10] = 'OFFENSES INVOLVING THE WELL-BEING OF WILDLIFE', +} + +Config.PenalCode = { + [1] = { + [1] = {title = 'Simple Assault', class = 'Misdemeanor', id = 'P.C. 1001', months = 7, fine = 500, color = 'green'}, + [2] = {title = 'Assault', class = 'Misdemeanor', id = 'P.C. 1002', months = 15, fine = 850, color = 'orange'}, + [3] = {title = 'Aggravated Assault', class = 'Felony', id = 'P.C. 1003', months = 20, fine = 1250, color = 'orange'}, + [4] = {title = 'Assault with a Deadly Weapon', class = 'Felony', id = 'P.C. 1004', months = 30, fine = 3750, color = 'red'}, + [5] = {title = 'Involuntary Manslaughter', class = 'Felony', id = 'P.C. 1005', months = 60, fine = 7500, color = 'red'}, + [6] = {title = 'Vehicular Manslaughter', class = 'Felony', id = 'P.C. 1006', months = 75, fine = 7500, color = 'red'}, + [7] = {title = 'Attempted Murder of a Civilian', class = 'Felony', id = 'P.C. 1007', months = 50, fine = 7500, color = 'red'}, + [8] = {title = 'Second Degree Murder', class = 'Felony', id = 'P.C. 1008', months = 100, fine = 15000, color = 'red'}, + [9] = {title = 'Accessory to Second Degree Murder', class = 'Felony', id = 'P.C. 1009', months = 50, fine = 5000, color = 'red'}, + [10] = {title = 'First Degree Murder', class = 'Felony', id = 'P.C. 1010', months = 0, fine = 0, color = 'red'}, + [11] = {title = 'Accessory to First Degree Murder', class = 'Felony', id = 'P.C. 1011', months = 0, fine = 0, color = 'red'}, + [12] = {title = 'Murder of a Public Servant or Peace Officer', class = 'Felony', id = 'P.C. 1012', months = 0, fine = 0, color = 'red'}, + [13] = {title = 'Attempted Murder of a Public Servant or Peace Officer', class = 'Felony', id = 'P.C. 1013', months = 65, fine = 10000, color = 'red'}, + [14] = {title = 'Accessory to the Murder of a Public Servant or Peace Officer', class = 'Felony', id = 'P.C. 1014', months = 0, fine = 0, color = 'red'}, + [15] = {title = 'Unlawful Imprisonment', class = 'Misdemeanor', id = 'P.C. 1015', months = 10, fine = 600, color = 'green'}, + [16] = {title = 'Kidnapping', class = 'Felony', id = 'P.C. 1016', months = 15, fine = 900, color = 'orange'}, + [17] = {title = 'Accessory to Kidnapping', class = 'Felony', id = 'P.C. 1017', months = 7, fine = 450, color = 'orange'}, + [18] = {title = 'Attempted Kidnapping', class = 'Felony', id = 'P.C. 1018', months = 10, fine = 450, color = 'orange'}, + [19] = {title = 'Hostage Taking', class = 'Felony', id = 'P.C. 1019', months = 20, fine = 1200, color = 'orange'}, + [20] = {title = 'Accessory to Hostage Taking', class = 'Felony', id = 'P.C. 1020', months = 10, fine = 600, color = 'orange'}, + [21] = {title = 'Unlawful Imprisonment of a Public Servant or Peace Officer.', class = 'Felony', id = 'P.C. 1021', months = 25, fine = 4000, color = 'orange'}, + [22] = {title = 'Criminal Threats', class = 'Misdemeanor', id = 'P.C. 1022', months = 5, fine = 500, color = 'orange'}, + [23] = {title = 'Reckless Endangerment', class = 'Misdemeanor', id = 'P.C. 1023', months = 10, fine = 1000, color = 'orange'}, + [24] = {title = 'Gang Related Shooting', class = 'Felony', id = 'P.C. 1024', months = 30, fine = 2500, color = 'red'}, + [25] = {title = 'Cannibalism', class = 'Felony', id = 'P.C. 1025', months = 0, fine = 0, color = 'red'}, + [26] = {title = 'Torture', class = 'Felony', id = 'P.C. 1026', months = 40, fine = 4500, color = 'red'}, + }, + [2] = { + [1] = {title = 'Petty Theft', class = 'Infraction', id = 'P.C. 2001', months = 0, fine = 250, color = 'green'}, + [2] = {title = 'Grand Theft', class = 'Misdemeanor', id = 'P.C. 2002', months = 10, fine = 600, color = 'green'}, + [3] = {title = 'Grand Theft Auto A', class = 'Felony', id = 'P.C. 2003', months = 15, fine = 900, color = 'green'}, + [4] = {title = 'Grand Theft Auto B', class = 'Felony', id = 'P.C. 2004', months = 35, fine = 3500, color = 'green'}, + [5] = {title = 'Carjacking', class = 'Felony', id = 'P.C. 2005', months = 30, fine = 2000, color = 'orange'}, + [6] = {title = 'Burglary', class = 'Misdemeanor', id = 'P.C. 2006', months = 10, fine = 500, color = 'green'}, + [7] = {title = 'Robbery', class = 'Felony', id = 'P.C. 2007', months = 25, fine = 2000, color = 'green'}, + [8] = {title = 'Accessory to Robbery', class = 'Felony', id = 'P.C. 2008', months = 12, fine = 1000, color = 'green'}, + [9] = {title = 'Attempted Robbery', class = 'Felony', id = 'P.C. 2009', months = 20, fine = 1000, color = 'green'}, + [10] = {title = 'Armed Robbery', class = 'Felony', id = 'P.C. 2010', months = 30, fine = 3000, color = 'orange'}, + [11] = {title = 'Accessory to Armed Robbery', class = 'Felony', id = 'P.C. 2011', months = 15, fine = 1500, color = 'orange'}, + [12] = {title = 'Attempted Armed Robbery', class = 'Felony', id = 'P.C. 2012', months = 25, fine = 1500, color = 'orange'}, + [13] = {title = 'Grand Larceny', class = 'Felony', id = 'P.C. 2013', months = 45, fine = 7500, color = 'orange'}, + [14] = {title = 'Leaving Without Paying', class = 'Infraction', id = 'P.C. 2014', months = 0, fine = 500, color = 'green'}, + [15] = {title = 'Possession of Nonlegal Currency', class = 'Misdemeanor', id = 'P.C. 2015', months = 10, fine = 750, color = 'green'}, + [16] = {title = 'Possession of Government-Issued Items', class = 'Misdemeanor', id = 'P.C. 2016', months = 15, fine = 1000, color = 'green'}, + [17] = {title = 'Possession of Items Used in the Commission of a Crime', class = 'Misdemeanor', id = 'P.C. 2017', months = 10, fine = 500, color = 'green'}, + [18] = {title = 'Sale of Items Used in the Commission of a Crime', class = 'Felony', id = 'P.C. 2018', months = 15, fine = 1000, color = 'orange'}, + [19] = {title = 'Theft of an Aircraft', class = 'Felony', id = 'P.C. 2019', months = 20, fine = 1000, color = 'green'}, + }, + [3] = { + [1] = {title = 'Impersonating', class = 'Misdemeanor', id = 'P.C. 3001', months = 15, fine = 1250, color = 'green'}, + [2] = {title = 'Impersonating a Peace Officer or Public Servant', class = 'Felony', id = 'P.C. 3002', months = 25, fine = 2750, color = 'green'}, + [3] = {title = 'Impersonating a Judge', class = 'Felony', id = 'P.C. 3003', months = 0, fine = 0, color = 'green'}, + [4] = {title = 'Possession of Stolen Identification', class = 'Misdemeanor', id = 'P.C. 3004', months = 10, fine = 750, color = 'green'}, + [5] = {title = 'Possession of Stolen Government Identification', class = 'Misdemeanor', id = 'P.C. 3005', months = 20, fine = 2000, color = 'green'}, + [6] = {title = 'Extortion', class = 'Felony', id = 'P.C. 3006', months = 20, fine = 900, color = 'orange'}, + [7] = {title = 'Fraud', class = 'Misdemeanor', id = 'P.C. 3007', months = 10, fine = 450, color = 'green'}, + [8] = {title = 'Forgery', class = 'Misdemeanor', id = 'P.C. 3008', months = 15, fine = 750, color = 'green'}, + [9] = {title = 'Money Laundering', class = 'Felony', id = 'P.C. 3009', months = 0, fine = 0, color = 'red'}, + }, + [4] = { + [1] = {title = 'Trespassing', class = 'Misdemeanor', id = 'P.C. 4001', months = 10, fine = 450, color = 'green'}, + [2] = {title = 'Felony Trespassing', class = 'Felony', id = 'P.C. 4002', months = 15, fine = 1500, color = 'green'}, + [3] = {title = 'Arson', class = 'Felony', id = 'P.C. 4003', months = 15, fine = 1500, color = 'orange'}, + [4] = {title = 'Vandalism', class = 'Infraction', id = 'P.C. 4004', months = 0, fine = 300, color = 'green'}, + [5] = {title = 'Vandalism of Government Property', class = 'Felony', id = 'P.C. 4005', months = 20, fine = 1500, color = 'green'}, + [6] = {title = 'Littering', class = 'Infraction', id = 'P.C. 4006', months = 0, fine = 200, color = 'green'}, + }, + [5] = { + [1] = {title = 'Bribery of a Government Official', class = 'Felony', id = 'P.C. 5001', months = 20, fine = 3500, color = 'green'}, + [2] = {title = 'Anti-Mask Law', class = 'Infraction', id = 'P.C. 5002', months = 0, fine = 750, color = 'green'}, + [3] = {title = 'Possession of Contraband in a Government Facility', class = 'Felony', id = 'P.C. 5003', months = 25, fine = 1000, color = 'green'}, + [4] = {title = 'Criminal Possession of Stolen Property', class = 'Misdemeanor', id = 'P.C. 5004', months = 10, fine = 500, color = 'green'}, + [5] = {title = 'Escaping', class = 'Felony', id = 'P.C. 5005', months = 10, fine = 450, color = 'green'}, + [6] = {title = 'Jailbreak', class = 'Felony', id = 'P.C. 5006', months = 30, fine = 2500, color = 'orange'}, + [7] = {title = 'Accessory to Jailbreak', class = 'Felony', id = 'P.C. 5007', months = 25, fine = 2000, color = 'orange'}, + [8] = {title = 'Attempted Jailbreak', class = 'Felony', id = 'P.C. 5008', months = 20, fine = 1500, color = 'orange'}, + [9] = {title = 'Perjury', class = 'Felony', id = 'P.C. 5009', months = 0, fine = 0, color = 'green'}, + [10] = {title = 'Violation of a Restraining Order', class = 'Felony', id = 'P.C. 5010', months = 20, fine = 2250, color = 'green'}, + [11] = {title = 'Embezzlement', class = 'Felony', id = 'P.C. 5011', months = 45, fine = 10000, color = 'green'}, + [12] = {title = 'Unlawful Practice', class = 'Felony', id = 'P.C. 5012', months = 15, fine = 1500, color = 'orange'}, + [13] = {title = 'Misuse of Emergency Systems', class = 'Infraction', id = 'P.C. 5013', months = 0, fine = 600, color = 'orange'}, + [14] = {title = 'Conspiracy', class = 'Misdemeanor', id = 'P.C. 5014', months = 10, fine = 450, color = 'green'}, + [15] = {title = 'Violating a Court Order', class = 'Misdemeanor', id = 'P.C. 5015', months = 0, fine = 0, color = 'orange'}, + [16] = {title = 'Failure to Appear', class = 'Misdemeanor', id = 'P.C. 5016', months = 0, fine = 0, color = 'orange'}, + [17] = {title = 'Contempt of Court', class = 'Felony', id = 'P.C. 5017', months = 0, fine = 0, color = 'orange'}, + [18] = {title = 'Resisting Arrest', class = 'Misdemeanor', id = 'P.C. 5018', months = 5, fine = 300, color = 'orange'}, + }, + [6] = { + [1] = {title = 'Disobeying a Peace Officer', class = 'infraction', id = 'P.C. 6001', months = 0, fine = 750, color = 'green'}, + [2] = {title = 'Disorderly Conduct', class = 'Infraction', id = 'P.C. 6002', months = 0, fine = 250, color = 'green'}, + [3] = {title = 'Disturbing the Peace', class = 'infraction', id = 'P.C. 6003', months = 0, fine = 350, color = 'green'}, + [4] = {title = 'False Reporting', class = 'Misdemeanor', id = 'P.C. 6004', months = 10, fine = 750, color = 'green'}, + [5] = {title = 'Harassment', class = 'Misdemeanor', id = 'P.C. 6005', months = 10, fine = 500, color = 'orange'}, + [6] = {title = 'Misdemeanor Obstruction of Justice', class = 'Misdemeanor', id = 'P.C. 6006', months = 10, fine = 500, color = 'green'}, + [7] = {title = 'Felony Obstruction of Justice', class = 'Felony', id = 'P.C. 6007', months = 15, fine = 900, color = 'green'}, + [8] = {title = 'Inciting a Riot', class = 'Felony', id = 'P.C. 6008', months = 25, fine = 1000, color = 'orange'}, + [9] = {title = 'Loitering on Government Properties', class = 'Infraction', id = 'P.C. 6009', months = 0, fine = 500, color = 'green'}, + [10] = {title = 'Tampering', class = 'Misdemeanor', id = 'P.C. 6010', months = 10, fine = 500, color = 'green'}, + [11] = {title = 'Vehicle Tampering', class = 'Misdemeanor', id = 'P.C. 6011', months = 15, fine = 750, color = 'green'}, + [12] = {title = 'Evidence Tampering', class = 'Felony', id = 'P.C. 6012', months = 20, fine = 1000, color = 'green'}, + [13] = {title = 'Witness Tampering', class = 'Felony', id = 'P.C. 6013', months = 0, fine = 0, color = 'green'}, + [14] = {title = 'Failure to Provide Identification', class = 'Misdemeanor', id = 'P.C. 6014', months = 15, fine = 1500, color = 'green'}, + [15] = {title = 'Vigilantism', class = 'Felony', id = 'P.C. 6015', months = 30, fine = 1500, color = 'orange'}, + [16] = {title = 'Unlawful Assembly', class = 'Misdemeanor', id = 'P.C. 6016', months = 10, fine = 750, color = 'orange'}, + [17] = {title = 'Government Corruption', class = 'Felony', id = 'P.C. 6017', months = 0, fine = 0, color = 'red'}, + [18] = {title = 'Stalking', class = 'Felony', id = 'P.C. 6018', months = 40, fine = 1500, color = 'orange'}, + [19] = {title = 'Aiding and Abetting', class = 'Misdemeanor', id = 'P.C. 6019', months = 15, fine = 450, color = 'orange'}, + [20] = {title = 'Harboring a Fugitive', class = 'Misdemeanor', id = 'P.C. 6020', months = 10, fine = 1000, color = 'green'}, + }, + [7] = { + [1] = {title = 'Misdemeanor Possession of Marijuana', class = 'Mask', id = 'P.C. 7001', months = 5, fine = 250, color = 'green'}, + [2] = {title = 'Felony Possession of Marijuana', class = 'Felony', id = 'P.C. 7002', months = 15, fine = 1000, color = 'green'}, + [3] = {title = 'Cultivation of Marijuana A', class = 'Misdemeanor', id = 'P.C. 7003', months = 10, fine = 750, color = 'green'}, + [4] = {title = 'Cultivation of Marijuana B', class = 'Felony', id = 'P.C. 7004', months = 30, fine = 1500, color = 'orange'}, + [5] = {title = 'Possession of Marijuana with Intent to Distribute', class = 'Felony', id = 'P.C. 7005', months = 30, fine = 3000, color = 'orange'}, + [6] = {title = 'Misdemeanor Possession of Cocaine', class = 'Misdemeanor', id = 'P.C. 7006', months = 7, fine = 500, color = 'green'}, + [7] = {title = 'Felony Possession of Cocaine', class = 'Felony', id = 'P.C. 7007', months = 25, fine = 1500, color = 'green'}, + [8] = {title = 'Possession of Cocaine with Intent to Distribute', class = 'Felony', id = 'P.C. 7008', months = 35, fine = 4500, color = 'orange'}, + [9] = {title = 'Misdemeanor Possession of Methamphetamine', class = 'Misdemeanor', id = 'P.C. 7009', months = 7, fine = 500, color = 'green'}, + [10] = {title = 'Felony Possession of Methamphetamine', class = 'Felony', id = 'P.C. 7010', months = 25, fine = 1500, color = 'green'}, + [11] = {title = 'Possession of Methamphetamine with Intent to Distribute', class = 'Felony', id = 'P.C. 7011', months = 35, fine = 4500, color = 'orange'}, + [12] = {title = 'Misdemeanor Possession of Oxy / Vicodin', class = 'Felony', id = 'P.C. 7012', months = 7, fine = 500, color = 'green'}, + [13] = {title = 'Felony Possession of Oxy / Vicodin', class = 'Felony', id = 'P.C. 7013', months = 25, fine = 1500, color = 'green'}, + [14] = {title = 'Felony Possession of Oxy / Vicodin with Intent to Distribute', class = 'Felony', id = 'P.C. 7014', months = 35, fine = 4500, color = 'orange'}, + [15] = {title = 'Misdemeanor Possession of Ecstasy', class = 'Misdemeanor', id = 'P.C. 7015', months = 7, fine = 500, color = 'green'}, + [16] = {title = 'Felony Possession of Ecstasy', class = 'Felony', id = 'P.C. 7016', months = 25, fine = 1500, color = 'green'}, + [17] = {title = 'Possession of Ecstasy with Intent to Distribute', class = 'Felony', id = 'P.C. 7017', months = 35, fine = 4500, color = 'orange'}, + [18] = {title = 'Misdemeanor Possession of Opium', class = 'Misdemeanor', id = 'P.C. 7018', months = 7, fine = 500, color = 'green'}, + [19] = {title = 'Felony Possession of Opium', class = 'Felony', id = 'P.C. 7019', months = 25, fine = 1500, color = 'green'}, + [20] = {title = 'Possession of Opium with Intent to Distribute', class = 'Felony', id = 'P.C. 7020', months = 35, fine = 4500, color = 'orange'}, + [21] = {title = 'Misdemeanor Possession of Adderall', class = 'Misdemeanor', id = 'P.C. 7021', months = 7, fine = 500, color = 'green'}, + [22] = {title = 'Felony Possession of Adderall', class = 'Felony', id = 'P.C. 7022', months = 25, fine = 1500, color = 'green'}, + [23] = {title = 'Possession of Adderall with Intent to Distribute', class = 'Felony', id = 'P.C. 7023', months = 35, fine = 4500, color = 'orange'}, + [24] = {title = 'Misdemeanor Possession of Xanax', class = 'Misdemeanor', id = 'P.C. 7024', months = 7, fine = 500, color = 'green'}, + [25] = {title = 'Felony Possession of Xanax', class = 'Felony', id = 'P.C. 7025', months = 25, fine = 1500, color = 'green'}, + [26] = {title = 'Possession of Xanax with Intent to Distribute', class = 'Felony', id = 'P.C. 7026', months = 35, fine = 4500, color = 'orange'}, + [27] = {title = 'Misdemeanor Possession of Shrooms', class = 'Misdemeanor', id = 'P.C. 7027', months = 7, fine = 500, color = 'green'}, + [28] = {title = 'Felony Possession of Shrooms', class = 'Felony', id = 'P.C. 7028', months = 25, fine = 1500, color = 'green'}, + [29] = {title = 'Possession of Shrooms with Intent to Distribute', class = 'Felony', id = 'P.C. 7029', months = 35, fine = 4500, color = 'orange'}, + [30] = {title = 'Misdemeanor Possession of Lean', class = 'Misdemeanor', id = 'P.C. 7030', months = 7, fine = 500, color = 'green'}, + [31] = {title = 'Felony Possession of Lean', class = 'Felony', id = 'P.C. 7031', months = 25, fine = 1500, color = 'green'}, + [32] = {title = 'Possession of Lean with Intent to Distribute', class = 'Felony', id = 'P.C. 7032', months = 35, fine = 4500, color = 'orange'}, + [33] = {title = 'Sale of a controlled substance', class = 'Misdemeanor', id = 'P.C. 7033', months = 10, fine = 1000, color = 'green'}, + [34] = {title = 'Drug Trafficking', class = 'Felony', id = 'P.C. 7034', months = 0, fine = 0, color = 'red'}, + [35] = {title = 'Desecration of a Human Corpse', class = 'Felony', id = 'P.C. 7035', months = 20, fine = 1500, color = 'orange'}, + [36] = {title = 'Public Intoxication', class = 'Infraction', id = 'P.C. 7036', months = 0, fine = 500, color = 'green'}, + [37] = {title = 'Public Indecency', class = 'Misdemeanor', id = 'P.C. 7037', months = 10, fine = 750, color = 'green'}, + }, + [8] = { + [1] = {title = 'Criminal Possession of Weapon Class A', class = 'Felony', id = 'P.C. 8001', months = 10, fine = 500, color = 'green'}, + [2] = {title = 'Criminal Possession of Weapon Class B', class = 'Felony', id = 'P.C. 8002', months = 15, fine = 1000, color = 'green'}, + [3] = {title = 'Criminal Possession of Weapon Class C', class = 'Felony', id = 'P.C. 8003', months = 30, fine = 3500, color = 'green'}, + [4] = {title = 'Criminal Possession of Weapon Class D', class = 'Felony', id = 'P.C. 8004', months = 25, fine = 1500, color = 'green'}, + [5] = {title = 'Criminal Sale of Weapon Class A', class = 'Felony', id = 'P.C. 8005', months = 15, fine = 1000, color = 'orange'}, + [6] = {title = 'Criminal Sale of Weapon Class B', class = 'Felony', id = 'P.C. 8006', months = 20, fine = 2000, color = 'orange'}, + [7] = {title = 'Criminal Sale of Weapon Class C', class = 'Felony', id = 'P.C. 8007', months = 35, fine = 7000, color = 'orange'}, + [8] = {title = 'Criminal Sale of Weapon Class D', class = 'Felony', id = 'P.C. 8008', months = 30, fine = 3000, color = 'orange'}, + [9] = {title = 'Criminal Use of Weapon', class = 'Misdemeanor', id = 'P.C. 8009', months = 10, fine = 450, color = 'orange'}, + [10] = {title = 'Possession of Illegal Firearm Modifications', class = 'Misdemeanor', id = 'P.C. 8010', months = 10, fine = 300, color = 'green'}, + [11] = {title = 'Weapon Trafficking', class = 'Felony', id = 'P.C. 8011', months = 0, fine = 0, color = 'red'}, + [12] = {title = 'Brandishing a Weapon', class = 'Misdemeanor', id = 'P.C. 8012', months = 15, fine = 500, color = 'orange'}, + [13] = {title = 'Insurrection', class = 'Felony', id = 'P.C. 8013', months = 0, fine = 0, color = 'red'}, + [14] = {title = 'Flying into Restricted Airspace', class = 'Felony', id = 'P.C. 8014', months = 20, fine = 1500, color = 'green'}, + [15] = {title = 'Jaywalking', class = 'Infraction', id = 'P.C. 8015', months = 0, fine = 150, color = 'green'}, + [16] = {title = 'Criminal Use of Explosives', class = 'Felony', id = 'P.C. 8016', months = 30, fine = 2500, color = 'orange'}, + }, + [9] = { + [1] = {title = 'Driving While Intoxicated', class = 'Misdemeanor', id = 'P.C. 9001', months = 5, fine = 300, color = 'green'}, + [2] = {title = 'Evading', class = 'Misdemeanor', id = 'P.C. 9002', months = 5, fine = 400, color = 'green'}, + [3] = {title = 'Reckless Evading', class = 'Felony', id = 'P.C. 9003', months = 10, fine = 800, color = 'orange'}, + [4] = {title = 'Failure to Yield to Emergency Vehicle', class = 'Infraction', id = 'P.C. 9004', months = 0, fine = 600, color = 'green'}, + [5] = {title = 'Failure to Obey Traffic Control Device', class = 'Infraction', id = 'P.C. 9005', months = 0, fine = 150, color = 'green'}, + [6] = {title = 'Nonfunctional Vehicle', class = 'Infraction', id = 'P.C. 9006', months = 0, fine = 75, color = 'green'}, + [7] = {title = 'Negligent Driving', class = 'Infraction', id = 'P.C. 9007', months = 0, fine = 300, color = 'green'}, + [8] = {title = 'Reckless Driving', class = 'Misdemeanor', id = 'P.C. 9008', months = 10, fine = 750, color = 'orange'}, + [9] = {title = 'Third Degree Speeding', class = 'Infraction', id = 'P.C. 9009', months = 0, fine = 225, color = 'green'}, + [10] = {title = 'Second Degree Speeding', class = 'Infraction', id = 'P.C. 9010', months = 0, fine = 450, color = 'green'}, + [11] = {title = 'First Degree Speeding', class = 'Infraction', id = 'P.C. 9011', months = 0, fine = 750, color = 'green'}, + [12] = {title = 'Unlicensed Operation of Vehicle', class = 'Infraction', id = 'P.C. 9012', months = 0, fine = 500, color = 'green'}, + [13] = {title = 'Illegal U-Turn', class = 'Infraction', id = 'P.C. 9013', months = 0, fine = 75, color = 'green'}, + [14] = {title = 'Illegal Passing', class = 'Infraction', id = 'P.C. 9014', months = 0, fine = 300, color = 'green'}, + [15] = {title = 'Failure to Maintain Lane', class = 'Infraction', id = 'P.C. 9015', months = 0, fine = 300, color = 'green'}, + [16] = {title = 'Illegal Turn', class = 'Infraction', id = 'P.C. 9016', months = 0, fine = 150, color = 'green'}, + [17] = {title = 'Failure to Stop', class = 'Infraction', id = 'P.C. 9017', months = 0, fine = 600, color = 'green'}, + [18] = {title = 'Unauthorized Parking', class = 'Infraction', id = 'P.C. 9018', months = 0, fine = 300, color = 'green'}, + [19] = {title = 'Hit and Run', class = 'Misdemeanor', id = 'P.C. 9019', months = 10, fine = 500, color = 'green'}, + [20] = {title = 'Driving without Headlights or Signals', class = 'Infraction', id = 'P.C. 9020', months = 0, fine = 300, color = 'green'}, + [21] = {title = 'Street Racing', class = 'Felony', id = 'P.C. 9021', months = 15, fine = 1500, color = 'green'}, + [22] = {title = 'Piloting without Proper Licensing', class = 'Felony', id = 'P.C. 9022', months = 20, fine = 1500, color = 'orange'}, + [23] = {title = 'Unlawful Use of a Motorvehicle', class = 'Misdemeanor', id = 'P.C. 9023', months = 10, fine = 750, color = 'green'}, + }, + [10] = { + [1] = {title = 'Hunting in Restricted Areas', class = 'Infraction', id = 'P.C. 10001', months = 0, fine = 450, color = 'green'}, + [2] = {title = 'Unlicensed Hunting', class = 'Infraction', id = 'P.C. 10002', months = 0, fine = 450, color = 'green'}, + [3] = {title = 'Animal Cruelty', class = 'Misdemeanor', id = 'P.C. 10003', months = 10, fine = 450, color = 'green'}, + [4] = {title = 'Hunting with a Non-Hunting Weapon', class = 'Misdemeanor', id = 'P.C. 10004', months = 10, fine = 750, color = 'green'}, + [5] = {title = 'Hunting outside of hunting hours', class = 'Infraction', id = 'P.C. 10005', months = 0, fine = 750, color = 'green'}, + [6] = {title = 'Overhunting', class = 'Misdemeanor', id = 'P.C. 10006', months = 10, fine = 1000, color = 'green'}, + [7] = {title = 'Poaching', class = 'Felony', id = 'P.C. 10007', months = 20, fine = 1250, color = 'red'}, + } +} + +Config.PoliceJobs = { + ['police'] = true, + ['lspd'] = true, + ['bcso'] = true, + ['sast'] = true, + ['sasp'] = true, + ['doc'] = true, + ['sapr'] = true, + ['pa'] = true -- yucky +} + +Config.AmbulanceJobs = { + ['ambulance'] = true, + ['doctor'] = true +} + +Config.DojJobs = { + ['lawyer'] = true, +} + +-- Leave my hacky code alone ya goblins +Config.AllowedJobs = {} +for index, value in pairs(Config.PoliceJobs) do + Config.AllowedJobs[index] = value +end +for index, value in pairs(Config.AmbulanceJobs) do + Config.AllowedJobs[index] = value +end +for index, value in pairs(Config.DojJobs) do + Config.AllowedJobs[index] = value +end +-- Leave my hacky code alone ya goblins + +Config.LogPerms = { + ['ambulance'] = { + [4] = true, + }, + ['police'] = { + [4] = true, + }, +} + +Config.ColorNames = { + [0] = "Metallic Black", + [1] = "Metallic Graphite Black", + [2] = "Metallic Black Steel", + [3] = "Metallic Dark Silver", + [4] = "Metallic Silver", + [5] = "Metallic Blue Silver", + [6] = "Metallic Steel Gray", + [7] = "Metallic Shadow Silver", + [8] = "Metallic Stone Silver", + [9] = "Metallic Midnight Silver", + [10] = "Metallic Gun Metal", + [11] = "Metallic Anthracite Grey", + [12] = "Matte Black", + [13] = "Matte Gray", + [14] = "Matte Light Grey", + [15] = "Util Black", + [16] = "Util Black Poly", + [17] = "Util Dark silver", + [18] = "Util Silver", + [19] = "Util Gun Metal", + [20] = "Util Shadow Silver", + [21] = "Worn Black", + [22] = "Worn Graphite", + [23] = "Worn Silver Grey", + [24] = "Worn Silver", + [25] = "Worn Blue Silver", + [26] = "Worn Shadow Silver", + [27] = "Metallic Red", + [28] = "Metallic Torino Red", + [29] = "Metallic Formula Red", + [30] = "Metallic Blaze Red", + [31] = "Metallic Graceful Red", + [32] = "Metallic Garnet Red", + [33] = "Metallic Desert Red", + [34] = "Metallic Cabernet Red", + [35] = "Metallic Candy Red", + [36] = "Metallic Sunrise Orange", + [37] = "Metallic Classic Gold", + [38] = "Metallic Orange", + [39] = "Matte Red", + [40] = "Matte Dark Red", + [41] = "Matte Orange", + [42] = "Matte Yellow", + [43] = "Util Red", + [44] = "Util Bright Red", + [45] = "Util Garnet Red", + [46] = "Worn Red", + [47] = "Worn Golden Red", + [48] = "Worn Dark Red", + [49] = "Metallic Dark Green", + [50] = "Metallic Racing Green", + [51] = "Metallic Sea Green", + [52] = "Metallic Olive Green", + [53] = "Metallic Green", + [54] = "Metallic Gasoline Blue Green", + [55] = "Matte Lime Green", + [56] = "Util Dark Green", + [57] = "Util Green", + [58] = "Worn Dark Green", + [59] = "Worn Green", + [60] = "Worn Sea Wash", + [61] = "Metallic Midnight Blue", + [62] = "Metallic Dark Blue", + [63] = "Metallic Saxony Blue", + [64] = "Metallic Blue", + [65] = "Metallic Mariner Blue", + [66] = "Metallic Harbor Blue", + [67] = "Metallic Diamond Blue", + [68] = "Metallic Surf Blue", + [69] = "Metallic Nautical Blue", + [70] = "Metallic Bright Blue", + [71] = "Metallic Purple Blue", + [72] = "Metallic Spinnaker Blue", + [73] = "Metallic Ultra Blue", + [74] = "Metallic Bright Blue", + [75] = "Util Dark Blue", + [76] = "Util Midnight Blue", + [77] = "Util Blue", + [78] = "Util Sea Foam Blue", + [79] = "Uil Lightning blue", + [80] = "Util Maui Blue Poly", + [81] = "Util Bright Blue", + [82] = "Matte Dark Blue", + [83] = "Matte Blue", + [84] = "Matte Midnight Blue", + [85] = "Worn Dark blue", + [86] = "Worn Blue", + [87] = "Worn Light blue", + [88] = "Metallic Taxi Yellow", + [89] = "Metallic Race Yellow", + [90] = "Metallic Bronze", + [91] = "Metallic Yellow Bird", + [92] = "Metallic Lime", + [93] = "Metallic Champagne", + [94] = "Metallic Pueblo Beige", + [95] = "Metallic Dark Ivory", + [96] = "Metallic Choco Brown", + [97] = "Metallic Golden Brown", + [98] = "Metallic Light Brown", + [99] = "Metallic Straw Beige", + [100] = "Metallic Moss Brown", + [101] = "Metallic Biston Brown", + [102] = "Metallic Beechwood", + [103] = "Metallic Dark Beechwood", + [104] = "Metallic Choco Orange", + [105] = "Metallic Beach Sand", + [106] = "Metallic Sun Bleeched Sand", + [107] = "Metallic Cream", + [108] = "Util Brown", + [109] = "Util Medium Brown", + [110] = "Util Light Brown", + [111] = "Metallic White", + [112] = "Metallic Frost White", + [113] = "Worn Honey Beige", + [114] = "Worn Brown", + [115] = "Worn Dark Brown", + [116] = "Worn straw beige", + [117] = "Brushed Steel", + [118] = "Brushed Black steel", + [119] = "Brushed Aluminium", + [120] = "Chrome", + [121] = "Worn Off White", + [122] = "Util Off White", + [123] = "Worn Orange", + [124] = "Worn Light Orange", + [125] = "Metallic Securicor Green", + [126] = "Worn Taxi Yellow", + [127] = "police car blue", + [128] = "Matte Green", + [129] = "Matte Brown", + [130] = "Worn Orange", + [131] = "Matte White", + [132] = "Worn White", + [133] = "Worn Olive Army Green", + [134] = "Pure White", + [135] = "Hot Pink", + [136] = "Salmon pink", + [137] = "Metallic Vermillion Pink", + [138] = "Orange", + [139] = "Green", + [140] = "Blue", + [141] = "Mettalic Black Blue", + [142] = "Metallic Black Purple", + [143] = "Metallic Black Red", + [144] = "Hunter Green", + [145] = "Metallic Purple", + [146] = "Metaillic V Dark Blue", + [147] = "MODSHOP BLACK1", + [148] = "Matte Purple", + [149] = "Matte Dark Purple", + [150] = "Metallic Lava Red", + [151] = "Matte Forest Green", + [152] = "Matte Olive Drab", + [153] = "Matte Desert Brown", + [154] = "Matte Desert Tan", + [155] = "Matte Foilage Green", + [156] = "DEFAULT ALLOY COLOR", + [157] = "Epsilon Blue", + [158] = "Unknown", +} + +Config.ColorInformation = { + [0] = "black", + [1] = "black", + [2] = "black", + [3] = "darksilver", + [4] = "silver", + [5] = "bluesilver", + [6] = "silver", + [7] = "darksilver", + [8] = "silver", + [9] = "bluesilver", + [10] = "darksilver", + [11] = "darksilver", + [12] = "matteblack", + [13] = "gray", + [14] = "lightgray", + [15] = "black", + [16] = "black", + [17] = "darksilver", + [18] = "silver", + [19] = "utilgunmetal", + [20] = "silver", + [21] = "black", + [22] = "black", + [23] = "darksilver", + [24] = "silver", + [25] = "bluesilver", + [26] = "darksilver", + [27] = "red", + [28] = "torinored", + [29] = "formulared", + [30] = "blazered", + [31] = "gracefulred", + [32] = "garnetred", + [33] = "desertred", + [34] = "cabernetred", + [35] = "candyred", + [36] = "orange", + [37] = "gold", + [38] = "orange", + [39] = "red", + [40] = "mattedarkred", + [41] = "orange", + [42] = "matteyellow", + [43] = "red", + [44] = "brightred", + [45] = "garnetred", + [46] = "red", + [47] = "red", + [48] = "darkred", + [49] = "darkgreen", + [50] = "racingreen", + [51] = "seagreen", + [52] = "olivegreen", + [53] = "green", + [54] = "gasolinebluegreen", + [55] = "mattelimegreen", + [56] = "darkgreen", + [57] = "green", + [58] = "darkgreen", + [59] = "green", + [60] = "seawash", + [61] = "midnightblue", + [62] = "darkblue", + [63] = "saxonyblue", + [64] = "blue", + [65] = "blue", + [66] = "blue", + [67] = "diamondblue", + [68] = "blue", + [69] = "blue", + [70] = "brightblue", + [71] = "purpleblue", + [72] = "blue", + [73] = "ultrablue", + [74] = "brightblue", + [75] = "darkblue", + [76] = "midnightblue", + [77] = "blue", + [78] = "blue", + [79] = "lightningblue", + [80] = "blue", + [81] = "brightblue", + [82] = "mattedarkblue", + [83] = "matteblue", + [84] = "matteblue", + [85] = "darkblue", + [86] = "blue", + [87] = "lightningblue", + [88] = "yellow", + [89] = "yellow", + [90] = "bronze", + [91] = "yellow", + [92] = "lime", + [93] = "champagne", + [94] = "beige", + [95] = "darkivory", + [96] = "brown", + [97] = "brown", + [98] = "lightbrown", + [99] = "beige", + [100] = "brown", + [101] = "brown", + [102] = "beechwood", + [103] = "beechwood", + [104] = "chocoorange", + [105] = "yellow", + [106] = "yellow", + [107] = "cream", + [108] = "brown", + [109] = "brown", + [110] = "brown", + [111] = "white", + [112] = "white", + [113] = "beige", + [114] = "brown", + [115] = "brown", + [116] = "beige", + [117] = "steel", + [118] = "blacksteel", + [119] = "aluminium", + [120] = "chrome", + [121] = "wornwhite", + [122] = "offwhite", + [123] = "orange", + [124] = "lightorange", + [125] = "green", + [126] = "yellow", + [127] = "blue", + [128] = "green", + [129] = "brown", + [130] = "orange", + [131] = "white", + [132] = "white", + [133] = "darkgreen", + [134] = "white", + [135] = "pink", + [136] = "pink", + [137] = "pink", + [138] = "orange", + [139] = "green", + [140] = "blue", + [141] = "blackblue", + [142] = "blackpurple", + [143] = "blackred", + [144] = "darkgreen", + [145] = "purple", + [146] = "darkblue", + [147] = "black", + [148] = "purple", + [149] = "darkpurple", + [150] = "red", + [151] = "darkgreen", + [152] = "olivedrab", + [153] = "brown", + [154] = "tan", + [155] = "green", + [156] = "silver", + [157] = "blue", + [158] = "black", +} + +Config.ClassList = { + [0] = "Compact", + [1] = "Sedan", + [2] = "SUV", + [3] = "Coupe", + [4] = "Muscle", + [5] = "Sport Classic", + [6] = "Sport", + [7] = "Super", + [8] = "Motorbike", + [9] = "Off-Road", + [10] = "Industrial", + [11] = "Utility", + [12] = "Van", + [13] = "Bike", + [14] = "Boat", + [15] = "Helicopter", + [16] = "Plane", + [17] = "Service", + [18] = "Emergency", + [19] = "Military", + [20] = "Commercial", + [21] = "Train" +} + +function GetJobType(job) + if Config.PoliceJobs[job] then + return 'police' + elseif Config.AmbulanceJobs[job] then + return 'ambulance' + elseif Config.DojJobs[job] then + return 'doj' + else + return nil + end +end + +-- this is a hack, because the qb-menu in qb-policejob populates an impound location and passed it through to the event. +-- if this impound locations are changed in qb-policejob, they must also be changed here. +Config.ImpoundLocations = { + [1] = vector4(436.68, -1007.42, 27.32, 180.0), + [2] = vector4(-436.14, 5982.63, 31.34, 136.0), +} \ No newline at end of file diff --git a/ui/app.js b/ui/app.js new file mode 100644 index 00000000..6e327537 --- /dev/null +++ b/ui/app.js @@ -0,0 +1,5048 @@ +let canSearchForProfiles = true; +let canSaveProfile = true; +let canRefreshBolo = true; +let canRefreshReports = true; +let canRefreshIncidents = true; +let canInputTag = true; +let canInputBoloTag = true; +let canInputBoloOfficerTag = true; +let canSearchReports = true; +let canCreateBulletin = 0; +let mouse_is_inside = false; +let currentTab = ".dashboard-page-container"; +let MyName = ""; +let canInputReportTag = true; +let canInputReportOfficerTag = true; +let canInputReportCivilianTag = true; +let canSearchForVehicles = true; +let canSearchForReports = true; +let canSaveVehicle = true; +var LastName = ""; +var DispatchNum = 0; +var playerJob = ""; +let rosterLink = ""; + +let impoundChanged = false; + +// TEMP CONFIG OF JOBS +const PoliceJobs = { + ['police']: true, +} + +const AmbulanceJobs = { + ['ambulance']: true, +} + +const DojJobs = { + ['lawyer']: true +} + +const MONTH_NAMES = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", +]; + +function getFormattedDate(date, prefomattedDate = false, hideYear = false) { + const day = date.getDate(); + const month = MONTH_NAMES[date.getMonth()]; + const year = date.getFullYear(); + const hours = date.getHours(); + let minutes = date.getMinutes(); + + if (minutes < 10) { + minutes = `0${minutes}`; + } + + if (prefomattedDate) { + return `${prefomattedDate} at ${hours}:${minutes}`; + } + + if (hideYear) { + return `${day}. ${month} at ${hours}:${minutes}`; + } + + return `${day}. ${month} ${year}. at ${hours}:${minutes}`; +} + +function timeAgo(dateParam) { + if (!dateParam) { + return null; + } + + const date = + typeof dateParam === "object" ? dateParam : new Date(dateParam); + const DAY_IN_MS = 86400000; + const today = new Date(); + const yesterday = new Date(today - DAY_IN_MS); + const seconds = Math.round((today - date) / 1000); + const minutes = Math.round(seconds / 60); + const isToday = today.toDateString() === date.toDateString(); + const isYesterday = yesterday.toDateString() === date.toDateString(); + const isThisYear = today.getFullYear() === date.getFullYear(); + + if (seconds < 5) { + return "Just Now"; + } else if (seconds < 60) { + return `${seconds} Seconds ago`; + } else if (seconds < 90) { + return "About a minute ago"; + } else if (minutes < 60) { + return `${minutes} Minutes ago`; + } else if (isToday) { + return getFormattedDate(date, "Today"); + } else if (isYesterday) { + return getFormattedDate(date, "Yesterday"); + } else if (isThisYear) { + return getFormattedDate(date, false, true); + } + + return getFormattedDate(date); +} + +$(document).ready(() => { + $(".header").hover( + function () { + $(".close-all").css("opacity", "0.5"); + }, + function () { + $(".close-all").css("opacity", "1"); + } + ); + $(".incidents-charges-title-container").hover( + function () { + $(".incidents-charges-table-container").css("opacity", "0.1"); + $(".close-all").css("filter", "none"); + }, + function () { + $(".close-all").css("filter", "brightness(30%)"); + $(".incidents-charges-table-container").css("opacity", "1"); + } + ); + $(".nav-item").click(function () { + if ($(this).hasClass("active-nav") == false) { + fidgetSpinner($(this).data("page")); + currentTab = $(this).data("page"); + } + }); + + $(".profile-items").on("click", ".profile-item", async function () { + let id = $(this).data("id"); + let result = await $.post( + `https://${GetParentResourceName()}/getProfileData`, + JSON.stringify({ + id: id, + }) + ); + + if (!canInputTag) { + if ($(".tags-add-btn").hasClass("fa-minus")) { + $(".tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".tag-input").remove(); + canInputTag = true; + } + + if ($(".gallery-upload-input").css("display") == "block") { + $(".gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".gallery-upload-input").css("display", "none"); + }, 250); + } + + if ($(".gallery-add-btn").hasClass("fa-minus")) { + $(".gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + + $(".manage-profile-editing-title").html(`You are currently editing ${result["firstname"]} ${result["lastname"]}`); + $(".manage-profile-citizenid-input").val(result['cid']); + $(".manage-profile-name-input-1").val(result["firstname"]); + $(".manage-profile-name-input-2").val(result["lastname"]); + $(".manage-profile-dob-input").val(result["dob"]); + $(".manage-profile-job-input").val(`${result.job}, ${result.grade}`); + $(".manage-profile-url-input").val(result["profilepic"]); + $(".manage-profile-info").val(result["mdtinfo"]); + $(".manage-profile-info").removeAttr("disabled"); + $(".manage-profile-fingerprint").val(result["fingerprint"]); + $(".manage-profile-fingerprint").removeAttr("disabled"); + $(".manage-profile-pic").attr("src", result["profilepic"]); + + const { vehicles, tags, gallery, convictions, properties } = result + + $(".licenses-holder").empty(); + $(".tags-holder").empty(); + $(".vehs-holder").empty(); + $(".gallery-inner-container").empty(); + $(".convictions-holder").empty(); + + let licencesHTML = '
No Licenses
'; + let tagsHTML = '
No Tags
'; + let convHTML = '
Clean Record ?
'; + let vehHTML = '
No Vehicles
'; + let galleryHTML = '
No Photos
'; + let propertyHTML = '
No Properties
'; + + // convert key value pair object of licenses to array + let licenses = Object.entries(result.licences); + + if (licenses.length > 0 && (PoliceJobs[playerJob] !== undefined || DojJobs[playerJob] !== undefined)) { + licencesHTML = ''; + for (const [lic, hasLic] of licenses) { + + let tagColour = hasLic == true ? "green-tag" : "red-tag"; + licencesHTML += `${titleCase(lic)}`; + } + if (vehicles && vehicles.length > 0) { + + vehHTML = ''; + vehicles.forEach(value => { + vehHTML += `
${value.plate} - ${value.vehicle}
` + }) + } + if (convictions && convictions.length > 0) { + convHTML = ''; + convictions.forEach(value => { + convHTML += `
${value}
`; + }) + } + if (properties && properties.length > 0) { + propertyHTML = ''; + properties.forEach(value => { + propertyHTML += `
${value.label}
`; + }) + } + } + if (tags && tags.length > 0) { + tagsHTML = ''; + tags.forEach((tag) => { + tagsHTML += `
${tag}
`; + }) + } + + if (gallery && gallery.length > 0) { + galleryHTML = ''; + gallery.forEach(value => { + galleryHTML += ``; + }) + } + + if (result.isLimited) { + $(".manage-profile-vehs-container").fadeOut(250); + $(".manage-profile-houses-container").fadeOut(250); + $(".manage-profile-houses-container").fadeOut(250); + } else { + $(".manage-profile-vehs-container").fadeIn(250); + $(".manage-profile-houses-container").fadeIn(250); + $(".manage-profile-houses-container").fadeIn(250); + } + + $(".licenses-holder").html(licencesHTML); + $(".tags-holder").html(tagsHTML); + $(".convictions-holder").html(convHTML); + $(".vehs-holder").html(vehHTML); + $(".gallery-inner-container").html(galleryHTML); + $(".houses-holder").html(propertyHTML); + }); + //
ID: ${BulletinId}
+ + $(".bulletin-add-btn").click(function () { + if (canCreateBulletin == 0) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + let BulletinId = Number($(".bulletin-item").first().data("id")) + 1; + if (Number.isNaN(BulletinId)) { + BulletinId = 1; + } + canCreateBulletin = BulletinId; + $(".bulletin-items-continer") + .prepend(`
+ + +
+
${MyName} - Just Now
+
+
`); + } else { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".bulletin-items-continer") + .find("[data-id='" + canCreateBulletin + "']") + .remove(); + canCreateBulletin = 0; + } + }); + //
ID: ${canCreateBulletin}
+ $(".bulletin-items-continer").on("keydown", ".bulletin-item", function (e) { + if (e.keyCode === 13) { + $(".bulletin-add-btn").removeClass("fa-minus").addClass("fa-plus"); + let id = $(this).find(".bulletin-id").text(); + let date = $(this).find(".bulletin-date").text(); + let title = $(this).find(".bulletin-item-title").text(); + let info = $(this).find(".bulletin-item-info").text(); + let time = new Date(); + $.post( + `https://${GetParentResourceName()}/newBulletin`, + JSON.stringify({ + title: title, + info: info, + time: time.getTime(), + }) + ); + $(".bulletin-items-continer") + .find("[data-id='" + canCreateBulletin + "']") + .remove(); + $(".bulletin-items-continer") + .prepend(`
+
${title}
+
${info}
+
+ +
${MyName} - ${timeAgo( + Number(time.getTime()) + )}
+
+
`); + canCreateBulletin = 0; + } + }); + $(".bulletin-items-continer").on( + "contextmenu", + ".bulletin-item", + function (e) { + let args = [ + { + className: "remove-bulletin", + icon: "fas fa-times", + text: "Remove Item", + info: $(this).data("id"), + status: $(this).data("title"), + }, + ]; + openContextMenu(e, args); + } + ); + $(".contextmenu").on("click", ".remove-bulletin", function () { + let id = $(this).data("info"); + let title = $(this).data("status") + $(".bulletin-items-continer") + .find("[data-id='" + id + "']") + .remove(); + $.post( + `https://${GetParentResourceName()}/deleteBulletin`, + JSON.stringify({ + id: id, + title: title + }) + ); + if (canCreateBulletin == id) { + canCreateBulletin = 0; + } + if ($(".bulletin-add-btn").hasClass("fa-minus")) { + $(".bulletin-add-btn").removeClass("fa-minus").addClass("fa-plus"); + } + }); + $(".associated-incidents-tags-add-btn").on("click", "", function () { + document.addEventListener("mouseup", onMouseDownIcidents); + $(".icidents-person-search-container").fadeIn(250); + $(".close-all").css("filter", "brightness(15%)"); + }); + $(".gallery-add-btn").click(function () { + if ($(".manage-profile-citizenid-input").val()) { + if ($(".gallery-upload-input").css("display") == "none") { + $(".gallery-upload-input").slideDown(250); + $(".gallery-upload-input").css("display", "block"); + $(this).removeClass("fa-plus").addClass("fa-minus"); + } else { + $(".gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".gallery-upload-input").css("display", "none"); + }, 250); + $(this).removeClass("fa-minus").addClass("fa-plus"); + } + } else { + $(this).effect("shake", { times: 2, distance: 2 }, 500); + } + }); + $("#gallery-upload-input").keydown(function (e) { + if (e.keyCode === 13) { + let URL = $("#gallery-upload-input").val(); + let cid = $(".manage-profile-citizenid-input").val(); + if (URL !== "") { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".gallery-inner-container").prepend( + `` + ); + $("#gallery-upload-input").val(""); + $(".gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".gallery-upload-input").css("display", "none"); + }, 250); + $(".gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + } + }); + $(".manage-profile-save").click(function () { + if (canSaveProfile == true) { + canSaveProfile = false; + $(".manage-profile-save").empty(); + $(".manage-profile-save").prepend( + `` + ); + setTimeout(() => { + $(".manage-profile-save").empty(); + $(".manage-profile-save").html("Save"); + canSaveProfile = true; + }, 750); + + setTimeout(() => { + let tags = new Array(); + let gallery = new Array(); + let licenses = {}; + + $(".tags-holder") + .find("div") + .each(function () { + if ($(this).text() != "" && $(this).text() != "No Tags") { + tags.push($(this).text()); + } + }); + + $(".gallery-inner-container") + .find("img") + .each(function () { + if ($(this).attr("src") != "") { + gallery.push($(this).attr("src")); + } + }); + + let pfp = $(".manage-profile-pic").attr("src"); + let newpfp = $(".manage-profile-url-input").val(); + if (newpfp.includes("base64")) { + newpfp = "img/not-found.jpg"; + } else { + pfp = newpfp; + } + let description = $(".manage-profile-info").val(); + let fingerprint = $(".manage-profile-fingerprint").val(); + let id = $(".manage-profile-citizenid-input").val(); + + $(".licenses-holder") + .find("span") + .each(function(){ + let type = $(this).data("type") + if ($(this).attr('class').includes('green-tag')){ + licenses[type] = true + } + else{ + licenses[type] = false + } + }) + + const fName = $(".manage-profile-name-input-1").val(); + const sName = $(".manage-profile-name-input-2").val(); + + $.post( + `https://${GetParentResourceName()}/saveProfile`, + JSON.stringify({ + pfp: pfp, + description: description, + id: id, + fName: fName, + sName: sName, + tags: tags, + gallery: gallery, + fingerprint: fingerprint, + licenses: licenses + }) + ); + $(".manage-profile-pic").attr("src", newpfp); + }, 250); + } + }); + $(".manage-incidents-title-holder").on( + "click", + ".manage-incidents-save", + function () { + if (canSaveProfile == true) { + canSaveProfile = false; + $(".manage-incidents-save").empty(); + $(".manage-incidents-save").prepend( + `` + ); + setTimeout(() => { + $(".manage-incidents-save").empty(); + $(".manage-incidents-save").prepend( + `` + ); + canSaveProfile = true; + }, 750); + + // Title, information, tags, officers involved, civs involved, evidence + const title = $("#manage-incidents-title-input").val(); + const information = $( + ".manage-incidents-reports-content" + ).val(); + const dbid = $(".manage-incidents-editing-title").data("id"); + + let tags = new Array(); + let officers = new Array(); + let civilians = new Array(); + let evidence = new Array(); + + $(".manage-incidents-tags-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + tags.push($(this).text()); + } + }); + + $(".manage-incidents-officers-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + officers.push($(this).text()); + } + }); + + $(".manage-incidents-civilians-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + civilians.push($(this).text()); + } + }); + + $(".manage-incidents-evidence-holder") + .find("img") + .each(function () { + if ($(this).attr("src") != "") { + evidence.push($(this).attr("src")); + } + }); + + let time = new Date(); + + let associated = new Array(); + + $(".associated-incidents-user-container").each(function ( + index + ) { + var cid = $(this).data("id"); + var guilty = false; + var warrant = false; + var processed = false; + var isassociated = false; + var charges = new Array(); + + $(".associated-incidents-user-tags-holder") + .children("div") + .each(function (index) { + if ($(this).data("id") == cid) { + if ($(this).hasClass("green-tag")) { + if ($(this).text() == "Guilty") { + guilty = true; + } + if ($(this).text() == "Warrant") { + warrant = true; + } + if ($(this).text() == "Processed") { + processed = true; + } + if ($(this).text() == "Associated") { + isassociated = true; + } + } + } + }); + + $(".associated-incidents-user-holder") + .children("div") + .each(function (index) { + if ( + ( $(".associated-incidents-user-holder") + .children() + .eq(index) + .data("id") == cid ) + ) { + charges.push( + $(".associated-incidents-user-holder") + .children() + .eq(index) + .html() + ); + } + }); + + associated.push({ + Cid: $(this).data("id"), + Warrant: warrant, + Guilty: guilty, + Processed: processed, + Isassociated: isassociated, + Charges: charges, + Fine: $(".fine-amount") + .filter("[data-id='" + $(this).data("id") + "']") + .val(), + Sentence: $(".sentence-amount") + .filter("[data-id='" + $(this).data("id") + "']") + .val(), + recfine: $(".fine-recommended-amount") + .filter("[data-id='" + $(this).data("id") + "']") + .val(), + recsentence: $(".sentence-recommended-amount") + .filter("[data-id='" + $(this).data("id") + "']") + .val(), + }); + }); + + $.post( + `https://${GetParentResourceName()}/saveIncident`, + JSON.stringify({ + ID: dbid, + title: title, + information: information, + tags: tags, + officers: officers, + civilians: civilians, + evidence: evidence, + associated: associated, + time: time.getTime(), + }) + ); + + setTimeout(() => { + if (canRefreshIncidents == true) { + canRefreshIncidents = false; + $(".incidents-search-refresh").empty(); + $(".incidents-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".incidents-search-refresh").empty(); + $(".incidents-search-refresh").html("Refresh"); + canRefreshIncidents = true; + $.post( + `https://${GetParentResourceName()}/getAllIncidents`, + JSON.stringify({}) + ); + }, 1500); + } + }, 1000); + } + } + ); + $(".manage-incidents-title-holder").on( + "click", + ".manage-incidents-create", + function () { + let tempalte = + "📝 Summary:\n\n[Insert Report Summary Here]\n\n🧍 Hostage: [Name Here]\n\n🔪 Weapons/Items Confiscated:\n\n· [Insert List Here]\n\n-----\n💸 Fine:\n⌚ Sentence:\n-----"; + $("#manage-incidents-title-input").val( + "Name - Charge - " + $(".date").html() + ); + $(".manage-incidents-reports-content").val(tempalte); + + $(".manage-incidents-tags-holder").empty(); + $(".manage-incidents-officers-holder").empty(); + $(".manage-incidents-civilians-holder").empty(); + $(".manage-incidents-evidence-holder").empty(); + $(".manage-incidents-title-holder").empty(); + $(".manage-incidents-title-holder").prepend( + ` +
Manage Incident
+
+
+ ` + ); + $(".manage-incidents-title").css("width", "66%"); + $(".manage-incidents-create").css("margin-right", "0px"); + + $(".incidents-ghost-holder").html(""); + $(".associated-incidents-tags-holder").html(""); + + $(".manage-incidents-editing-title").html( + "You are currently creating a new Incident" + ); + $(".manage-incidents-editing-title").data("id", 0); + + $(".manage-incidents-tags-add-btn").css("pointer-events", "auto"); + $(".manage-incidents-reports-content").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-officers-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-civilians-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-evidence-add-btn").css( + "pointer-events", + "auto" + ); + $(".associated-incidents-tags-add-btn").css( + "pointer-events", + "auto" + ); + } + ); + $(".tags-add-btn").click(function () { + if ($(".manage-profile-citizenid-input").val()) { + if (canInputTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".tags-holder").prepend( + `` + ); + canInputTag = false; + } else if (!canInputTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".tag-input").remove(); + canInputTag = true; + } + } else { + $(this).effect("shake", { times: 2, distance: 2 }, 500); + } + }); + + $(".tags-holder").on("keydown", ".tag-input", function (e) { + if (e.keyCode === 13) { + addTag($(".tag-input").text()); + if ($(".tags-add-btn").hasClass("fa-minus")) { + $(".tags-add-btn").removeClass("fa-minus").addClass("fa-plus"); + } + $(".tag-input").remove(); + } + }); + $(".contextmenu").on("click", ".search-vehicle", function () { + let plate = $(this).data("info"); + fidgetSpinner(".dmv-page-container"); + currentTab = ".dmv-page-container"; + setTimeout(() => { + $(".dmv-search-input").slideDown(250); + $(".dmv-search-input").css("display", "block"); + setTimeout(() => { + $("#dmv-search-input:text").val(plate.toString()); + setTimeout(() => { + var e = jQuery.Event("keydown"); + e.which = 13; // # Some key code value + e.keyCode = 13 + $("#dmv-search-input").trigger(e); + }, 250); + }, 250); + }, 250); + }); + $(".vehs-holder").on("contextmenu", ".veh-tag", function (e) { + let args = [ + { + className: "search-vehicle", + icon: "fas fa-car", + text: "Search Vehicle", + info: $(this).data("plate"), + status: "", + }, + ]; + openContextMenu(e, args); + }); + + $(".contextmenu").on("click", ".make-waypoint", function () { + let coord = $(this).data("info").split("===") + setTimeout(() => { + $.post( + `https://${GetParentResourceName()}/SetHouseLocation`, + JSON.stringify({ + coord: coord, + }) + ); + }, 250); + }); + $(".houses-holder").on("contextmenu", ".white-tag", function (e) { + let args = [ + { + className: "make-waypoint", + icon: "fas fa-map-pin", + text: "Make Waypoint", + info: $(this).data("location"), + status: "", + }, + ]; + openContextMenu(e, args); + }); + $(".gallery-inner-container").on("click", ".gallery-img", function () { + if ($(this).css("filter") == "none") { + $(this).css("filter", "blur(5px)"); + } else { + $(this).css("filter", "none"); + } + }); + $(".contextmenu").on("click", ".expand-image", function () { + expandImage($(this).data("info")); + }); + $(".contextmenu").on("click", ".remove-image", function () { + removeImage($(this).data("info")); + }); + $(".contextmenu").on("click", ".remove-image-incident", function () { + $(".manage-incidents-evidence-holder img") + .filter("[src='" + $(this).data("info") + "']") + .remove(); + }); + $(".gallery-inner-container").on( + "contextmenu", + ".gallery-img", + function (e) { + let args = [ + { + className: "remove-image", + icon: "fas fa-times", + text: "Remove Image", + info: $(this).attr("src"), + status: "", + }, + { + className: "expand-image", + icon: "fas fa-expand", + text: "Expand Image", + info: $(this).attr("src"), + status: $(this).css("filter"), + }, + ]; + openContextMenu(e, args); + } + ); + + $(".licenses-holder").on("contextmenu", ".license-tag", function (e) { + const status = $(this).data("type"); + let type = $(this).html(); + + if (type == "Theory") { + info = "theory"; + } else if (type == "Car") { + info = "drive"; + } else if (type == "Bike") { + info = "drive_bike"; + } else if (type == "Truck") { + info = "drive_truck"; + } else if (type == "Hunting") { + info = "hunting"; + } else if (type == "Pilot") { + info = "pilot"; + } else if (type == "Weapon") { + info = "weapon"; + } else { + info = type; + } + + if ($(this).hasClass("green-tag")) { + openContextMenu(e, [ + { + className: "revoke-licence", + icon: "fas fa-times", + text: "Revoke License", + info: info, + status: status, + }, + ]); + } else if ($(this).hasClass("red-tag")) { + openContextMenu(e, [ + { + className: "give-licence", + icon: "fas fa-check", + text: "Give License", + info: info, + status: status, + }, + ]); + } + }); + + $(".contextmenu").on("click", ".revoke-licence", function () { + // $.post( + // `https://${GetParentResourceName()}/updateLicence`, + // JSON.stringify({ + // cid: $(".manage-profile-citizenid-input").val(), + // type: $(this).data("status"), + // status: "revoke", + // }) + // ); + + const Elem = $(this).data("status"); + $(".license-tag") + .filter(`[data-type="${Elem}"]`) + .removeClass("green-tag") + .addClass("red-tag"); + + onMouseDown(); + }); + + $(".contextmenu").on("click", ".give-licence", function () { + // $.post( + // `https://${GetParentResourceName()}/updateLicence`, + // JSON.stringify({ + // cid: $(".manage-profile-citizenid-input").val(), + // type: $(this).data("status"), + // status: "give", + // }) + // ); + + const Elem = $(this).data("status"); + $(".license-tag") + .filter(`[data-type="${Elem}"]`) + .removeClass("red-tag") + .addClass("green-tag"); + + onMouseDown(); + }); + + $(".profile-title").click(function () { + if (canSearchForProfiles == true) { + if ($(".profile-search-input").css("display") == "none") { + $(".profile-search-input").slideDown(250); + $(".profile-search-input").css("display", "block"); + } else { + $(".profile-search-input").slideUp(250); + setTimeout(() => { + $(".profile-search-input").css("display", "none"); + }, 250); + } + } + }); + + $("#profile-search-input").keydown(async function (e) { + if (e.keyCode === 13 && canSearchForProfiles == true) { + let name = $("#profile-search-input").val(); + if (name != "") { + canSearchForProfiles = false; + $(".profile-items").empty(); + $(".profile-items").prepend( + `
` + ); + + let result = await $.post( + `https://${GetParentResourceName()}/searchProfiles`, + JSON.stringify({ + name: name, + }) + ); + + searchProfilesResults(result); + } + } + }); + + $(".incidents-title").click(function () { + if (canSearchForProfiles == true) { + if ($(".incidents-search-input").css("display") == "none") { + $(".incidents-search-input").slideDown(250); + $(".incidents-search-input").css("display", "block"); + } else { + $(".incidents-search-input").slideUp(250); + setTimeout(() => { + $(".incidents-search-input").css("display", "none"); + }, 250); + } + } + }); + + $("#incidents-search-input").keydown(function (e) { + if (e.keyCode === 13 && canSearchForProfiles == true) { + let incident = $("#incidents-search-input").val(); + if (incident !== "") { + canSearchForProfiles = false; + $.post( + `https://${GetParentResourceName()}/searchIncidents`, + JSON.stringify({ + incident: incident, + }) + ); + $(".incidents-items").empty(); + $(".incidents-items").prepend( + `
` + ); + } + } + }); + + $("#dispatchmsg").keydown(function (e) { + const keyCode = e.which || e.keyCode; + if (keyCode === 13 && !e.shiftKey) { + e.preventDefault(); + const time = new Date(); + $.post( + `https://${GetParentResourceName()}/dispatchMessage`, + JSON.stringify({ + message: $(this).val(), + time: time.getTime(), + }) + ); + $(this).val(""); + } + }); + + $(".incidents-items").on("click", ".incidents-item", function () { + const id = $(this).data("id"); + $.post( + `https://${GetParentResourceName()}/getIncidentData`, + JSON.stringify({ + id: id, + }) + ); + }); + $(".manage-incidents-civilians-holder").on("click", ".manage-incidents-civilians", async function () { + const name = $(this).text(); + fidgetSpinner(".profile-page-container"); + currentTab = ".profile-page-container"; + $(".profile-search-input").slideDown(250); + $(".profile-search-input").css("display", "block"); + $("#profile-search-input:text").val(name); + canSearchForProfiles = false; + let result = await $.post( + `https://${GetParentResourceName()}/searchProfiles`, + JSON.stringify({ + name: name, + }) + ); + + searchProfilesResults(result); + } + ); + document.onkeyup = function (data) { + if (data.which == 27) { + let shouldClose = true; + + if ($(".respond-calls-container").css("display") == "block") { + shouldClose = false; + $(".respond-calls-container").fadeOut(500); + setTimeout(() => { + $(".close-all").css("filter", "none"); + }, 250); + } + + if ($(".gallery-image-enlarged").css("display") == "block") { + shouldClose = false; + $(".gallery-image-enlarged").fadeOut(150); + $(".gallery-image-enlarged").css("display", "none"); + $(".close-all").css("filter", "none"); + } + + if ($(".incidents-image-enlarged").css("display") == "block") { + shouldClose = false; + $(".incidents-image-enlarged").fadeOut(150); + $(".incidents-image-enlarged").css("display", "none"); + } + + if ( + $(".icidents-person-search-container").css("display") != "none" + ) { + shouldClose = false; + $(".icidents-person-search-container").fadeOut(250); + $(".close-all").css("filter", "none"); + } + + if ($(".incidents-charges-table").css("display") != "none") { + shouldClose = false; + $(".incidents-charges-table").slideUp(500); + $(".incidents-charges-table").fadeOut(500); + setTimeout(() => { + $(".close-all").css("filter", "none"); + }, 550); + } + + if ($(".dispatch-attached-units").css("display") != "none") { + shouldClose = false; + $(".dispatch-attached-units").slideUp(500); + $(".dispatch-attached-units").fadeOut(500); + setTimeout(() => { + $(".close-all").css("filter", "none"); + }, 550); + } + + if ($(".impound-form").css("display") != "none") { + shouldClose = false; + $(".impound-form").slideUp(250); + $(".impound-form").fadeOut(250); + setTimeout(() => { + $(".close-all").css("filter", "none"); + }, 550); + } + + if (shouldClose == true) { + $.post(`https://${GetParentResourceName()}/escape`, JSON.stringify({})); + } + } + }; + $(".manage-incidents-tags-add-btn").click(function () { + if ($(".tag-incident-input")[0]) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".tag-incident-input").remove(); + } else { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-incidents-tags-holder").prepend( + `` + ); + } + }); + + $(".icidents-person-search-name-input").on("keydown", "", function (e) { + if (e.keyCode === 13) { + let name = $(".icidents-person-search-name-input").val(); + $.post( + `https://${GetParentResourceName()}/incidentSearchPerson`, + JSON.stringify({ + name: name, + }) + ); + } + }); + $(".manage-incidents-tags-holder").on( + "keydown", + ".tag-incident-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-incidents-tags-holder").prepend( + `
${$( + ".tag-incident-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".manage-incidents-tags-add-btn").hasClass("fa-minus")) { + $(".manage-incidents-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".tag-incident-input").remove(); + } + } + ); + + $(".manage-incidents-officers-add-btn").click(function () { + if ($(".officers-incident-input")[0]) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".officers-incident-input").remove(); + } else { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-incidents-officers-holder").prepend( + `` + ); + } + }); + + $(".manage-incidents-officers-holder").on( + "keydown", + ".officers-incident-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-incidents-officers-holder").prepend( + `
${$( + ".officers-incident-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ( + $(".manage-incidents-officers-add-btn").hasClass("fa-minus") + ) { + $(".manage-incidents-officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".officers-incident-input").remove(); + } + } + ); + + $(".manage-incidents-civilians-add-btn").click(function () { + if ($(".civilians-incident-input")[0]) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".civilians-incident-input").remove(); + } else { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-incidents-civilians-holder").prepend( + `` + ); + } + }); + + $(".manage-incidents-civilians-holder").on( + "keydown", + ".civilians-incident-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-incidents-civilians-holder").prepend( + `
${$( + ".civilians-incident-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ( + $(".manage-incidents-civilians-add-btn").hasClass( + "fa-minus" + ) + ) { + $(".manage-incidents-civilians-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".civilians-incident-input").remove(); + } + } + ); + + $(".manage-incidents-evidence-add-btn").click(function () { + if ($(".incidents-upload-input").css("display") == "none") { + $(".incidents-upload-input").slideDown(250); + $(".incidents-upload-input").css("display", "block"); + $(this).removeClass("fa-plus").addClass("fa-minus"); + } else { + $(".incidents-upload-input").slideUp(250); + setTimeout(() => { + $(".incidents-upload-input").css("display", "none"); + }, 250); + $(this).removeClass("fa-minus").addClass("fa-plus"); + } + }); + + $("#incidents-upload-input").keydown(function (e) { + if (e.keyCode === 13) { + let URL = $("#incidents-upload-input").val(); + let cid = $(".manage-profile-citizenid-input").val(); + if (URL !== "") { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".manage-incidents-evidence-holder").prepend( + `` + ); + $("#incidents-upload-input").val(""); + $(".incidents-upload-input").slideUp(250); + setTimeout(() => { + $(".incidents-upload-input").css("display", "none"); + }, 250); + $(".manage-incidents-evidence-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + } + }); + + $(".manage-incidents-evidence-holder").on( + "click", + ".incidents-img", + function () { + if ($(this).css("filter") == "none") { + $(this).css("filter", "blur(5px)"); + } else { + $(this).css("filter", "none"); + } + } + ); + + $(".manage-bolos-title-holder").on( + "click", + ".manage-bolos-new", + function () { + //if ($(".manage-bolos-editing-title").html() == 'You are currently creating a new BOLO') { + //$(".manage-bolos-new").effect("shake", { times: 2, distance: 2 }, 500) + //} else { + var template = ""; + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + template = + "ICU Room #: [ # ]\n\nReport ID: [ Report ID ]\n\nTime Admitted: [ Date and Time Here ]\n\nSurgery: [Yes/No]\n\nInjuries/Ailments:\n - [ Enter List Of Injuries Here ]\n\n\nAdditional Attending:\n - [ List Any Other Staff Here ]\n\n\n🧑‍🤝‍🧑 Additonal Emergency Contacts:\n - [ Name And Number ]\n\n\nNotes:\n[Additional Notes Here]"; + } + $(".manage-bolos-editing-title").html( + "You are currently creating a new BOLO" + ); + $(".manage-bolos-input-title").val(""); + $(".manage-bolos-input-plate").val(""); + $(".manage-bolos-input-owner").val(""); + $(".manage-bolos-input-individual").val(""); + $(".manage-bolos-reports-content").val(template); + $(".manage-bolos-tags-holder").empty(); + $(".bolo-gallery-inner-container").empty(); + $(".manage-officers-tags-holder").empty(); + + if ($(".manage-bolos-tags-add-btn").hasClass("fa-minus")) { + $(".manage-bolos-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".bolo-gallery-add-btn").hasClass("fa-minus")) { + $(".bolo-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".officers-add-btn").hasClass("fa-minus")) { + $(".officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + + if ($(".bolo-gallery-upload-input").css("display") == "block") { + $(".bolo-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".bolo-gallery-upload-input").css("display", "none"); + }, 250); + } + + canInputTag = true; + canInputBoloTag = true; + canInputBoloOfficerTag = true; + + $(".tag-bolo-input").remove(); + canInputBoloTag = true; + + //} + } + ); + + $(".manage-bolos-title-holder").on( + "click", + ".manage-bolos-save", + function () { + let existing = !( + $(".manage-bolos-editing-title").html() == + "You are currently creating a new BOLO" + ); + let id = $(".manage-bolos-editing-title").data("id"); + let title = $("#bolotitle").val(); + let plate = $("#boloplate").val(); + let owner = $("#boloowner").val(); + let individual = $("#boloindividual").val(); + let detail = $("#bolodetail").val(); + + let tags = new Array(); + let gallery = new Array(); + let officers = new Array(); + + $(".manage-bolos-tags-holder").each(function (index) { + if ($(this).text() != "") { + tags.push($(this).text()); + } + }); + + $(".bolo-gallery-inner-container").each(function (index) { + if ($(this).text() != "") { + gallery.push($(this).text()); + } + }); + + $(".manage-officers-tags-holder").each(function (index) { + if ($(this).text() != "") { + officers.push($(this).text()); + } + }); + + let time = new Date(); + + $.post( + `https://${GetParentResourceName()}/newBolo`, + JSON.stringify({ + existing: existing, + id: id, + title: title, + plate: plate, + owner: owner, + individual: individual, + detail: detail, + tags: tags, + gallery: gallery, + officers: officers, + time: time.getTime(), + }) + ); + } + ); + + $(".manage-incidents-evidence-holder").on( + "contextmenu", + ".incidents-img", + function (e) { + let args = [ + { + className: "remove-image-incident", + icon: "fas fa-times", + text: "Remove Image", + info: $(this).attr("src"), + status: "", + }, + { + className: "expand-image", + icon: "fas fa-expand", + text: "Expand Image", + info: $(this).attr("src"), + status: $(this).css("filter"), + }, + ]; + openContextMenu(e, args); + } + ); + + $(".bolos-search-title").click(function () { + if (canSearchForProfiles == true) { + if ($(".bolos-search-input").css("display") == "none") { + $(".bolos-search-input").slideDown(250); + $(".bolos-search-input").css("display", "block"); + } else { + $(".bolos-search-input").slideUp(250); + setTimeout(() => { + $(".bolos-search-input").css("display", "none"); + }, 250); + } + } + }); + + $("#bolos-search-input").keydown(function (e) { + if (e.keyCode === 13 && canSearchForProfiles == true) { + let searchVal = $("#bolos-search-input").val(); + if (searchVal !== "") { + canSearchForProfiles = false; + $.post( + `https://${GetParentResourceName()}/searchBolos`, + JSON.stringify({ + searchVal: searchVal, + }) + ); + $(".bolos-items").empty(); + $(".bolos-items").prepend(`
`); + } + } + }); + + $(".bolos-search-refresh").click(function () { + if (canRefreshBolo == true) { + canRefreshBolo = false; + $(".bolos-search-refresh").empty(); + $(".bolos-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".bolos-search-refresh").empty(); + $(".bolos-search-refresh").html("Refresh"); + canRefreshBolo = true; + $.post(`https://${GetParentResourceName()}/getAllBolos`, JSON.stringify({})); + }, 1500); + } + }); + + $(".manage-bolos-tags-add-btn").click(function () { + if (canInputBoloTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-bolos-tags-holder").prepend( + `` + ); + canInputBoloTag = false; + } else if (!canInputBoloTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".tag-bolo-input").remove(); + canInputBoloTag = true; + } + }); + + $(".manage-bolos-tags-holder").on( + "keydown", + ".tag-bolo-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-bolos-tags-holder").prepend( + `
${$(".tag-bolo-input").text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".manage-bolos-tags-add-btn").hasClass("fa-minus")) { + $(".manage-bolos-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".tag-bolo-input").remove(); + canInputBoloTag = true; + } + } + ); + + $(".bolo-gallery-add-btn").click(function () { + //if ($(".manage-profile-citizenid-input").val()) { + if ($(".bolo-gallery-upload-input").css("display") == "none") { + $(".bolo-gallery-upload-input").slideDown(250); + $(".bolo-gallery-upload-input").css("display", "block"); + $(this).removeClass("fa-plus").addClass("fa-minus"); + } else { + $(".bolo-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".bolo-gallery-upload-input").css("display", "none"); + }, 250); + $(this).removeClass("fa-minus").addClass("fa-plus"); + } + //} else { + // $(this).effect("shake", { times: 2, distance: 2 }, 500) + // } + }); + + $("#bolo-gallery-upload-input").keydown(function (e) { + if (e.keyCode === 13) { + let URL = $("#bolo-gallery-upload-input").val(); + let cid = $(".manage-profile-citizenid-input").val(); + if (URL !== "") { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".bolo-gallery-inner-container").prepend( + `` + ); + $("#bolo-gallery-upload-input").val(""); + $(".bolo-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".bolo-gallery-upload-input").css("display", "none"); + }, 250); + $(".bolo-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + } + }); + + $(".bolos-items").on("click", ".bolo-item", function () { + if ($(".manage-bolos-tags-add-btn").hasClass("fa-minus")) { + $(".manage-bolos-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".bolo-gallery-add-btn").hasClass("fa-minus")) { + $(".bolo-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".officers-add-btn").hasClass("fa-minus")) { + $(".officers-add-btn").removeClass("fa-minus").addClass("fa-plus"); + } + + if ($(".bolo-gallery-upload-input").css("display") == "block") { + $(".bolo-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".bolo-gallery-upload-input").css("display", "none"); + }, 250); + } + + canInputTag = true; + canInputBoloTag = true; + canInputBoloOfficerTag = true; + let id = $(this).data("id"); + $.post( + `https://${GetParentResourceName()}/getBoloData`, + JSON.stringify({ + id: id, + }) + ); + }); + + $(".contextmenu").on("click", ".bolo-delete", function () { + if ($(this).data("info") != 0) { + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + $(".bolos-items") + .find("[data-id='" + $(this).data("info") + "']") + .remove(); + $.post( + `https://${GetParentResourceName()}/deleteICU`, + JSON.stringify({ + id: $(this).data("info"), + }) + ); + } + $(".bolos-items") + .find("[data-id='" + $(this).data("info") + "']") + .remove(); + $.post( + `https://${GetParentResourceName()}/deleteBolo`, + JSON.stringify({ + id: $(this).data("info"), + }) + ); + } + }); + + $(".bolos-items").on("contextmenu", ".bolo-item", function (e) { + var args = ""; + args = [ + { + className: "bolo-delete", + icon: "fas fa-times", + text: "Delete Bolo", + info: $(this).data("id"), + status: "", + }, + ]; + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + args = [ + { + className: "bolo-delete", + icon: "fas fa-times", + text: "Delete Check-In", + info: $(this).data("id"), + status: "", + }, + ]; + } + openContextMenu(e, args); + }); + $(".incidents-ghost-holder").on( + "contextmenu", + ".associated-incidents-user-holder", + function (e) { + let args = [ + { + className: "add-charge", + icon: "fas fa-check", + text: "Add Charge", + info: $(this).data("name"), + status: "", + }, + ]; + openContextMenu(e, args); + } + ); + $(".contextmenu").on("click", ".add-charge", function () { + let stupidasscid = $(this).data("info"); + $(".incidents-charges-table").slideDown(500); + $(".incidents-charges-table").fadeIn(500); + $("#current-charges-holder").data("cid", $(this).data("info")); + $("#current-charges-holder").html(""); + $(".associated-incidents-user-holder") + .children("div") + .each(function (index) { + if ( + $(".associated-incidents-user-holder") + .children() + .eq(index) + .data("id") == stupidasscid + ) { + const randomNum = Math.ceil( + Math.random() * 1000 + ).toString(); + $("#current-charges-holder").prepend( + `
${$( + ".associated-incidents-user-holder" + ) + .children() + .eq(index) + .html()}
` + ); + } + }); + setTimeout(() => { + $(".close-all").css("filter", "brightness(30%)"); + }, 250); + $.post(`https://${GetParentResourceName()}/getPenalCode`, JSON.stringify({})); + }); + + var shiftPressed = false; + $(document).keydown(function (event) { + shiftPressed = event.keyCode == 16; + }); + $(document).keyup(function (event) { + if (event.keyCode == 16) { + shiftPressed = false; + } + }); + + $(".offenses-main-container").on( + "mousedown", + ".offense-item", + function (e) { + const cid = $("#current-charges-holder").data("cid"); + const newItem = $(this).find(".offense-item-offense").html(); + const Fine = +$(this).data("fine"); + const Sentence = +$(this).data("sentence"); + if (e.which == 1) { + let randomNum = Math.ceil(Math.random() * 1000).toString(); + $(`[data-name="${cid}"]`).prepend( + `
${$( + this + ) + .find(".offense-item-offense") + .html()}
` + ); + $("#current-charges-holder").prepend( + `
${$( + this + ) + .find(".offense-item-offense") + .html()}
` + ); + + const CurrRfine = $(".fine-recommended-amount").val(); + const NewFine = +CurrRfine + +Fine; + $(".fine-recommended-amount").val(NewFine); + const CurrRsentence = $(".sentence-recommended-amount").val(); + const NewSentence = +CurrRsentence + +Sentence; + $(".sentence-recommended-amount").val(NewSentence); + } else if (e.which == 3) { + $(".associated-incidents-user-holder") + .children("div") + .each(function (index) { + if ( + $(".associated-incidents-user-holder") + .children() + .eq(index) + .data("id") == cid + ) { + if ( + $(".associated-incidents-user-holder") + .children() + .eq(index) + .html() == newItem + ) { + const linkedId = $( + ".associated-incidents-user-holder" + ) + .children() + .eq(index) + .data("link"); + //$(".current-charges-tag").filter(`[data-link="${linkedId}"]`).remove() + $(".white-tag") + .filter(`[data-link="${linkedId}"]`) + .remove(); + + var stop = false; + + $("#current-charges-holder") + .children("div") + .each(function (index) { + if (stop == false) { + if ( + $("#current-charges-holder") + .children() + .eq(index) + .html() == newItem + ) { + const linkedId = $( + "#current-charges-holder" + ) + .children() + .eq(index) + .data("link"); + $(".current-charges-tag") + .filter( + `[data-link="${linkedId}"]` + ) + .remove(); + stop = true; + } + } + }); + + const CurrRfine = $( + ".fine-recommended-amount" + ).val(); + const NewFine = +CurrRfine - Fine; + $(".fine-recommended-amount").val(NewFine); + // + const CurrRsentence = $( + ".sentence-recommended-amount" + ).val(); + const NewSentence = +CurrRsentence - +Sentence; + $(".sentence-recommended-amount").val( + NewSentence + ); + + return false; + } + } + }); + } + } + ); + + $(".bolo-gallery-inner-container").on("click", ".bolo-img", function () { + if ($(this).css("filter") == "none") { + $(this).css("filter", "blur(5px)"); + } else { + $(this).css("filter", "none"); + } + }); + $(".contextmenu").on("click", ".bolo-remove-image", function () { + $(".bolo-gallery-inner-container img") + .filter("[src='" + $(this).data("info") + "']") + .remove(); + }); + $(".bolo-gallery-inner-container").on( + "contextmenu", + ".bolo-img", + function (e) { + let args = [ + { + className: "bolo-remove-image", + icon: "fas fa-times", + text: "Remove Image", + info: $(this).attr("src"), + status: "", + }, + { + className: "expand-image", + icon: "fas fa-expand", + text: "Expand Image", + info: $(this).attr("src"), + status: $(this).css("filter"), + }, + ]; + openContextMenu(e, args); + } + ); + + $(".officers-add-btn").click(function () { + if (canInputBoloOfficerTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-officers-tags-holder").prepend( + `` + ); + canInputBoloOfficerTag = false; + } else if (!canInputBoloOfficerTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".officer-tag-bolo-input").remove(); + canInputBoloOfficerTag = true; + } + }); + + $(".manage-officers-tags-holder").on( + "keydown", + ".officer-tag-bolo-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-officers-tags-holder").prepend( + `
${$( + ".officer-tag-bolo-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".officers-add-btn").hasClass("fa-minus")) { + canInputBoloOfficerTag = true; + $(".officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + canInputBoloOfficerTag = true; + $(".officer-tag-bolo-input").remove(); + } + } + ); + $(".incidents-ghost-holder").on( + "click", + ".associated-incidents-user-tag", + function () { + if ($(this).hasClass("red-tag")) { + $(this).removeClass("red-tag"); + $(this).addClass("green-tag"); + if ($(this).text() == "Associated") { + $(".associated-incidents-user-holder") + .filter(`[data-name="${$(this).data("id")}"]`) + .css("display", "none"); + $(".associated-incidents-fine-input") + .filter(`[data-id="${$(this).data("id")}"]`) + .css("display", "none"); + $(".manage-incidents-title-tag") + .filter(`[data-id="${$(this).data("id")}"]`) + .css("display", "none"); + $(".associated-incidents-sentence-input") + .filter(`[data-id="${$(this).data("id")}"]`) + .css("display", "none"); + } + } else { + $(this).removeClass("green-tag"); + $(this).addClass("red-tag"); + if ($(this).text() == "Associated") { + $(".associated-incidents-user-holder") + .filter(`[data-name="${$(this).data("id")}"]`) + .fadeIn(100); + $(".associated-incidents-fine-input") + .filter(`[data-id="${$(this).data("id")}"]`) + .fadeIn(100); + $(".manage-incidents-title-tag") + .filter(`[data-id="${$(this).data("id")}"]`) + .fadeIn(100); + $(".associated-incidents-sentence-input") + .filter(`[data-id="${$(this).data("id")}"]`) + .fadeIn(100); + } + } + } + ); + $(".contextmenu").on( + "click", + ".associated-incidents-remove-tag", + function () { + $( + `.associated-incidents-tag:contains(${$(this).data("info")})` + ).remove(); + $( + `.associated-incidents-user-title:contains(${$(this).data( + "info" + )})` + ) + .parent() + .remove(); + const incidentId = $(".manage-incidents-editing-title").data("id"); + if (incidentId != 0) { + $.post( + `https://${GetParentResourceName()}/removeIncidentCriminal`, + JSON.stringify({ + cid: $(this).data("status"), + incidentId: incidentId, + }) + ); + } + } + ); + $(".associated-incidents-tags-holder").on( + "contextmenu", + ".associated-incidents-tag", + function (e) { + let args = [ + { + className: "associated-incidents-remove-tag", + icon: "fas fa-times", + text: "Remove Tag", + info: $(this).html(), + status: $(this).data("id"), + }, + ]; + openContextMenu(e, args); + } + ); + $(".icidents-person-search-holder").on( + "click", + ".icidents-person-search-item", + function () { + $(".icidents-person-search-container").fadeOut(250); + $(".close-all").css("filter", "none"); + $(".associated-incidents-tags-holder").prepend( + `
${$(this).data("name")}
` + ); + + $(".incidents-ghost-holder").prepend( + ` +
+
${$(this).data( + "info" + )}
+
+
Warrant
+
Guilty
+
Processed
+
Associated
+
+
+
+
Recommended Fine
+
+
Recommended Sentence
+
+
Fine
+
+
Sentence
+
+
+ ` + ); + } + ); + + $(".contextmenu").on("click", ".incidents-remove-tag", function () { + $(`.tag:contains(${$(this).data("info")})`).remove(); + }); + + $(".manage-incidents-tags-holder").on("contextmenu", ".tag", function (e) { + let args = [ + { + className: "incidents-remove-tag", + icon: "fas fa-times", + text: "Remove Tag", + info: $(this).html(), + status: "", + }, + ]; + openContextMenu(e, args); + }); + + $(".contextmenu").on("click", ".incidents-remove-officer-tag", function () { + $( + `.manage-incidents-officers:contains(${$(this).data("info")})` + ).remove(); + }); + + $(".manage-incidents-officers-holder").on( + "contextmenu", + ".manage-incidents-officers", + function (e) { + let args = [ + { + className: "incidents-remove-officer-tag", + icon: "fas fa-times", + text: "Remove Tag", + info: $(this).html(), + status: "", + }, + ]; + openContextMenu(e, args); + } + ); + + $(".contextmenu").on("click", ".incidents-remove-civ-tag", function () { + $( + `.manage-incidents-civilians:contains(${$(this).data("info")})` + ).remove(); + }); + + $(".manage-incidents-civilians-holder").on( + "contextmenu", + ".manage-incidents-civilians", + function (e) { + let args = [ + { + className: "incidents-remove-civ-tag", + icon: "fas fa-times", + text: "Remove Tag", + info: $(this).html(), + status: "", + }, + ]; + openContextMenu(e, args); + } + ); + + $(".incidents-search-refresh").click(function () { + if (canRefreshIncidents == true) { + canRefreshIncidents = false; + $(".incidents-search-refresh").empty(); + $(".incidents-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".incidents-search-refresh").empty(); + $(".incidents-search-refresh").html("Refresh"); + canRefreshIncidents = true; + $.post(`https://${GetParentResourceName()}/getAllIncidents`, JSON.stringify({})); + }, 1500); + } + }); + + $(".contextmenu").on("click", ".incidents-remove-normal-tag", function () { + $(`.tag:contains(${$(this).data("info")})`).remove(); + let cid = $(".manage-profile-citizenid-input").val(); + if (cid) { + $.post( + `https://${GetParentResourceName()}/removeProfileTag`, + JSON.stringify({ + cid: cid, + text: $(this).data("info"), + }) + ); + } + }); + $(".tags-holder").on("contextmenu", ".tag", function (e) { + let args = [ + { + className: "incidents-remove-normal-tag", + icon: "fas fa-times", + text: "Remove Tag", + info: $(this).html(), + status: "", + }, + ]; + openContextMenu(e, args); + }); + $(".reports-search-title").click(function () { + if (canSearchReports == true) { + if ($(".reports-search-input").css("display") == "none") { + $(".reports-search-input").slideDown(250); + $(".reports-search-input").css("display", "block"); + } else { + $(".reports-search-input").slideUp(250); + setTimeout(() => { + $(".reports-search-input").css("display", "none"); + }, 250); + } + } + }); + $(".icidents-person-search-container").hover( + function () { + mouse_is_inside = true; + }, + function () { + mouse_is_inside = false; + } + ); + + $(".reports-search-refresh").click(function () { + if (canRefreshReports == true) { + canRefreshReports = false; + $(".reports-search-refresh").empty(); + $(".reports-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".reports-search-refresh").empty(); + $(".reports-search-refresh").html("Refresh"); + canRefreshReports = true; + $.post(`https://${GetParentResourceName()}/getAllReports`, JSON.stringify({})); + }, 1500); + } + }); + + $(".dispatch-comms-refresh").click(function () { + $(".dispatch-comms-refresh").empty(); + $(".dispatch-comms-refresh").prepend( + `` + ); + setTimeout(() => { + $(".dispatch-comms-refresh").empty(); + $(".dispatch-comms-refresh").html("Refresh"); + canRefreshReports = true; + $.post(`https://${GetParentResourceName()}/refreshDispatchMsgs`, JSON.stringify({})); + }, 1500); + }); + + $(".reports-items").on("click", ".reports-item", function () { + if (currentTab != ".reports-page-container") { + fidgetSpinner(".reports-page-container"); + currentTab = ".reports-page-container"; + } + + if ($(".manage-reports-tags-add-btn").hasClass("fa-minus")) { + $(".manage-reports-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".reports-gallery-add-btn").hasClass("fa-minus")) { + $(".reports-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".reports-officers-add-btn").hasClass("fa-minus")) { + $(".reports-officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + + if ($(".reports-gallery-upload-input").css("display") == "block") { + $(".reports-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".reports-gallery-upload-input").css("display", "none"); + }, 250); + } + + canInputTag = true; + canInputReportTag = true; + canInputReportOfficerTag = true; + let id = $(this).data("id"); + $.post( + `https://${GetParentResourceName()}/getReportData`, + JSON.stringify({ + id: id, + }) + ); + }); + + $(".manage-reports-tags-add-btn").click(function () { + if (canInputReportTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".manage-reports-tags-holder").prepend( + `` + ); + canInputReportTag = false; + } else if (!canInputReportTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".tag-reports-input").remove(); + canInputReportTag = true; + } + }); + + $(".manage-reports-tags-holder").on( + "keydown", + ".tag-reports-input", + function (e) { + if (e.keyCode === 13) { + $(".manage-reports-tags-holder").prepend( + `
${$(".tag-reports-input").text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".manage-reports-tags-add-btn").hasClass("fa-minus")) { + $(".manage-reports-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + $(".tag-reports-input").remove(); + canInputReportTag = true; + } + } + ); + + $(".reports-gallery-add-btn").click(function () { + //if ($(".manage-profile-citizenid-input").val()) { + if ($(".reports-gallery-upload-input").css("display") == "none") { + $(".reports-gallery-upload-input").slideDown(250); + $(".reports-gallery-upload-input").css("display", "block"); + $(this).removeClass("fa-plus").addClass("fa-minus"); + } else { + $(".reports-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".reports-gallery-upload-input").css("display", "none"); + }, 250); + $(this).removeClass("fa-minus").addClass("fa-plus"); + } + //} else { + // $(this).effect("shake", { times: 2, distance: 2 }, 500) + // } + }); + + $("#reports-gallery-upload-input").keydown(function (e) { + if (e.keyCode === 13) { + let URL = $("#reports-gallery-upload-input").val(); + let cid = $(".manage-profile-citizenid-input").val(); + if (URL !== "") { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".reports-gallery-inner-container").prepend( + `` + ); + $("#reports-gallery-upload-input").val(""); + $(".reports-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".reports-gallery-upload-input").css("display", "none"); + }, 250); + $(".reports-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + } + }); + + $(".reports-gallery-inner-container").on( + "click", + ".reports-img", + function () { + if ($(this).css("filter") == "none") { + $(this).css("filter", "blur(5px)"); + } else { + $(this).css("filter", "none"); + } + } + ); + $(".contextmenu").on("click", ".reports-remove-image", function () { + $(".reports-gallery-inner-container img") + .filter("[src='" + $(this).data("info") + "']") + .remove(); + }); + + $(".reports-gallery-inner-container").on( + "contextmenu", + ".reports-img", + function (e) { + let args = [ + { + className: "reports-remove-image", + icon: "fas fa-times", + text: "Remove Image", + info: $(this).attr("src"), + status: "", + }, + { + className: "expand-image", + icon: "fas fa-expand", + text: "Expand Image", + info: $(this).attr("src"), + status: $(this).css("filter"), + }, + ]; + openContextMenu(e, args); + } + ); + + $(".reports-officers-add-btn").click(function () { + if (canInputReportOfficerTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".reports-officers-tags-holder").prepend( + `` + ); + canInputReportOfficerTag = false; + } else if (!canInputReportOfficerTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".officer-tag-reports-input").remove(); + canInputReportOfficerTag = true; + } + }); + + $(".reports-officers-tags-holder").on( + "keydown", + ".officer-tag-reports-input", + function (e) { + if (e.keyCode === 13) { + $(".reports-officers-tags-holder").prepend( + `
${$( + ".officer-tag-reports-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".reports-officers-add-btn").hasClass("fa-minus")) { + canInputReportOfficerTag = true; + $(".reports-officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + canInputReportOfficerTag = true; + $(".officer-tag-reports-input").remove(); + } + } + ); + + $(".reports-civilians-add-btn").click(function () { + if (canInputReportCivilianTag) { + $(this).removeClass("fa-plus").addClass("fa-minus"); + $(".reports-civilians-tags-holder").prepend( + `` + ); + canInputReportCivilianTag = false; + } else if (!canInputReportCivilianTag) { + $(this).removeClass("fa-minus").addClass("fa-plus"); + $(".civilian-tag-reports-input").remove(); + canInputReportCivilianTag = true; + } + }); + + $(".reports-civilians-tags-holder").on( + "keydown", + ".civilian-tag-reports-input", + function (e) { + if (e.keyCode === 13) { + $(".reports-civilians-tags-holder").prepend( + `
${$( + ".civilian-tag-reports-input" + ).text()}
` + ); + // Have it save instantly if it's an existing report. + if ($(".reports-civilians-add-btn").hasClass("fa-minus")) { + canInputReportCivilianTag = true; + $(".reports-civilians-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + canInputReportCivilianTag = true; + $(".civilian-tag-reports-input").remove(); + } + } + ); + + $(".manage-reports-title-holder").on( + "click", + ".manage-reports-new", + function () { + //if ($(".manage-bolos-editing-title").html() == 'You are currently creating a new BOLO') { + //$(".manage-bolos-new").effect("shake", { times: 2, distance: 2 }, 500) + //} else { + let template = ""; + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + template = + "Submitted to ICU?: [Yes/No]\n\nIncident Report:\n[ Brief summary of what happened and who did what while on scene. Note anything that stood out about the scene as well as what was done to treat the patient ]\n\n\nList of Injuries:\n- [ State what injury or injuries occurred ]\n\n\n💉 Surgical Report:\n[ Full report on what was done in surgery, list any complications or anything that was found while in operation. Note who was attending and what they did during the surgery. At the end of the report be sure to note the state of the patient after ]\n\n\nAttending:\n- [ List Any Attending Here ]\n\n\nMedications Applied:\n- [ List Any Attending Here ]\n\n\nNotes:\n[ Additional Notes Here ]"; + } + $(".manage-reports-editing-title").html( + "You are currently creating a new report" + ); + $(".manage-reports-input-title").val(""); + $(".manage-reports-input-type").val(""); + $(".manage-reports-reports-content").val(template); + $(".manage-reports-tags-holder").empty(); + $(".reports-gallery-inner-container").empty(); + $(".reports-officers-tags-holder").empty(); + $(".reports-civilians-tags-holder").empty(); + + if ($(".manage-reports-tags-add-btn").hasClass("fa-minus")) { + $(".manage-reports-tags-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".reports-gallery-add-btn").hasClass("fa-minus")) { + $(".reports-gallery-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + if ($(".officers-add-btn").hasClass("fa-minus")) { + $(".officers-add-btn") + .removeClass("fa-minus") + .addClass("fa-plus"); + } + + if ($(".reports-gallery-upload-input").css("display") == "block") { + $(".reports-gallery-upload-input").slideUp(250); + setTimeout(() => { + $(".reports-gallery-upload-input").css("display", "none"); + }, 250); + } + + canInputTag = true; + canInputReportTag = true; + canInputReportOfficerTag = true; + + $(".tag-reports-input").remove(); + canInputReportTag = true; + + //} + } + ); + + $("#reports-search-input").keydown(function (e) { + if (e.keyCode === 13 && canSearchForReports == true) { + let name = $(this).val(); + if (name !== "") { + canSearchForReports = false; + $.post( + `https://${GetParentResourceName()}/searchReports`, + JSON.stringify({ + name: name, + }) + ); + $(".reports-items").empty(); + $(".reports-items").prepend( + `
` + ); + } + } + }); + + $(".manage-reports-title-holder").on( + "click", + ".manage-reports-save", + function () { + let existing = !( + $(".manage-reports-editing-title").html() == + "You are currently creating a new report" + ); + let id = $(".manage-reports-editing-title").data("id"); + let title = $("#reporttitle").val(); + let type = $("#reporttype").val(); + let details = $("#reportdetail").val(); + let tags = new Array(); + let gallery = new Array(); + let officers = new Array(); + let civilians = new Array(); + + $(".manage-reports-tags-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + tags.push($(this).text()); + } + }); + + $(".reports-gallery-inner-container") + .find("img") + .each(function () { + if ($(this).attr("src") != "") { + gallery.push($(this).attr("src")); + } + }); + + $(".reports-officers-tags-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + officers.push($(this).text()); + } + }); + + $(".reports-civilians-tags-holder") + .find("div") + .each(function () { + if ($(this).text() != "") { + civilians.push($(this).text()); + } + }); + + let time = new Date(); + + $.post( + `https://${GetParentResourceName()}/newReport`, + JSON.stringify({ + existing: existing, + id: id, + title: title, + type: type, + details: details, + tags: tags, + gallery: gallery, + officers: officers, + civilians: civilians, + time: time.getTime(), + }) + ); + } + ); + + $(".dmv-search-title").click(function () { + if (canSearchForVehicles == true) { + if ($(".dmv-search-input").css("display") == "none") { + $(".dmv-search-input").slideDown(250); + $(".dmv-search-input").css("display", "block"); + } else { + $(".dmv-search-input").slideUp(250); + setTimeout(() => { + $(".dmv-search-input").css("display", "none"); + }, 250); + } + } + }); + + $("#dmv-search-input").keydown(async function (e) { + if (e.keyCode === 13 && canSearchForVehicles == true) { + let name = $("#dmv-search-input").val(); + if (name !== "") { + canSearchForVehicles = false; + $(".dmv-items").empty(); + $(".dmv-items").prepend(`
`); + + let result = await $.post( + `https://${GetParentResourceName()}/searchVehicles`, + JSON.stringify({ + name: name, + }) + ); + if (result.length === 0) { + $(".dmv-items").html( + ` +
+ +
+
+
No Vehicles Matching that search
+
+
+
+
+
+ ` + ); + canSearchForVehicles = true; + return true; + } + $(".dmv-items").empty(); + + let vehicleHTML = ""; + + result.forEach((value) => { + let paint = value.color; + let impound = "red-tag"; + let bolo = "red-tag"; + let codefive = "red-tag"; + let stolen = "red-tag"; + + if (value.state == 'Impounded') { + impound = "green-tag"; + } + + if (value.bolo) { + bolo = "green-tag"; + } + + if (value.code) { + codefive = "green-tag"; + } + + if (value.stolen) { + stolen = "green-tag"; + } + + vehicleHTML += ` +
+ +
+
+
${value.model}
+
+
${value.colorName}
+
Impound
+
BOLO
+
Stolen
+
Code 5
+
+
+
+
Plate: ${value.plate} · Owner: ${value.owner}
+
+
+
+ `; + }); + + $(".dmv-items").html(vehicleHTML); + + canSearchForVehicles = true; + + } + } + }); + + $(".dmv-items").on("click", ".dmv-item", function () { + $.post( + `https://${GetParentResourceName()}/getVehicleData`, + JSON.stringify({ + plate: $(this).data("plate"), + }) + ); + }); + + $(".vehicle-information-title-holder").on( + "click", + ".vehicle-information-save", + function () { + if (canSaveVehicle) { + canSaveVehicle = false; + $(".vehicle-information-save").empty(); + $(".vehicle-information-save").prepend( + `` + ); + setTimeout(() => { + $(".vehicle-information-save").empty(); + $(".vehicle-information-save").html("Save"); + canSaveVehicle = true; + }, 750); + setTimeout(() => { + let dbid = $(".vehicle-information-title-holder").data( + "dbid" + ); + let plate = $(".vehicle-info-plate-input").val(); + let notes = $(".vehicle-info-content").val(); + + let imageurl = $(".vehicle-info-image").attr("src"); + let newImageurl = $(".vehicle-info-imageurl-input").val(); + if (newImageurl.includes("base64")) { + imageurl = "img/not-found.jpg"; + } else { + imageurl = newImageurl; + } + + let code5 = false; + let code5tag = $(".vehicle-tags").find(".code5-tag"); + if (code5tag.hasClass("green-tag")) { + code5 = true + } + + let stolen = false; + let stolentag = $(".vehicle-tags").find(".stolen-tag"); + if (stolentag.hasClass("green-tag")) { + stolen = true + } + + let impoundInfo = {} + impoundInfo.impoundActive = $(".vehicle-tags").find(".impound-tag").hasClass("green-tag") + impoundInfo.impoundChanged = impoundChanged + if (impoundChanged === true) { + if (impoundInfo.impoundActive === true) { + impoundInfo.plate = $(".impound-plate").val(); + impoundInfo.linkedreport = $(".impound-linkedreport").val(); + impoundInfo.fee = $(".impound-fee").val(); + impoundInfo.time = $(".impound-time").val(); + } + } + + $.post( + `https://${GetParentResourceName()}/saveVehicleInfo`, + JSON.stringify({ + dbid: dbid, + plate: plate, + imageurl: imageurl, + notes: notes, + stolen: stolen, + code5: code5, + impound: impoundInfo, + }) + ); + + impoundChanged = false; + $(".vehicle-info-image").attr("src", newImageurl); + }, 250); + } + } + ); + + $(".contextmenu").on("click", ".mark-code-5", function () { + let tag = $(".vehicle-tags").find(".code5-tag"); + if (tag.hasClass("red-tag")) { + tag.removeClass("red-tag").addClass("green-tag"); + } + }); + + $(".contextmenu").on("click", ".remove-code-5", function () { + let tag = $(".vehicle-tags").find(".code5-tag"); + if (tag.hasClass("green-tag")) { + tag.removeClass("green-tag").addClass("red-tag"); + } + }); + + $(".vehicle-tags").on("contextmenu", ".code5-tag", function (e) { + let plate = $(".vehicle-info-plate-input").val(); + if (plate) { + let args = []; + if ($(this).hasClass("red-tag")) { + args = [ + { + className: "mark-code-5", + icon: "fas fa-check", + text: "Mark as Code 5", + info: plate, + status: "", + }, + ]; + } else { + args = [ + { + className: "remove-code-5", + icon: "fas fa-times", + text: "Remove Code 5 Status", + info: plate, + status: "", + }, + ]; + } + + openContextMenu(e, args); + } + }); + + $(".contextmenu").on("click", ".mark-stolen", function () { + let tag = $(".vehicle-tags").find(".stolen-tag"); + if (tag.hasClass("red-tag")) { + tag.removeClass("red-tag").addClass("green-tag"); + } + }); + + $(".contextmenu").on("click", ".remove-stolen", function () { + let tag = $(".vehicle-tags").find(".stolen-tag"); + if (tag.hasClass("green-tag")) { + tag.removeClass("green-tag").addClass("red-tag"); + } + }); + + $(".vehicle-tags").on("contextmenu", ".stolen-tag", function (e) { + let plate = $(".vehicle-info-plate-input").val(); + if (plate) { + let args = []; + if ($(this).hasClass("red-tag")) { + args = [ + { + className: "mark-stolen", + icon: "fas fa-check", + text: "Mark as Stolen", + info: plate, + status: "", + }, + ]; + } else { + args = [ + { + className: "remove-stolen", + icon: "fas fa-times", + text: "Remove Code 5 Status", + info: plate, + status: "", + }, + ]; + } + + openContextMenu(e, args); + } + }); + + $(".contextmenu").on("click", ".impound-vehicle", function () { + const plate = $(this).data("info"); + $(".impound-linkedreport").val("").removeAttr("disabled"); + $(".impound-fee").val("").removeAttr("disabled"); + $(".impound-time").val("").removeAttr("disabled"); + $(".impound-fee").css("color", "white"); + $(".impound-cancel").html("Cancel"); + $(".impound-submit").fadeIn(250); + $(".impound-form").slideDown(250); + $(".impound-form").fadeIn(250); + $(".impound-form").data("plate", plate); + $(".impound-plate").val(plate); + }); + + $(".impound-submit").click(function () { + const plate = $(".impound-plate").val(); + const linkedreport = $(".impound-linkedreport").val(); + const fee = $(".impound-fee").val(); + const time = $(".impound-time").val(); + + if (!plate || plate === "") { + $(".impound-form").css("border", "1px solid rgb(184, 3, 3)"); + setTimeout(() => { + $(".impound-form").css( + "border", + "1px solid rgb(168, 168, 168)" + ); + }, 500); + return; + } + + if (!linkedreport || linkedreport === "") { + $(".impound-form").css("border", "1px solid rgb(184, 3, 3)"); + setTimeout(() => { + $(".impound-form").css( + "border", + "1px solid rgb(168, 168, 168)" + ); + }, 500); + return; + } + + if (!fee || fee === "") { + $(".impound-form").css("border", "1px solid rgb(184, 3, 3)"); + setTimeout(() => { + $(".impound-form").css( + "border", + "1px solid rgb(168, 168, 168)" + ); + }, 500); + return; + } + + if (!time || time === "") { + $(".impound-form").css("border", "1px solid rgb(184, 3, 3)"); + setTimeout(() => { + $(".impound-form").css( + "border", + "1px solid rgb(168, 168, 168)" + ); + }, 500); + return; + } + + /* $.post( + `https://${GetParentResourceName()}/impoundVehicle`, + JSON.stringify({ + plate: plate, + linkedreport: linkedreport, + fee: fee, + time: time, + }) + ); */ + + //$(".impound-plate").val(""); + //$(".impound-linkedreport").val(""); + //$(".impound-fee").val(""); + //$(".impound-time").val(""); + //$(".impound-fee").css("color", "white"); + + $(".vehicle-tags").find(".impound-tag").addClass("green-tag").removeClass("red-tag"); + + $(".impound-form").slideUp(250); + $(".impound-form").fadeOut(250); + impoundChanged = true; + }); + + $(".impound-cancel").click(function () { + $(".impound-form").slideUp(250); + $(".impound-form").fadeOut(250); + + $(".impound-plate").val(""); + $(".impound-linkedreport").val(""); + $(".impound-fee").val(""); + $(".impound-time").val(""); + $(".impound-fee").css("color", "white"); + }); + + $(".contextmenu").on("click", ".remove-impound", function () { + const plate = $(this).data("info"); + /* $.post( + `https://${GetParentResourceName()}/removeImpound`, + JSON.stringify({ + plate: plate, + }) + ); */ + $(".impound-plate").val(""); + $(".impound-linkedreport").val(""); + $(".impound-fee").val(""); + $(".impound-time").val(""); + impoundChanged = true; + + $(".vehicle-tags") + .find(".impound-tag") + .addClass("red-tag") + .removeClass("green-tag"); + }); + + $(".contextmenu").on("click", ".status-impound", function () { + const plate = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/statusImpound`, + JSON.stringify({ + plate: plate, + }) + ); + }); + + $(".vehicle-tags").on("contextmenu", ".impound-tag", function (e) { + let plate = $(".vehicle-info-plate-input").val(); + if (plate) { + let args = []; + if ($(this).hasClass("red-tag")) { + args = [ + { + className: "impound-vehicle", + icon: "fas fa-check", + text: "State Impound", + info: plate, + status: "", + }, + ]; + } else { + args = [ + { + className: "remove-impound", + icon: "fas fa-times", + text: "Unimpound Vehicle", + info: plate, + status: "", + }, + { + className: "status-impound", + icon: "fas fa-info-circle", + text: "View Impound Status", + info: plate, + status: "", + }, + ]; + } + openContextMenu(e, args); + } + }); + + $(".contextmenu").on("click", ".view-profile", async function () { + const cid = $(this).data("info"); + fidgetSpinner(".profile-page-container"); + currentTab = ".profile-page-container"; + $(".profile-search-input").slideDown(250); + $(".profile-search-input").css("display", "block"); + $("#profile-search-input:text").val(cid.toString()); + canSearchForProfiles = false; + let result = await $.post( + `https://${GetParentResourceName()}/searchProfiles`, + JSON.stringify({ + name: cid, + }) + ); + + searchProfilesResults(result); + }); + + $(".contextmenu").on("click", ".view-incident", function () { + const incidentId = $(this).data("info"); + fidgetSpinner(".incidents-page-container"); + currentTab = ".incidents-page-container"; + setTimeout(() => { + $(".incidents-search-input").slideDown(250); + $(".incidents-search-input").css("display", "block"); + setTimeout(() => { + $("#incidents-search-input:text").val(incidentId.toString()); + canSearchForProfiles = false; + $.post( + `https://${GetParentResourceName()}/searchIncidents`, + JSON.stringify({ + incident: incidentId.toString(), + }) + ); + $(".incidents-items").empty(); + $(".incidents-items").prepend( + `
` + ); + setTimeout(() => { + $.post( + `https://${GetParentResourceName()}/getIncidentData`, + JSON.stringify({ + id: incidentId.toString(), + }) + ); + }, 250); + }, 250); + }, 250); + }); + + $(".warrants-items").on("contextmenu", ".warrants-item", function (e) { + //let information = $(this).html() + //if (information) { + args = [ + { + className: "view-profile", + icon: "far fa-eye", + text: "View Profile", + info: $(this).data("cid"), + status: "", + }, + { + className: "view-incident", + icon: "fas fa-search", + text: "View Incident", + info: $(this).data("id"), + status: "", + }, + ]; + openContextMenu(e, args); + //} + }); + + $(".contextmenu").on("click", ".toggle-duty", function () { + let info = $(this).data("info"); + let currentStatus = $(`[data-id="${info}"]`) + .find(".unit-status") + .html(); + if (currentStatus == "10-8") { + $(`[data-id="${info}"]`).find(".unit-status").html("10-7"); + $(`[data-id="${info}"]`) + .find(".unit-status") + .removeClass("green-status") + .addClass("yellow-status"); + $.post( + `https://${GetParentResourceName()}/toggleDuty`, + JSON.stringify({ + cid: info, + status: 0, + }) + ); + } else if (currentStatus == "10-7") { + $(`[data-id="${info}"]`).find(".unit-status").html("10-8"); + $(`[data-id="${info}"]`) + .find(".unit-status") + .removeClass("yellow-status") + .addClass("green-status"); + $.post( + `https://${GetParentResourceName()}/toggleDuty`, + JSON.stringify({ + cid: info, + status: 1, + }) + ); + } + }); + + $(".contextmenu").on("click", ".set-callsign", function () { + let info = $(this).data("info"); + $(".callsign-container").fadeIn(0); + $(".callsign-inner-container").slideDown(500); + $(".callsign-inner-container").fadeIn(500); + $(".callsign-container").data("id", info); + }); + + $(".contextmenu").on("click", ".set-radio", function () { + let info = $(this).data("info"); + $(".radio-container").fadeIn(0); + $(".radio-inner-container").slideDown(500); + $(".radio-inner-container").fadeIn(500); + $(".radio-container").data("id", info); + }); + + $(".contextmenu").on("click", ".set-waypoint", function () { + let info = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/setWaypointU`, + JSON.stringify({ + cid: info, + }) + ); + }); + + $(".active-unit-list").on("contextmenu", ".active-unit-item", function (e) { + let cid = $(this).data("id"); + if (cid) { + args = [ + { + className: "toggle-duty", + icon: "fas fa-thumbtack", + text: "Toggle Duty", + info: cid, + status: "", + }, + { + className: "set-callsign", + icon: "far fa-id-badge", + text: "Set Callsign", + info: cid, + status: "", + }, + { + className: "set-radio", + icon: "fas fa-broadcast-tower", + text: "Set Radio", + info: cid, + status: "", + }, + { + className: "set-waypoint", + icon: "fas fa-map-marker-alt", + text: "Set Waypoint", + info: cid, + status: "", + }, + ]; + openContextMenu(e, args); + } + }); + + $(".contextmenu").on("click", ".Set-Waypoint", function () { + const callId = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/setWaypoint`, + JSON.stringify({ + callid: callId, + }) + ); + }); + + $(".contextmenu").on("click", ".call-attach", function () { + const callId = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/callAttach`, + JSON.stringify({ + callid: callId, + }) + ); + }); + + $(".contextmenu").on("click", ".call-detach", function () { + const callId = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/callDetach`, + JSON.stringify({ + callid: callId, + }) + ); + }); + + $(".contextmenu").on("click", ".attached-units", function () { + const callId = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/attachedUnits`, + JSON.stringify({ + callid: callId, + }) + ); + }); + + $("#respondcalls").keydown(function (e) { + const keyCode = e.which || e.keyCode; + if (keyCode === 13 && !e.shiftKey) { + const callid = $(".respond-calls-container").data("id"); + e.preventDefault(); + const time = new Date(); + $.post( + `https://${GetParentResourceName()}/sendCallResponse`, + JSON.stringify({ + message: $(this).val(), + time: time.getTime(), + callid: callid, + }) + ); + $(this).val(""); + } + }); + + $(".contextmenu").on("click", ".respond-call", function () { + const callId = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/getCallResponses`, + JSON.stringify({ + callid: callId, + }) + ); + /**$(".respond-calls").fadeIn(0) + $(".respond-calls-container").fadeIn(250) + $(".close-all").css("filter", "brightness(15%)"); + $("#respondcalls").val("")*/ + }); + + $(".active-calls-list").on( + "contextmenu", + ".active-calls-item", + function (e) { + const callId = $(this).data("id"); + const canRespond = $(this).data("canrespond"); + if (callId) { + if (canRespond == true) { + args = [ + { + className: "respond-call", + icon: "fas fa-reply", + text: "Respond to Call", + info: callId, + status: "", + }, + { + className: "attached-units", + icon: "fas fa-link", + text: "Attached Units", + info: callId, + status: "", + }, + { + className: "call-detach", + icon: "fas fa-sign-out-alt", + text: "Detach", + info: callId, + status: "", + }, + { + className: "call-attach", + icon: "fas fa-sign-in-alt", + text: "Respond", + info: callId, + status: "", + }, + { + className: "Set-Waypoint", + icon: "fas fa-map-marker-alt", + text: "Set Waypoint", + info: callId, + status: "", + }, + ]; + } else if (canRespond == false) { + args = [ + { + className: "attached-units", + icon: "fas fa-link", + text: "Attached Units", + info: callId, + status: "", + }, + { + className: "call-detach", + icon: "fas fa-sign-out-alt", + text: "Detach", + info: callId, + status: "", + }, + { + className: "call-attach", + icon: "fas fa-sign-in-alt", + text: "Respond", + info: callId, + status: "", + }, + { + className: "Set-Waypoint", + icon: "fas fa-map-marker-alt", + text: "Set Waypoint", + info: callId, + status: "", + }, + ]; + } + + openContextMenu(e, args); + } + } + ); + + $(".contextmenu").on("click", ".call-dispatch-detach", function () { + const cid = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/callDispatchDetach`, + JSON.stringify({ + callid: $(".dispatch-attached-units-container").attr("id"), + cid: cid, + }) + ); + $(".dispatch-attached-unit-item").filter(`[data-id="${cid}"]`).remove(); + }); + + $(".contextmenu").on("click", ".Set-Dispatch-Waypoint", function () { + const cid = $(this).data("info"); + $.post( + `https://${GetParentResourceName()}/setDispatchWaypoint`, + JSON.stringify({ + callid: $(".dispatch-attached-units-container").attr("id"), + cid: cid, + }) + ); + }); + + $(".dispatch-attached-units-holder").on( + "contextmenu", + ".dispatch-attached-unit-item", + function (e) { + const cid = $(this).data("id"); + if (cid) { + args = [ + { + className: "set-waypoint", + icon: "fas fa-map-marker-alt", + text: "Set Waypoint", + info: cid, + status: "", + }, + ]; + openContextMenu(e, args); + } + } + ); + + $(".contextmenu").on("click", ".dispatch-reply", function () { + const callsign = $(this).data("info"); + const currVal = $(".dispatch-input").val(); + if (currVal === "") { + $(".dispatch-input").val(callsign + " "); + } else { + $(".dispatch-input").val(currVal + " " + callsign + " "); + } + $(".dispatch-input").focus(); + }); + + $(".dispatch-items").on( + "contextmenu", + ".dispatch-item-message", + function (e) { + const Callsign = $(this).data("author"); + + var mySubString = Callsign.substring( + Callsign.indexOf("(") + 1, + Callsign.lastIndexOf(")") + ); + + args = [ + { + className: "dispatch-reply", + icon: "fas fa-reply", + text: "Reply", + info: mySubString, + status: "", + }, + ]; + openContextMenu(e, args); + } + ); + + $(".callsign-buttons").on("click", ".callsign-cancel", function () { + $(".callsign-inner-container").slideUp(500); + $(".callsign-inner-container").fadeOut(500); + setTimeout(() => { + $(".callsign-container").slideUp(500); + $(".callsign-container").fadeOut(500); + $(".callsign-input").val(""); + }, 500); + }); + + $(".callsign-buttons").on("click", ".callsign-submit", function () { + const callsign = $(".callsign-input").val(); + if (callsign.length > 2) { + let editingcallsign = $(".callsign-container").data("id"); + let name = $(`[data-id="${editingcallsign}"]`) + .find(".unit-name") + .html() + .replace(/\s*(?:\[[^\]]*\]|\([^)]*\))\s*/g, ""); + let newunitname = `(${callsign}) ${name}`; + $(`[data-id="${editingcallsign}"]`) + .find(".unit-name") + .html(newunitname); + $.post( + `https://${GetParentResourceName()}/setCallsign`, + JSON.stringify({ + cid: editingcallsign, + newcallsign: callsign, + }) + ); + + $(".callsign-inner-container").slideUp(500); + $(".callsign-inner-container").fadeOut(500); + setTimeout(() => { + $(".callsign-container").slideUp(500); + $(".callsign-container").fadeOut(500); + $(".callsign-input").val(""); + }, 500); + } + }); + + $(".radio-buttons").on("click", ".radio-cancel", function () { + $(".radio-inner-container").slideUp(500); + $(".radio-inner-container").fadeOut(500); + setTimeout(() => { + $(".radio-container").slideUp(500); + $(".radio-container").fadeOut(500); + $(".radio-input").val(""); + }, 500); + }); + + $(".radio-buttons").on("click", ".radio-submit", function () { + const radio = $(".radio-input").val(); + if (radio.length > 0) { + let editingradio = $(".radio-container").data("id"); + let newunitname = `${radio}`; + $(`[data-id="${editingradio}"]`) + .find(".unit-radio") + .html(newunitname); + $.post( + `https://${GetParentResourceName()}/setRadio`, + JSON.stringify({ + cid: editingradio, + newradio: radio, + }) + ); + + $(".radio-inner-container").slideUp(500); + $(".radio-inner-container").fadeOut(500); + setTimeout(() => { + $(".radio-container").slideUp(500); + $(".radio-container").fadeOut(500); + $(".radio-input").val(""); + }, 500); + } + }); + + var draggedElement = 0; + var dragging = false; + + $(".active-unit-list").on("click", ".active-unit-item", function (e) { + if (dragging) { + $("#draggedItem").css("opacity", 0.0); + document.getElementById("draggedItem").innerHTML = ""; + dragging = false; + } else { + dragging = true; + draggedElement = $(this).data("id"); + let draggedItemHtml = $(this).html(); + document.getElementById("draggedItem").innerHTML = draggedItemHtml; + document.getElementById("draggedItem").style.left = "cursorX-50"; + document.getElementById("draggedItem").style.top = "cursorY-50"; + document.getElementById("draggedItem").style.opacity = "0.5"; + } + }); + + document.onmousemove = handleMouseMove; + + function handleMouseMove(event) { + let dot, eventDoc, doc, body, pageX, pageY; + event = event || window.event; // IE-ism + if (event.pageX == null && event.clientX != null) { + eventDoc = (event.target && event.target.ownerDocument) || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = + event.clientX + + ((doc && doc.scrollLeft) || (body && body.scrollLeft) || 0) - + ((doc && doc.clientLeft) || (body && body.clientLeft) || 0); + event.pageY = + event.clientY + + ((doc && doc.scrollTop) || (body && body.scrollTop) || 0) - + ((doc && doc.clientTop) || (body && body.clientTop) || 0); + } + + if (dragging) { + cursorX = event.pageX; + cursorY = event.pageY; + document.getElementById("draggedItem").style.left = + "" + cursorX - 50 + "px"; + document.getElementById("draggedItem").style.top = + "" + cursorY - 50 + "px"; + } + } + + $(".active-calls-list").on("click", ".active-calls-item", function (e) { + const callId = $(this).data("id"); + $("#draggedItem").css("opacity", 0.0); + document.getElementById("draggedItem").innerHTML = ""; + dragging = false; + if (callId && draggedElement) { + $.post( + `https://${GetParentResourceName()}/callDragAttach`, + JSON.stringify({ + callid: callId, + cid: draggedElement, + }) + ); + draggedElement = 0; + } + }); + + function JobColors(sentJob) { + if (sentJob) { + if (PoliceJobs[sentJob] !== undefined) { + document.documentElement.style.setProperty( + "--color-1", + "#1E3955" + ); + document.documentElement.style.setProperty( + "--color-2", + "#213F5F" + ); + document.documentElement.style.setProperty( + "--color-3", + "#2C537B" + ); + document.documentElement.style.setProperty( + "--color-4", + "#23405E" + ); + document.documentElement.style.setProperty( + "--color-5", + "#152638" + ); + document.documentElement.style.setProperty( + "--color-6", + "#121f2c" + ); + document.documentElement.style.setProperty( + "--color-7", + "rgb(28, 54, 82)" + ); + document.documentElement.style.setProperty( + "--color-8", + "#2554cc" + ); + document.documentElement.style.setProperty( + "--color-9", + "#6E707C" + ); + document.documentElement.style.setProperty( + "--color-10", + "#8f741b" + ); + $(".badge-logo").attr("src", "img/sasp_badge.png"); + $(".header-title").html("SAN ANDREAS STATE POLICE"); + $(".bolo-nav-item").html("BOLOs"); + $(".bolos-search-title").html("Bolos"); + $("#bolos-search-input").attr("placeholder", "Search Bolo..."); + $(".manage-bolos-title").html("Manage Bolo"); + $(".manage-bolos-editing-title").html( + "You are currently creating a new BOLO" + ); + $(".boloplate-title").html("Plate"); + $(".boloowner-title").html("Owner"); + $(".boloindividual-title").html("Individual"); + $("#boloplate").attr("placeholder", "Place plate here..."); + $("#bolodetail").attr( + "placeholder", + "Bolo detail goes here..." + ); + $("#boloowner").attr( + "placeholder", + "Place vehicle owner here..." + ); + $("#boloindividual").attr( + "placeholder", + "Place invidivual here..." + ); + $("#home-warrants-container").fadeIn(0); + $("#home-reports-container").fadeOut(0); + $(".quote-span").html("TUCKER MALD, BEST MALD"); + $(".incidents-nav-item").show(); + $(".bolo-nav-item").show(); + $(".dmv-nav-item").show(); + $(".dispatch-title-ofsomesort").html("Dispatch"); + $(".dispatch-comms-container").fadeIn(0); + $(".manage-profile-name-input-1").attr("readonly", true); + $(".manage-profile-name-input-2").attr("readonly", true); + $("#reports-officers-involved-tag-title").html( + "Officers Involved" + ); + $(".roster-iframe").attr("src", rosterLink); + + $(".manage-profile-save").css("display", "block"); + $(".manage-profile-editing-title").css("display", "block"); + $(".manage-incidents-create").css("display", "block"); + $(".manage-incidents-save").css("display", "block"); + $(".manage-incidents-editing-title").css("display", "block"); + $(".manage-reports-new").css("display", "block"); + $(".manage-reports-save").css("display", "block"); + $(".manage-reports-editing-title").css("display", "block"); + $(".vehicle-information-save").css("display", "block"); + $(".vehicle-information-title").css("margin-right", "0px").css("width", "81%"); + $(".manage-incidents-title ").css("margin-right", "0px") + $(".manage-reports-title").css("margin-right", "0px").css("width", "66%"); + } else if (AmbulanceJobs[sentJob] !== undefined) { + $("#home-warrants-container").fadeOut(0); + $("#home-reports-container").fadeIn(0); + document.documentElement.style.setProperty( + "--color-1", + "#5F2121" + ); + document.documentElement.style.setProperty( + "--color-2", + "#7B2C2C" + ); + document.documentElement.style.setProperty( + "--color-3", + "#4A1C1C" + ); + document.documentElement.style.setProperty( + "--color-4", + "#5E2323" + ); + document.documentElement.style.setProperty( + "--color-5", + "#381515" + ); + document.documentElement.style.setProperty( + "--color-6", + "#2C1212" + ); + document.documentElement.style.setProperty( + "--color-7", + "#521C1C" + ); + document.documentElement.style.setProperty( + "--color-8", + "#CC2525" + ); + document.documentElement.style.setProperty( + "--color-9", + "#8A8D91" + ); + document.documentElement.style.setProperty( + "--color-10", + "#444444" + ); + $(".badge-logo").attr("src", "img/ems_badge.png"); + $(".header-title").html("PILLBOX HILL MEDICAL CENTER"); + $(".quote-span").html( + "The simplest explanation is almost always somebody screwed up." + ); + $(".bolo-nav-item").html("ICU"); + $(".bolos-search-title").html("ICU Check-ins"); + $("#bolos-search-input").attr( + "placeholder", + "Search Check-ins..." + ); + $(".manage-bolos-title").html("Manage ICU Check-in"); + $(".manage-bolos-editing-title").html( + "You are creating a new ICU Check-in" + ); + $(".boloplate-title").html("Estimated Recovery"); + $(".boloowner-title").html("Emergency Contact"); + $(".boloindividual-title").html("Patient"); + $("#boloplate").attr( + "placeholder", + "Enter recovery time here..." + ); + $("#bolodetail").attr( + "placeholder", + "Enter ICU Check-in details here..." + ); + $("#boloowner").attr( + "placeholder", + "Enter emergency contact here..." + ); + $("#boloindividual").attr( + "placeholder", + "Enter patient name and CID here..." + ); + $(".incidents-nav-item").hide(); + $(".dmv-nav-item").hide(); + $("#reports-officers-involved-tag-title").html("EMS Involved"); + $(".dispatch-title-ofsomesort").html("Dispatch"); + $(".dispatch-comms-container").fadeIn(0); + $(".manage-profile-name-input-1").attr("readonly", true); + $(".manage-profile-name-input-2").attr("readonly", true); + $(".roster-iframe").attr("src", rosterLink); + + $(".manage-profile-save").css("display", "block"); + $(".manage-profile-editing-title").css("display", "block"); + $(".manage-incidents-create").css("display", "block"); + $(".manage-incidents-save").css("display", "block"); + $(".manage-incidents-editing-title").css("display", "block"); + $(".manage-reports-new").css("display", "block"); + $(".manage-reports-save").css("display", "block"); + $(".manage-reports-editing-title").css("display", "block"); + $(".vehicle-information-save").css("display", "block"); + $(".vehicle-information-title").css("margin-right", "0px").css("width", "81%"); + $(".manage-incidents-title ").css("margin-right", "0px") + $(".manage-reports-title").css("margin-right", "0px").css("width", "66%"); + } else if (DojJobs[sentJob] !== undefined) { + document.documentElement.style.setProperty( + "--color-1", + "#553a1e" + ); + document.documentElement.style.setProperty( + "--color-2", + "#5f4321" + ); + document.documentElement.style.setProperty( + "--color-3", + "#7b552c" + ); + document.documentElement.style.setProperty( + "--color-4", + "#5e4123" + ); + document.documentElement.style.setProperty( + "--color-5", + "#382815" + ); + document.documentElement.style.setProperty( + "--color-6", + "#2c2312" + ); + document.documentElement.style.setProperty( + "--color-7", + "rgb(82, 60, 28)" + ); + document.documentElement.style.setProperty( + "--color-8", + "#cc9225" + ); + $(".badge-logo").attr("src", "img/court.png"); + $(".header-title").html("DEPARTMENT OF JUSTICE"); + $(".quote-span").html("Actually useless."); + //$(".dmv-nav-item").hide(); + $(".bolo-nav-item").hide(); + $(".dispatch-title-ofsomesort").html("Message Board"); + $(".dispatch-comms-container").fadeOut(0); + $(".manage-profile-name-input-1").attr("readonly", false); + $(".manage-profile-name-input-2").attr("readonly", false); + $("#home-warrants-container").css("height", "98%"); + $(".roster-iframe").attr("src", rosterLink); + + $(".manage-profile-save").css("display", "none"); + $(".manage-profile-editing-title").css("display", "none"); + $(".manage-incidents-create").css("display", "none"); + $(".manage-incidents-title").css("margin-right", "auto"); + $(".manage-incidents-title").css("width", "95%"); + $(".manage-incidents-save").css("display", "none"); + $(".manage-incidents-editing-title").css("display", "none"); + $(".manage-reports-new").css("display", "none"); + $(".manage-reports-save").css("display", "none"); + $(".manage-reports-editing-title").css("display", "none"); + $(".vehicle-information-save").css("display", "none"); + $(".vehicle-information-title").css("margin-right", "auto").css("width", "95%"); + $(".manage-incidents-title ").css("margin-right", "auto") + $(".manage-reports-title").css("margin-right", "auto").css("width", "95%"); + } + } + } +{/*
ID: ${value.id}
*/} + window.addEventListener("message", function (event) { + let eventData = event.data; + $(".dispatch-msg-notif").fadeIn(500); + if (eventData.type == "show") { + if (eventData.enable == true) { + rosterLink = eventData.rosterLink; + playerJob = eventData.job; + JobColors(playerJob); + if (PoliceJobs[playerJob] !== undefined || DojJobs[playerJob] !== undefined) { + $(".manage-profile-licenses-container").removeClass("display_hidden"); + $(".manage-convictions-container").removeClass("display_hidden"); + $(".manage-profile-vehs-container").removeClass("display_hidden"); + $(".manage-profile-houses-container").removeClass("display_hidden"); + } + + /* if (PoliceJobs[playerJob] !== undefined || AmbulanceJobs[playerJob] !== undefined) { + $(".manage-profile-save").css("display", "block"); + $(".manage-profile-editing-title").css("display", "block"); + $(".manage-incidents-create").css("display", "block"); + $(".manage-incidents-save").css("display", "block"); + $(".manage-incidents-editing-title").css("display", "block"); + $(".manage-reports-new").css("display", "block"); + $(".manage-reports-save").css("display", "block"); + $(".manage-reports-editing-title").css("display", "block"); + } else if (DojJobs[playerJob] !== undefined) { + $(".manage-profile-save").css("display", "none"); + $(".manage-profile-editing-title").css("display", "none"); + $(".manage-incidents-create").css("display", "none"); + $(".manage-incidents-save").css("display", "none"); + $(".manage-incidents-editing-title").css("display", "none"); + $(".manage-reports-new").css("display", "none"); + $(".manage-reports-save").css("display", "none"); + $(".manage-reports-editing-title").css("display", "none"); + } */ + + $("body").fadeIn(0); + $(".close-all").css("filter", "none"); + $(".close-all").fadeOut(0); + if (!currentTab) { + currentTab = ".dashboard-page-container"; + } + $(currentTab).slideDown(250); + timeShit(); + } else { + $(".callsign-inner-container").fadeOut(0); + $(".callsign-container").fadeOut(0); + $(".radio-inner-container").fadeOut(0); + $(".radio-container").fadeOut(0); + $(".icidents-person-search-container").fadeOut(0); + $(".dispatch-attached-units").fadeOut(0); + $(".respond-calls").fadeOut(0); + $(".respond-calls-container").fadeOut(0); + $("body").slideUp(250); + $(".close-all").slideUp(250); + } + } else if (eventData.type == "data") { + $(".name-shit").html(eventData.name); + $(".header-location").html(" " + eventData.location); + MyName = eventData.fullname; + + $(".bulletin-items-continer").empty(); + $.each(eventData.bulletin, function (index, value) { + $( + ".bulletin-items-continer" + ).prepend(`
+
${value.title}
+
${value.desc}
+
+
${value.author + } - ${timeAgo(Number(value.time))}
+
+
`); + }); + + let policeCount = 0; + let emsCount = 0; + let dojCount = 0; + let fireCount = 0; + + let activeUnits = eventData.activeUnits; + $(".active-unit-list").html(' '); + let unitListHTML = ''; + + activeUnits = Object.values(activeUnits) + activeUnits.forEach((unit) => { + let status = unit.duty == 1 ? "10-8" : '10-7'; + let statusColor = unit.duty == 1 ? "green-status" : 'yellow-status'; + let radioBack = unit.sig100 ? "#7b2c2c" : "var(--color-3)"; + let radio = unit.radio ? unit.radio : "0"; + let callSign = unit.callSign ? unit.callSign : "000"; + let activeInfoJob = `
UNKNOWN
`; + if (PoliceJobs[playerJob] !== undefined) { + policeCount++; + activeInfoJob = `
LSPD
`; + } else if (AmbulanceJobs[unit.unitType] !== undefined) { + activeInfoJob = `
Ambulance
` + emsCount++; + /* } else if (DojJobs[unit.unitType] !== undefined) { + activeInfoJob = `
FIRE
` + fireCount++; */ + } else if (DojJobs[unit.unitType] !== undefined) { + activeInfoJob = `
DOJ
` + dojCount++; + } + + unitListHTML += ` +
+
${status}
+ ${activeInfoJob} +
(${callSign}) ${unit.firstName} ${unit.lastName}
+
${radio}
+
+ `; + }); + + $(".active-unit-list").html(unitListHTML) + + + $("#police-count").html(policeCount); + $("#ems-count").html(emsCount); + $("#doj-count").html(dojCount); + $("#fire-count").html(fireCount); + /* } else if (eventData.type == "bulletin") { + $(".bulletin-items-continer").empty(); + $.each(eventData.data, function (index, value) { + $( + ".bulletin-items-continer" + ).prepend(`
+
${value.title}
+
${value.desc}
+
+
ID: ${value.id}
+
${value.author + } - ${timeAgo(Number(value.time))}
+
+
`); + }); */ + } else if (eventData.type == "newBulletin") { + const value = eventData.data; + $(".bulletin-items-continer") + .prepend(`
+
${value.title}
+
${value.info}
+
+
ID: ${value.id}
+
${value.author} - ${timeAgo( + Number(value.time) + )}
+
+
`); + } else if (eventData.type == "deleteBulletin") { + $(".bulletin-items-continer") + .find("[data-id='" + eventData.data + "']") + .remove(); + } else if (eventData.type == "warrants") { + $(".warrants-items").empty(); + $.each(eventData.data, function (index, value) { + $('.warrants-items').prepend(`
+
+
${value.name}
+
+
+
Incident ID: ${value.linkedincident}
+
+
`) + }) + } else if (eventData.type == "dispatchmessages") { + const table = eventData.data; + LastName = ""; + DispatchNum = 0; + $(".dispatch-items").empty(); + $.each(table, function (index, value) { + DispatchNum = DispatchNum + 1; + if (LastName == value.name) { + $(".dispatch-items").append(` +
+
${value.message}
+
+ `); + } else { + if (DispatchNum == 1) { + $(".dispatch-items") + .append(`
+ +
+
${value.name + } ${timeAgo( + Number(value.time) + )}
+
${value.message}
+
+
`); + } else { + $(".dispatch-items") + .append(`
+ +
+
${value.name + } ${timeAgo( + Number(value.time) + )}
+
${value.message}
+
+
`); + } + } + LastName = value.name; + $(".dispatch-items").scrollTop( + $(".dispatch-items")[0].scrollHeight + ); + }); + $(".dispatch-items").scrollTop( + $(".dispatch-items")[0].scrollHeight + ); + } else if (eventData.type == "dispatchmessage") { + const value = eventData.data; + DispatchNum = DispatchNum + 1; + const BodyDisplay = $("body").css("display"); + if (BodyDisplay == "block") { + if (LastName == value.name) { + $(".dispatch-items").append(` +
+
${value.message}
+
+ `); + } else { + if (DispatchNum == 1) { + $(".dispatch-items") + .append(`
+ +
+
${value.name + } ${timeAgo( + Number(value.time) + )}
+
${value.message}
+
+
`); + } else { + $(".dispatch-items") + .append(`
+ +
+
${value.name + } ${timeAgo( + Number(value.time) + )}
+
${value.message}
+
+
`); + } + } + LastName = value.name; + } else if (BodyDisplay == "none") { + $.post( + `https://${GetParentResourceName()}/dispatchNotif`, + JSON.stringify({ + data: value, + }) + ); + } + $(".dispatch-items").scrollTop( + $(".dispatch-items")[0].scrollHeight + ); + } else if (eventData.type == "call") { + const value = eventData.data; + if (value) { + const prio = value["priority"]; + let DispatchItem = `
#${value.callId}
${value.dispatchCode}
${value.dispatchMessage}
${value.units.length}
`; + + if ( + value.dispatchCode == "911" || + value.dispatchCode == "311" + ) { + DispatchItem = `
#${value.callId}
${value.dispatchCode}
${value.dispatchMessage}
${value.units.length}
`; + } + + if (value["time"]) { + DispatchItem += `
${timeAgo( + value.time + )}
`; + } + + if (value["firstStreet"]) { + DispatchItem += `
${value.firstStreet}
`; + } + + if (value["heading"]) { + DispatchItem += `
${value.heading}
`; + } + + if (value["gender"]) { + let gender = "Male"; + if (value["gender"] == 0 || value["gender"] == 2) { + gender = "Female"; + } + DispatchItem += `
${gender}
`; + } + + if (value["model"] && value["plate"]) { + DispatchItem += `
${value["model"]}${value["plate"]}
`; + } else if (value["plate"]) { + DispatchItem += `
${value["plate"]}
`; + } else if (value["model"]) { + DispatchItem += `
${value["model"]}
`; + } + + if (value["firstColor"]) { + DispatchItem += `
${value["firstColor"]}
`; + } + + if (value["automaticGunfire"] == true) { + DispatchItem += `
Automatic Gunfire
`; + } + + if (value["name"] && value["number"]) { + DispatchItem += `
${value["name"]}${value["number"]}
`; + } else if (value["number"]) { + DispatchItem += `
${value["number"]}
`; + } else if (value["name"]) { + DispatchItem += `
${value["name"]}
`; + } + + if (value["information"]) { + DispatchItem += `
${value["information"]}
`; + } + + DispatchItem += `
`; + $(".active-calls-list").prepend( + $(DispatchItem).hide().fadeIn("slow") + ); + } + } else if (eventData.type == "attachedUnits") { + const table = eventData.data; + if (table) { + $(".dispatch-attached-units").fadeIn(0); + $(".dispatch-attached-units-container").fadeIn(250); + $(".close-all").css("filter", "brightness(15%)"); + $(".dispatch-attached-units-holder").empty(); + $.each(table, function (index, value) { + $( + ".dispatch-attached-units-holder" + ).prepend(`
+
${value.job}
+
(${value.callsign}) ${value.fullname}
+
1
+
`); + }); + setTimeout(() => { + $(".dispatch-attached-units-container").attr( + "id", + eventData.callid + ); + }, 1000); + } + } else if (eventData.type == "sendCallResponse") { + if ($(".respond-calls-container").data("id") == eventData.callid) { + $(".respond-calls-responses").prepend( + `
${eventData["name"] + } responded "${eventData["message"]}" - ${timeAgo( + Number(eventData.time) + )}.
` + ); + } + } else if (eventData.type == "getCallResponses") { + const table = eventData.data; + $(".respond-calls").fadeIn(0); + $(".respond-calls-container").fadeIn(250); + $(".close-all").css("filter", "brightness(15%)"); + $("#respondcalls").val(""); + $(".respond-calls-responses").empty(); + setTimeout(() => { + $(".respond-calls-container").data("id", eventData.callid); + }, 1000); + $.each(table, function (index, value) { + $(".respond-calls-responses").prepend( + `
${value["name"] + } responded "${value["message"]}" - ${timeAgo( + Number(value.time) + )}.
` + ); + }); + } else if (eventData.type == "calls") { + const table = eventData.data; + $(".active-calls-list").empty(); + $.each(table, function (index, value) { + if (value) { + const prio = value["priority"]; + let DispatchItem = `
#${value.callId}
${value.dispatchCode}
${value.dispatchMessage}
${value.units.length}
`; + + if ( + value.dispatchCode == "911" || + value.dispatchCode == "311" + ) { + DispatchItem = `
#${value.callId}
${value.dispatchCode}
${value.dispatchMessage}
${value.units.length}
`; + } + + if (value["time"]) { + DispatchItem += `
${timeAgo( + value.time + )}
`; + } + + if (value["firstStreet"]) { + DispatchItem += `
${value.firstStreet}
`; + } + + if (value["heading"]) { + DispatchItem += `
${value.heading}
`; + } + + if (value["gender"]) { + let gender = "Male"; + if (value["gender"] == 0 || value["gender"] == 2) { + gender = "Female"; + } + DispatchItem += `
${gender}
`; + } + + if (value["model"] && value["plate"]) { + DispatchItem += `
${value["model"]}${value["plate"]}
`; + } else if (value["plate"]) { + DispatchItem += `
${value["plate"]}
`; + } else if (value["model"]) { + DispatchItem += `
${value["model"]}
`; + } + + if (value["firstColor"]) { + DispatchItem += `
${value["firstColor"]}
`; + } + + if (value["automaticGunfire"] == true) { + DispatchItem += `
Automatic Gunfire
`; + } + + if (value["name"] && value["number"]) { + DispatchItem += `
${value["name"]}${value["number"]}
`; + } else if (value["number"]) { + DispatchItem += `
${value["number"]}
`; + } else if (value["name"]) { + DispatchItem += `
${value["name"]}
`; + } + + if (value["information"]) { + DispatchItem += `
${value["information"]}
`; + } + + DispatchItem += `
`; + $(".active-calls-list").prepend( + $(DispatchItem).hide().fadeIn("slow") + ); + } + }); + } else if (eventData.type == "incidents") { + let table = eventData.data; + canSearchForProfiles = true; + $(".incidents-items").empty(); + $.each(table, function (index, value) { + $(".incidents-items").append( + `
+
+
${value.title}
+
Incident Report
+
+
+
ID: ${value.id}
+
${value.author + } - ${timeAgo(Number(value.time))}
+
+
` + ); + }); + } else if (eventData.type == "getPenalCode") { + const titles = eventData.titles; + const penalcode = eventData.penalcode; + $(".offenses-main-container").empty(); + $.each(titles, function (index, value) { + $(".offenses-main-container").append( + `
+
${value}
+
+
+
+ ` + ); + }); + $.each(penalcode, function (index, value) { + $.each(value, function (i, v) { + $(`#penal-${index}`).append(` +
+
+
${v.title}
+
${v.class}
+
+
+
${v.id}
+
${v.months} Months - $${v.fine}
+
+ `); + }); + }); + } else if (eventData.type == "incidentData") { + let table = eventData.data; + + $(".incidents-ghost-holder").html(""); + $(".associated-incidents-tags-holder").html(""); + + $(".manage-incidents-editing-title").html( + "You are currently editing incident " + table["id"] + ); + $(".manage-incidents-editing-title").data( + "id", + Number(table["id"]) + ); + + $(".manage-incidents-tags-add-btn").css("pointer-events", "auto"); + $(".manage-incidents-reports-content").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-officers-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-civilians-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-evidence-add-btn").css( + "pointer-events", + "auto" + ); + $(".associated-incidents-tags-add-btn").css( + "pointer-events", + "auto" + ); + + $("#manage-incidents-title-input").val(table["title"]); + $(".manage-incidents-reports-content").val(table["details"]); + + $(".manage-incidents-tags-holder").empty(); + $.each(table["tags"], function (index, value) { + $(".manage-incidents-tags-holder").append( + `
${value}
` + ); + }); + + $(".manage-incidents-officers-holder").empty(); + $.each(table["officersinvolved"], function (index, value) { + $(".manage-incidents-officers-holder").append( + `
${value}
` + ); + }); + + $(".manage-incidents-civilians-holder").empty(); + $.each(table["civsinvolved"], function (index, value) { + $(".manage-incidents-civilians-holder").append( + `
${value}
` + ); + }); + + $(".manage-incidents-evidence-holder").empty(); + $.each(table["evidence"], function (index, value) { + $(".manage-incidents-evidence-holder").append( + `` + ); + }); + + $(".manage-incidents-title-holder").empty(); + if (PoliceJobs[playerJob] !== undefined || AmbulanceJobs[playerJob] !== undefined) { + $(".manage-incidents-title-holder").prepend( + ` +
Manage Incident
+
+
+ ` + ); + $(".manage-incidents-title").css("width", "66%"); + $(".manage-incidents-create").css("margin-right", "0px"); + } else if (DojJobs[playerJob] !== undefined) { + $(".manage-incidents-title-holder").prepend( + ` +
Manage Incident
+ ` + ); + $(".manage-incidents-title").css("width", "95%"); + } + + let associateddata = eventData.convictions; + $.each(associateddata, function (index, value) { + $(".associated-incidents-tags-holder").prepend( + `
${value.name}
` + ); + + var warrantTag = "red-tag"; + var guiltyTag = "red-tag"; + var processedTag = "red-tag"; + var associatedTag = "red-tag"; + + if (value.warrant == 1) { + warrantTag = "green-tag"; + } + if (value.guilty == 1) { + guiltyTag = "green-tag"; + } + if (value.processed == 1) { + processedTag = "green-tag"; + } + if (value.associated == 1) { + associatedTag = "green-tag"; + } + + const cid = value.cid; + + if (value.associated == 1) { + $(".incidents-ghost-holder").prepend( + `
+
${value.name} (#${value.cid})
+
+
Warrant
+
Guilty
+
Processed
+
Associated
+
+ + + + + + + + + +
` + ); + } else { + $(".incidents-ghost-holder").prepend( + `
+
${value.name} (#${value.cid})
+
+
Warrant
+
Guilty
+
Processed
+
Associated
+
+
+
+
Recommended Fine
+
+
Recommended Sentence
+
+
Fine
+
+
Sentence
+
+
` + ); + } + + $(".fine-amount") + .filter("[data-id='" + value.cid + "']") + .val(value.fine); + + $(".sentence-amount") + .filter("[data-id='" + value.cid + "']") + .val(value.sentence); + + $(".fine-recommended-amount") + .filter("[data-id='" + value.cid + "']") + .val(value.recfine); + + $(".sentence-recommended-amount") + .filter("[data-id='" + value.cid + "']") + .val(value.recsentence); + + const charges = value["charges"]; + for (var i = 0; i < charges.length; i++) { + const randomNum = Math.ceil( + Math.random() * 1000 + ).toString(); + $(`[data-name="${cid}"]`).prepend( + `
${charges[i]}
` + ); + } + }); + } else if (eventData.type == "incidentSearchPerson") { + let table = eventData.data; + $(".icidents-person-search-holder").empty(); + $.each(table, function (index, value) { + let name = value.firstname + " " + value.lastname; + $(".icidents-person-search-holder").prepend( + ` +
+ +
+
Citizen ID
+
${value.id}
+
Name
+
${name}
+
+
+ ` + ); + }); + } else if (eventData.type == "boloData") { + let table = eventData.data; + $(".manage-bolos-editing-title").html( + "You are currently editing BOLO " + table["id"] + ); + + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + $(".manage-bolos-editing-title").html( + "You are editing ICU Check-in " + table["id"] + ); + } + + $(".manage-bolos-editing-title").data("id", Number(table["id"])); + + $(".manage-bolos-input-title").val(table["title"]); + $(".manage-bolos-input-plate").val(table["plate"]); + $(".manage-bolos-input-owner").val(table["owner"]); + $(".manage-bolos-input-individual").val(table["individual"]); + + $(".manage-bolos-reports-content").val(table["detail"]); + + $(".manage-bolos-tags-holder").empty(); + $.each(table["tags"], function (index, value) { + $(".manage-bolos-tags-holder").prepend( + `
${value}
` + ); + }); + + $(".bolo-gallery-inner-container").empty(); + $.each(table["gallery"], function (index, value) { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".bolo-gallery-inner-container").prepend( + `` + ); + }); + + $(".manage-officers-tags-holder").empty(); + $.each(table["officersinvolved"], function (index, value) { + $(".manage-officers-tags-holder").prepend( + `
${value}
` + ); + }); + } else if (eventData.type == "bolos") { + let table = eventData.data; + var reportName = "General BOLO"; + canSearchForProfiles = true; + $(".bolos-items").empty(); + if ($(".badge-logo").attr("src") == "img/ems_badge.png") { + reportName = "ICU Check-in"; + } + $.each(table, function (index, value) { + $(".bolos-items").prepend( + `
+
+
${value.title}
+
${reportName}
+
+
+
ID: ${value.id}
+
${value.author + } - ${timeAgo(Number(value.time))}
+
+
` + ); + }); + } else if (eventData.type == "boloComplete") { + let id = eventData.data; + if (canRefreshBolo == true) { + canRefreshBolo = false; + $(".bolos-search-refresh").empty(); + $(".bolos-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".bolos-search-refresh").empty(); + $(".bolos-search-refresh").html("Refresh"); + canRefreshBolo = true; + $.post(`https://${GetParentResourceName()}/getAllBolos`, JSON.stringify({})); + }, 1500); + } + $(".manage-bolos-editing-title").html( + "You are currently editing BOLO " + id + ); + $(".manage-bolos-editing-title").data("id", Number(id)); + } else if (eventData.type == "reportComplete") { + let id = eventData.data; + if (canRefreshReports == true) { + canRefreshReports = false; + $(".reports-search-refresh").empty(); + $(".reports-search-refresh").prepend( + `` + ); + setTimeout(() => { + $(".reports-search-refresh").empty(); + $(".reports-search-refresh").html("Refresh"); + canRefreshReports = true; + $.post(`https://${GetParentResourceName()}/getAllReports`, JSON.stringify({})); + }, 1500); + } + $(".manage-reports-editing-title").html( + "You are currently editing report " + id + ); + $(".manage-reports-editing-title").data("id", Number(id)); + } else if (eventData.type == "reports") { + let table = eventData.data; + canSearchForReports = true; + $(".reports-items").empty(); + $.each(table, function (index, value) { + $(".reports-items").append( + `
+
+
${value.title}
+
${value.type + } Report
+
+
+
ID: ${value.id}
+
${value.author + } - ${timeAgo(Number(value.time))}
+
+
` + ); + }); + } else if (eventData.type == "reportData") { + let table = eventData.data; + + $(".manage-reports-editing-title").html( + "You are currently editing report " + table["id"] + ); + + $(".manage-reports-editing-title").data("id", Number(table["id"])); + + $(".manage-reports-input-title").val(table["title"]); + $(".manage-reports-input-type").val(table["type"]); + $(".manage-reports-reports-content").val(table["details"]); + + $(".manage-reports-tags-holder").empty(); + $.each(table["tags"], function (index, value) { + $(".manage-reports-tags-holder").append( + `
${value}
` + ); + }); + + $(".reports-gallery-inner-container").empty(); + $.each(table["gallery"], function (index, value) { + let randomNum = Math.ceil(Math.random() * 10).toString(); + $(".reports-gallery-inner-container").append( + `` + ); + }); + + $(".reports-officers-tags-holder").empty(); + $.each(table["officersinvolved"], function (index, value) { + $(".reports-officers-tags-holder").append( + `
${value}
` + ); + }); + } else if (eventData.type == "searchedVehicles") { + + } else if (eventData.type == "getVehicleData") { + impoundChanged = false; + let table = eventData.data; + + $(".vehicle-information-title-holder").data( + "dbid", + Number(table["dbid"]) + ); + + $(".vehicle-info-plate-input").val(table["plate"]); + $(".vehicle-info-owner-input").val(table["name"]); + $(".vehicle-info-class-input").val(table["class"]); + $(".vehicle-info-model-input").val(table["model"]); + $(".vehicle-info-imageurl-input").val(table["image"]); + + $(".vehicle-info-content").val(table["information"]); + + $(".vehicle-tags").empty(); + $(".vehicle-info-image").attr("src", table["image"]); + $(".vehicle-tags").prepend( + `
${table.colorName}
` + ); + + let impound = "red-tag"; + let bolo = "red-tag"; + let codefive = "red-tag"; + let stolen = "red-tag"; + + if (table.impound) { + impound = "green-tag"; + } + + if (table.bolo) { + bolo = "green-tag"; + } + + if (table.code) { + codefive = "green-tag"; + } + + if (table.stolen) { + stolen = "green-tag"; + } + + $(".vehicle-tags").append( + `
Impound
` + ); + $(".vehicle-tags").append( + `
BOLO
` + ); + $(".vehicle-tags").append( + `
Code 5
` + ); + $(".vehicle-tags").append( + `
Stolen
` + ); + $(".vehicle-info-imageurl-input").val(table["image"]); + } else if (eventData.type == "updateVehicleDbId") { + $(".vehicle-information-title-holder").data("dbid", Number(eventData.data)); + } else if (eventData.type == "updateIncidentDbId") { + $(".manage-incidents-editing-title").data("id", Number(eventData.data)); + + $(".manage-incidents-tags-add-btn").css("pointer-events", "auto"); + $(".manage-incidents-reports-content").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-officers-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-civilians-add-btn").css( + "pointer-events", + "auto" + ); + $(".manage-incidents-evidence-add-btn").css( + "pointer-events", + "auto" + ); + $(".associated-incidents-tags-add-btn").css( + "pointer-events", + "auto" + ); + } else if (eventData.type == "callDetach") { + $(".active-calls-item") + .filter("[data-id='" + eventData.callid + "']") + .children() + .children() + .find(".call-radio") + .html(eventData.data); + } else if (eventData.type == "callAttach") { + $(".active-calls-item") + .filter("[data-id='" + eventData.callid + "']") + .children() + .children() + .find(".call-radio") + .html(eventData.data); + } else if (eventData.type == "getAllLogs") { + let table = eventData.data; + $(".stafflogs-container").empty(); + $.each(table, function (index, value) { + $(".stafflogs-container").append( + `

• ${value.text + } (${timeAgo( + Number(value.time) + )})

` + ); + }); + } else if (eventData.type == "statusImpound") { + const table = eventData.data; + const plate = eventData.plate; + const linkedreport = table["linkedreport"]; + const fee = table["fee"]; + const time = table["time"] * 1000; + + let localDate = new Date(time); + const impoundDate = localDate.toLocaleDateString("en-US", { + timeZone: "UTC", + }); + const impoundTime = localDate.toLocaleTimeString("en-US", { + timeZone: "UTC", + }); + + $(".impound-plate").val(plate).attr("disabled", "disabled"); + $(".impound-linkedreport") + .val(linkedreport) + .attr("disabled", "disabled"); + $(".impound-fee") + .val("$" + fee) + .attr("disabled", "disabled"); + + if (table.paid === 1) { + $(".impound-fee").css("color", "green"); + } else { + $(".impound-fee").css("color", "red"); + } + + $(".impound-time") + .val(impoundDate + " - " + impoundTime) + .attr("disabled", "disabled"); + $(".impound-cancel").html("Close"); + $(".impound-submit").fadeOut(250); + $(".impound-form").slideDown(250); + $(".impound-form").fadeIn(250); + } else if (eventData.type == "greenImpound") { + $(".vehicle-tags") + .find(".impound-tag") + .addClass("green-tag") + .removeClass("red-tag"); + } else if (eventData.type == "redImpound") { + $(".vehicle-tags") + .find(".impound-tag") + .removeClass("green-tag") + .addClass("red-tag"); + } + }); +}); + +function fidgetSpinner(page) { + $(".close-all").fadeOut(0); + $(".container-load").fadeIn(0); + if (page == ".dashboard-page-container"){ + $.post(`https://${GetParentResourceName()}/getAllDashboardData`, JSON.stringify({})); + } + if (page == ".bolos-page-container") { + $.post(`https://${GetParentResourceName()}/getAllBolos`, JSON.stringify({})); + } + if (page == ".reports-page-container") { + $.post(`https://${GetParentResourceName()}/getAllReports`, JSON.stringify({})); + } + if (page == ".stafflogs-page-container") { + $.post(`https://${GetParentResourceName()}/getAllLogs`, JSON.stringify({})); + } + if (page == ".incidents-page-container") { + $.post(`https://${GetParentResourceName()}/getAllIncidents`, JSON.stringify({})); + } + setTimeout(() => { + $(".container-load").fadeOut(0); + $(page).fadeIn(0); + }, 1250); +} + +function timeShit() { + let localDate = new Date(); + const myTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone + date = localDate.toLocaleDateString("en-US", { + timeZone: myTimeZone, + }); + time = localDate.toLocaleTimeString("en-US", { + timeZone: myTimeZone, + }); + $(".date").html(date); + $(".time").html(time); +} + +setInterval(timeShit, 1000); + +function addTag(tagInput) { + $(".tags-holder").prepend(`
${tagInput}
`); + + $.post( + `https://${GetParentResourceName()}/newTag`, + JSON.stringify({ + id: $(".manage-profile-citizenid-input").val(), + tag: tagInput, + }) + ); +} + +// Context menu + +var menu = document.querySelector(".contextmenu"); + +function showMenu(x, y) { + $(".contextmenu").css("left", x + "px"); + $(".contextmenu").css("top", y + "px"); + $(".contextmenu").addClass("contextmenu-show"); +} + +function hideMenu() { + $(".contextmenu").removeClass("contextmenu-show"); +} + +function onMouseDown(e) { + hideMenu(); + document.removeEventListener("mouseup", onMouseDown); +} + +function openContextMenu(e, args) { + e.preventDefault(); + showMenu(e.pageX, e.pageY); + $(".contextmenu").empty(); + $.each(args, function (index, value) { + if (value.status !== "blur(5px)") { + $(".contextmenu").prepend( + ` +
  • + + + ${value.text} + +
  • + ` + ); + } + }); + document.addEventListener("mouseup", onMouseDown); +} + +function expandImage(url) { + $(".close-all").css("filter", "brightness(35%)"); + $(".gallery-image-enlarged").fadeIn(150); + $(".gallery-image-enlarged").css("display", "block"); + $(".gallery-image-enlarged").attr("src", url); +} + +function removeImage(url) { + let cid = $(".manage-profile-citizenid-input").val(); + $(".gallery-inner-container img") + .filter("[src='" + url + "']") + .remove(); +} + +function hideIcidentsMenu() { + if ( + $(".icidents-person-search-container").css("display") != "none" && + !mouse_is_inside + ) { + $(".icidents-person-search-container").fadeOut(250); + $(".close-all").css("filter", "none"); + } +} + +function onMouseDownIcidents(e) { + hideIcidentsMenu(); + document.removeEventListener("mouseup", onMouseDownIcidents); +} + +function titleCase(str) { + return str + .split(' ') + .map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase()) + .join(' '); +} + +function searchProfilesResults(result) { + canSearchForProfiles = true; + $(".profile-items").empty(); + + if (result.length < 1) { + $(".profile-items").html( + ` +
    + +
    +
    +
    No Users Matching that search
    +
    +
    +
    +
    +
    + ` + ); + return true; + } + + let profileHTML = ""; + + result.forEach((value) => { + let charinfo = value.charinfo; + let metadata = value.licences; + + if (typeof value.charinfo == "string") { + charinfo = JSON.parse(charinfo); + } + + if (typeof value.metadata == "string") { + metadata = JSON.parse(metadata); + } + + let name = charinfo.firstname + " " + charinfo.lastname; + let warrant = "red-tag"; + let convictions = "red-tag"; + + let licences = ""; + let licArr = Object.entries(value.licences); + + if (licArr.length > 0 && (PoliceJobs[playerJob] !== undefined || DojJobs[playerJob] !== undefined)) { + for (const [lic, hasLic] of licArr) { + let tagColour = + hasLic == true ? "green-tag" : "red-tag"; + licences += `${titleCase(lic)}`; + } + } + + if (value.warrant == true) { + warrant = "green-tag"; + } + + if (value.convictions < 5) { + convictions = "green-tag"; + } else if ( + value.convictions > 4 && + value.convictions < 15 + ) { + convictions = "orange-tag"; + } + + if (value.pp == '') { + value.pp = 'img/not-found.jpg' + } + + profileHTML += ` +
    + +
    +
    +
    ${name}
    +
    + ${licences} +
    +
    +
    +
    ID: ${value.citizenid}
      +
    +
    +
    + `; + }); + + $(".profile-items").html(profileHTML); +} + +window.addEventListener("load", function () { + document + .getElementById("offenses-search") + .addEventListener("keyup", function () { + var search = this.value.toLowerCase(); + if (search.length > 1) { + $.each($(".offense-item"), function (i, d) { + const Name = $(this) + .find(".offense-item-offense") + .html() + .toLowerCase(); + const Number = $(this) + .find(".offense-item-id") + .html() + .toLowerCase(); + if (Name.includes(search)) { + $(this).show(); + } else if (Number.includes(search)) { + $(this).show(); + } else { + $(this).hide(); + } + }); + } else { + $.each($(".offense-item"), function (i, d) { + $(this).show(); + }); + } + }); +}); diff --git a/ui/dashboard.html b/ui/dashboard.html new file mode 100644 index 00000000..3db8e93c --- /dev/null +++ b/ui/dashboard.html @@ -0,0 +1,755 @@ + + + + + + + + Envy MDT + + + + + + + + + +
      +
    +
    +
    + + + +
    +
    +
    Attached Units
    +
    +
    +
    +
    + + + + + +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    +
    +
    +
    Dispatch
    +
    Refresh
    +
    +
    + +
    + +
    +
    Warrants
    +
    + +
    +
    +
    + +
    +
    +
    Quote of the Day
    +
    The DOJ is not the enemy, but is clearly not an ally
    +
    +
    +
    +
    Bulletin Board
    +
    +
    +
    +
    +
    +
    +
    Dispatch
    +
    +
    Active Units
    +
    0
    +
    0
    +
    0
    +
    0
    +
    +
    +
    +
    Calls
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    +
    Profiles
    +
    +
    +
    +
    +
    +
    Manage Profile
    +
    +
    You are currently editing ...
    +
    Save
    +
    +
    + +
    +
    Citizen ID
    +
    +
    +
    Forename
    +
    +
    +
    Surname
    +
    +
    +
    DOB
    +
    +
    +
    Profession
    +
    +
    +
    Profile Image URL
    +
    +
    +
    +
    + + +
    +
    +
    +
    Licenses
    +
    +
    +
    +
    Vehicles
    +
    +
    +
    +
    +
    Tags
    +
    +
    +
    +
    +
    +
    Properties
    +
    +
    + + + + +
    +
    Known Convictions
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    +
    +
    Incidents
    +
    Refresh
    +
    +
    +
    +
    +
    +
    +
    +
    +
    Manage Incident
    +
    +
    + +
    +
    You are currently creating a new Incident
    +
    Title
    +
    + +
    +
    +
    Tags
    +
    +
    +
    +
    +
    +
    +
    +
    Officers Involved
    +
    +
    +
    + +
    +
    +
    +
    +
    Civilians Involved
    +
    +
    +
    + +
    +
    +
    +
    +
    Evidence
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    Associated
    +
    +
    +
    Criminals Involved
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    + +
    +
    Reports
    +
    Refresh
    +
    +
    +
    +
    +
    +
    +
    +
    Manage Report
    +
    New
    +
    Save
    +
    +
    You are currently creating a new report
    +
    Title
    +
    + + +
    + +
    Type
    +
    + + +
    + +
    +
    +
    +
    Tags
    +
    +
    +
    +
    + +
    +
    +
    Officers Involved
    +
    +
    +
    +
    +
    +
    +
    Civilians Involved
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    + +
    +
    Bolos
    +
    Refresh
    +
    +
    +
    +
    +
    +
    +
    +
    Manage Bolo
    +
    New
    +
    Save
    +
    +
    You are currently creating a new BOLO
    +
    Title
    +
    + + +
    + +
    Plate
    +
    + +
    Owner
    +
    + +
    Individual
    +
    + + +
    + +
    +
    +
    +
    Tags
    +
    +
    +
    +
    + +
    +
    +
    Officers Involved
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    +
    Vehicles
    +
    +
    + +
    +
    +
    +
    +
    Vehicle Information
    +
    Save
    +
    +
    + +
    +
    Registration Plate
    +
    +
    +
    Owner
    +
    +
    +
    Class
    +
    +
    +
    Make/Model
    +
    +
    +
    Image URL
    +
    +
    +
    +
    +
    +
    Known Information
    +
    +
    +
    Paint
    +
    Impound
    +
    BOLO
    +
    Code 5
    +
    Stolen
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    SAN ANDREAS STATE POLICE
    +
    Mobile Database Terminal
    +
    +
    +
    Loading...
    +
    00:00
    +
    +
    +
    Welcome, Loading... +
    +
    +
    +
    +
    + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/ui/img/court.png b/ui/img/court.png new file mode 100644 index 00000000..91243ea4 Binary files /dev/null and b/ui/img/court.png differ diff --git a/ui/img/ems_badge.png b/ui/img/ems_badge.png new file mode 100644 index 00000000..67a27808 Binary files /dev/null and b/ui/img/ems_badge.png differ diff --git a/ui/img/ems_badge_zonah.png b/ui/img/ems_badge_zonah.png new file mode 100644 index 00000000..9245457c Binary files /dev/null and b/ui/img/ems_badge_zonah.png differ diff --git a/ui/img/female.png b/ui/img/female.png new file mode 100644 index 00000000..21593434 Binary files /dev/null and b/ui/img/female.png differ diff --git a/ui/img/male.png b/ui/img/male.png new file mode 100644 index 00000000..d66d894e Binary files /dev/null and b/ui/img/male.png differ diff --git a/ui/img/not-found.jpg b/ui/img/not-found.jpg new file mode 100644 index 00000000..95c6a1c9 Binary files /dev/null and b/ui/img/not-found.jpg differ diff --git a/ui/img/profile_pic.png b/ui/img/profile_pic.png new file mode 100644 index 00000000..c3d55ce0 Binary files /dev/null and b/ui/img/profile_pic.png differ diff --git a/ui/img/sasp_badge.png b/ui/img/sasp_badge.png new file mode 100644 index 00000000..b7f0e2de Binary files /dev/null and b/ui/img/sasp_badge.png differ diff --git a/ui/img/warrant_pfp.png b/ui/img/warrant_pfp.png new file mode 100644 index 00000000..f2888703 Binary files /dev/null and b/ui/img/warrant_pfp.png differ diff --git a/ui/style.css b/ui/style.css new file mode 100644 index 00000000..71df059e --- /dev/null +++ b/ui/style.css @@ -0,0 +1,5854 @@ +@import url('https://fonts.googleapis.com/css?family=Montserrat'); + +:root { + --color-1: #1E3955; + --color-2: #213F5F; + --color-3: #2C537B; + --color-4: #23405E; + --color-5: #152638; + --color-6: #121f2c; + --color-7: rgb(28, 54, 82); + --color-8: #2554cc; + --color-9: #6E707C; + --color-10: #8f741b; +} + +body { + font-family: 'Montserrat', sans-serif; + overflow: hidden; + display: none; +} + +textarea { + font-family: 'Montserrat', sans-serif; +} + +::-webkit-scrollbar { + width: 0px; +} + +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.dashboard-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.badge-logo { + margin-left: 1vh +} + +.profile-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.incidents-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.bolos-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.reports-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.penalcode-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.dmv-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.stafflogs-page-container { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; + overflow: auto +} + +.container-load { + background-color: var(--color-9); + border-radius: 15px; + position: absolute; + width: 96.5%; + height: 96.5%; + left: 2.0%; + top: 1.5%; + display: none; +} + +.header { + height: 7vh; + background-color: var(--color-1); + border: 5px solid #393B39; + border-top-right-radius: 50px; + border-bottom-right-radius: 50px; + width: 96.5%; + position: absolute; + top: 5.5vh; + display: flex; + align-items: center; + user-select: none; +} + +.header-left { + display: flex; + flex-direction: column; + text-align: left; + margin-left: 10px; + margin-right: 0px; +} + +.header-middle { + background-color: var(--color-2); + border-radius: 15px; + width: fit-content; + height: fit-content; + padding: 10px; + padding-left: 20px; + padding-right: 20px; + display: flex; + flex-direction: column; + text-align: center; + color: white; + margin: auto; + font-size: 20px; +} + +.header-right { + display: flex; + flex-direction: column; + text-align: right; + margin: auto; + margin-right: 35px; + margin-left: 0px; +} + +.main-container { + border-top: 5px solid var(--color-3); + width: 100%; + height: 79.5%; + position: absolute; + display: flex; + bottom: 0; +} + +.nav-menu { + background-color: var(--color-1); + border-right: 5px solid var(--color-3); + min-width: 22.5vh; + height: 100%; + display: flex; + flex-direction: column; + user-select: none; + border-bottom-left-radius: 15px; +} + +.nav-item { + background-color: var(--color-4); + margin-top: 10px; + padding: 10px; + color: white; + font-size: 18px; + font-weight: bolder; +} + +.nav-item:hover { + background-color: var(--color-3); +} + +.active-nav { + background-color: var(--color-3); +} + +.warrants-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + +.warrants-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.fa-search { + font-size: 15px; + font-weight: normal; +} + +.warrants-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 55vh; +} + +.warrants-item { + background-color: var(--color-5); + width: 100%; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; +} + +.warrants-item:hover { + background-color: var(--color-3); +} + +.warrant-image { + width: 9vh; + height: 9vh; + margin-left: 5px; + margin-top: auto; + margin-bottom: auto; +} + +.warrant-title { + font-size: 16px; + font-weight: lighter; + color: white; + margin-top: 5px; +} + +.warrant-item-info { + color: #cccccc; + font-size: 12px; +} + +.warrant-bottom-info { + display: flex; + margin-top: 1vh; + margin-bottom: 0.75vh; + width: 100%; +} + +.warrant-id { + color: white; + font-size: 12px; +} + +.warrant-expiry-date { + color: white; + font-size: 12px; + margin: auto; + margin-right: 10px; +} + +.quotes-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + width: 50vh; + height: 75px; + margin-top: 10px; + margin-left: 10px; + display: flex; + align-items: center; + user-select: none; +} + +.quote-title { + font-size: 14px; + background-color: var(--color-4); + padding: 5px; + margin: 10px 0px 10px 10px; + text-align: center; + color: white; + font-weight: bolder; + width: 85px; + /* height: 30px; */ + text-shadow: black 1px 1px; +} + +.quote { + margin-right: 10px; + margin-left: 10px; + /* margin-bottom: 25px; */ + width: 100%; + background-color: var(--color-5); + height: 30px; + padding: 10px; + text-align: center; + display: flex; + font-style: italic; +} + +.quote-span { + margin: auto; + color: white; + font-size: 16px; +} + +.bulletin-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 100%; + width: 50vh; + margin-top: 10px; + margin-bottom: 8px; + margin-left: 10px; + user-select: none; + overflow: hidden; +} + +.bulletin-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-right: 0px; + margin-bottom: 0px; + width: 83.5%; + align-items: center; + user-select: none; +} + +.bulletin-items-continer { + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + overflow: auto; + height: 100%; + display: flex; + flex-direction: column; +} + +.bulletin-item { + background-color: var(--color-5); + width: 45vh; + /* min-height: 7.7vh; */ + /* height: 7.7vh; */ + padding: 10px; + display: flex; + flex-direction: column; + margin-bottom: 10px; +} + +.bulletin-item:hover { + background-color: var(--color-3); +} + +.bulletin-item-title { + color: white; + margin-left: 5px; + font-size: 20px; + text-align: left; +} + +span.bulletin-item-title { + outline: none; + border: none; +} + +span.bulletin-item-title[contenteditable]:empty::before { + content: 'Enter Title'; +} + +.bulletin-item-info { + color: #cccccc; + font-size: 15px; + margin-left: 5px; + margin-top: 10px; + text-align: left; + padding-bottom: 0.8vh; + overflow-wrap: break-word; +} + +span.bulletin-item-info { + outline: none; + border: none; +} + +span.bulletin-item-info[contenteditable]:empty::before { + content: 'Enter Bulletin Information'; +} + +.bulletin-bottom-info { + display: flex; + margin-left: 5px; + margin-bottom: 0px; + color: white; + font-size: 12px; + height: 100%; +} + +.bulletin-date { + margin: auto; + margin-right: 5px; + margin-bottom: 0px; +} + +.bulletin-id { + margin: auto; + margin-left: 0px; + margin-bottom: 0px; +} + +.dispatch-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + margin-right: 15px; +} + +.dispatch-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.active-unit-title { + background-color: var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 2px; + margin-left: 10px; + margin-left: 13px; + width: 57.5%; + align-items: center; + user-select: none; +} + +.active-unit-count { + background-color: var(--color-3); + color: white; + font-weight: bolder; + font-size: 14px; + padding-top: 6px; + padding-bottom: 6px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 3px; + margin-left: 3px; + width: 8%; + align-items: center; + user-select: none; + border-radius: 5px; +} + +.calls-title { + background-color: var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 2px; + margin-left: 10px; + margin-left: 13px; + width: 95%; + align-items: center; + user-select: none; +} + +#police-count { + background-color: #093095; +} + +#ems-count { + background-color: #950909; +} + +#doj-count { + background-color: #525252; +} + +#doc-count { + background-color: #7b25cc; +} + +#pa-count { + background-color: #008080; +} + +.active-unit-list { + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + overflow: auto; + height: 35vh; + display: flex; + flex-direction: column; + width: 95%; +} + +.active-unit-item { + padding-top: 7.5px; + padding-bottom: 7.5px; + padding-right: 10px; + padding-left: 10px; + /* height: 3vh; */ + background-color: var(--color-5); + display: flex; + align-items: center; + margin-bottom: 5px; +} + +#draggedItem { + position: absolute; + z-index: 80; + -webkit-transition: opacity 0.2s ease; + -moz-transition: opacity 0.2s ease; + -ms-transition: opacity 0.2s ease; + transition: opacity 0.2s ease; + opacity: 0; + pointer-events: none; + + padding: 10px; + height: 3vh; + background-color: var(--color-5); + display: flex; + align-items: center; + margin-bottom: 5px; + width: 45vh; +} + +.unit-status { + width: fit-content; + padding: 5px; + padding-left: 15px; + padding-right: 15px; + color: white; + font-size: 12px; + font-weight: bolder; + margin: auto; + margin-left: 5px; + margin-right: 0px; + background-color: #0B9509; + border-radius: 10px; +} + +.green-status { + background-color: #099517; +} + +.yellow-status { + background-color: #958F09; +} + +.unit-job { + width: fit-content; + padding: 5px; + padding-left: 15px; + padding-right: 15px; + color: white; + font-size: 12px; + font-weight: bolder; + margin: auto; + margin-left: 5px; + margin-right: 0px; + background-color: #093095; + border-radius: 10px; +} + +.unit-police { + background-color: #093095; +} + +.unit-ems { + background-color: #950909; +} + +.unit-doc { + background-color: #7b25cc; +} + +.unit-pa { + background-color: #008080; +} + +.unit-name { + margin: auto; + margin-left: 10px; + margin-right: 0px; + font-size: 12px; + font-weight: bolder; + color: white; +} + +.unit-radio { + margin: auto; + margin-right: 5px; + font-size: 12px; + font-weight: bolder; + color: white; + background-color: var(--color-3); + padding: 5px; + padding-left: 12.5px; + padding-right: 12.5px; + border-radius: 5px; +} + +.active-calls-list { + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + overflow: auto; + height: 100%; + display: flex; + flex-direction: column; + width: 95%; +} + +.active-calls-item { + height: fit-content; + background-color: var(--color-5); + display: flex; + align-items: center; + margin-bottom: 5px; + border-bottom-left-radius: 1vh; + border-top-left-radius: 1vh; +} + +.active-call-inner-container { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; +} + +.red-call { + background-color: #381515; +} + +.call-item-top { + height: 50%; + width: 100%; + display: flex; + align-items: center; + margin: auto; + margin-top: .5vh; +} + +.call-number { + background-color: #950909; + color: white; + font-size: 15px; + font-weight: bolder; + padding: 2.5px; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; + width: fit-content; + margin: auto; + margin-left: .75vh; + margin-right: 0; +} + +.call-code { + background-color: #097C95; + color: white; + font-size: 15px; + font-weight: bolder; + padding: 2.5px; + padding-left: 10px; + padding-right: 10px; + border-radius: 10px; + width: fit-content; + margin: auto; + margin-left: 5px; + margin-right: 0; +} + +.call-title { + color: white; + font-size: 20px; + font-weight: bolder; + padding: 2.5px; + padding-left: 0px; + padding-right: 0px; + border-radius: 10px; + width: fit-content; + margin: auto; + margin-left: 5px; + margin-right: 0; +} + +.call-radio { + margin: auto; + margin-left: auto; + margin-right: .5vh; + font-size: 15px; + font-weight: bolder; + color: white; + background-color: var(--color-3); + padding: 5px; + padding-left: 12.5px; + padding-right: 12.5px; + border-radius: 5px; +} + +.call-item-bottom { + height: fit-content; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + margin: auto; + margin-top: 0vh; + margin-left: .75vh; + padding-bottom: .75vh; +} + +.call-bottom-info { + color: white; + font-size: 15px; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + margin-left: 0.3vh; + overflow:wrap; + white-space:normal; +} + +.dispatch-line { + background-color: rgba(128, 128, 128, 0.1); + height: 0.05vh; + width: 100%; + margin-top: 0.1vh; + margin-bottom: 0.1vh +} + +.call-bottom-info > .far { + margin-right: .1vh; +} + +.call-bottom-information { + margin-top: 0.5vh; +} + +.call-victim { + color: white; + font-size: 15px; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + margin-left: 0px; +} + +a { + text-decoration: none; +} + +.profile-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + + + +.profile-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.profile-title:hover { + background-color: var(--color-3); +} + +.profile-search-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#profile-search-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#profile-search-input::placeholder { + color: white; +} + +.profile-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 100%; + margin-bottom: 15px; +} + +.profile-item { + background-color: var(--color-5); + width: 100%; + height: 9vh; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + +} + +.profile-item:hover { + background-color: var(--color-3); +} + +.profile-image { + width: 7vh; + height: 7vh; + margin-left: 10px; + margin-top: auto; + margin-bottom: auto; + object-fit: cover; +} + +.profile-item-title { + font-size: 16px; + font-weight: lighter; + color: white; + padding-top: 2px; +} + +.profile-tags { + display: flex; + overflow-x: auto; + width: 100%; + margin-top: 10px; + margin-bottom: 5px; +} + +.profile-tag { + margin: auto; + margin-left: 0px; + margin-right: 6px; + padding: 4px; + padding-left: 7px; + padding-right: 7px; + border-radius: 10px; + color: white; + font-size: 12px; + font-weight: bolder; + background-color: #956E09; +} + +.profile-bottom-info { + display: flex; + margin: auto; + width: 100%; +} + +.profile-id { + color: white; + font-size: 13px; +} + +.manage-profile-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + +.manage-profile-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.manage-profile-editing-title { + background-color: var(--color-3); + color: white; + font-size: 15px; + font-weight: lighter; + padding-top: 10px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + width: 80%; + align-items: center; + user-select: none; + display: block; +} + +.manage-profile-save { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 10px; + padding-bottom: 10px; + background-color: #1b8f25; + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.manage-profile-save:hover { + background-color: #1caa28; +} + +.manage-profile-info-container { + display: flex; + flex-direction: row; + width: 95%; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; +} + +.manage-profile-pic { + width: 45%; + object-fit: cover; +} + +.manage-profile-info-inner-container { + display: flex; + flex-direction: column; + width: 55%; +} + +.manage-profile-citizenid { + color: white; + margin-left: 10px; + font-size: 14px; + user-select: none; +} + +.manage-profile-citizenid-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 2px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.manage-cid-pic { + color: white; + font-size: 16px; + margin-left: 10px +} + +.line { + background-color: var(--color-3); + height: 2px; + margin-left: 10px; + margin-bottom: 10px; +} + +.manage-profile-name { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.manage-profile-name-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 2px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.manage-profile-dob { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.manage-profile-dob-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 2px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.manage-profile-job { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.manage-profile-job-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 2px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.manage-profile-url { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.manage-profile-url-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 2px; + color: white; + background-color: rgba(0, 0, 0, 0); + width: 21.75vh; +} + +.manage-profile-info { + width: 92.5%; + margin: auto; + margin-top: 10px; + margin-bottom: 15px; + border: none; + outline: none; + height: 100%; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; +} + +.manage-profile-fingerprint { + width: 92.5%; + margin: auto; + margin-top: 10px; + margin-bottom: 15px; + border: none; + outline: none; + height: 8%; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; + line-height: 1 +} + +.manage-profile-right-container { + display: flex; + flex-direction: column; + height: 95.7%; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + margin-right: 15px; +} + +.manage-profile-licenses-container { + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + height: 15%; +} + +.license-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.licenses-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + user-select: none; +} + +.license-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: rgb(255, 255, 255); + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; +} + +.manage-profile-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + min-height: 100px; + max-height: 200px; + overflow: scroll; +} + +.tags-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-right: 0px; + margin-bottom: 0px; + width: 84%; + align-items: center; + user-select: none; +} + +.tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.tags-add-btn:hover { + background-color: var(--color-3); +} + +.tags-holder { + overflow: auto; + margin: auto; + margin-top: 5px; + width: 95%; + user-select: none; +} + +.tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +span.tag-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.tag-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +.manage-profile-vehs-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + max-height: 150px; + overflow: scroll; +} + +.vehs-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.vehs-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + user-select: none; +} + +.veh-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; +} + +.manage-profile-houses-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + max-height: 150px; + overflow: scroll; +} + +.houses-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.houses-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + user-select: none; +} + +.houses-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: bolder; + background-color: white; + user-select: none; +} + +.manage-profile-gallery-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + height: 18vh; + overflow: scroll; +} + +.gallery-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-right: 0px; + margin-bottom: 0px; + width: 84%; + align-items: center; + user-select: none; +} + +.gallery-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.gallery-add-btn:hover { + background-color: var(--color-3); +} + +.gallery-inner-container { + overflow: auto; + white-space: nowrap; + margin: auto; + margin-top: 10px; + width: 95%; + user-select: none; +} + +.gallery-img { + width: 10vh; + filter: blur(5px); + object-fit: cover; +} + +.manage-convictions-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + max-height: 200px; + overflow: scroll; +} + +.convictions-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + +} + +.convictions-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + user-select: none; +} + +.loader { + position: absolute; + left: 50%; + top: 50%; + z-index: 1; + width: 120px; + height: 120px; + border: 12px solid var(--color-1); + border-radius: 50%; + border-top: 12px solid var(--color-3); + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; +} + +.profile-loader { + margin-top: 5vh; + margin-left: auto; + margin-right: auto; + z-index: 1; + width: 120px; + height: 120px; + border: 12px solid var(--color-4); + border-radius: 50%; + border-top: 12px solid var(--color-3); + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; +} + +@-webkit-keyframes spin { + 0% { -webkit-transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); } +} + +@keyframes spin { + 0% { transform: rotate(0deg); } + 100% { transform: rotate(360deg); } +} + +.gallery-image-enlarged { + width: 40vh; + position: absolute; + top: 20%; + left: 25%; + display: none; + z-index: 999; +} + +/* Context Menu */ + +.contextmenu { + position: absolute; + width: fit-content; + padding: 2px; + margin: 0; + border: 1px solid var(--color-3); + background: var(--color-5); + z-index: 100; + border-radius: 3px; + box-shadow: 1px 1px 4px rgba(0,0,0,.2); + opacity: 0; + transform: translate(0, 15px) scale(.95); + transition: transform 0.1s ease-out, opacity 0.1s ease-out; + pointer-events: none; +} + +.contextmenu-item { + display: block; + position: relative; + margin: 0; + padding: 0; + white-space: nowrap; +} + +.contextmenu-btn { + display: block; + color: white; + font-size: 13px; + cursor: pointer; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 8px; + border-radius: 3px; +} + +.contextmenu-btn { + outline: 0 none; + text-decoration: none; +} + +.contextmenu-text { + margin-left: 5px; +} + +.contextmenu-btn .fa { + position: absolute; + left: 8px; + top: 50%; + transform: translateY(-50%); +} + +.contextmenu-item-disabled { + opacity: .5; + pointer-events: none; +} + +.contextmenu-item-disabled .contextmenu-btn { + cursor: default; +} + +.contextmenu-item-submenu::after { + content: ""; + position: absolute; + right: 6px; + top: 50%; + transform: translateY(-50%); + border: 5px solid transparent; + border-left-color: #808080; +} + +.contextmenu-item-submenu:hover::after { + border-left-color: #fff; +} + +.contextmenu-show, +.contextmenu-item:hover > .contextmenu { + opacity: 1; + transform: translate(0, 0) scale(1); + pointer-events: auto; +} + +.contextmenu-item:hover > .contextmenu { + transition-delay: 300ms; +} + +.revoke-licence:hover { + background-color: #950909; +} + +.give-licence:hover { + background-color: #099517; +} + +.remove-image:hover { + background-color: #950909; +} + +.expand-image:hover { + background-color: #099517; +} + +.gallery-upload-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#gallery-upload-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#gallery-upload-input::placeholder { + color: white; +} + +.penalcode-embed { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 96.5%; + width: 85%; + margin: auto; + overflow: hidden; +} + +.penalcode-embed iframe { + height: 96.5%; + width: 98%; + margin: auto; + border: none; + outline: none; +} + +.incidents-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + +.incidents-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.incidents-title:hover { + background-color: var(--color-3); +} + +.incidents-search-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#incidents-search-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#incidents-search-input::placeholder { + color: white; +} + +.incidents-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 100%; + margin-bottom: 15px; +} + +.incidents-item { + background-color: var(--color-5); + width: 100%; + height: 5.5vh; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + flex-direction: column; +} + +.incidents-item:hover { + background-color: var(--color-3); +} + +.incidents-top-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; +} + +.incidents-item-title { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + max-width: 25vh; + margin-top: 5px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.incedent-report-name { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-top: 5px; +} + +.incidents-bottom-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; + padding-top: 5px; +} + +.incedent-report-id { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + margin-bottom: 5px; +} + +.incedent-report-time-ago { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-bottom: 5px; +} + +.manage-incidents-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + max-height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + overflow: auto; +} + +.manage-incidents-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: auto; + width: 80%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.manage-incidents-title:hover { + background-color: var(--color-3); +} + +.manage-incidents-create { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 5px; + padding-bottom: 5px; + align-items: center; + background-color: var(--color-4); + margin: auto; + margin-left: 5px; + margin-top: 10px; + /* margin-right: 0px; */ + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.manage-incidents-create:hover { + background-color: var(--color-3); +} + +.manage-incidents-save { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 5px; + padding-bottom: 5px; + background-color: #1b8f25; + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.manage-incidents-save:hover { + background-color: #1caa28; +} + +.manage-incidents-title-tag { + font-size: 16px; + font-weight: lighter; + color: white; + width: 95%; + margin: auto; + text-align: left; + margin-top: 10px; + margin-bottom: 0px; +} + +.manage-incidents-title-input { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-incidents-title-input input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-incidents-reports-content { + width: 91%; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + border: none; + outline: none; + min-height: 30vh; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; + pointer-events: none; +} + +.manage-incidents-tags-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.manage-incidents-tags-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-right: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.manage-incidents-tags-add-btn:hover { + background-color: var(--color-3); +} + +.manage-incidents-tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; + pointer-events: none; +} + +.manage-incidents-tags-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 5px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-incidents-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.manage-incidents-officers-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.manage-incidents-officers-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-right: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.manage-incidents-officers-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; + pointer-events: none; +} + +.manage-incidents-officers-add-btn:hover { + background-color: var(--color-3); +} + +.manage-incidents-officers-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 5px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-incidents-officers { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.manage-incidents-civilians-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.manage-incidents-civilians-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-right: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.manage-incidents-civilians-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; + pointer-events: none; +} + +.manage-incidents-civilians-add-btn:hover { + background-color: var(--color-3); +} + +.manage-incidents-civilians-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 5px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-incidents-civilians { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.manage-incidents-evidence-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.manage-incidents-evidence-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-right: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.manage-incidents-evidence-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; + pointer-events: none; +} + +.manage-incidents-evidence-add-btn:hover { + background-color: var(--color-3); +} + +.manage-incidents-evidence-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-incidents-evidence { + width: 10vh; + filter: blur(5px); +} + +span.tag-incident-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.tag-incident-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +span.officers-incident-input[contenteditable]:empty::before { + content: '(XXX) Officer Name'; +} + +.officers-incident-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +span.civilians-incident-input[contenteditable]:empty::before { + content: 'Civilian Name'; +} + +.civilians-incident-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +.associated-incidents-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +.associated-incidents-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.associated-incidents-title:hover { + background-color: var(--color-3); +} + +.associated-incidents-tags-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.associated-incidents-tags-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-right: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.associated-incidents-tags-add-btn:hover { + background-color: var(--color-3); +} + +.associated-incidents-tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; + pointer-events: none; +} + +.associated-incidents-tags-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.associated-incidents-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.incidents-upload-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#incidents-upload-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#incidents-upload-input::placeholder { + color: white; +} + +.incidents-img { + width: 10vh; + filter: blur(5px); + object-fit: cover; +} + +.bulletin-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.bulletin-add-btn:hover { + background-color: var(--color-3); +} + +.associated-incidents-user-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + width: 94%; + height: fit-content; + align-items: center; + user-select: none; +} + +.associated-incidents-user-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.associated-incidents-user-tags-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + min-height: 3.5vh; + max-height: 14vh; + user-select: none; + display: flex; + background-color: var(--color-5); +} + +.associated-incidents-user-tag { + text-decoration: none; + margin-top: auto; + margin-bottom: auto; + margin-left: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: white; + font-size: 12px; + font-weight: 600; + background-color: black; + user-select: none; + width: fit-content; +} + +.associated-incidents-user-holder { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + min-height: 3.5vh; + max-height: 37vh; + user-select: none; +} + +.associated-incidents-user { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.associated-incidents-fine-input { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.associated-incidents-fine-input input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.associated-incidents-sentence-input { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 15px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.associated-incidents-sentence-input input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.icidents-person-search { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-top: 32.5vh; +} + +.icidents-person-search-container { + background-color: var(--color-5); + width: 95vh; + height: 45vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 9999; + display: none; +} + +.icidents-person-search-title { + background-color: var(--color-4); + color: white; + font-size: 20px; + font-weight: bolder; + text-align: center; + padding-top: 15px; + padding-bottom: 15px; + width: 95%; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + user-select: none; +} + +.icidents-person-search-name-title { + width: 95%; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + color: white; + font-size: 15px; + text-align: left; + user-select: none; +} + +.icidents-person-search-name-input { + background-color: rgba(0, 0, 0, 0); + border: none; + outline: none; + color: white; + width: 100%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + text-align: left; + padding-bottom: 2.5px; +} + +.icidents-person-search-holder { + overflow: auto; + height: 30vh; + width: 95%; + margin: auto; + margin-top: 15px; + margin-bottom: 15px; +} + +.icidents-person-search-item { + width: 100%; + height: 12.5vh; + display: flex; + flex-direction: row; +} + +.icidents-person-search-item:hover { + background-color: var(--color-3); +} + +.icidents-person-search-item-pfp { + width: 11vh; + height: 11vh; + margin-top: auto; + margin-bottom: auto; + margin-left: 10px; +} + +.icidents-person-search-item-right { + display: flex; + flex-direction: column; + width: 100%; + margin-top: auto; + margin-bottom: auto; + margin-right: 10px; + margin-left: 10px; + height: 11vh; +} + +.icidents-person-search-item-right-cid-title { + width: 100%; + margin: auto; + margin-top: 0px; + margin-bottom: 0px; + color: white; + font-size: 16px; + text-align: left; + user-select: none; +} + +.icidents-person-search-item-right-cid-input { + width: 100%; + margin: auto; + margin-top: 5px; + margin-bottom: auto; + color: white; + font-size: 16px; + text-align: left; + padding-bottom: 2.5px; + border-bottom: 2px solid var(--color-3); + user-select: none; +} + +.icidents-person-search-item-right-name-title { + width: 100%; + margin: auto; + margin-top: auto; + margin-bottom: 0px; + color: white; + font-size: 16px; + text-align: left; + user-select: none; +} + +.icidents-person-search-item-right-name-input { + width: 100%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + color: white; + font-size: 16px; + text-align: left; + padding-bottom: 2.5px; + border-bottom: 2px solid var(--color-3); +} + +.bolos-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + +.bolos-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.bolos-title:hover { + background-color: var(--color-3); +} + +.bolos-search-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#bolos-search-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#bolos-search-input::placeholder { + color: white; +} + +.bolos-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 100%; + margin-bottom: 15px; +} + +.bolos-item { + background-color: var(--color-5); + width: 100%; + height: 5.5vh; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + flex-direction: column; +} + +.manage-bolos-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + max-height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + overflow: auto; +} + +.manage-bolos-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 10px; + width: 66%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.manage-bolos-title-tag { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-right: 0px; + margin-bottom: 0px; + width: 84%; + align-items: center; + user-select: none; +} + +.manage-bolos-title:hover { + background-color: var(--color-3); +} + + + +.manage-bolos-create { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 5px; + padding-bottom: 5px; + align-items: center; + background-color: var(--color-4); + margin: auto; + margin-left: 5px; + margin-top: 10px; + /* margin-right: 0px; */ + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.manage-bolos-create:hover { + background-color: var(--color-3); +} + +.manage-bolos-input-tag { + font-size: 16px; + font-weight: lighter; + color: white; + width: 95%; + margin: auto; + text-align: left; + margin-top: 10px; + margin-bottom: 0px; +} + +.manage-bolos-input-title { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-bolos-input-title input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-bolos-input-plate { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-bolos-input-plate input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-bolos-input-owner { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-bolos-input-owner input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-bolos-input-individual { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-bolos-input-individual input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-bolos-save { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: #1b8f25; + margin: auto; + margin-left: 0px; + margin-top: 10px; + margin-right: 13px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.manage-bolos-save:hover { + background-color: #1caa28; +} + +.manage-bolos-new { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: #8f1b1b; + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.manage-bolos-new:hover { + background-color: #aa1c1c; +} + +.manage-bolos-reports-content { + width: 91%; + margin: auto; + margin-top: 15px; + margin-bottom: 15px; + border: none; + outline: none; + height: 100%; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; +} + +.manage-bolos-right-container { + display: flex; + flex-direction: column; + height: 95.7%; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + margin-right: 15px; +} + +.manage-bolos-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + max-height: 150px; + overflow: scroll; +} + +.manage-bolos-gallery-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + height: 18vh; + overflow: scroll; +} + +.manage-bolos-tags-holder { + overflow: auto; + margin: auto; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-officers-tags-holder { + overflow: auto; + margin: auto; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.officers-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.officers-add-btn:hover { + background-color: var(--color-3); +} + +.manage-officers-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + max-height: 150px; + margin-top: 10px; + overflow: scroll; +} + +.bolo-item { + background-color: var(--color-5); + width: 100%; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + flex-direction: column; +} + +.bolo-item:hover { + background-color: var(--color-3); +} + +.bolo-top-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; +} + +.bolo-item-title { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + margin-top: 5px; +} + +.bolo-report-name { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-top: 5px; +} + +.bolo-bottom-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; + margin-top: 5px +} + +.bolo-report-id { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + margin-bottom: 5px; +} + +.bolo-report-time-ago { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-bottom: 5px; +} + +.bolos-search-refresh { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: var(--color-10); + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.bolos-search-refresh:hover { + background-color: #aa891c; +} + +.bolos-search-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 0px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + width: 80%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.bolos-search-title:hover { + background-color: var(--color-3); +} + +.manage-bolos-tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.manage-bolos-tags-add-btn:hover { + background-color: var(--color-3); +} + +span.tag-bolo-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.tag-bolo-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +span.officer-tag-bolo-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.officer-tag-bolo-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +.bolo-gallery-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.bolo-gallery-add-btn:hover { + background-color: var(--color-3); +} + +.bolo-gallery-upload-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#bolo-gallery-upload-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#bolo-gallery-upload-input::placeholder { + color: white; +} + +.bolo-img { + width: 10vh; + filter: blur(5px); + object-fit: cover; +} + +.bolo-gallery-inner-container { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-bolos-editing-title { + background-color: var(--color-3); + color: white; + font-size: 15px; + font-weight: lighter; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 10px; + width: 95%; + align-items: center; + user-select: none; +} + +.reports-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; +} + +#home-reports-container { + height: 50%; +} + +#home-warrants-container { + height: 50%; +} + +.dispatch-comms-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 45.5%; + width: 50vh; + margin-top: 1vh; + margin-left: 10px; +} + +.reports-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.reports-title:hover { + background-color: var(--color-3); +} + +.reports-search-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#reports-search-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#reports-search-input::placeholder { + color: white; +} + +.reports-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 100%; + margin-bottom: 15px; +} + +.dispatch-item { + height: auto; + padding: auto; + margin-top: 1vh; +} + +.dispatch-item:hover { + background-color: var(--color-7); +} + +.dispatch-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 94%; + height: 100%; +} + +.dispatch-message-profilepic { + width: 2.8vh; + height: 2.8vh; + object-fit: cover; + float: left; + border-radius: 50%; +} + +.dispatch-item-info { + float:left; + font-size: 14px; + font-weight: bold; + padding-left: 0.75vh; + color: var(--color-8); +} + +.dispatch-info-job-lspd { + color: #2554cc; +} + +.dispatch-info-job-bcso { + color: #cc7e25; +} + +.dispatch-info-job-sast { + color: #2589cc; +} + +.dispatch-info-job-sasp { + color: #2589cc; +} + +.dispatch-info-job-doc { + color: #7b25cc; +} + +.dispatch-info-job-sapr { + color: #5acc25; +} + +.dispatch-info-job-pa { + color: #008080; +} + +.dispatch-info-job-ambulance { + color: #cc2525; +} + +.dispatch-info-job-doj { + color: #FFEAB9; +} + +.active-info-job-lspd { + background-color: #2554cc; +} + +.active-info-job-bcso { + background-color: #cc7e25; +} + +.active-info-job-sast { + background-color: #2589cc; +} + +.active-info-job-sasp { + background-color: #2589cc; +} + +.active-info-job-doc { + background-color: #7b25cc; +} + +.active-info-job-sapr { + background-color: #5acc25; +} + +.active-info-job-pa { + background-color: #008080; +} + +.active-info-job-ambulance { + background-color: #cc2525; +} + +.active-info-job-doj { + background-color: #525252; +} + +.active-info-job-unk { + background-color: #6E707C; +} + +.dispatch-item-message { + float:left; + font-size: 14px; + font-weight: lighter; + color: white; + width: 100%; + overflow:wrap; + white-space:normal; + padding-left: 0.80vh; + padding-top: 0.2vh; +} + +.dispatch-item-msg { + padding-left: 2.8vh; + padding-bottom: 0vh; +} + +.dispatch-item-msg:hover { + background-color: var(--color-7); +} + +.dispatch-item-grid { + display:grid; +} + +.dispatch-input { + min-width: 90%; + max-width: 90%; + min-height: 0.1vh; + margin-left: 1.1vh; + margin-bottom: 1vh; + border: none; + padding: 12px 20px; + background-color: var(--color-7); + color: #bebec2; +} + +.dispatch-input:focus { + outline:none!important; +} + +.reports-search-refresh { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: var(--color-10); + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.reports-search-refresh:hover { + background-color: #aa891c; +} + +.dispatch-comms-refresh { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: var(--color-10); + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.dispatch-comms-refresh:hover { + background-color: #aa891c; +} + +.reports-search-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 0px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + width: 80%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.reports-search-title:hover { + background-color: var(--color-3); +} + +.manage-reports-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + max-height: 74.7vh; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + overflow: auto; +} + +.manage-reports-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: auto; + margin-left: 10px; + width: 80%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.manage-reports-title-tag { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-right: 0px; + margin-bottom: 0px; + width: 84%; + align-items: center; + user-select: none; +} + +.manage-reports-title:hover { + background-color: var(--color-3); +} + + + +.manage-reports-create { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 5px; + padding-bottom: 5px; + align-items: center; + background-color: var(--color-4); + margin: auto; + margin-left: 5px; + margin-top: 10px; + /* margin-right: 0px; */ + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.manage-reports-create:hover { + background-color: var(--color-3); +} + +.manage-reports-input-tag { + font-size: 16px; + font-weight: lighter; + color: white; + width: 95%; + margin: auto; + text-align: left; + margin-top: 10px; + margin-bottom: 0px; +} + +.manage-reports-input-title { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-reports-input-title input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-reports-input-type { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-reports-input-type input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-reports-input-owner { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-reports-input-owner input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-reports-input-individual { + color: white; + font-weight: lighter; + width: 95%; + margin: auto; + margin-top: 5px; + margin-bottom: 0px; + align-items: center; + display: flex; + border-bottom: 2px solid var(--color-3); +} + +.manage-reports-input-individual input { + border: none; + outline: none; + margin-left: 5px; + font-size: 16px; + margin-top: 5px; + color: white; + width: 100%; + background-color: rgba(0, 0, 0, 0); +} + +.manage-reports-save { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: #1b8f25; + margin: auto; + margin-left: 0px; + margin-top: 10px; + margin-right: 13px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.manage-reports-save:hover { + background-color: #1caa28; +} + +.manage-reports-new { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: #8f1b1b; + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.manage-reports-new:hover { + background-color: #aa1c1c; +} + +.incidents-remove-normal-tag:hover { + background-color: #aa1c1c; +} + +.incidents-remove-normal-civ:hover { + background-color: #aa1c1c; +} + +.incidents-remove-tag:hover { + background-color: #aa1c1c; +} + +.incidents-remove-officer-tag:hover { + background-color: #aa1c1c; +} + +.manage-reports-editing-title { + background-color: var(--color-3); + color: white; + font-size: 15px; + font-weight: lighter; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 10px; + width: 95%; + align-items: center; + user-select: none; + display: block; +} + +.manage-reports-reports-content { + width: 91%; + margin: auto; + margin-top: 15px; + margin-bottom: 15px; + border: none; + outline: none; + height: 100%; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; +} + +.manage-reports-right-container { + display: flex; + flex-direction: column; + height: 95.7%; + width: 50vh; + margin-top: 10px; + margin-left: 10px; + margin-right: 15px; +} + +.manage-reports-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + max-height: 150px; + overflow: scroll; +} + +.manage-reports-gallery-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + margin-top: 10px; + height: 18vh; + overflow: scroll; +} + +.manage-reports-tags-holder { + overflow: auto; + margin: auto; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.reports-officers-tags-holder { + overflow: auto; + margin: auto; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.reports-officers-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.reports-officers-add-btn:hover { + background-color: var(--color-3); +} + +.reports-officers-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + max-height: 150px; + margin-top: 10px; + overflow: scroll; +} + +.reports-gallery-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.reports-gallery-add-btn:hover { + background-color: var(--color-3); +} + +.reports-gallery-upload-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#reports-gallery-upload-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#reports-gallery-upload-input::placeholder { + color: white; +} + +.reports-img { + width: 10vh; + filter: blur(5px); + object-fit: cover; +} + +.reports-gallery-inner-container { + overflow: auto; + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.manage-reports-tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.manage-reports-tags-add-btn:hover { + background-color: var(--color-3); +} + +.reports-civilians-tags-container { + display: flex; + flex-direction: column; + background-color: var(--color-1); + width: 100%; + border: 2px solid var(--color-3); + max-height: 150px; + margin-top: 10px; + overflow: scroll; +} + +.reports-civilians-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7px; + padding-bottom: 7px; + margin: auto; + margin-top: 10px; + margin-left: 5px; + margin-bottom: 0px; + width: 10%; + text-align: center; +} + +.reports-civilians-add-btn:hover { + background-color: var(--color-3); +} + +.reports-civilians-tags-holder { + overflow: auto; + margin: auto; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.reports-item { + background-color: var(--color-5); + width: 100%; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + flex-direction: column; +} + +.reports-item:hover { + background-color: var(--color-3); +} + +.reports-top-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; +} + +.reports-item-title { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + margin-top: 5px; + max-width: 25vh; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.reports-report-name { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-top: 5px +} + +.reports-bottom-holder { + width: 100%; + height: 50%; + display: flex; + align-items: center; + margin-top: 5px; +} + +.reports-report-id { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-left: 5px; + margin-bottom: 5px; +} + +.reports-report-time-ago { + font-size: 14px; + font-weight: lighter; + color: white; + margin: auto; + margin-right: 5px; + margin-bottom: 5px; +} + +span.tag-reports-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.tag-reports-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +span.officer-tag-reports-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.officer-tag-reports-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +span.civilian-tag-reports-input[contenteditable]:empty::before { + content: 'Input Tag'; +} + +.civilian-tag-reports-input { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-top: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +.dmv-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50%; + margin-top: 10px; + margin-left: 10px; +} + +.dmv-search-refresh { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: var(--color-10); + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.dmv-search-refresh:hover { + background-color: #aa891c; +} + +.dmv-search-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.dmv-search-title:hover { + background-color: var(--color-3); +} + +.dmv-search-input { + background-color: var(--color-3); + color: white; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; + display: none; +} + +#dmv-search-input { + outline: none; + border: none; + width: 95%; + color: white; + font-size: 15px; + background-color: rgba(0, 0, 0, 0); + margin: auto; +} + +#dmv-search-input::placeholder { + color: white; +} + +.dmv-items { + display: flex; + flex-direction: column; + overflow: auto; + margin: auto; + margin-top: 10px; + width: 95%; + height: 100%; + margin-bottom: 15px; +} + +.vehicle-information-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 50%; + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +.vehicle-information-save { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: #1b8f25; + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; + display: block; +} + +.vehicle-information-save:hover { + background-color: #1caa28; +} + +.add-charge:hover { + background-color: #1caa28; +} + +.vehicle-information-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 0px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + width: 81%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.dmv-item { + background-color: var(--color-5); + width: 100%; + height: 9vh; + margin: auto; + margin-bottom: 10px; + margin-top: 0px; + display: flex; + user-select: none; + +} + +.dmv-item:hover { + background-color: var(--color-3); +} + +.dmv-image { + width: 7vh; + height: 7vh; + margin-left: 10px; + margin-top: auto; + margin-bottom: auto; + object-fit: cover; +} + +.dmv-item-title { + font-size: 16px; + font-weight: lighter; + color: white; + padding-top: 2px; +} + +.dmv-tags { + display: flex; + overflow-x: auto; + width: 98%; + margin-top: 10px; + margin-bottom: 5px; +} + +.dmv-tag { + margin: auto; + margin-left: 0px; + margin-right: 6px; + padding: 4px; + padding-left: 7px; + padding-right: 7px; + border-radius: 10px; + color: white; + font-size: 12px; + font-weight: bolder; + background-color: #956E09; +} + +.dmv-bottom-info { + display: flex; + margin: auto; + width: 100%; +} + +.dmv-id { + color: white; + font-size: 13px; +} + +.vehicle-info-stuff { + display: flex; + flex-direction: row; + width: 95%; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; +} + +.vehicle-info-image { + width: 444px; + height: 269px; + object-fit: cover; +} + +.vehicle-info-inner-container { + display: flex; + flex-direction: column; + width: 55%; +} + +.vehicle-info-plate { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.vehicle-info-plate-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 5px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.vehicle-info-owner { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.vehicle-info-owner-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 5px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.vehicle-info-class { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.vehicle-info-class-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 5px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.vehicle-info-model { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.vehicle-info-model-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 5px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.vehicle-info-imageurl { + color: white; + margin-left: 10px; + font-size: 15px; + user-select: none; +} + +.vehicle-info-imageurl-input { + border: none; + outline: none; + margin-left: 2.5px; + font-size: 16px; + margin-top: 5px; + color: white; + background-color: rgba(0, 0, 0, 0); +} + +.vehicle-info-icon { + color: white; + font-size: 16px; + margin-left: 10px +} + +.vehicle-info-line { + background-color: var(--color-3); + height: 2px; + margin-left: 10px; + margin-bottom: 10px; +} + +.vehicle-info-tags-container { + display: flex; + flex-direction: column; + border: 2px solid var(--color-3); + color: white; + font-size: 18px; + font-weight: bolder; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + height: fit-content; + align-items: center; + user-select: none; +} + +.vehicle-info-tags-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 5px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + width: 95%; + align-items: center; + user-select: none; +} + +.vehicle-info-tags-add-btn:hover { + background-color: var(--color-3); +} + +.vehicle-info-tags-add-btn { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 7.25px; + padding-bottom: 7.25px; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + margin-left: 5px; + margin-right: 0px; + width: 10%; + text-align: center; +} + +.vehicle-info-tags-holder { + overflow: auto; + margin: auto; + margin-top: 7px; + margin-bottom: 7px; + width: 95%; + max-height: 14vh; + user-select: none; +} + +.vehicle-info-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; +} + +.vehicle-info-content { + width: 93%; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + border: none; + outline: none; + min-height: 30.9vh; + resize: none; + background-color: var(--color-5); + color: white; + font-size: 16px; + padding: 10px; +} + +.vehicle-tags { + display: flex; + overflow-x: auto; + width: 98%; + margin-top: 5px; + margin-bottom: 5px; +} + +.vehicle-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + padding: 4px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: white; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + outline: none; + border: none; +} + +.stafflogs-container { + background-color: var(--color-1); + border: 2px solid var(--color-3); + display: flex; + flex-direction: column; + height: 74.7vh; + width: 100%; + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; + overflow: auto; +} + +.stafflogs-container > p { + color: white; + font-size: 1.3vh; + padding-left: 1vh; +} + +/* Vehicle Colors :( so long lol */ + +.black-color { + background-color: #0e0e0e; + color: white; +} + +.darksilver-color { + background-color: #333333; + color: white; +} + +.silver-color { + background-color: #333333; + color: white; +} + +.bluesilver-color { background-color: #c4d4e0; } + +.matteblack-color { + background-color: #141414; + color: white; +} + +.gray-color { + background-color: #808080; + color: white; +} + +.lightgray-color { background-color: #D3D3D3; } +.utilgunmetal-color { background-color: #39434d; } +.red-color { background-color: #c00e1a; } +.torinored-color { background-color: #da1918; } +.formulared-color { background-color: #b6111b; } +.blazered-color { background-color: #a51e23; } +.gracefulred-color { background-color: #7b1a22; } +.garnetred-color { background-color: #8e1b1f; } +.desertred-color { background-color: #6f1818; } +.cabernetred-color { background-color: #49111d; } +.candyred-color { background-color: #b60f25; } +.orange-color { background-color: #f78616; } +.gold-color { background-color: #c2944f; } +.mattedarkred-color { background-color: #732021; } +.matteyellow-color { background-color: #ffc91f; color: black } +.brightred-color { background-color: #de0f18; } +.darkgreen-color { background-color: #132428; } +.racingreen-color { background-color: #122e2b; } +.seagreen-color { background-color: #12383c; } +.olivegreen-color { background-color: #31423f; } +.green-color { background-color: #155c2d; } +.gasolinebluegreen-color { background-color: #1b6770; } +.mattelimegreen-color { background-color: #66b81f; } +.seawash-color { background-color: #65867f; } +.midnightblue-color { background-color: #222e46; } +.darkblue-color { background-color: #233155; } +.saxonyblue-color { background-color: #304c7e; } +.blue-color { background-color: #345df3; } +.diamondblue-color { background-color: #d6e7f1; } +.brightblue-color { background-color: #0b9cf1; } +.purpleblue-color { background-color: #2f2d52; } +.ultrablue-color { background-color: #2354a1; } +.lightningblue-color { background-color: #2446a8; } +.mattedarkblue-color { background-color: #1f2852; } +.matteblue-color { background-color: #253aa7; } +.yellow-color { background-color: #fbe212; color: black } +.bronze-color { background-color: #916532; } +.lime-color { background-color: #98d223; } +.champagne-color { background-color: #9b8c78; } +.beige-color { background-color: #F5F5DC; } +.darkivory-color { background-color: #473f2b; } +.brown-color { background-color: #3a2a1b; } +.lightbrown-color { background-color: #b5a079; } +.beechwood-color { background-color: #a4965f; } +.chocoorange-color { background-color: #752b19; } +.cream-color { background-color: #f7edd5; } +.white-color { background-color: #f0f0f0; color: black } +.steel-color { background-color: #6a747c; } +.blacksteel-color { background-color: #354158; } +.aluminium-color { background-color: #9ba0a8; } +.chrome-color { background-color: #5870a1; } +.wornwhite-color { background-color: #eae6de; color: black } +.offwhite-color { background-color: #dfddd0; color: black } +.lightorange-color { background-color: #f9a458; } +.pink-color { background-color: #f21f99; } +.blackblue-color { background-color: #0a0c17; } +.blackpurple-color { background-color: #0c0d18; } +.blackred-color { background-color: #0e0d14; } +.darkpurple-color { background-color: #621276; } +.olivedrab-color { background-color: #696748; } +.tan-color { background-color: #c3b492; } + +.reports-remove-image:hover { + background-color: #950909; +} + +.bolo-remove-image:hover { + background-color: #950909; +} + +.bolo-delete:hover { + background-color: #950909; +} + +.remove-bulletin:hover { + background-color: #950909; +} + +.search-vehicle:hover { + background-color: #956E09; +} + +.mark-code-5:hover { + background-color: #0B9509; +} + +.remove-code-5:hover { + background-color: #950909; +} + +.mark-stolen:hover { + background-color: #0B9509; +} + +.remove-stolen:hover { + background-color: #950909; +} + +.toggle-duty:hover { + background-color: #956E09; +} + +.set-callsign:hover { + background-color: #0B9509; +} + +.set-radio:hover { + background-color: #09956b; +} + +.incidents-ghost-holder { + overflow: auto; + max-height: 80vh; + margin-top: 10px; + margin-bottom: 10px; +} + +.incidents-charges-table { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin: auto; + margin-top: -25vh; +} + +.incidents-charges-table-container { + background-color: var(--color-5); + width: 155vh; + height: 85vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 9999; + user-select: none; +} + +.incidents-charges-title-container { + width: 95%; + height: 11vh; + background-color: var(--color-4); + margin: auto; + margin-top: 1.5vh; + margin-bottom: 0vh; + display: flex; + flex-direction: column; + border: 2px solid var(--color-4); +} + +.incidents-charges-title { + color: white; + margin: auto; + text-align: center; + align-items: center; + font-size: 22px; + font-weight: bolder; + margin-top: 1vh; +} + +.incidents-charges-title span { + color: #B4A684; + font-size: 19px; +} + +.incidents-charges-title-description { + color: white; + margin: auto; + background-color: var(--color-5); + text-align: left; + font-size: 17px; + padding: .5vh; + width: 97%; + margin-bottom: 1.5vh; +} + +.manage-incidents-editing-title { + background-color: var(--color-3); + color: white; + font-size: 15px; + font-weight: lighter; + padding-top: 10px; + padding-bottom: 10px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + margin-left: 10px; + width: 95%; + align-items: center; + user-select: none; +} + + +.current-charges-container { + width: 95%; + border: 2px solid var(--color-4); + margin: auto; + margin-top: 1.5vh; + margin-bottom: 0vh; + display: flex; +} + +.current-charges-inner-container { + background-color: var(--color-4); + width: 35vh; + height: fit-content; + margin: auto; + margin-left: 1vh; + margin-right: 0vh; + text-align: center; + display: flex; +} + +.current-charges-title { + color: white; + font-size: 19px; + font-weight: bolder; + padding: .25vh; + padding-left: 6vh; + padding-right: 6vh; + margin: auto; +} + +#current-charges-holder { + display: flex; + margin: auto; + width: 110vh; + margin-left: 1vh; + margin-right: 1vh; + overflow: hidden; +} + +.current-charges-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + padding: 5px; + padding-left: 7px; + padding-right: 7px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + background-color: white; + color: black; + white-space: nowrap; +} + +.offenses-title-container { + width: fit-content; + height: fit-content; + background-color: var(--color-4); + margin-left: 3.75vh; + margin-top: 1.5vh; + margin-bottom: 0vh; + display: flex; + border: 2px solid var(--color-4); +} + +.offenses-title { + color: white; + padding: .7vh; + padding-right: 3vh; + font-weight: bolder; + font-size: 1.4vh; +} + +.offenses-prepend-holder { + width: 95%; + background-color: var(--color-4); + margin: auto; + margin-top: 1.5vh; + margin-bottom: 0vh; + border: 2px solid var(--color-4); + display: grid; + grid-template-columns: auto auto auto auto; + grid-template-rows: auto auto auto auto; + row-gap: 0vh; + overflow: auto; +} + +.offense-item { + background-color: #0B9509; + border: 1.5px solid black; + height: 5.0vh; + margin: .5vh; + flex-direction: column; + color: white; + display: inline-block; + overflow: auto; + transition: all 0.15s ease-in-out; +} + +.offense-item:hover { + transform: scale(1.02); + transition: all 0.15s ease-in-out; +} + +.offense-item-offense { + margin: auto; + margin-left: .5vh; + margin-top: .5vh; + color: white; + font-size: 1.2vh; + font-weight: bold; +} + +.offfense-item-name { + margin: auto; + margin-right: .5vh; + margin-top: .5vh; + color: white; + font-size: 1.2vh; + font-weight: bold; +} + +.offense-item-id { + margin: auto; + margin-left: .5vh; + margin-bottom: .5vh; + color: white; + font-size: 1.2vh; + font-weight: bold; +} + +.offfense-item-months { + margin: auto; + margin-right: .5vh; + margin-bottom: .5vh; + color: white; + font-size: 1.2vh; + font-weight: bold; +} + +.offenses-main-container { + overflow: auto; + margin: auto; + margin-top: 1vh; + margin-bottom: 1vh; + width: 100%; +} + +.callsign-container { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-top: 40.5vh; +} + +.radio-container { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-top: 40.5vh; +} + +.radio-inner-container { + background-color: var(--color-5); + width: 30vh; + height: 17.5vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 9999; + border: .45vh solid white; +} + +.radio-title { + color: white; + font-size: 2vh; + font-weight: bold; + margin: auto; + margin-top: 2vh; + margin-bottom: 0vh; +} + +.radio-input { + width: 20vh; + margin: auto; + margin-top: 1.5vh; + margin-bottom: 0vh; + background-color: var(--color-6); + border: none; + outline: none; + font-size: 2vh; + color: white; + text-align: center; + padding: 1vh; +} + +.radio-buttons { + width: 20vh; + margin: auto; + margin-top: 1.5vh; + display: flex; + flex-direction: row; +} + +.radio-cancel { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #D77A0D; + border-radius: 1vh; + margin: auto; + user-select: none; +} + +.radio-cancel:hover { + background-color: #f18f1e; +} + +.radio-submit { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #0B9509; + border-radius: 1vh; + margin: auto; + user-select: none; +} + +.radio-submit:hover { + background-color: #15ac12; +} + +.callsign-inner-container { + background-color: var(--color-5); + width: 30vh; + height: 17.5vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 9999; + border: .45vh solid white; +} + +.callsign-title { + color: white; + font-size: 2vh; + font-weight: bold; + margin: auto; + margin-top: 2vh; + margin-bottom: 0vh; +} + +.callsign-input { + width: 20vh; + margin: auto; + margin-top: 1.5vh; + margin-bottom: 0vh; + background-color: var(--color-6); + border: none; + outline: none; + font-size: 2vh; + color: white; + text-align: center; + padding: 1vh; +} + +.callsign-buttons { + width: 20vh; + margin: auto; + margin-top: 1.5vh; + display: flex; + flex-direction: row; +} + +.callsign-cancel { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #D77A0D; + border-radius: 1vh; + margin: auto; + user-select: none; +} + +.callsign-cancel:hover { + background-color: #f18f1e; +} + +.callsign-submit { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #0B9509; + border-radius: 1vh; + margin: auto; + user-select: none; +} + +.callsign-submit:hover { + background-color: #15ac12; +} + + +/* Keep At Bottom */ + +.red-tag { + background-color: #950909; +} + +.orange-tag { + background-color: #956E09; +} + +.green-tag { + background-color: #0B9509; +} + +.white-tag { + display: inline-block; + text-decoration: none; + margin: auto; + margin-left: 0px; + margin-right: 10px; + margin-bottom: 6px; + padding: 7px; + padding-left: 8px; + padding-right: 8px; + border-radius: 10px; + color: black; + font-size: 12px; + font-weight: 600; + background-color: white; + user-select: none; + width: fit-content; + background-color: white; + color: black; +} + +.orange-penis-code { + background-color: #D77A0D; +} + +.green-penis-code { + background-color: #0B9509; +} + +.red-penis-code { + background-color: #950909; +} + +.header-pin { + padding-right: 5px; +} + +.priority-1 { + background-color: #bb0404; +} + +.priority-2 { + background-color: #ce7808; +} + +.call-bottom-info > span { + padding-right: 0.5vh; +} + +.call-attach:hover { + background-color: #1caa28; +} + +.Set-Waypoint:hover { + background-color: #f18f1e; +} + +.call-detach:hover { + background-color: #950909; +} + +.dispatch-attached-units { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; +} + +.active-unit-item:hover { + background-color: var(--color-3); +} + +.active-calls-item:hover { + background-color: var(--color-3); +} + +.dispatch-attached-units-container { + background-color: var(--color-1); + width: 92vh; + height: 46vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 1; + border: 2px solid #FFFFFF; + display: none; + margin-top: 32.5vh; +} + +.dispatch-attached-units-title { + background-color: var(--color-4); + color: white; + font-size: 20px; + font-weight: bolder; + text-align: center; + padding-top: 15px; + padding-bottom: 15px; + width: 95%; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + user-select: none; +} + +.dispatch-attached-units-holder { + margin: auto; + margin-top: 10px; + margin-bottom: 10px; + overflow: auto; + height: 37.8vh; + display: flex; + flex-direction: column; + width: 95%; +} + +.dispatch-attached-unit-item { + padding: 10px; + height: 3vh; + background-color: var(--color-5); + display: flex; + align-items: center; + margin-bottom: 5px; +} + +.attached-units:hover { + background-color: rgb(156, 156, 156); +} + +.Set-Dispatch-Waypoint:hover { + background-color: #f18f1e; +} + +.call-dispatch-detach:hover { + background-color: #950909; +} + +.incidents-title { + background-color: var(--color-4); + color: white; + font-size: 18px; + font-weight: bolder; + padding-top: 5px; + padding-bottom: 0px; + text-align: center; + margin: auto; + margin-top: 10px; + margin-bottom: 0px; + margin-right: 0px; + width: 80%; + /* width: 66%; */ + align-items: center; + user-select: none; +} + +.incidents-title:hover { + background-color: var(--color-3); +} + +.incidents-search-refresh { + width: 13.7%; + font-size: 15px; + font-weight: lighter; + padding-top: 7px; + padding-bottom: 7px; + background-color: var(--color-10); + margin: auto; + margin-left: 5px; + margin-top: 10px; + margin-bottom: 0px; + color: white; + text-align: center; + user-select: none; +} + +.incidents-search-refresh:hover { + background-color: #aa891c; +} + +.respond-calls { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin-top: 32.5vh; +} + +.respond-calls-container { + background-color: var(--color-5); + width: 70vh; + min-height: 30vh; + max-height: 40vh; + margin: auto; + display: flex; + flex-direction: column; + z-index: 9999; + overflow: auto; +} + +.respond-calls-title { + background-color: var(--color-4); + color: white; + font-size: 20px; + font-weight: bolder; + text-align: center; + padding-top: 15px; + padding-bottom: 15px; + width: 95%; + margin: auto; + margin-top: 15px; + margin-bottom: 0px; + user-select: none; +} + +.respond-calls-input { + width: 92.5%; + margin-top: 10px; + margin-bottom: 10px; + outline: solid 3px #1B3047; + margin-left: 27px; + min-height: 21.5vh; + max-height: 21.5vh; + border: none; + padding: 10px 10px; + background-color: transparent; + color: #dadada; + resize: none; + font-size: 16px; +} + +.respond-calls-input:focus { + outline: solid 3px #1B3047; +} + +.respond-calls-responses { + width: 95%; + margin-left: 1.7vh +} + +.respond-calls-response { + color: #dadada; + margin-top: 0.5vh; + padding: 0.5vh; + background-color: rgba(32, 32, 32, 0.5); + color: #FFFFFF; +} + +.offenses-search-area { + width: 95%; + border: 2px solid var(--color-4); + height: 3vh; + margin: 1.5vh auto 0vh; + display: flex; +} + +.offenses-search { + background: transparent; + border: none; + outline: none; + font-size: 1.2vh; + color: rgb(255, 255, 255); + font-family: Roboto, sans-serif; + font-style: normal; + font-weight: normal; + margin-left: 1vh; + padding-top: 10px; + padding-bottom: 10px; +} + +.impound-form { + display: flex; + flex-direction: column; + + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + + width: 750px; + height: 375px; + background: var(--color-5); + border: 1px solid white; +} + +.impound-form > form { + position: absolute; + left: 10%; + width: 73%; + height: 100%; +} + +.impound-form > form > input { + border: none; + outline: none; + font-size: 24px; + color: white; + + background: transparent; + border: 1px solid rgb(168, 168, 168); + + width: 100%; + height: 13.5%; + + margin-top: 20px; + padding-left: 10%; +} + +.impound-form > form > i { + position: absolute; + color: white; + font-size: 24px; + margin-top: 37.5px; + margin-left: 12.6px; +} + +.impound-buttons { + position: absolute; + margin: auto; + display: flex; + flex-direction: row; + bottom: 6%; + left: 10%; +} + +.impound-cancel { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #D77A0D; + border-radius: 1vh; + margin: auto; + user-select: none; +} + +.impound-cancel:hover { + background-color: #f18f1e; +} + +.impound-submit { + color: white; + padding: .5vh; + padding-left: 1vh; + padding-right: 1vh; + background-color: #0B9509; + border-radius: 1vh; + margin: auto; + user-select: none; + margin-left: 10px; +} + +.impound-submit:hover { + background-color: #15ac12; +} + +.status-impound:hover { + background-color: #ac8312; +} + +.remove-impound:hover { + background-color: #ac1212; +} + +.impound-vehicle:hover { + background-color: #12ac1f; +} + +.impound-fee { + color: white; +} + +.dispatch-reply:hover { + background-color: var(--color-1); +} +.display_hidden{ + display: none; +} \ No newline at end of file