I have table of invoices where each invoice has multiple expense row with different values. I store invoices and expenses in seperate db tables. I display all the invoices inside table on main page and I allow user to check checkboxes and each time they check it, correlated row of invoice gets pusshed into the array as an object. So I get somethnig like this
[{
"id": 587,
"name": "Ornek",
"cariKodu": "129896",
"adres": "HACI HALIL MAH. KIZILAY CAD. NO:29/B\nGEBZE / KOCAELI",
"il": "ILYASBEY",
"ilce": "Gebze"
}, {
"id": 589,
"name": "Ornek_1",
"cariKodu": "34324",
"adres": "Ataşehir Konakları",
"il": "İstanbul",
"ilce": "Araşehir"
}]
What I want is to make an array like this with expenses and push it into the array above. But I list invoices and expenses in two different pages so I don't know how to send data between those pages. I want to have one super array where each index of it is an object and inside that object I is another array of objects.
I know it's little complicated but I tried my best to explain it.