update,
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"customers":[{"userID":1,"email":"jerry@gmail.com","fname":"Jerry","lname":"Kwok","pwd":"admin","rule":"user"},{"userID":2,"email":"alex@gmail.com","fname":"Alex","lname":"Ng","pwd":"admin","rule":"admin"},{"userID":3,"email":"marywong@gmail.com","fname":"Mary","lname":"Wong","pwd":"admin","rule":"user"},{"userID":4,"email":"stephy@gmail.com","fname":"Stephy","lname":"Liu","pwd":"admin","rule":"operator"},{"userID":5,"email":"tongwong@gmail.com","fname":"Tong","lname":"Wong","pwd":"admin","rule":"user"},{"userID":6,"email":"edwardleung@gmail.com","fname":"Edward","lname":"Leung","pwd":"admin","rule":"admin"},{"userID":7,"email":"test@gmail.com","fname":"abd","lname":"cab","pwd":"admin","rule":"user","favorite":[]},{"userID":8,"email":"jerry.kwok.khh@gmail.com","fname":"Jerry","lname":"Kwok","pwd":"admin","rule":"user","favorite":[]},{"userID":9,"email":"happy123@gmail.com","fname":"Jerry","lname":"Kwok","pwd":"asd","rule":"user","favorite":[]},{"userID":10,"email":"test123123@gmail.com","fname":"Jerry","lname":"Kwok","pwd":"admin","rule":"user","favorite":[]}]}
|
@@ -0,0 +1 @@
|
||||
{"userID":2,"email":"alex@gmail.com","fname":"Alex","lname":"Ng","pwd":"admin","favorite":[0,1]}
|
@@ -0,0 +1 @@
|
||||
{"userID":1,"email":"jerry@gmail.com","fname":"Jerry","lname":"Test","pwd":"admin","favorite":["7","2","4"]}
|
113
it114105/itp4506/Assignment/19-20/jsonDB/restaurants.json
Normal file
113
it114105/itp4506/Assignment/19-20/jsonDB/restaurants.json
Normal file
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"restaurants":[
|
||||
{
|
||||
"id": 1,
|
||||
"image":"images/NeNeChickenTKO.jpeg",
|
||||
"name":"ABC Chicken",
|
||||
"tel": "21800000",
|
||||
"address": "Tseung Kwan O Road",
|
||||
"opTime": "9:00 AM",
|
||||
"clTIme": "9:00 PM",
|
||||
"user": "stephy@gmail.com",
|
||||
"tag":[
|
||||
"Noodles",
|
||||
"Koeran"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"image":"images/NeNeChickenTst.jpg",
|
||||
"name":"NeNe Chicken",
|
||||
"tel": "21800000",
|
||||
"address": "Tseung Kwan O Road",
|
||||
"opTime": "10:00 AM",
|
||||
"clTIme": "9:00 PM",
|
||||
"user": "stephy@gmail.com",
|
||||
"tag":[
|
||||
"Noodles",
|
||||
"Koeran"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"image":"images/TeaWood.jpg",
|
||||
"name":"TeaWood Cafe",
|
||||
"tel": "21800000",
|
||||
"address": "Shop L4-19, 4/F, apm Millennium City 5, 418 Kwun Tong Road, Kwun Tong, Hong Kong",
|
||||
"opTime": "11:00 AM",
|
||||
"clTIme": "10:00 PM",
|
||||
"user": "operator@gmail.com",
|
||||
"tag":[
|
||||
"Taiwanese",
|
||||
"Rice"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"image":"images/TamJai.jpg",
|
||||
"name":"TamJai SamGor",
|
||||
"tel": "21805650",
|
||||
"address": "Portion A, Shop 15, G/F, Kai Tin Tower, 55-63 Kai Tin Road, Lam Tin, Hong Kong",
|
||||
"opTime": "11:00 AM",
|
||||
"clTIme": "10:00 PM",
|
||||
"user": "operator@gmail.com",
|
||||
"tag":[
|
||||
"Noodles",
|
||||
"Chinese"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"image":"images/Satay.jpg",
|
||||
"name":"Satay King ",
|
||||
"tel": "21801234",
|
||||
"address": "Room C & D, G/F, Block 2, Kwun Tong Industrial Centre, 464-466 Kwun Tong Road, Kwun Tong, X Hong Kong",
|
||||
"opTime": "11:00 AM",
|
||||
"clTIme": "9:30 PM",
|
||||
"user": "operator@gmail.com",
|
||||
"tag":[
|
||||
"Chinese",
|
||||
"Western"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"image":"images/Dimsum.jpg",
|
||||
"name":"Dim Sum",
|
||||
"tel": "21845687",
|
||||
"address": "Emperor Watch & Jewellery Ctr, 2/F Russell St, Causeway Bay",
|
||||
"opTime": "11:30 AM",
|
||||
"clTIme": "11:00 PM",
|
||||
"user": "operator@gmail.com",
|
||||
"tag":[
|
||||
"Dim Sum"
|
||||
]
|
||||
}
|
||||
],
|
||||
"commRestaurants":[
|
||||
{
|
||||
"resID":1,
|
||||
"userID": 3,
|
||||
"comment":"It is Good",
|
||||
"rate":5
|
||||
},
|
||||
{
|
||||
"resID":1,
|
||||
"userID":2,
|
||||
"comment":"It is Good AR",
|
||||
"rate":3
|
||||
},
|
||||
{
|
||||
"resID": 1,
|
||||
"userID": 4,
|
||||
"comment":"It is not Good AR",
|
||||
"rate":3
|
||||
},
|
||||
{
|
||||
"resID":1,
|
||||
"userID":5,
|
||||
"comment":"Yummy",
|
||||
"rate":2
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1 @@
|
||||
{"userID":4,"email":"stephy@gmail.com","fname":"Stephy","lname":"Liu","pwd":"admin","favorite":[]}
|
17
it114105/itp4506/Assignment/19-20/jsonDB/update.php
Normal file
17
it114105/itp4506/Assignment/19-20/jsonDB/update.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
if(isset($_POST["fav"])){
|
||||
$jsonCustomer = $_POST["dataCus"];
|
||||
print($jsonCustomer);
|
||||
$jsonCustomerPath = $_POST["dataEmail"].".json";
|
||||
print($jsonCustomerPath);
|
||||
file_put_contents($jsonCustomerPath, $jsonCustomer);
|
||||
}else{
|
||||
$jsonAdmin = $_POST["dataAdmin"];
|
||||
$jsonCustomer = $_POST["dataCus"];
|
||||
$jsonAdminPath = "adminCustomer.json";
|
||||
file_put_contents($jsonAdminPath, $jsonAdmin);
|
||||
$jsonCustomerPath = $_POST["dataEmail"].".json";
|
||||
fopen($jsonCustomerPath, "w");
|
||||
file_put_contents($jsonCustomerPath, $jsonCustomer);
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user