database.sql
row spec.
ID = Primary auto_increment
Nome = Name of object in items table
Label = Name showed in gcphone
Attuale = Actual price , change every time stocks change [do not insert any value]
Min = Minium price of item
Max = Maxium price of item
Med = medion value [do not insert any value]
function getBourse()
nome = {}
prezzo = {}
medio = {}
differenza = {}
local result = MySQL.Sync.fetchAll("SELECT * FROM borsa",{})
local qnt = #result
for i=1, qnt, 1 do
nome[i] = result[i].Label
prezzo[i] = result[i].Attuale
medio[i] = result[i].Med
differenza[i] = prezzo[i] - medio[i]
end
local result = {}
for i=1, qnt, 1 do
local line = {libelle = nome[i], price = prezzo[i], difference = differenza[i]}
table.insert(result, line)
end
return result
end
return 0 === t.difference ? ["fa-arrow-right", "iblue"] : t.difference < 0 ? ["fa-arrow-up", "ired"] : ["fa-arrow-down", "igreen"]
return 0 === t.difference ? ["fa-arrow-right", "iblue"] : t.difference < 0 ? ["fa-arrow-down", "igreen"] : ["fa-arrow-up", "ired"]
start rdsk_borsa start gcphone