-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
38 lines (34 loc) · 1.26 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function add_bid(){
var allbids = JSON.parse(localStorage.getItem('bids')) || [];
var airline = document.getElementById("airline").value;
var flight = document.getElementById("flightno").value;
var amount = document.getElementById("deptime").value;
var timestamp = Math.floor(Date.now() / 1000);
var route = document.getElementById("route").value;
var aircraft = document.getElementById("aircraft").value;
var reg = document.getElementById("reg").value;
var dep = document.getElementById("depicao").value;
var arr = document.getElementById("arricao").value;
var randomId = Math.floor(Math.random() * 1000000000);
var eft = document.getElementById("eft").value;
var date = document.getElementById("date").value;
var alt = document.getElementById("alt").vlaue;
var bid = {
airline: airline,
flight: flight,
amount: amount,
timestamp: timestamp,
route: route,
aircraft: aircraft,
reg: reg,
dep: dep,
arr: arr,
eft: eft,
id: randomId,
date: date,
alt: alt
};
alert("Bid added successfully!");
allbids.push(bid);
localStorage.setItem('bids', JSON.stringify(allbids));
}