diff --git a/css/index.css b/css/index.css index e606a71..c10ce37 100644 --- a/css/index.css +++ b/css/index.css @@ -51,6 +51,15 @@ body { height: 20px; width: 20px; } +.iconWrapper .page-link { + padding: 0.35rem 0.4rem; +} +.iconWrapper li img { + margin: 0; +} +.iconWrapper li.active img { + filter: invert(100%); +} .card-columns .card { display: inline-block; @@ -96,6 +105,9 @@ body.dollars span.price::after { .itemAmountWrapper { clear: both; } +.itemAmountText { + font-size: 0.9rem; +} .itemAmount.itemAmountBtn { -webkit-appearance: none; -moz-appearance: textfield; diff --git a/icon/basket2.svg b/icon/basket2.svg new file mode 100644 index 0000000..8f60297 --- /dev/null +++ b/icon/basket2.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/icon/check-all.svg b/icon/check-all.svg new file mode 100644 index 0000000..ae42900 --- /dev/null +++ b/icon/check-all.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/icon/list-check.svg b/icon/list-check.svg new file mode 100644 index 0000000..dcce4b6 --- /dev/null +++ b/icon/list-check.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plan/do.php b/plan/do.php index 460ca45..0c958e5 100644 --- a/plan/do.php +++ b/plan/do.php @@ -142,6 +142,19 @@ if(!empty($data) && isset($user_id)){ returns($db->error,1); } + else if($data['plan'] == "setState"){ + + if(($temp = checkArgs(array("storeID"=>@$data['storeID'], "state"=>@$data['state']))) !== true){ + returns("Missing a value: $temp", 1); + } + + if( setState($data['storeID'], $data['state']) ){ + returns(); + } + + returns($db->error, 1); + } + else if($data['plan'] == 'spaces'){ $spaces = []; $getOwnedSpacesSQL = "SELECT space_id, space_name, owner_id userid FROM plan_space s WHERE s.owner_id = $user_id;"; @@ -418,3 +431,16 @@ function setItemAmount($storeID, $itemID, $newAmount = 1){ return false; } + +function setState($storeID, $newState){ + global $db, $spaceID; + + $verifyUserOwnershipSQL = "SELECT `plan_store_id` FROM plan_store WHERE `space_id` = '$spaceID' AND `plan_store_id` = '$storeID'"; + $setStateSQL = "UPDATE plan_store SET state = '$newState' WHERE plan_store_id = ($verifyUserOwnershipSQL);"; + + if($db->query($setStateSQL)){ + return true; + } + + return false; +} \ No newline at end of file diff --git a/plan/plan.js b/plan/plan.js index 25f2168..ad6e752 100644 --- a/plan/plan.js +++ b/plan/plan.js @@ -1,9 +1,9 @@ /*jshint sub:true, esversion: 6, -W083 */ class Store { - constructor(title, storeID) { + constructor(title, storeID, state) { this.items = []; - this.state = 'unlocked'; // states: unlocked/locked + this.state = state || 'planning'; // states: planning/shopping/closed let storeNum = $(".store").length+1; this.title = title || "Store "+storeNum; @@ -12,13 +12,20 @@ class Store { let html = ""; html += "
"; html += "
"+this.title+"
"; - html += "
Lock the store
"; + html += "
"; + html += " "; + html += "
"; html += "
"; html += " edit name"; + // html += " sort items"; html += " remove store"; html += "
"; html += "
"; - html += "