From 261a9c720cd20098c821c3796afdf81ebc6d7ab1 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Tue, 18 May 2021 21:41:00 +0700 Subject: [PATCH 001/155] created common function files for sorting by features and created time --- private/check-featured-stores-products.php | 1 + private/created-time-function.php | 1 + 2 files changed, 2 insertions(+) create mode 100644 private/check-featured-stores-products.php create mode 100644 private/created-time-function.php diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php new file mode 100644 index 00000000..b3d9bbc7 --- /dev/null +++ b/private/check-featured-stores-products.php @@ -0,0 +1 @@ + Date: Wed, 19 May 2021 11:26:06 +0700 Subject: [PATCH 002/155] added functions to check featured products and stores --- private/check-featured-stores-products.php | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index b3d9bbc7..11839494 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -1 +1,24 @@ Date: Wed, 19 May 2021 11:34:27 +0700 Subject: [PATCH 003/155] debugged functions to check featured products and stores --- private/check-featured-stores-products.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index 11839494..cf0c961b 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -1,10 +1,11 @@ Date: Wed, 19 May 2021 11:41:20 +0700 Subject: [PATCH 004/155] added documentation for checking featured products on home and mall page --- private/check-featured-stores-products.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index cf0c961b..7e70716c 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -2,6 +2,14 @@ require_once "csv.php"; require_once "../private/database/products.csv"; + /** + * Check if products are featured on the Mall Home page + * user input + * @param int $product_id + * id required for the input + * true if user input has TRUE value, + * false otherwise. + */ function check_featured_products($product_id) { $products = read_csv("../../../../private/database/products.csv", true); foreach ($products as $p) { @@ -12,6 +20,14 @@ function check_featured_products($product_id) { return false; } + /** + * Check if Check if featured products on the Store Home page(s) + * user input + * @param int $store_id + * id required for the input + * true if user input has TRUE value, + * false otherwise. + */ function check_featured_stores($store_id) { $stores = read_csv("../../../../private/database/products.csv", true); foreach ($stores as $s) { From 4735de84ff8406f717230ec68dec0dee94168de7 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 11:43:19 +0700 Subject: [PATCH 005/155] temporarily apply method=POST to test the query --- public/mall/browse/index.php | 93 ++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 20 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index fc59446d..203a7496 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -5,36 +5,89 @@ $page_title = "Yabe | Browse"; $style_sheets = [ "/css/common.css", + "/css/browse.css", + "/css/cards.css", + "/css/pagination.css", ]; $scripts = [ "/js/common.js", ]; include(SHARED_PATH . "/top.php"); +include("../../../private/csv.php"); ?> -
- -

BROWSE

+
-

Advanced browsing page with filtering features to be further implemented with PHP

- -

Browse Products

- - -

Browse Stores

- + +
+
+ + + image representation of a shop + $store_name +
+ "; + } + } + } + } + } + } + } + + ?> + +
-
+
\ No newline at end of file From ac3c20db5367ffea08bdc78280e91d51830cf4d5 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Wed, 19 May 2021 11:47:01 +0700 Subject: [PATCH 006/155] debugged featured products on home and mall page --- private/check-featured-stores-products.php | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index 7e70716c..ee313904 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -10,11 +10,11 @@ * true if user input has TRUE value, * false otherwise. */ - function check_featured_products($product_id) { - $products = read_csv("../../../../private/database/products.csv", true); - foreach ($products as $p) { - if (($p['featured_in_mall'] == TRUE) && ($p['id'] == $product_id)) { - return $p; + function check_featured_products($mall_product_id) { + $mall_products = read_csv("../../../../private/database/products.csv", true); + foreach ($mall_products as $p_mall) { + if (($p_mall['featured_in_mall'] == TRUE) && ($p_mall['id'] == $mall_product_id)) { + return $p_mall; } } return false; @@ -23,19 +23,22 @@ function check_featured_products($product_id) { /** * Check if Check if featured products on the Store Home page(s) * user input - * @param int $store_id + * @param int $store_product_id * id required for the input * true if user input has TRUE value, * false otherwise. */ - function check_featured_stores($store_id) { - $stores = read_csv("../../../../private/database/products.csv", true); - foreach ($stores as $s) { - if (($s['featured_in_store'] == TRUE) && ($s['id'] == $store_id)) { - return $s; + function check_featured_stores(int $store_product_id) { + $store_products = read_csv("../../../../private/database/products.csv", true); + foreach ($store_products as $p_store) { + if (($p_store['featured_in_store'] == TRUE) && ($p_store['id'] == $store_product_id)) { + return $p_store; } } return false; } + + + \ No newline at end of file From 56ed9df9149e9a91430cbdc871b7b57616e110d9 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Wed, 19 May 2021 11:48:23 +0700 Subject: [PATCH 007/155] changed more meaningful function name for featured products on home and mall page --- private/check-featured-stores-products.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index ee313904..02254856 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -10,7 +10,7 @@ * true if user input has TRUE value, * false otherwise. */ - function check_featured_products($mall_product_id) { + function check_featured_mall_products($mall_product_id) { $mall_products = read_csv("../../../../private/database/products.csv", true); foreach ($mall_products as $p_mall) { if (($p_mall['featured_in_mall'] == TRUE) && ($p_mall['id'] == $mall_product_id)) { @@ -28,7 +28,7 @@ function check_featured_products($mall_product_id) { * true if user input has TRUE value, * false otherwise. */ - function check_featured_stores(int $store_product_id) { + function check_featured_store_products(int $store_product_id) { $store_products = read_csv("../../../../private/database/products.csv", true); foreach ($store_products as $p_store) { if (($p_store['featured_in_store'] == TRUE) && ($p_store['id'] == $store_product_id)) { @@ -41,4 +41,7 @@ function check_featured_stores(int $store_product_id) { + + + \ No newline at end of file From e6f57334f5ef8e02e248f347834f8e65f35cdf7c Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Wed, 19 May 2021 11:53:49 +0700 Subject: [PATCH 008/155] added function and documentation for featured stores on home --- private/check-featured-stores-products.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index 02254856..6440587f 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -39,6 +39,25 @@ function check_featured_store_products(int $store_product_id) { } + /** + * Check if Check if featured stores on the Store Home page(s) + * user input + * @param int $store_stores_id + * id required for the input + * true if user input has TRUE value, + * false otherwise. + */ + function check_featured_store_stores(int $store_stores_id) { + $store_stores = read_csv("../../../../private/database/stores.csv", true); + foreach ($store_stores as $s_store) { + if (($s_store['featured_in_store'] == TRUE) && ($s_store['id'] == $store_stores_id)) { + return $s_store; + } + } + return false; + } + + From ba3a8ff44ac2ecc7fe24214e7bf35a9fba89a83c Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Wed, 19 May 2021 11:56:17 +0700 Subject: [PATCH 009/155] added required stores csv --- private/check-featured-stores-products.php | 1 + 1 file changed, 1 insertion(+) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index 6440587f..d4323aa4 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -1,6 +1,7 @@ Date: Wed, 19 May 2021 12:52:25 +0700 Subject: [PATCH 010/155] temporarily apply method=POST to test the query --- public/mall/browse/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 203a7496..155b979e 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -20,7 +20,7 @@
-
From f187afed0f982a2927da975d4650d7f37f83ef18 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 14:38:17 +0700 Subject: [PATCH 013/155] keep existed $_GET['by-store'] in the URL --- public/mall/browse/index.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 155b979e..70c5b25e 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -20,20 +20,19 @@
-
+
\ No newline at end of file From 36f66a285b9ad9e0c4ce8dde94e720a0e76d123e Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 15:05:09 +0700 Subject: [PATCH 014/155] Implemented bio editing for CMS About Us Editor --- public/admin/about_us.php | 32 ++++++++++++++++++++++---------- public/css/admin.css | 28 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index e06da7cb..8d85bcfc 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -1,4 +1,9 @@ - + @@ -43,16 +57,14 @@
- - + ?> + Reset +
diff --git a/public/css/admin.css b/public/css/admin.css index f9e0d65a..fd03cc12 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -19,6 +19,12 @@ form input { margin-bottom: 12px; } +.cms-editor-reset { + display: inline; + width: min-content; + margin: 15px; +} + form input[type="reset"], form input[type="submit"] { display: inline; @@ -88,6 +94,28 @@ form input[type="submit"]:active { } +/* Page editor styles */ +.page-editor-label { + display: block; + margin: 20px 0 10px 0; + font-size: larger; +} + +.page-editor-textarea { + outline: none; + color: #000; + background: transparent; + padding: 10px; + border: 1px solid #cdcdcd; + transition: 0.5s; +} + +.page-editor-textarea:focus { + border-color: #555555; + border-radius: 10px 10px 0 10px; +} + + /* Responsive admin pages */ @media screen and (max-width: 950px) { .dtbm-form { From 6e57d14fc3c1f56fd7d18d3cb908ca19b5d972a8 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 15:06:30 +0700 Subject: [PATCH 015/155] Change wording: EDIT --> MODIFY --- public/admin/about_us.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index 8d85bcfc..746dad7b 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -64,7 +64,7 @@ ?> Reset - + From 079cb0044e429b999ac41e7a8e23e9a8fe1b42ea Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 16:22:16 +0700 Subject: [PATCH 016/155] Mall About Us Page now displays team members according to a database instead of hard-coded html --- private/database/team.csv | 5 + public/mall/about-us/index.php | 151 +++++++++---------------- public/media/image/{ => team}/manh.jpg | Bin public/media/image/{ => team}/mike.png | Bin public/media/image/{ => team}/nhi.jpg | Bin public/media/image/{ => team}/thu.jpg | Bin 6 files changed, 58 insertions(+), 98 deletions(-) create mode 100644 private/database/team.csv rename public/media/image/{ => team}/manh.jpg (100%) rename public/media/image/{ => team}/mike.png (100%) rename public/media/image/{ => team}/nhi.jpg (100%) rename public/media/image/{ => team}/thu.jpg (100%) diff --git a/private/database/team.csv b/private/database/team.csv new file mode 100644 index 00000000..3d809361 --- /dev/null +++ b/private/database/team.csv @@ -0,0 +1,5 @@ +id,name,img,desc +S-3880599,"Doan Yen Nhi","/media/image/team/nhi.jpg","

Developer
Chief Secretary

Visit my GitHub page here

" +S-3877562,"Tuong-Minh ""Mike"" Vo","/media/image/team/mike.png","

Designer
Project Coordinator
Technical Officer

Visit my GitHub page here

" +S-3878480,"Du Duc Manh","/media/image/team/manh.jpg","

Developer
Operation Officer

Visit my GitHub page here

" +S-3879312,"Tran Ngoc Anh Thu","/media/image/team/thu.jpg","

Developer
Designer
Content Officer

Visit my GitHub page here

" \ No newline at end of file diff --git a/public/mall/about-us/index.php b/public/mall/about-us/index.php index 2b03488b..9e37df46 100644 --- a/public/mall/about-us/index.php +++ b/public/mall/about-us/index.php @@ -1,63 +1,47 @@ - - -$page_title = "Yabe | About Us"; -$style_sheets = [ - "/css/common.css", - "/css/flip-card.css", - "/css/mall-about-us.css" -]; -$scripts = [ - "/js/common.js", - "/js/about-us.js" -]; - -include(SHARED_PATH . "/top.php"); +
- - - - - - - + + +

" . $member["name"] . "

" . $member["id"] ."

"; + echo $member["desc"]; + echo "
"; + } + + ?>
@@ -86,51 +70,22 @@
-
-
-
- Portrait of Nhi -
-
-

Doan Yen Nhi

-
-
-
- -
-
-
- Portrait of Mike -
-
-

Tuong-Minh "Mike" Vo

-
-
-
-
- -
-
-
-
- Portrait of Manh -
-
-

Du Duc Manh

-
-
-
- -
-
-
- Portrait of Thu -
-
-

Tran Ngoc Anh Thu

-
-
-
+ +
+
+ Portrait of a person +
+
+

" . $member["name"] . "

+
+
+
"; + } + + ?>
diff --git a/public/media/image/manh.jpg b/public/media/image/team/manh.jpg similarity index 100% rename from public/media/image/manh.jpg rename to public/media/image/team/manh.jpg diff --git a/public/media/image/mike.png b/public/media/image/team/mike.png similarity index 100% rename from public/media/image/mike.png rename to public/media/image/team/mike.png diff --git a/public/media/image/nhi.jpg b/public/media/image/team/nhi.jpg similarity index 100% rename from public/media/image/nhi.jpg rename to public/media/image/team/nhi.jpg diff --git a/public/media/image/thu.jpg b/public/media/image/team/thu.jpg similarity index 100% rename from public/media/image/thu.jpg rename to public/media/image/team/thu.jpg From eaac291474b3fdb7b399f7a7cd07a309a75774dc Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 17:05:08 +0700 Subject: [PATCH 017/155] display selected value after submit --- public/mall/browse/index.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 70c5b25e..e2685377 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -35,15 +35,23 @@ $category_list = read_csv("../../../private/database/categories.csv", true); if ($_GET["by-store"] == "by-category") { - echo ""; + echo ""; for ($i = 0; $i < count($category_list); $i++) { $category = $category_list[$i]["name"]; - echo ""; + if ($_GET['browse-option'] != $category) { + echo ""; + } else { //set selected value as default displayed value + echo ""; + } } } else if ($_GET["by-store"] == "by-name") { for ($letter = "A"; $letter < "Z"; $letter++) { - echo ""; + if ($_GET['browse-option'] != $letter) { + echo ""; + } else { //set selected value as default displayed value + echo ""; + } } echo ""; } @@ -77,6 +85,19 @@ } } } + } else { + for ($i = 0; $i < count($category_list); $i++) { + for ($k = 0; $k< count($stores_list); $k++) { + $store_name = $stores_list[$k]["name"]; + echo " +
+ image representation of a shop + $store_name +
+ "; + } + } + } } } From c70321dd6844cd357907cea3cc8bb95f47b82ae3 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 17:22:08 +0700 Subject: [PATCH 018/155] display selected value after submit (for missed ones) --- public/mall/browse/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index e2685377..46c145c1 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -53,7 +53,12 @@ echo ""; } } - echo ""; + } + $letter = 'Z'; + if ($_GET['browse-option'] != 'Z') { + echo ""; + } else { //set selected value as default displayed value + echo ""; } ?> @@ -85,7 +90,7 @@ } } } - } else { + } else if (!isset($_GET["browse-option"]) || $_GET["browse-option"] == "all-categories" ) { for ($i = 0; $i < count($category_list); $i++) { for ($k = 0; $k< count($stores_list); $k++) { $store_name = $stores_list[$k]["name"]; From 7f1b869c512d77885bbdd1d6eab5d7424e7e5cc0 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 17:23:33 +0700 Subject: [PATCH 019/155] return 'Z' to the right place --- public/mall/browse/index.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 46c145c1..1fca0921 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -53,14 +53,13 @@ echo ""; } } - } $letter = 'Z'; if ($_GET['browse-option'] != 'Z') { echo ""; } else { //set selected value as default displayed value echo ""; + } } - ?> From 441cf86de70409831a746a2a63e14f4ea93e213e Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 17:37:03 +0700 Subject: [PATCH 020/155] Initial implementation of CMS About Us editor photo uploading --- public/admin/about_us.php | 55 ++++++++++++++++++++++++++++++++++----- public/css/admin.css | 23 +++++++++++++++- 2 files changed, 70 insertions(+), 8 deletions(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index 746dad7b..e70fbb85 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -1,6 +1,8 @@ @@ -10,7 +12,8 @@ $page_title = "Yabe CMS Administrator's Dashboard"; $style_sheets = [ "/css/common.css", - "/css/admin.css" + "/css/flip-card.css", + "/css/admin.css", ]; $scripts = [ "/js/common.js", @@ -24,12 +27,24 @@ // About Us Editor logic $filepath = SHARED_PATH . "/about-us-bio.php"; - if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["edit"])) { - file_put_contents($filepath, $_POST["bio-edit"],LOCK_EX); - new_logs_entry("../../private/logs.txt","CMS About Us Editor | modified $filepath"); + $team_database_path = "../../private/database/team.csv"; + $team_members = read_csv($team_database_path, true); + if ($_SERVER["REQUEST_METHOD"] === "POST") { + + // Edit Bio logic + if (isset($_POST["edit_bio"])) { + file_put_contents($filepath, $_POST["bio-edit"], LOCK_EX); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | modified $filepath"); + } + + // Edit member photo logic + if (isset($_POST["edit_photo"])) { + $id = $_POST["id"]; + } + } - - + + include(SHARED_PATH . "/top.php"); ?> @@ -64,8 +79,34 @@ ?> Reset - + + +

Team Members

+
+ +
+
+ Portrait of a person +
+
+

" . $team_member["name"] . "

+
+ + + + +
+
+
+
"; + } + + ?> +
diff --git a/public/css/admin.css b/public/css/admin.css index fd03cc12..455275c0 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -95,9 +95,15 @@ form input[type="submit"]:active { /* Page editor styles */ +.page-editor-title { + font-size: xx-large; + padding: 0 20px; + margin: 100px 20px 50px 20px; +} + .page-editor-label { display: block; - margin: 20px 0 10px 0; + margin: 30px 0 10px 0; font-size: larger; } @@ -115,6 +121,21 @@ form input[type="submit"]:active { border-radius: 10px 10px 0 10px; } +.flip-card { + font-size: smaller; + width: 300px; + height: 300px; + margin: 0 2.5% 5% 2.5%; +} + +.flip-card:hover { + cursor: initial; +} + +.flip-card input[type="file"] { + background: #aba18c; +} + /* Responsive admin pages */ @media screen and (max-width: 950px) { From 29b786731227cf8d5567a6e58337978536e208cc Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 17:43:49 +0700 Subject: [PATCH 021/155] Fixed typo in database.php --- private/database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/database.php b/private/database.php index 96d5403f..4b1d99bc 100644 --- a/private/database.php +++ b/private/database.php @@ -64,7 +64,7 @@ function print_table(string $name, array $database, string $action, $empty=false foreach ($database[0] as $header => $field) { echo "" . $header . ""; } - echo ""; + echo ""; // Data rows for ($index = 0; $index < count($database); $index++) { From dd71dc1a429518a78d66b345c6676318835d8b72 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 17:53:29 +0700 Subject: [PATCH 022/155] Added function get_entry_index_by_id() and its docstring --- private/database.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/private/database.php b/private/database.php index 4b1d99bc..d1236389 100644 --- a/private/database.php +++ b/private/database.php @@ -41,10 +41,32 @@ function list_databases(): array { } + /** + * Get the index of a database entry given its id. Only works on non-empty with first line header .csv databases + * @param string $database_path + * @param string $id + * @return int + */ + function get_entry_index_by_id(string $database_path, string $id): int { + $index = null; + $database = read_csv($database_path, true); + if (count($database) > 0) { + $index = 0; + foreach ($database as $entry) { + if ($entry["id"] === $id) { + break; + } + $index++; + } + } + return $index; + } + + /** * Convert and echo a given database as an editable HTML table. Uses method=POST to communicate with database processor * @param string $name the name of the given database. For use with form submission. - * @param array $database MUST be a database with header. Won't work on header-less database. For empty databases, set $empty to true. + * @param array $database MUST be a .csv database with header. Won't work on header-less database. For empty databases, set $empty to true. * @param string $action url to database processor * @param bool $empty set to true to just print out a header row (only works on empty databases). Default to false. */ From a43581cb23f8d8bcffc92e5e016514c6a7413bc5 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 17:56:40 +0700 Subject: [PATCH 023/155] Updated function get_entry_index_by_id() behavior and its docstring --- private/database.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/private/database.php b/private/database.php index d1236389..f2d6cbf8 100644 --- a/private/database.php +++ b/private/database.php @@ -42,14 +42,13 @@ function list_databases(): array { /** - * Get the index of a database entry given its id. Only works on non-empty with first line header .csv databases - * @param string $database_path + * Get the index of a database entry given its id. Only works on databases with header + * @param array $database MUST be a database with header. Won't work on header-less database * @param string $id - * @return int + * @return int Return null if database is empty */ - function get_entry_index_by_id(string $database_path, string $id): int { + function get_entry_index_by_id(array $database, string $id): int { $index = null; - $database = read_csv($database_path, true); if (count($database) > 0) { $index = 0; foreach ($database as $entry) { @@ -66,7 +65,7 @@ function get_entry_index_by_id(string $database_path, string $id): int { /** * Convert and echo a given database as an editable HTML table. Uses method=POST to communicate with database processor * @param string $name the name of the given database. For use with form submission. - * @param array $database MUST be a .csv database with header. Won't work on header-less database. For empty databases, set $empty to true. + * @param array $database MUST be a database with header. Won't work on header-less database. For empty databases, set $empty to true. * @param string $action url to database processor * @param bool $empty set to true to just print out a header row (only works on empty databases). Default to false. */ From 5bcabae6aa40b43b04b50636883d72b7542d0d49 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 18:01:59 +0700 Subject: [PATCH 024/155] set default browse option --- public/mall/browse/index.php | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 1fca0921..b8429edd 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -16,6 +16,13 @@ include(SHARED_PATH . "/top.php"); include("../../../private/csv.php"); + +if ($_GET["by-store"] === "by-category" && !isset($_GET["browse-option"])) { + $_GET["browse-option"] = "all-categories"; +} else if ($_GET["by-store"] === "by-name" && !isset($_GET["browse-option"])) { + $_GET["browse-option"] = "A"; +} + ?>
@@ -33,6 +40,15 @@ + image representation of a shop + $store + + "; + } + $category_list = read_csv("../../../private/database/categories.csv", true); if ($_GET["by-store"] == "by-category") { echo ""; @@ -79,28 +95,18 @@ for ($k = 0; $k< count($stores_list); $k++) { if ($category_list[$i]["id"] == $stores_list[$k]["category_id"]) { $store_name = $stores_list[$k]["name"]; - echo " -
- image representation of a shop - $store_name -
- "; + display_store($store_name); } } } } - } else if (!isset($_GET["browse-option"]) || $_GET["browse-option"] == "all-categories" ) { + } else { for ($i = 0; $i < count($category_list); $i++) { for ($k = 0; $k< count($stores_list); $k++) { $store_name = $stores_list[$k]["name"]; - echo " -
- image representation of a shop - $store_name -
- "; - } + display_store($store_name); } + } } } From e46d1ddae1a65c2e4ca2713fe5ff98ac014388f7 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 18:17:17 +0700 Subject: [PATCH 025/155] Implemented CMS About Us Editor member photo changing --- public/admin/about_us.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index e70fbb85..5412b6a4 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -38,8 +38,21 @@ } // Edit member photo logic - if (isset($_POST["edit_photo"])) { - $id = $_POST["id"]; + if (isset($_POST["edit_photo"]) && $_FILES["photo"]["error"] === UPLOAD_ERR_OK) { + $member_index = get_entry_index_by_id($team_members, $_POST["id"]); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | Changing photo for team member ID " . $_POST["id"]); + + $old_photo_src = $team_members[$member_index]["img"]; + $new_photo_src = "/media/image/team/" . $_FILES["photo"]["name"]; + move_uploaded_file($_FILES["photo"]["tmp_name"], PUBLIC_PATH . $new_photo_src); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | added $new_photo_src"); + + $team_members[$member_index]["img"] = $new_photo_src; + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | linked database to $new_photo_src"); + + unlink(PUBLIC_PATH . $old_photo_src); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | deleted $old_photo_src"); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | Changing photo for team member ID " . $_POST["id"]) . " complete"; } } @@ -96,7 +109,7 @@

" . $team_member["name"] . "

- +
From b75d62f0bd2ac7e9d88c926e24b04048bfc75447 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 18:18:33 +0700 Subject: [PATCH 026/155] Update logging message --- public/admin/about_us.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index 5412b6a4..b8834065 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -48,7 +48,7 @@ new_logs_entry("../../private/logs.txt", "CMS About Us Editor | added $new_photo_src"); $team_members[$member_index]["img"] = $new_photo_src; - new_logs_entry("../../private/logs.txt", "CMS About Us Editor | linked database to $new_photo_src"); + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | linked $new_photo_src to database"); unlink(PUBLIC_PATH . $old_photo_src); new_logs_entry("../../private/logs.txt", "CMS About Us Editor | deleted $old_photo_src"); From 6d69874d4f5357adb6ec267e36d5b7bd3aafa6af Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 18:19:52 +0700 Subject: [PATCH 027/155] Added 1:1 image message --- public/admin/about_us.php | 1 + 1 file changed, 1 insertion(+) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index b8834065..e598bed2 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -110,6 +110,7 @@
+

Please upload an 1:1 image for best result

From 5afe5b4f4225d7312db34085120f0d6b1f57968c Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 18:23:59 +0700 Subject: [PATCH 028/155] Update common.css for cross-browser compatibility --- public/css/common.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/css/common.css b/public/css/common.css index 6e47eae4..9a650c37 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -190,14 +190,20 @@ i { } .text-align-center { + text-align: -moz-center; + text-align: -webkit-center; text-align: center; } .text-align-left { + text-align: -moz-left; + text-align: -webkit-left; text-align: left; } .text-align-right { + text-align: -moz-right; + text-align: -webkit-right; text-align: right; } From 5c597cb531cdd26ecdf230afdacd024ba9bb77e8 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 18:44:25 +0700 Subject: [PATCH 029/155] display 10 products per page (haven't got button to change between pages and haven't displayed browse stores by name) --- public/mall/browse/index.php | 42 ++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index b8429edd..e70696cc 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -19,8 +19,35 @@ if ($_GET["by-store"] === "by-category" && !isset($_GET["browse-option"])) { $_GET["browse-option"] = "all-categories"; + $_GET["page"] = "1"; } else if ($_GET["by-store"] === "by-name" && !isset($_GET["browse-option"])) { $_GET["browse-option"] = "A"; + $_GET["page"] = "1"; +} + +function display_store($s) { + echo " +
+ image representation of a shop + $s +
+ "; +} + +function each_page($store, $list_length) { + $min = 0; + $length = 10; // maximum number of products displayed on the page + $max = $length - $min - 1; + $page = $_GET["page"]; + $min += $length * ($page-1); + $max += $length * ($page-1); + if ($max > $list_length) { + $max = $list_length - 1; + } + for ($i = $min; $i <= $max; $i++) { + display_store($store[$i]); + } + } ?> @@ -32,6 +59,7 @@ // keep existed $_GET['by-store'] in the URL echo " + " ?> @@ -40,15 +68,6 @@ - image representation of a shop - $store - - "; - } - $category_list = read_csv("../../../private/database/categories.csv", true); if ($_GET["by-store"] == "by-category") { echo ""; @@ -87,6 +106,7 @@ function display_store($store) { Date: Wed, 19 May 2021 18:47:00 +0700 Subject: [PATCH 030/155] updated version of "display 10 products per page (haven't got button to change between pages and haven't displayed browse stores by name)" --- public/mall/browse/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index e70696cc..afcb1537 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -115,11 +115,12 @@ function each_page($store, $list_length) { for ($k = 0; $k< count($stores_list); $k++) { if ($category_list[$i]["id"] == $stores_list[$k]["category_id"]) { $store_name = $stores_list[$k]["name"]; - display_store($store_name); + array_push($expected_stores, $store_name); } } } } + each_page($expected_stores, count($expected_stores)); } else { for ($i = 0; $i < count($category_list); $i++) { for ($k = 0; $k< count($stores_list); $k++) { From f4e5dc0000bba28befb696491e0772c8db3633a6 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 19:00:25 +0700 Subject: [PATCH 031/155] implement browse stores by name --- public/mall/browse/index.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index afcb1537..3898f5e9 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -69,7 +69,7 @@ function each_page($store, $list_length) { ALL CATEGORIES"; for ($i = 0; $i < count($category_list); $i++) { @@ -80,7 +80,7 @@ function each_page($store, $list_length) { echo ""; } } - } else if ($_GET["by-store"] == "by-name") { + } else if ($_GET["by-store"] === "by-name") { for ($letter = "A"; $letter < "Z"; $letter++) { if ($_GET['browse-option'] != $letter) { echo ""; @@ -108,7 +108,7 @@ function each_page($store, $list_length) { $stores_list = read_csv("../../../private/database/stores.csv", true); $expected_stores = []; if (isset($_GET["browse-option"])) { - if ($_GET["by-store"] == "by-category") { + if ($_GET["by-store"] === "by-category") { if ($_GET["browse-option"] != "all-categories") { for ($i = 0; $i < count($category_list); $i++) { if ($category_list[$i]["name"] == $_GET["browse-option"]) { @@ -130,6 +130,15 @@ function each_page($store, $list_length) { } each_page($expected_stores, count($expected_stores)); } + } else if ($_GET["by-store"] === "by-name") { + for ($i = 0; $i < count($stores_list); $i++) { + $first_letter = substr($stores_list[$i]["name"], 0, 1); + if ($_GET["browse-option"] === strtolower($first_letter) || $_GET["browse-option"] === strtoupper($first_letter) ) { + $store_name = $stores_list[$i]["name"]; + array_push($expected_stores, $store_name); + } + } + each_page($expected_stores, count($expected_stores)); } } From 3a09d34da7bd8783d921313f71141584350be5b0 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 19:37:05 +0700 Subject: [PATCH 032/155] implement pagination (prev page and next page), wait for more styling and haven't got "no result" message for the unmatched --- public/mall/browse/index.php | 46 ++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 3898f5e9..d9d4514f 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -34,13 +34,15 @@ function display_store($s) { "; } +$max_products = 10; // maximum number of products displayed on the page + function each_page($store, $list_length) { + global $max_products; $min = 0; - $length = 10; // maximum number of products displayed on the page - $max = $length - $min - 1; + $max = $max_products - $min - 1; $page = $_GET["page"]; - $min += $length * ($page-1); - $max += $length * ($page-1); + $min += $max_products * ($page-1); + $max += $max_products * ($page-1); if ($max > $list_length) { $max = $list_length - 1; } @@ -50,6 +52,24 @@ function each_page($store, $list_length) { } +function prev_page() { + $prev = $_GET["page"] - 1; + if ($prev < 1) { + $prev = 1; + } + return $prev; +} + +function next_page($list_length) { + global $max_products; + $next = $_GET["page"] + 1; + $max_page = floor($list_length / $max_products) + 1; + if ($next > $max_page) { + $next = $max_page; + } + return $next; +} + ?>
@@ -146,6 +166,24 @@ function each_page($store, $list_length) { + + + + + + + + "; + ?> +
From 15f7cfb4649c2b0a513332a03777e9c7a7405f9f Mon Sep 17 00:00:00 2001 From: rider3458 Date: Wed, 19 May 2021 20:53:56 +0700 Subject: [PATCH 033/155] apply store-id to store link --- public/mall/browse/index.php | 66 +++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index d9d4514f..a0e2b590 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -25,18 +25,19 @@ $_GET["page"] = "1"; } -function display_store($s) { +function display_store($s, $sid) { + $store_href = url_for("/store/store-template/?={$sid}"); echo "
- image representation of a shop - $s + image representation of a shop + $s
"; } $max_products = 10; // maximum number of products displayed on the page -function each_page($store, $list_length) { +function each_page($stores, $list_length) { global $max_products; $min = 0; $max = $max_products - $min - 1; @@ -47,7 +48,7 @@ function each_page($store, $list_length) { $max = $list_length - 1; } for ($i = $min; $i <= $max; $i++) { - display_store($store[$i]); + display_store($stores[$i]["store_name"],$stores[$i]["store_id"]); } } @@ -63,7 +64,13 @@ function prev_page() { function next_page($list_length) { global $max_products; $next = $_GET["page"] + 1; - $max_page = floor($list_length / $max_products) + 1; + if ($list_length % $max_products != 0) { + $max_page = floor($list_length / $max_products) + 1; + } else { + $max_page = $list_length / $max_products; + } + echo $list_length; + echo $max_page; if ($next > $max_page) { $next = $max_page; } @@ -126,7 +133,8 @@ function next_page($list_length) { "", + "store_name" => "", + ]); + $expected_stores[$row]["store_name"] = $store_name; + $expected_stores[$row]["store_id"] = $store_id; + $row++; + } } } } } - each_page($expected_stores, count($expected_stores)); } else { - for ($i = 0; $i < count($category_list); $i++) { - for ($k = 0; $k< count($stores_list); $k++) { - $store_name = $stores_list[$k]["name"]; - array_push($expected_stores, $store_name); - } + for ($k = 0; $k< count($stores_list); $k++) { + $store_name = $stores_list[$k]["name"]; + $store_id = $stores_list[$k]["id"]; + array_push($expected_stores, [ + "store_id" => "", + "store_name" => "", + ]); + $expected_stores[$row]["store_name"] = $store_name; + $expected_stores[$row]["store_id"] = $store_id; + $row++; + } } - each_page($expected_stores, count($expected_stores)); } } else if ($_GET["by-store"] === "by-name") { for ($i = 0; $i < count($stores_list); $i++) { $first_letter = substr($stores_list[$i]["name"], 0, 1); if ($_GET["browse-option"] === strtolower($first_letter) || $_GET["browse-option"] === strtoupper($first_letter) ) { $store_name = $stores_list[$i]["name"]; - array_push($expected_stores, $store_name); + $store_id = $stores_list[$i]["id"]; + if (!in_array($store_id,$expected_stores)) { + array_push($expected_stores, [ + "store_id" => "", + "store_name" => "", + ]); + $expected_stores[$row]["store_name"] = $store_name; + $expected_stores[$row]["store_id"] = $store_id; + $row++; + } } } - each_page($expected_stores, count($expected_stores)); - } } - + each_page($expected_stores, count($expected_stores)); ?> From 92c7d6219be29809d1f8f29906f7a920b154fd55 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 21:56:37 +0700 Subject: [PATCH 034/155] Refined CMS about_us.php --- public/admin/about_us.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index e598bed2..20f813dc 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -48,11 +48,12 @@ new_logs_entry("../../private/logs.txt", "CMS About Us Editor | added $new_photo_src"); $team_members[$member_index]["img"] = $new_photo_src; + write_csv($team_database_path, $team_members, true); new_logs_entry("../../private/logs.txt", "CMS About Us Editor | linked $new_photo_src to database"); unlink(PUBLIC_PATH . $old_photo_src); new_logs_entry("../../private/logs.txt", "CMS About Us Editor | deleted $old_photo_src"); - new_logs_entry("../../private/logs.txt", "CMS About Us Editor | Changing photo for team member ID " . $_POST["id"]) . " complete"; + new_logs_entry("../../private/logs.txt", "CMS About Us Editor | Changed photo for team member ID " . $_POST["id"]); } } From b5d11ddd5fc6126102deb308426b86551b43d287 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 22:13:26 +0700 Subject: [PATCH 035/155] Renamed Page Editor to "Edit Legal Information" --- public/admin/about_us.php | 2 +- public/admin/database_man.php | 2 +- public/admin/database_man/index.php | 2 +- public/admin/index.php | 2 +- public/admin/{page_editor.php => legal_editor.php} | 11 +++++++++-- public/admin/logs.php | 2 +- public/admin/manual.php | 2 +- public/admin/password.php | 2 +- public/admin/phpinfo.php | 2 +- public/css/admin.css | 2 +- 10 files changed, 18 insertions(+), 11 deletions(-) rename public/admin/{page_editor.php => legal_editor.php} (77%) diff --git a/public/admin/about_us.php b/public/admin/about_us.php index 20f813dc..c22bf9b5 100644 --- a/public/admin/about_us.php +++ b/public/admin/about_us.php @@ -77,7 +77,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/database_man.php b/public/admin/database_man.php index ac883e8b..6eaae33b 100644 --- a/public/admin/database_man.php +++ b/public/admin/database_man.php @@ -43,7 +43,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/database_man/index.php b/public/admin/database_man/index.php index 9211c9e8..2c9b3163 100644 --- a/public/admin/database_man/index.php +++ b/public/admin/database_man/index.php @@ -70,7 +70,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/index.php b/public/admin/index.php index 52991aad..ffa513fd 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -34,7 +34,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/page_editor.php b/public/admin/legal_editor.php similarity index 77% rename from public/admin/page_editor.php rename to public/admin/legal_editor.php index 201bff5a..46c0a394 100644 --- a/public/admin/page_editor.php +++ b/public/admin/legal_editor.php @@ -34,7 +34,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • @@ -42,7 +42,14 @@
    - To be implemented +
    + + +
    diff --git a/public/admin/logs.php b/public/admin/logs.php index 2e4cf0ef..8ad460e6 100644 --- a/public/admin/logs.php +++ b/public/admin/logs.php @@ -47,7 +47,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/manual.php b/public/admin/manual.php index eedd2406..d7ab6401 100644 --- a/public/admin/manual.php +++ b/public/admin/manual.php @@ -34,7 +34,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/password.php b/public/admin/password.php index 88838e6b..c1026ed1 100644 --- a/public/admin/password.php +++ b/public/admin/password.php @@ -71,7 +71,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Change password
  • ">Log out
  • diff --git a/public/admin/phpinfo.php b/public/admin/phpinfo.php index 86176bd2..af705cc9 100644 --- a/public/admin/phpinfo.php +++ b/public/admin/phpinfo.php @@ -34,7 +34,7 @@
  • ">PHPInfo
  • ">Logs
  • ">Database Manager
  • -
  • ">Page Editor
  • +
  • ">Edit Legal Information
  • ">Edit About Us
  • ">Administrator's Manual
  • ">Change password
  • diff --git a/public/css/admin.css b/public/css/admin.css index 455275c0..9cb68935 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -94,7 +94,7 @@ form input[type="submit"]:active { } -/* Page editor styles */ +/* Edit Legal Information styles */ .page-editor-title { font-size: xx-large; padding: 0 20px; From 50abf50dd2455fa2bc9d8f09761cc96eeac4044b Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 22:36:10 +0700 Subject: [PATCH 036/155] Implemented CMS Legal Page editor skeleton logic --- public/admin/legal_editor.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/public/admin/legal_editor.php b/public/admin/legal_editor.php index 46c0a394..e1cbf847 100644 --- a/public/admin/legal_editor.php +++ b/public/admin/legal_editor.php @@ -16,6 +16,24 @@ redirect_to(url_for("/admin/auth")); } + + // Legal page editor logic + $a_page_selected = $_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["page"]); + if ($a_page_selected) { + switch ($_GET["page"]) { + case "copyright": + echo "copyright"; + break; + case "tos": + echo "tos"; + break; + case "privacy_policy": + echo "privacy policy"; + break; + } + } + + include(SHARED_PATH . "/top.php"); ?> @@ -42,12 +60,13 @@
    -
    - - + + + +
    From c3b61aebb090e3290bc844d9aaa343e83899e309 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 22:44:18 +0700 Subject: [PATCH 037/155] Added a shared page-editor.php module in private/shared --- private/shared/page-editor.php | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 private/shared/page-editor.php diff --git a/private/shared/page-editor.php b/private/shared/page-editor.php new file mode 100644 index 00000000..7aa24d51 --- /dev/null +++ b/private/shared/page-editor.php @@ -0,0 +1,6 @@ +
    +
    + +
    +
    +
    From d31a158dd0105d577f14150e03b8d565f2335955 Mon Sep 17 00:00:00 2001 From: miketvo Date: Wed, 19 May 2021 22:52:13 +0700 Subject: [PATCH 038/155] Modularize legal pages --- private/shared/legal/copyright.php | 18 +++++ private/shared/legal/privacy-policy.php | 87 +++++++++++++++++++++ private/shared/legal/tos.php | 78 +++++++++++++++++++ public/mall/legal/copyright/index.php | 19 +---- public/mall/legal/privacy-policy/index.php | 88 +--------------------- public/mall/legal/tos/index.php | 79 +------------------ 6 files changed, 186 insertions(+), 183 deletions(-) create mode 100644 private/shared/legal/copyright.php create mode 100644 private/shared/legal/privacy-policy.php create mode 100644 private/shared/legal/tos.php diff --git a/private/shared/legal/copyright.php b/private/shared/legal/copyright.php new file mode 100644 index 00000000..a6010200 --- /dev/null +++ b/private/shared/legal/copyright.php @@ -0,0 +1,18 @@ +

    MIT License

    +
    +

    Copyright (c) 2021 栗 KURI 栗

    +

    Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions:

    +

    The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software.

    +

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE.

    diff --git a/private/shared/legal/privacy-policy.php b/private/shared/legal/privacy-policy.php new file mode 100644 index 00000000..bfbf5d27 --- /dev/null +++ b/private/shared/legal/privacy-policy.php @@ -0,0 +1,87 @@ +

    1. INTRODUCTION WELCOME TO YABE ONLINE MALL
    Yabe online mall (“us”, “we”, or “our”) operates yabe-online-mall.github.io (hereinafter referred to as “Service”). 
    +
    Our Privacy Policy governs your visit to yabe-online-mall.github.io, and explains how we collect, safeguard and disclose information that results from your use of our Service. 
    +
    We use your data to provide and improve Service. By using Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, the terms used in this Privacy Policy have the same meanings as in our Terms and Conditions. 
    +
    Our Terms and Conditions (“Terms”) govern all use of our Service and together with the Privacy Policy constitutes your agreement with us (“agreement”). 
    +
    +
    2. Definitions 
    +
    SERVICE means the yabe-online-mall.github.io website operated by Yabe online mall.  +
    +
    PERSONAL DATA
    means data about a living individual who can be identified from those data (or from those and other information either in our possession or likely to come into our possession). 
    +
    USAGE DATA is data collected automatically either generated by the use of Service or from Service infrastructure itself (for example, the duration of a page visit). 
    +
    COOKIES are small files stored on your device (computer or mobile device). 
    +
    DATA CONTROLLER means a natural or legal person who (either alone or jointly or in common with other persons) determines the purposes for which and the manner in which any personal data are, or are to be, processed. For the purpose of this Privacy Policy, we are a Data Controller of your data. 
    +
    +
    DATA PROCESSORS (OR SERVICE PROVIDERS) means any natural or legal person who processes the data on behalf of the Data Controller. We may use the services of various Service Providers in order to process your data more effectively. 
    +
    DATA SUBJECT is any living individual who is the subject of Personal Data. 
    +
    +
    THE USER is the individual using our Service. The User corresponds to the Data Subject, who is the subject of Personal Data. 
    +
    +
    3. Information Collection and Use We collect several different types of information for various purposes to provide and improve our Service to you. 
    +
    +
    4. Types of Data CollectedPersonal Data While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you (“Personal Data”). Personally identifiable information may include, but is not limited to: 
    +
    0.1. Email address 
    0.2. First name and last name 
    0.3. Phone number 
    0.4. Address, Country, State, Province, ZIP/Postal code, City 
    0.5. Cookies and Usage Data + We may use your Personal Data to contact you with newsletters, marketing or promotional materials and other information that may be of interest to you. You may opt out of receiving any, or all, of these communications from us by following the unsubscribe link. 
    +
    Usage Data 
    We may also collect information that your browser sends whenever you visit our Service or when you access Service by or through any device (“Usage Data”). + This Usage Data may include information such as your computer’s Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data. + When you access Service with a device, this Usage Data may include information such as the type of device you use, your device unique ID, the IP address of your device, your device operating system, the type of Internet browser you use, unique device identifiers and other diagnostic data. 
    +
    Location Data +
    We may use and store information about your location if you give us permission to do so (“Location Data”). We use this data to provide features of our Service, to improve and customize our Service.You can enable or disable location services when you use our Service at any time by way of your device settings. 
    +
    Tracking Cookies Data 
    We use cookies and similar tracking technologies to track the activity on our Service and we hold certain information. + Cookies are files with a small amount of data which may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Other tracking technologies are also used such as beacons, tags and scripts to collect and track information and to improve and analyze our Service. + You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service. 
    +
    Examples of Cookies we use: 
    0.1. Session Cookies: We use Session Cookies to operate our Service. 
    0.2. Preference Cookies: We use Preference Cookies to remember your preferences and various settings. 
    0.3. Security Cookies: We use Security Cookies for security purposes. 
    0.4. Advertising Cookies: Advertising Cookies are used to serve you with advertisements that may be relevant to you and your interests. 
    +
    Other Data 
    While using our Service, we may also collect the following information: sex, age, date of birth, place of birth, passport details, citizenship, registration at place of residence and actual address, telephone number (work, mobile), details of documents on education, qualification, professional training, employment agreements, NDA agreements, information on bonuses and compensation, information on marital status, family members, social security (or other taxpayer identification) number, office location and other data. 
    +
    5. Use of Data 
    Yabe online mall uses the collected data for various purposes: 
    0.1. to provide and maintain our Service; 
    0.2. to notify you about changes to our Service; 
    0.3. to allow you to participate in interactive features of our Service when you choose to do so; 
    0.4. to provide customer support; 
    0.5. to gather analysis or valuable information so that we can improve our Service; 
    0.6. to monitor the usage of our Service; 
    0.7. to detect, prevent and address technical issues; 
    0.8. to fulfil any other purpose for which you provide it; 
    0.9. to carry out our obligations and enforce our rights arising from any contracts entered into between you and us, including for billing and collection; + 0.10. to provide you with notices about your account and/or subscription, including expiration and renewal notices, email-instructions, etc.; 
    0.11. to provide you with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless you have opted not to receive such information; 
    0.12. in any other way we may describe when you provide the information; 
    0.13. for any other purpose with your consent. 
    +
    6. Retention of Data 
    We will retain your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies. + We will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period, except when this data is used to strengthen the security or to improve the functionality of our Service, or we are legally obligated to retain this data for longer time periods. 
    +
    7. Transfer of Data 
    Your information, including Personal Data, may be transferred to – and maintained on – computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ from those of your jurisdiction. + If you are located outside Vietnam and choose to provide information to us, please note that we transfer the data, including Personal Data, to Vietnam and process it there. + Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer. + Yabe online mall will take all the steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organisation or a country unless there are adequate controls in place including the security of your data and other personal information. + 8. Disclosure of Data We may disclose personal information that we collect, or you provide: 
    0.1. Disclosure for Law Enforcement. Under certain circumstances, we may be required to disclose your Personal Data if required to do so by law or in response to valid requests by public authorities.
    0.2. Business Transaction.If we or our subsidiaries are involved in a merger, acquisition or asset sale, your Personal Data may be transferred.0.3. Other cases. We may disclose your information also:0.3.1. to our subsidiaries and affiliates;0.3.2. to contractors, service providers, and other third parties we use to support our business;
    0.3.3. to fulfill the purpose for which you provide it;
    0.3.4. for the purpose of including your company’s logo on our website;
    0.3.5. for any other purpose disclosed by us when you provide the information;
    0.3.6. with your consent in any other cases;
    0.3.7. if we believe disclosure is necessary or appropriate to protect the rights, property, or safety of the Company, our customers, or others. 
    +
    9. Security of Data 
    The security of your data is important to us but remember that no method of transmission over the Internet or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security. 
    +
    10. Your Data Protection Rights Under General Data Protection Regulation (GDPR) If you are a resident of the European Union (EU) and European Economic Area (EEA), you have certain data protection rights, covered by GDPR. + We aim to take reasonable steps to allow you to correct, amend, delete, or limit the use of your Personal Data. + If you wish to be informed what Personal Data we hold about you and if you want it to be removed from our systems, please email us at ngocanhthu20102002@gmail.com. + In certain circumstances, you have the following data protection rights: 
    0.1. the right to access, update or to delete the information we have on you; 
    0.2. the right of rectification. You have the right to have your information rectified if that information is inaccurate or incomplete; 
    0.3. the right to object. You have the right to object to our processing of your Personal Data; 
    0.4. the right of restriction. You have the right to request that we restrict the processing of your personal information; 
    0.5. the right to data portability. You have the right to be provided with a copy of your Personal Data in a structured, machine-readable and commonly used format; 
    0.6. the right to withdraw consent. You also have the right to withdraw your consent at any time where we rely on your consent to process your personal information; + Please note that we may ask you to verify your identity before responding to such requests. Please note, we may not able to provide Service without some necessary data. + You have the right to complain to a Data Protection Authority about our collection and use of your Personal Data. For more information, please contact your local data protection authority in the European Economic Area (EEA). 
    +
    11. Your Data Protection Rights under the California Privacy Protection Act (CalOPPA) CalOPPA is the first state law in the nation to require commercial websites and online services to post a privacy policy. The law’s reach stretches well beyond California to require a person or company in the United States (and conceivable the world) that operates websites collecting personally identifiable information from California consumers to post a conspicuous privacy policy on its website stating exactly the information being collected and those individuals with whom it is being shared, and to comply with this policy. + According to CalOPPA we agree to the following: + 0.1. users can visit our site anonymously; + 0.2. our Privacy Policy link includes the word “Privacy”, and can easily be found on the home page of our website; + 0.3. users will be notified of any privacy policy changes on our Privacy Policy Page; + 0.4. users are able to change their personal information by emailing us at ngocanhthu20102002@gmail.com. + Our Policy on “Do Not Track” Signals: + We honor Do Not Track signals and do not track, plant cookies, or use advertising when a Do Not Track browser mechanism is in place. Do Not Track is a preference you can set in your web browser to inform websites that you do not want to be tracked. + You can enable or disable Do Not Track by visiting the Preferences or Settings page of your web browser. + 12. Your Data Protection Rights under the California Consumer Privacy Act (CCPA) If you are a California resident, you are entitled to learn what data we collect about you, ask to delete your data and not to sell (share) it. To exercise your data protection rights, you can make certain requests and ask us: 0.1. What personal information we have about you. If you make this request, we will return to you: 
    0.0.1. The categories of personal information we have collected about you. 
    0.0.2. The categories of sources from which we collect your personal information. 
    0.0.3. The business or commercial purpose for collecting or selling your personal information. 
    0.0.4. The categories of third parties with whom we share personal information. 
    0.0.5. The specific pieces of personal information we have collected about you. 
    0.0.6. A list of categories of personal information that we have sold, along with the category of any other company we sold it to. If we have not sold your personal information, we will inform you of that fact. 
    0.0.7. A list of categories of personal information that we have disclosed for a business purpose, along with the category of any other company we shared it with. + Please note, you are entitled to ask us to provide you with this information up to two times in a rolling twelve-month period. When you make this request, the information provided may be limited to the personal information we collected about you in the previous 12 months. 
    +
    0.2. To delete your personal information. 
    If you make this request, we will delete the personal information we hold about you as of the date of your request from our records and direct any service providers to do the same. In some cases, deletion may be accomplished through de-identification of the information. If you choose to delete your personal information, you may not be able to use certain functions that require your personal information to operate.
    0.3. To stop selling your personal information. We don’t sell or rent your personal information to any third parties for any purpose. We do not sell your personal information for monetary consideration. However, under some circumstances, a transfer of personal information to a third party, or within our family of companies, without monetary consideration may be considered a “sale” under California law. You are the only owner of your Personal Data and can request disclosure or deletion at any time. 
    +
    If you submit a request to stop selling your personal information, we will stop making such transfers. + Please note, if you ask us to delete or stop selling your data, it may impact your experience with us, and you may not be able to participate in certain programs or membership services which require the usage of your personal information to function. But in no circumstances, we will discriminate against you for exercising your rights. + To exercise your California data protection rights described above, please send your request(s) by email: ngocanhthu20102002@gmail.com. + Your data protection rights, described above, are covered by the CCPA, short for the California Consumer Privacy Act. 
    +
    To find out more, visit the official California Legislative Information website. The CCPA took effect on 01/01/2020. + 13. Service Providers We may employ third party companies and individuals to facilitate our Service (“Service Providers”), provide Service on our behalf, perform Service-related services or assist us in analysing how our Service is used. + These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose. 
    +
    14. Analytics 
    We may use third-party Service Providers to monitor and analyze the use of our Service. 
    +
    15. CI/CD tools 
    We may use third-party Service Providers to automate the development process of our Service. 
    +
    16. Advertising +
    We may use third-party Service Providers to show advertisements to you to help support and maintain our Service. 
    +
    17. Behavioral Remarketing 
    We may use remarketing services to advertise on third party websites to you after you visited our Service. We and our third-party vendors use cookies to inform, optimise and serve ads based on your past visits to our Service. 
    +
    18. Payments +
    +
    We may provide paid products and/or services within Service. In that case, we use third-party services for payment processing (e.g. payment processors).We will not store or collect your payment card details. That information is provided directly to our third-party payment processors whose use of your personal information is governed by their Privacy Policy. These payment processors adhere to the standards set by PCI-DSS as managed by the PCI Security Standards Council, which is a joint effort of brands like Visa, Mastercard, American Express and Discover. PCI-DSS requirements help ensure the secure handling of payment information. 
    +
    19. Links to Other Sites 
    Our Service may contain links to other sites that are not operated by us. If you click a third party link, you will be directed to that third party’s site. We strongly advise you to review the Privacy Policy of every site you visit. + We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services. + For example, the outlined privacy policy has been made using PolicyMaker.io, a free tool that helps create high-quality legal documents. PolicyMaker’s privacy policy generator is an easy-to-use tool for creating a privacy policy for blog, website, e-commerce store or mobile app. 
    +
    20. Children’s Privacy 
    Our Services are not intended for use by children under the age of 18 (“Child” or “Children”). + We do not knowingly collect personally identifiable information from Children under 18. If you become aware that a Child has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from Children without verification of parental consent, we take steps to remove that information from our servers. 
    +
    21. Changes to This Privacy Policy 
    We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page. + We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update “effective date” at the top of this Privacy Policy. + You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page. 
    +
    22. Contact Us 
    If you have any questions about this Privacy Policy, please contact us by email: ngocanhthu20102002@gmail.com. 
    +
    This Privacy Policy was created for yabe-online-mall.github.io by PolicyMaker.io on 2021-04-16. 
    +

    diff --git a/private/shared/legal/tos.php b/private/shared/legal/tos.php new file mode 100644 index 00000000..dc08e138 --- /dev/null +++ b/private/shared/legal/tos.php @@ -0,0 +1,78 @@ +

    1. Introduction 
    Welcome to Yabe online mall (“Company”, “we”, “our”, “us”)! + These Terms of Service (“Terms”, “Terms of Service”) govern your use of our website located at yabe-online-mall.github.io (together or individually “Service”) operated by Yabe online mall
    Our Privacy Policy also governs your use of our Service and explains how we collect, safeguard and disclose information that results from your use of our web pages. + Your agreement with us includes these Terms and our Privacy Policy (“Agreements”). You acknowledge that you have read and understood Agreements, and agree to be bound of them. + If you do not agree with (or cannot comply with) Agreements, then you may not use the Service, but please let us know by emailing at ngocanhthu20102002@gmail.com so we can try to find a solution. These Terms apply to all visitors, users and others who wish to access or use Service. 
    +
    +
    2. Communications 
    By using our Service, you agree to subscribe to newsletters, marketing or promotional materials and other information we may send. However, you may opt out of receiving any, or all, of these communications from us by following the unsubscribe link or by emailing at ngocanhthu20102002@gmail.com. 
    +
    +
    3. Purchases +
    If you wish to purchase any product or service made available through Service (“Purchase”), you may be asked to supply certain information relevant to your Purchase including but not limited to, your credit or debit card number, the expiration date of your card, your billing address, and your shipping information.
    You represent and warrant that: 
    (i) you have the legal right to use any card(s) or other payment method(s) in connection with any Purchase; and that (ii) the information you supply to us is true, correct and complete.We may employ the use of third party services for the purpose of facilitating payment and the completion of Purchases. By submitting your information, you grant us the right to provide the information to these third parties subject to our Privacy Policy.We reserve the right to refuse or cancel your order at any time for reasons including but not limited to: product or service availability, errors in the description or price of the product or service, error in your order or other reasons.We reserve the right to refuse or cancel your order if fraud or an unauthorized or illegal transaction is suspected. 
    +
    +
    4. Contests, Sweepstakes and Promotions 
    Any contests, sweepstakes or other promotions (collectively, “Promotions”) made available through Service may be governed by rules that are separate from these Terms of Service. If you participate in any Promotions, please review the applicable rules as well as our Privacy Policy. If the rules for a Promotion conflict with these Terms of Service, Promotion rules will apply. 
    +
    +
    5. Subscriptions +
    Some parts of Service are billed on a subscription basis ("Subscription(s)"). You will be billed in advance on a recurring and periodic basis ("Billing Cycle"). Billing cycles will be set depending on the type of subscription plan you select when purchasing a Subscription.At the end of each Billing Cycle, your Subscription will automatically renew under the exact same conditions unless you cancel it or Yabe online mall cancels it. You may cancel your Subscription renewal either through your online account management page or by contacting ngocanhthu20102002@gmail.com customer support team.A valid payment method is required to process the payment for your subscription. You shall provide Yabe online mall with accurate and complete billing information that may include but not limited to full name, address, state, postal or zip code, telephone number, and a valid payment method information. By submitting such payment information, you automatically authorize Yabe online mall to charge all Subscription fees incurred through your account to any such payment instruments.Should automatic billing fail to occur for any reason, Yabe online mall reserves the right to terminate your access to the Service with immediate effect.
    +
    +
    6. Free Trial +
    Yabe online mall may, at its sole discretion, offer a Subscription with a free trial for a limited period of time ("Free Trial").You may be required to enter your billing information in order to sign up for Free Trial.If you do enter your billing information when signing up for Free Trial, you will not be charged by Yabe online mall until Free Trial has expired. On the last day of Free Trial period, unless you cancelled your Subscription, you will be automatically charged the applicable Subscription fees for the type of Subscription you have selected.At any time and without notice, Yabe online mall reserves the right to (i) modify Terms of Service of Free Trial offer, or (ii) cancel such Free Trial offer.
    +
    +
    7. Fee Changes +
    Yabe online mall, in its sole discretion and at any time, may modify Subscription fees for the Subscriptions. Any Subscription fee change will become effective at the end of the then-current Billing Cycle.Yabe online mall will provide you with a reasonable prior notice of any change in Subscription fees to give you an opportunity to terminate your Subscription before such change becomes effective.Your continued use of Service after Subscription fee change comes into effect constitutes your agreement to pay the modified Subscription fee amount. + 8. RefundsWe issue refunds for Contracts within 30 days of the original purchase of the Contract. 
    +
    +
    9. Content +
    Content found on or through this Service are the property of Yabe online mall or used with permission. You may not distribute, modify, transmit, reuse, download, repost, copy, or use said Content, whether in whole or in part, for commercial purposes or for personal gain, without express advance written permission from us. 
    +
    +
    10. Prohibited Uses 
    You may use Service only for lawful purposes and in accordance with Terms. 
    You agree not to use Service: 
    0.1. In any way that violates any applicable national or international law or regulation. 
    0.2. For the purpose of exploiting, harming, or attempting to exploit or harm minors in any way by exposing them to inappropriate content or otherwise. + 0.3. To transmit, or procure the sending of, any advertising or promotional material, including any “junk mail”, “chain letter,” “spam,” or any other similar solicitation. 
    0.4. To impersonate or attempt to impersonate Company, a Company employee, another user, or any other person or entity. 
    0.5. In any way that infringes upon the rights of others, or in any way is illegal, threatening, fraudulent, or harmful, or in connection with any unlawful, illegal, fraudulent, or harmful purpose or activity. 
    0.6. To engage in any other conduct that restricts or inhibits anyone’s use or enjoyment of Service, or which, as determined by us, may harm or offend Company or users of Service or expose them to liability. 
    Additionally, you agree not to: 
    0.1. Use Service in any manner that could disable, overburden, damage, or impair Service or interfere with any other party’s use of Service, including their ability to engage in real time activities through Service. 
    0.2. Use any robot, spider, or other automatic device, process, or means to access Service for any purpose, including monitoring or copying any of the material on Service. 
    0.3. Use any manual process to monitor or copy any of the material on Service or for any other unauthorized purpose without our prior written consent. + 0.4. Use any device, software, or routine that interferes with the proper working of Service. 
    0.5. Introduce any viruses, trojan horses, worms, logic bombs, or other material which is malicious or technologically harmful. 
    0.6. Attempt to gain unauthorized access to, interfere with, damage, or disrupt any parts of Service, the server on which Service is stored, or any server, computer, or database connected to Service. 
    0.7. Attack Service via a denial-of-service attack or a distributed denial-of-service attack. 
    0.8. Take any action that may damage or falsify Company rating. 
    0.9. Otherwise attempt to interfere with the proper working of Service. 
    +
    +
    11. Analytics 
    We may use third-party Service Providers to monitor and analyze the use of our Service. 
    +
    +
    12. No Use By Minors 
    Service is intended only for access and use by individuals at least eighteen (18) years old. By accessing or using Service, you warrant and represent that you are at least eighteen (18) years of age and with the full authority, right, and capacity to enter into this agreement and abide by all of the terms and conditions of Terms. If you are not at least eighteen (18) years old, you are prohibited from both the access and usage of Service. 
    +
    +
    13. Accounts +
    When you create an account with us, you guarantee that you are above the age of 18, and that the information you provide us is accurate, complete, and current at all times. Inaccurate, incomplete, or obsolete information may result in the immediate termination of your account on Service.You are responsible for maintaining the confidentiality of your account and password, including but not limited to the restriction of access to your computer and/or account. You agree to accept responsibility for any and all activities or actions that occur under your account and/or password, whether your password is with our Service or a third-party service. You must notify us immediately upon becoming aware of any breach of security or unauthorized use of your account.You may not use as a username the name of another person or entity or that is not lawfully available for use, a name or trademark that is subject to any rights of another person or entity other than you, without appropriate authorization. You may not use as a username any name that is offensive, vulgar or obscene.We reserve the right to refuse service, terminate accounts, remove or edit content, or cancel orders in our sole discretion. 
    +
    +
    14. Intellectual Property 
    Service and its original content (excluding Content provided by users), features and functionality are and will remain the exclusive property of Yabe online mall and its licensors. Service is protected by copyright, trademark, and other laws of and foreign countries. Our trademarks may not be used in connection with any product or service without the prior written consent of Yabe online mall. 
    +
    +
    15. Copyright Policy 
    We respect the intellectual property rights of others. It is our policy to respond to any claim that Content posted on Service infringes on the copyright or other intellectual property rights (“Infringement”) of any person or entity. + If you are a copyright owner, or authorized on behalf of one, and you believe that the copyrighted work has been copied in a way that constitutes copyright infringement, please submit your claim via email to ngocanhthu20102002@gmail.com, with the subject line: “Copyright Infringement” and include in your claim a detailed description of the alleged Infringement as detailed below, under “DMCA Notice and Procedure for Copyright Infringement Claims” + You may be held accountable for damages (including costs and attorneys’ fees) for misrepresentation or bad-faith claims on the infringement of any Content found on and/or through Service on your copyright. 
    +
    +
    16. DMCA Notice and Procedure for Copyright Infringement Claims 
    You may submit a notification pursuant to the Digital Millennium Copyright Act (DMCA) by providing our Copyright Agent with the following information in writing (see 17 U.S.C 512(c)(3) for further detail): 
    0.1. an electronic or physical signature of the person authorized to act on behalf of the owner of the copyright’s interest; 
    0.2. a description of the copyrighted work that you claim has been infringed, including the URL (i.e., web page address) of the location where the copyrighted work exists or a copy of the copyrighted work; 
    0.3. identification of the URL or other specific location on Service where the material that you claim is infringing is located; 
    0.4. your address, telephone number, and email address; 
    0.5. a statement by you that you have a good faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law; 
    0.6. a statement by you, made under penalty of perjury, that the above information in your notice is accurate and that you are the copyright owner or authorized to act on the copyright owner’s behalf. + You can contact our Copyright Agent via email at ngocanhthu20102002@gmail.com. 
    +
    +
    17. Error Reporting and Feedback 
    You may provide us either directly at ngocanhthu20102002@gmail.com or via third party sites and tools with information and feedback concerning errors, suggestions for improvements, ideas, problems, complaints, and other matters related to our Service (“Feedback”). You acknowledge and agree that: (i) you shall not retain, acquire or assert any intellectual property right or other right, title or interest in or to the Feedback; (ii) Company may have development ideas similar to the Feedback; (iii) Feedback does not contain confidential information or proprietary information from you or any third party; and (iv) Company is not under any obligation of confidentiality with respect to the Feedback. In the event the transfer of the ownership to the Feedback is not possible due to applicable mandatory laws, you grant Company and its affiliates an exclusive, transferable, irrevocable, free-of-charge, sub-licensable, unlimited and perpetual right to use (including copy, modify, create derivative works, publish, distribute and commercialize) Feedback in any manner and for any purpose. 
    +
    +
    18. Links To Other Web Sites 
    Our Service may contain links to third party web sites or services that are not owned or controlled by Yabe online mall. + Yabe online mall has no control over, and assumes no responsibility for the content, privacy policies, or practices of any third party web sites or services. We do not warrant the offerings of any of these entities/individuals or their websites. + For example, the outlined Terms of Use have been created using PolicyMaker.io, a free web application for generating high-quality legal documents. PolicyMaker’s Terms and Conditions generator is an easy-to-use free tool for creating an excellent standard Terms of Service template for a website, blog, e-commerce store or app. + YOU ACKNOWLEDGE AND AGREE THAT COMPANY SHALL NOT BE RESPONSIBLE OR LIABLE, DIRECTLY OR INDIRECTLY, FOR ANY DAMAGE OR LOSS CAUSED OR ALLEGED TO BE CAUSED BY OR IN CONNECTION WITH USE OF OR RELIANCE ON ANY SUCH CONTENT, GOODS OR SERVICES AVAILABLE ON OR THROUGH ANY SUCH THIRD PARTY WEB SITES OR SERVICES. + WE STRONGLY ADVISE YOU TO READ THE TERMS OF SERVICE AND PRIVACY POLICIES OF ANY THIRD PARTY WEB SITES OR SERVICES THAT YOU VISIT. 
    +
    +
    19. Disclaimer Of Warranty 
    THESE SERVICES ARE PROVIDED BY COMPANY ON AN “AS IS” AND “AS AVAILABLE” BASIS. COMPANY MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THEIR SERVICES, OR THE INFORMATION, CONTENT OR MATERIALS INCLUDED THEREIN. YOU EXPRESSLY AGREE THAT YOUR USE OF THESE SERVICES, THEIR CONTENT, AND ANY SERVICES OR ITEMS OBTAINED FROM US IS AT YOUR SOLE RISK. + NEITHER COMPANY NOR ANY PERSON ASSOCIATED WITH COMPANY MAKES ANY WARRANTY OR REPRESENTATION WITH RESPECT TO THE COMPLETENESS, SECURITY, RELIABILITY, QUALITY, ACCURACY, OR AVAILABILITY OF THE SERVICES. WITHOUT LIMITING THE FOREGOING, NEITHER COMPANY NOR ANYONE ASSOCIATED WITH COMPANY REPRESENTS OR WARRANTS THAT THE SERVICES, THEIR CONTENT, OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE SERVICES WILL BE ACCURATE, RELIABLE, ERROR-FREE, OR UNINTERRUPTED, THAT DEFECTS WILL BE CORRECTED, THAT THE SERVICES OR THE SERVER THAT MAKES IT AVAILABLE ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS OR THAT THE SERVICES OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE SERVICES WILL OTHERWISE MEET YOUR NEEDS OR EXPECTATIONS. + COMPANY HEREBY DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, AND FITNESS FOR PARTICULAR PURPOSE. + THE FOREGOING DOES NOT AFFECT ANY WARRANTIES WHICH CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW. 
    +
    +
    20. Limitation Of Liability 
    EXCEPT AS PROHIBITED BY LAW, YOU WILL HOLD US AND OUR OFFICERS, DIRECTORS, EMPLOYEES, AND AGENTS HARMLESS FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGE, HOWEVER IT ARISES (INCLUDING ATTORNEYS’ FEES AND ALL RELATED COSTS AND EXPENSES OF LITIGATION AND ARBITRATION, OR AT TRIAL OR ON APPEAL, IF ANY, WHETHER OR NOT LITIGATION OR ARBITRATION IS INSTITUTED), WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, OR ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT, INCLUDING WITHOUT LIMITATION ANY CLAIM FOR PERSONAL INJURY OR PROPERTY DAMAGE, ARISING FROM THIS AGREEMENT AND ANY VIOLATION BY YOU OF ANY FEDERAL, STATE, OR LOCAL LAWS, STATUTES, RULES, OR REGULATIONS, EVEN IF COMPANY HAS BEEN PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EXCEPT AS PROHIBITED BY LAW, IF THERE IS LIABILITY FOUND ON THE PART OF COMPANY, IT WILL BE LIMITED TO THE AMOUNT PAID FOR THE PRODUCTS AND/OR SERVICES, AND UNDER NO CIRCUMSTANCES WILL THERE BE CONSEQUENTIAL OR PUNITIVE DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF PUNITIVE, INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE PRIOR LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU. 
    +
    +
    21. Termination 
    We may terminate or suspend your account and bar access to Service immediately, without prior notice or liability, under our sole discretion, for any reason whatsoever and without limitation, including but not limited to a breach of Terms. + If you wish to terminate your account, you may simply discontinue using Service. + All provisions of Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability. 
    +
    +
    22. Governing Law 
    These Terms shall be governed and construed in accordance with the laws of Vietnam, which governing law applies to agreement without regard to its conflict of law provisions. + Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our Service and supersede and replace any prior agreements we might have had between us regarding Service.
    +
    +
    23. Changes To Service 
    We reserve the right to withdraw or amend our Service, and any service or material we provide via Service, in our sole discretion without notice. We will not be liable if for any reason all or any part of Service is unavailable at any time or for any period. From time to time, we may restrict access to some parts of Service, or the entire Service, to users, including registered users. 
    +
    +
    24. Amendments To Terms 
    We may amend Terms at any time by posting the amended terms on this site. It is your responsibility to review these Terms periodically. + Your continued use of the Platform following the posting of revised Terms means that you accept and agree to the changes. You are expected to check this page frequently so you are aware of any changes, as they are binding on you. + By continuing to access or use our Service after any revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, you are no longer authorized to use Service. 
    +
    +
    25. Waiver And Severability 
    No waiver by Company of any term or condition set forth in Terms shall be deemed a further or continuing waiver of such term or condition or a waiver of any other term or condition, and any failure of Company to assert a right or provision under Terms shall not constitute a waiver of such right or provision. + If any provision of Terms is held by a court or other tribunal of competent jurisdiction to be invalid, illegal or unenforceable for any reason, such provision shall be eliminated or limited to the minimum extent such that the remaining provisions of Terms will continue in full force and effect.
    +
    26. Acknowledgement
    BY USING SERVICE OR OTHER SERVICES PROVIDED BY US, YOU ACKNOWLEDGE THAT YOU HAVE READ THESE TERMS OF SERVICE AND AGREE TO BE BOUND BY THEM.  
    +
    27. Contact Us Please send your feedback, comments, requests for technical support by email: ngocanhthu20102002@gmail.com.
    These Terms of Service were created for yabe-online-mall.github.io by PolicyMaker.io on 2021-04-16. 
    +

    diff --git a/public/mall/legal/copyright/index.php b/public/mall/legal/copyright/index.php index 46889e36..f7cd9247 100644 --- a/public/mall/legal/copyright/index.php +++ b/public/mall/legal/copyright/index.php @@ -24,24 +24,7 @@

    COPYRIGHT

    -

    MIT License

    -
    -

    Copyright (c) 2021 栗 KURI 栗

    -

    Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions:

    -

    The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software.

    -

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE.

    +

    diff --git a/public/mall/legal/privacy-policy/index.php b/public/mall/legal/privacy-policy/index.php index 2cb312b5..e3d4f0b7 100644 --- a/public/mall/legal/privacy-policy/index.php +++ b/public/mall/legal/privacy-policy/index.php @@ -24,93 +24,7 @@

    PRIVACY POLICY

    -

    1. INTRODUCTION WELCOME TO YABE ONLINE MALL
    Yabe online mall (“us”, “we”, or “our”) operates yabe-online-mall.github.io (hereinafter referred to as “Service”). 
    -
    Our Privacy Policy governs your visit to yabe-online-mall.github.io, and explains how we collect, safeguard and disclose information that results from your use of our Service. 
    -
    We use your data to provide and improve Service. By using Service, you agree to the collection and use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, the terms used in this Privacy Policy have the same meanings as in our Terms and Conditions. 
    -
    Our Terms and Conditions (“Terms”) govern all use of our Service and together with the Privacy Policy constitutes your agreement with us (“agreement”). 
    -
    -
    2. Definitions 
    -
    SERVICE means the yabe-online-mall.github.io website operated by Yabe online mall.  -
    -
    PERSONAL DATA
    means data about a living individual who can be identified from those data (or from those and other information either in our possession or likely to come into our possession). 
    -
    USAGE DATA is data collected automatically either generated by the use of Service or from Service infrastructure itself (for example, the duration of a page visit). 
    -
    COOKIES are small files stored on your device (computer or mobile device). 
    -
    DATA CONTROLLER means a natural or legal person who (either alone or jointly or in common with other persons) determines the purposes for which and the manner in which any personal data are, or are to be, processed. For the purpose of this Privacy Policy, we are a Data Controller of your data. 
    -
    -
    DATA PROCESSORS (OR SERVICE PROVIDERS) means any natural or legal person who processes the data on behalf of the Data Controller. We may use the services of various Service Providers in order to process your data more effectively. 
    -
    DATA SUBJECT is any living individual who is the subject of Personal Data. 
    -
    -
    THE USER is the individual using our Service. The User corresponds to the Data Subject, who is the subject of Personal Data. 
    -
    -
    3. Information Collection and Use We collect several different types of information for various purposes to provide and improve our Service to you. 
    -
    -
    4. Types of Data CollectedPersonal Data While using our Service, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you (“Personal Data”). Personally identifiable information may include, but is not limited to: 
    -
    0.1. Email address 
    0.2. First name and last name 
    0.3. Phone number 
    0.4. Address, Country, State, Province, ZIP/Postal code, City 
    0.5. Cookies and Usage Data - We may use your Personal Data to contact you with newsletters, marketing or promotional materials and other information that may be of interest to you. You may opt out of receiving any, or all, of these communications from us by following the unsubscribe link. 
    -
    Usage Data 
    We may also collect information that your browser sends whenever you visit our Service or when you access Service by or through any device (“Usage Data”). - This Usage Data may include information such as your computer’s Internet Protocol address (e.g. IP address), browser type, browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on those pages, unique device identifiers and other diagnostic data. - When you access Service with a device, this Usage Data may include information such as the type of device you use, your device unique ID, the IP address of your device, your device operating system, the type of Internet browser you use, unique device identifiers and other diagnostic data. 
    -
    Location Data -
    We may use and store information about your location if you give us permission to do so (“Location Data”). We use this data to provide features of our Service, to improve and customize our Service.You can enable or disable location services when you use our Service at any time by way of your device settings. 
    -
    Tracking Cookies Data 
    We use cookies and similar tracking technologies to track the activity on our Service and we hold certain information. - Cookies are files with a small amount of data which may include an anonymous unique identifier. Cookies are sent to your browser from a website and stored on your device. Other tracking technologies are also used such as beacons, tags and scripts to collect and track information and to improve and analyze our Service. - You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some portions of our Service. 
    -
    Examples of Cookies we use: 
    0.1. Session Cookies: We use Session Cookies to operate our Service. 
    0.2. Preference Cookies: We use Preference Cookies to remember your preferences and various settings. 
    0.3. Security Cookies: We use Security Cookies for security purposes. 
    0.4. Advertising Cookies: Advertising Cookies are used to serve you with advertisements that may be relevant to you and your interests. 
    -
    Other Data 
    While using our Service, we may also collect the following information: sex, age, date of birth, place of birth, passport details, citizenship, registration at place of residence and actual address, telephone number (work, mobile), details of documents on education, qualification, professional training, employment agreements, NDA agreements, information on bonuses and compensation, information on marital status, family members, social security (or other taxpayer identification) number, office location and other data. 
    -
    5. Use of Data 
    Yabe online mall uses the collected data for various purposes: 
    0.1. to provide and maintain our Service; 
    0.2. to notify you about changes to our Service; 
    0.3. to allow you to participate in interactive features of our Service when you choose to do so; 
    0.4. to provide customer support; 
    0.5. to gather analysis or valuable information so that we can improve our Service; 
    0.6. to monitor the usage of our Service; 
    0.7. to detect, prevent and address technical issues; 
    0.8. to fulfil any other purpose for which you provide it; 
    0.9. to carry out our obligations and enforce our rights arising from any contracts entered into between you and us, including for billing and collection; - 0.10. to provide you with notices about your account and/or subscription, including expiration and renewal notices, email-instructions, etc.; 
    0.11. to provide you with news, special offers and general information about other goods, services and events which we offer that are similar to those that you have already purchased or enquired about unless you have opted not to receive such information; 
    0.12. in any other way we may describe when you provide the information; 
    0.13. for any other purpose with your consent. 
    -
    6. Retention of Data 
    We will retain your Personal Data only for as long as is necessary for the purposes set out in this Privacy Policy. We will retain and use your Personal Data to the extent necessary to comply with our legal obligations (for example, if we are required to retain your data to comply with applicable laws), resolve disputes, and enforce our legal agreements and policies. - We will also retain Usage Data for internal analysis purposes. Usage Data is generally retained for a shorter period, except when this data is used to strengthen the security or to improve the functionality of our Service, or we are legally obligated to retain this data for longer time periods. 
    -
    7. Transfer of Data 
    Your information, including Personal Data, may be transferred to – and maintained on – computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ from those of your jurisdiction. - If you are located outside Vietnam and choose to provide information to us, please note that we transfer the data, including Personal Data, to Vietnam and process it there. - Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer. - Yabe online mall will take all the steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organisation or a country unless there are adequate controls in place including the security of your data and other personal information. - 8. Disclosure of Data We may disclose personal information that we collect, or you provide: 
    0.1. Disclosure for Law Enforcement. Under certain circumstances, we may be required to disclose your Personal Data if required to do so by law or in response to valid requests by public authorities.
    0.2. Business Transaction.If we or our subsidiaries are involved in a merger, acquisition or asset sale, your Personal Data may be transferred.0.3. Other cases. We may disclose your information also:0.3.1. to our subsidiaries and affiliates;0.3.2. to contractors, service providers, and other third parties we use to support our business;
    0.3.3. to fulfill the purpose for which you provide it;
    0.3.4. for the purpose of including your company’s logo on our website;
    0.3.5. for any other purpose disclosed by us when you provide the information;
    0.3.6. with your consent in any other cases;
    0.3.7. if we believe disclosure is necessary or appropriate to protect the rights, property, or safety of the Company, our customers, or others. 
    -
    9. Security of Data 
    The security of your data is important to us but remember that no method of transmission over the Internet or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security. 
    -
    10. Your Data Protection Rights Under General Data Protection Regulation (GDPR) If you are a resident of the European Union (EU) and European Economic Area (EEA), you have certain data protection rights, covered by GDPR. - We aim to take reasonable steps to allow you to correct, amend, delete, or limit the use of your Personal Data. - If you wish to be informed what Personal Data we hold about you and if you want it to be removed from our systems, please email us at ngocanhthu20102002@gmail.com. - In certain circumstances, you have the following data protection rights: 
    0.1. the right to access, update or to delete the information we have on you; 
    0.2. the right of rectification. You have the right to have your information rectified if that information is inaccurate or incomplete; 
    0.3. the right to object. You have the right to object to our processing of your Personal Data; 
    0.4. the right of restriction. You have the right to request that we restrict the processing of your personal information; 
    0.5. the right to data portability. You have the right to be provided with a copy of your Personal Data in a structured, machine-readable and commonly used format; 
    0.6. the right to withdraw consent. You also have the right to withdraw your consent at any time where we rely on your consent to process your personal information; - Please note that we may ask you to verify your identity before responding to such requests. Please note, we may not able to provide Service without some necessary data. - You have the right to complain to a Data Protection Authority about our collection and use of your Personal Data. For more information, please contact your local data protection authority in the European Economic Area (EEA). 
    -
    11. Your Data Protection Rights under the California Privacy Protection Act (CalOPPA) CalOPPA is the first state law in the nation to require commercial websites and online services to post a privacy policy. The law’s reach stretches well beyond California to require a person or company in the United States (and conceivable the world) that operates websites collecting personally identifiable information from California consumers to post a conspicuous privacy policy on its website stating exactly the information being collected and those individuals with whom it is being shared, and to comply with this policy. - According to CalOPPA we agree to the following: - 0.1. users can visit our site anonymously; - 0.2. our Privacy Policy link includes the word “Privacy”, and can easily be found on the home page of our website; - 0.3. users will be notified of any privacy policy changes on our Privacy Policy Page; - 0.4. users are able to change their personal information by emailing us at ngocanhthu20102002@gmail.com. - Our Policy on “Do Not Track” Signals: - We honor Do Not Track signals and do not track, plant cookies, or use advertising when a Do Not Track browser mechanism is in place. Do Not Track is a preference you can set in your web browser to inform websites that you do not want to be tracked. - You can enable or disable Do Not Track by visiting the Preferences or Settings page of your web browser. - 12. Your Data Protection Rights under the California Consumer Privacy Act (CCPA) If you are a California resident, you are entitled to learn what data we collect about you, ask to delete your data and not to sell (share) it. To exercise your data protection rights, you can make certain requests and ask us: 0.1. What personal information we have about you. If you make this request, we will return to you: 
    0.0.1. The categories of personal information we have collected about you. 
    0.0.2. The categories of sources from which we collect your personal information. 
    0.0.3. The business or commercial purpose for collecting or selling your personal information. 
    0.0.4. The categories of third parties with whom we share personal information. 
    0.0.5. The specific pieces of personal information we have collected about you. 
    0.0.6. A list of categories of personal information that we have sold, along with the category of any other company we sold it to. If we have not sold your personal information, we will inform you of that fact. 
    0.0.7. A list of categories of personal information that we have disclosed for a business purpose, along with the category of any other company we shared it with. - Please note, you are entitled to ask us to provide you with this information up to two times in a rolling twelve-month period. When you make this request, the information provided may be limited to the personal information we collected about you in the previous 12 months. 
    -
    0.2. To delete your personal information. 
    If you make this request, we will delete the personal information we hold about you as of the date of your request from our records and direct any service providers to do the same. In some cases, deletion may be accomplished through de-identification of the information. If you choose to delete your personal information, you may not be able to use certain functions that require your personal information to operate.
    0.3. To stop selling your personal information. We don’t sell or rent your personal information to any third parties for any purpose. We do not sell your personal information for monetary consideration. However, under some circumstances, a transfer of personal information to a third party, or within our family of companies, without monetary consideration may be considered a “sale” under California law. You are the only owner of your Personal Data and can request disclosure or deletion at any time. 
    -
    If you submit a request to stop selling your personal information, we will stop making such transfers. - Please note, if you ask us to delete or stop selling your data, it may impact your experience with us, and you may not be able to participate in certain programs or membership services which require the usage of your personal information to function. But in no circumstances, we will discriminate against you for exercising your rights. - To exercise your California data protection rights described above, please send your request(s) by email: ngocanhthu20102002@gmail.com. - Your data protection rights, described above, are covered by the CCPA, short for the California Consumer Privacy Act. 
    -
    To find out more, visit the official California Legislative Information website. The CCPA took effect on 01/01/2020. - 13. Service Providers We may employ third party companies and individuals to facilitate our Service (“Service Providers”), provide Service on our behalf, perform Service-related services or assist us in analysing how our Service is used. - These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose. 
    -
    14. Analytics 
    We may use third-party Service Providers to monitor and analyze the use of our Service. 
    -
    15. CI/CD tools 
    We may use third-party Service Providers to automate the development process of our Service. 
    -
    16. Advertising -
    We may use third-party Service Providers to show advertisements to you to help support and maintain our Service. 
    -
    17. Behavioral Remarketing 
    We may use remarketing services to advertise on third party websites to you after you visited our Service. We and our third-party vendors use cookies to inform, optimise and serve ads based on your past visits to our Service. 
    -
    18. Payments -
    -
    We may provide paid products and/or services within Service. In that case, we use third-party services for payment processing (e.g. payment processors).We will not store or collect your payment card details. That information is provided directly to our third-party payment processors whose use of your personal information is governed by their Privacy Policy. These payment processors adhere to the standards set by PCI-DSS as managed by the PCI Security Standards Council, which is a joint effort of brands like Visa, Mastercard, American Express and Discover. PCI-DSS requirements help ensure the secure handling of payment information. 
    -
    19. Links to Other Sites 
    Our Service may contain links to other sites that are not operated by us. If you click a third party link, you will be directed to that third party’s site. We strongly advise you to review the Privacy Policy of every site you visit. - We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services. - For example, the outlined privacy policy has been made using PolicyMaker.io, a free tool that helps create high-quality legal documents. PolicyMaker’s privacy policy generator is an easy-to-use tool for creating a privacy policy for blog, website, e-commerce store or mobile app. 
    -
    20. Children’s Privacy 
    Our Services are not intended for use by children under the age of 18 (“Child” or “Children”). - We do not knowingly collect personally identifiable information from Children under 18. If you become aware that a Child has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from Children without verification of parental consent, we take steps to remove that information from our servers. 
    -
    21. Changes to This Privacy Policy 
    We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page. - We will let you know via email and/or a prominent notice on our Service, prior to the change becoming effective and update “effective date” at the top of this Privacy Policy. - You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are effective when they are posted on this page. 
    -
    22. Contact Us 
    If you have any questions about this Privacy Policy, please contact us by email: ngocanhthu20102002@gmail.com. 
    -
    This Privacy Policy was created for yabe-online-mall.github.io by PolicyMaker.io on 2021-04-16. 
    -

    +

    diff --git a/public/mall/legal/tos/index.php b/public/mall/legal/tos/index.php index adfb5c9b..c527d97a 100644 --- a/public/mall/legal/tos/index.php +++ b/public/mall/legal/tos/index.php @@ -24,84 +24,7 @@

    TERMS OF SERVICE

    -

    1. Introduction 
    Welcome to Yabe online mall (“Company”, “we”, “our”, “us”)! - These Terms of Service (“Terms”, “Terms of Service”) govern your use of our website located at yabe-online-mall.github.io (together or individually “Service”) operated by Yabe online mall
    Our Privacy Policy also governs your use of our Service and explains how we collect, safeguard and disclose information that results from your use of our web pages. - Your agreement with us includes these Terms and our Privacy Policy (“Agreements”). You acknowledge that you have read and understood Agreements, and agree to be bound of them. - If you do not agree with (or cannot comply with) Agreements, then you may not use the Service, but please let us know by emailing at ngocanhthu20102002@gmail.com so we can try to find a solution. These Terms apply to all visitors, users and others who wish to access or use Service. 
    -
    -
    2. Communications 
    By using our Service, you agree to subscribe to newsletters, marketing or promotional materials and other information we may send. However, you may opt out of receiving any, or all, of these communications from us by following the unsubscribe link or by emailing at ngocanhthu20102002@gmail.com. 
    -
    -
    3. Purchases -
    If you wish to purchase any product or service made available through Service (“Purchase”), you may be asked to supply certain information relevant to your Purchase including but not limited to, your credit or debit card number, the expiration date of your card, your billing address, and your shipping information.
    You represent and warrant that: 
    (i) you have the legal right to use any card(s) or other payment method(s) in connection with any Purchase; and that (ii) the information you supply to us is true, correct and complete.We may employ the use of third party services for the purpose of facilitating payment and the completion of Purchases. By submitting your information, you grant us the right to provide the information to these third parties subject to our Privacy Policy.We reserve the right to refuse or cancel your order at any time for reasons including but not limited to: product or service availability, errors in the description or price of the product or service, error in your order or other reasons.We reserve the right to refuse or cancel your order if fraud or an unauthorized or illegal transaction is suspected. 
    -
    -
    4. Contests, Sweepstakes and Promotions 
    Any contests, sweepstakes or other promotions (collectively, “Promotions”) made available through Service may be governed by rules that are separate from these Terms of Service. If you participate in any Promotions, please review the applicable rules as well as our Privacy Policy. If the rules for a Promotion conflict with these Terms of Service, Promotion rules will apply. 
    -
    -
    5. Subscriptions -
    Some parts of Service are billed on a subscription basis ("Subscription(s)"). You will be billed in advance on a recurring and periodic basis ("Billing Cycle"). Billing cycles will be set depending on the type of subscription plan you select when purchasing a Subscription.At the end of each Billing Cycle, your Subscription will automatically renew under the exact same conditions unless you cancel it or Yabe online mall cancels it. You may cancel your Subscription renewal either through your online account management page or by contacting ngocanhthu20102002@gmail.com customer support team.A valid payment method is required to process the payment for your subscription. You shall provide Yabe online mall with accurate and complete billing information that may include but not limited to full name, address, state, postal or zip code, telephone number, and a valid payment method information. By submitting such payment information, you automatically authorize Yabe online mall to charge all Subscription fees incurred through your account to any such payment instruments.Should automatic billing fail to occur for any reason, Yabe online mall reserves the right to terminate your access to the Service with immediate effect.
    -
    -
    6. Free Trial -
    Yabe online mall may, at its sole discretion, offer a Subscription with a free trial for a limited period of time ("Free Trial").You may be required to enter your billing information in order to sign up for Free Trial.If you do enter your billing information when signing up for Free Trial, you will not be charged by Yabe online mall until Free Trial has expired. On the last day of Free Trial period, unless you cancelled your Subscription, you will be automatically charged the applicable Subscription fees for the type of Subscription you have selected.At any time and without notice, Yabe online mall reserves the right to (i) modify Terms of Service of Free Trial offer, or (ii) cancel such Free Trial offer.
    -
    -
    7. Fee Changes -
    Yabe online mall, in its sole discretion and at any time, may modify Subscription fees for the Subscriptions. Any Subscription fee change will become effective at the end of the then-current Billing Cycle.Yabe online mall will provide you with a reasonable prior notice of any change in Subscription fees to give you an opportunity to terminate your Subscription before such change becomes effective.Your continued use of Service after Subscription fee change comes into effect constitutes your agreement to pay the modified Subscription fee amount. - 8. RefundsWe issue refunds for Contracts within 30 days of the original purchase of the Contract. 
    -
    -
    9. Content -
    Content found on or through this Service are the property of Yabe online mall or used with permission. You may not distribute, modify, transmit, reuse, download, repost, copy, or use said Content, whether in whole or in part, for commercial purposes or for personal gain, without express advance written permission from us. 
    -
    -
    10. Prohibited Uses 
    You may use Service only for lawful purposes and in accordance with Terms. 
    You agree not to use Service: 
    0.1. In any way that violates any applicable national or international law or regulation. 
    0.2. For the purpose of exploiting, harming, or attempting to exploit or harm minors in any way by exposing them to inappropriate content or otherwise. - 0.3. To transmit, or procure the sending of, any advertising or promotional material, including any “junk mail”, “chain letter,” “spam,” or any other similar solicitation. 
    0.4. To impersonate or attempt to impersonate Company, a Company employee, another user, or any other person or entity. 
    0.5. In any way that infringes upon the rights of others, or in any way is illegal, threatening, fraudulent, or harmful, or in connection with any unlawful, illegal, fraudulent, or harmful purpose or activity. 
    0.6. To engage in any other conduct that restricts or inhibits anyone’s use or enjoyment of Service, or which, as determined by us, may harm or offend Company or users of Service or expose them to liability. 
    Additionally, you agree not to: 
    0.1. Use Service in any manner that could disable, overburden, damage, or impair Service or interfere with any other party’s use of Service, including their ability to engage in real time activities through Service. 
    0.2. Use any robot, spider, or other automatic device, process, or means to access Service for any purpose, including monitoring or copying any of the material on Service. 
    0.3. Use any manual process to monitor or copy any of the material on Service or for any other unauthorized purpose without our prior written consent. - 0.4. Use any device, software, or routine that interferes with the proper working of Service. 
    0.5. Introduce any viruses, trojan horses, worms, logic bombs, or other material which is malicious or technologically harmful. 
    0.6. Attempt to gain unauthorized access to, interfere with, damage, or disrupt any parts of Service, the server on which Service is stored, or any server, computer, or database connected to Service. 
    0.7. Attack Service via a denial-of-service attack or a distributed denial-of-service attack. 
    0.8. Take any action that may damage or falsify Company rating. 
    0.9. Otherwise attempt to interfere with the proper working of Service. 
    -
    -
    11. Analytics 
    We may use third-party Service Providers to monitor and analyze the use of our Service. 
    -
    -
    12. No Use By Minors 
    Service is intended only for access and use by individuals at least eighteen (18) years old. By accessing or using Service, you warrant and represent that you are at least eighteen (18) years of age and with the full authority, right, and capacity to enter into this agreement and abide by all of the terms and conditions of Terms. If you are not at least eighteen (18) years old, you are prohibited from both the access and usage of Service. 
    -
    -
    13. Accounts -
    When you create an account with us, you guarantee that you are above the age of 18, and that the information you provide us is accurate, complete, and current at all times. Inaccurate, incomplete, or obsolete information may result in the immediate termination of your account on Service.You are responsible for maintaining the confidentiality of your account and password, including but not limited to the restriction of access to your computer and/or account. You agree to accept responsibility for any and all activities or actions that occur under your account and/or password, whether your password is with our Service or a third-party service. You must notify us immediately upon becoming aware of any breach of security or unauthorized use of your account.You may not use as a username the name of another person or entity or that is not lawfully available for use, a name or trademark that is subject to any rights of another person or entity other than you, without appropriate authorization. You may not use as a username any name that is offensive, vulgar or obscene.We reserve the right to refuse service, terminate accounts, remove or edit content, or cancel orders in our sole discretion. 
    -
    -
    14. Intellectual Property 
    Service and its original content (excluding Content provided by users), features and functionality are and will remain the exclusive property of Yabe online mall and its licensors. Service is protected by copyright, trademark, and other laws of and foreign countries. Our trademarks may not be used in connection with any product or service without the prior written consent of Yabe online mall. 
    -
    -
    15. Copyright Policy 
    We respect the intellectual property rights of others. It is our policy to respond to any claim that Content posted on Service infringes on the copyright or other intellectual property rights (“Infringement”) of any person or entity. - If you are a copyright owner, or authorized on behalf of one, and you believe that the copyrighted work has been copied in a way that constitutes copyright infringement, please submit your claim via email to ngocanhthu20102002@gmail.com, with the subject line: “Copyright Infringement” and include in your claim a detailed description of the alleged Infringement as detailed below, under “DMCA Notice and Procedure for Copyright Infringement Claims” - You may be held accountable for damages (including costs and attorneys’ fees) for misrepresentation or bad-faith claims on the infringement of any Content found on and/or through Service on your copyright. 
    -
    -
    16. DMCA Notice and Procedure for Copyright Infringement Claims 
    You may submit a notification pursuant to the Digital Millennium Copyright Act (DMCA) by providing our Copyright Agent with the following information in writing (see 17 U.S.C 512(c)(3) for further detail): 
    0.1. an electronic or physical signature of the person authorized to act on behalf of the owner of the copyright’s interest; 
    0.2. a description of the copyrighted work that you claim has been infringed, including the URL (i.e., web page address) of the location where the copyrighted work exists or a copy of the copyrighted work; 
    0.3. identification of the URL or other specific location on Service where the material that you claim is infringing is located; 
    0.4. your address, telephone number, and email address; 
    0.5. a statement by you that you have a good faith belief that the disputed use is not authorized by the copyright owner, its agent, or the law; 
    0.6. a statement by you, made under penalty of perjury, that the above information in your notice is accurate and that you are the copyright owner or authorized to act on the copyright owner’s behalf. - You can contact our Copyright Agent via email at ngocanhthu20102002@gmail.com. 
    -
    -
    17. Error Reporting and Feedback 
    You may provide us either directly at ngocanhthu20102002@gmail.com or via third party sites and tools with information and feedback concerning errors, suggestions for improvements, ideas, problems, complaints, and other matters related to our Service (“Feedback”). You acknowledge and agree that: (i) you shall not retain, acquire or assert any intellectual property right or other right, title or interest in or to the Feedback; (ii) Company may have development ideas similar to the Feedback; (iii) Feedback does not contain confidential information or proprietary information from you or any third party; and (iv) Company is not under any obligation of confidentiality with respect to the Feedback. In the event the transfer of the ownership to the Feedback is not possible due to applicable mandatory laws, you grant Company and its affiliates an exclusive, transferable, irrevocable, free-of-charge, sub-licensable, unlimited and perpetual right to use (including copy, modify, create derivative works, publish, distribute and commercialize) Feedback in any manner and for any purpose. 
    -
    -
    18. Links To Other Web Sites 
    Our Service may contain links to third party web sites or services that are not owned or controlled by Yabe online mall. - Yabe online mall has no control over, and assumes no responsibility for the content, privacy policies, or practices of any third party web sites or services. We do not warrant the offerings of any of these entities/individuals or their websites. - For example, the outlined Terms of Use have been created using PolicyMaker.io, a free web application for generating high-quality legal documents. PolicyMaker’s Terms and Conditions generator is an easy-to-use free tool for creating an excellent standard Terms of Service template for a website, blog, e-commerce store or app. - YOU ACKNOWLEDGE AND AGREE THAT COMPANY SHALL NOT BE RESPONSIBLE OR LIABLE, DIRECTLY OR INDIRECTLY, FOR ANY DAMAGE OR LOSS CAUSED OR ALLEGED TO BE CAUSED BY OR IN CONNECTION WITH USE OF OR RELIANCE ON ANY SUCH CONTENT, GOODS OR SERVICES AVAILABLE ON OR THROUGH ANY SUCH THIRD PARTY WEB SITES OR SERVICES. - WE STRONGLY ADVISE YOU TO READ THE TERMS OF SERVICE AND PRIVACY POLICIES OF ANY THIRD PARTY WEB SITES OR SERVICES THAT YOU VISIT. 
    -
    -
    19. Disclaimer Of Warranty 
    THESE SERVICES ARE PROVIDED BY COMPANY ON AN “AS IS” AND “AS AVAILABLE” BASIS. COMPANY MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THEIR SERVICES, OR THE INFORMATION, CONTENT OR MATERIALS INCLUDED THEREIN. YOU EXPRESSLY AGREE THAT YOUR USE OF THESE SERVICES, THEIR CONTENT, AND ANY SERVICES OR ITEMS OBTAINED FROM US IS AT YOUR SOLE RISK. - NEITHER COMPANY NOR ANY PERSON ASSOCIATED WITH COMPANY MAKES ANY WARRANTY OR REPRESENTATION WITH RESPECT TO THE COMPLETENESS, SECURITY, RELIABILITY, QUALITY, ACCURACY, OR AVAILABILITY OF THE SERVICES. WITHOUT LIMITING THE FOREGOING, NEITHER COMPANY NOR ANYONE ASSOCIATED WITH COMPANY REPRESENTS OR WARRANTS THAT THE SERVICES, THEIR CONTENT, OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE SERVICES WILL BE ACCURATE, RELIABLE, ERROR-FREE, OR UNINTERRUPTED, THAT DEFECTS WILL BE CORRECTED, THAT THE SERVICES OR THE SERVER THAT MAKES IT AVAILABLE ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS OR THAT THE SERVICES OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE SERVICES WILL OTHERWISE MEET YOUR NEEDS OR EXPECTATIONS. - COMPANY HEREBY DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, AND FITNESS FOR PARTICULAR PURPOSE. - THE FOREGOING DOES NOT AFFECT ANY WARRANTIES WHICH CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW. 
    -
    -
    20. Limitation Of Liability 
    EXCEPT AS PROHIBITED BY LAW, YOU WILL HOLD US AND OUR OFFICERS, DIRECTORS, EMPLOYEES, AND AGENTS HARMLESS FOR ANY INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGE, HOWEVER IT ARISES (INCLUDING ATTORNEYS’ FEES AND ALL RELATED COSTS AND EXPENSES OF LITIGATION AND ARBITRATION, OR AT TRIAL OR ON APPEAL, IF ANY, WHETHER OR NOT LITIGATION OR ARBITRATION IS INSTITUTED), WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, OR ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT, INCLUDING WITHOUT LIMITATION ANY CLAIM FOR PERSONAL INJURY OR PROPERTY DAMAGE, ARISING FROM THIS AGREEMENT AND ANY VIOLATION BY YOU OF ANY FEDERAL, STATE, OR LOCAL LAWS, STATUTES, RULES, OR REGULATIONS, EVEN IF COMPANY HAS BEEN PREVIOUSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EXCEPT AS PROHIBITED BY LAW, IF THERE IS LIABILITY FOUND ON THE PART OF COMPANY, IT WILL BE LIMITED TO THE AMOUNT PAID FOR THE PRODUCTS AND/OR SERVICES, AND UNDER NO CIRCUMSTANCES WILL THERE BE CONSEQUENTIAL OR PUNITIVE DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF PUNITIVE, INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE PRIOR LIMITATION OR EXCLUSION MAY NOT APPLY TO YOU. 
    -
    -
    21. Termination 
    We may terminate or suspend your account and bar access to Service immediately, without prior notice or liability, under our sole discretion, for any reason whatsoever and without limitation, including but not limited to a breach of Terms. - If you wish to terminate your account, you may simply discontinue using Service. - All provisions of Terms which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability. 
    -
    -
    22. Governing Law 
    These Terms shall be governed and construed in accordance with the laws of Vietnam, which governing law applies to agreement without regard to its conflict of law provisions. - Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our Service and supersede and replace any prior agreements we might have had between us regarding Service.
    -
    -
    23. Changes To Service 
    We reserve the right to withdraw or amend our Service, and any service or material we provide via Service, in our sole discretion without notice. We will not be liable if for any reason all or any part of Service is unavailable at any time or for any period. From time to time, we may restrict access to some parts of Service, or the entire Service, to users, including registered users. 
    -
    -
    24. Amendments To Terms 
    We may amend Terms at any time by posting the amended terms on this site. It is your responsibility to review these Terms periodically. - Your continued use of the Platform following the posting of revised Terms means that you accept and agree to the changes. You are expected to check this page frequently so you are aware of any changes, as they are binding on you. - By continuing to access or use our Service after any revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, you are no longer authorized to use Service. 
    -
    -
    25. Waiver And Severability 
    No waiver by Company of any term or condition set forth in Terms shall be deemed a further or continuing waiver of such term or condition or a waiver of any other term or condition, and any failure of Company to assert a right or provision under Terms shall not constitute a waiver of such right or provision. - If any provision of Terms is held by a court or other tribunal of competent jurisdiction to be invalid, illegal or unenforceable for any reason, such provision shall be eliminated or limited to the minimum extent such that the remaining provisions of Terms will continue in full force and effect.
    -
    26. Acknowledgement
    BY USING SERVICE OR OTHER SERVICES PROVIDED BY US, YOU ACKNOWLEDGE THAT YOU HAVE READ THESE TERMS OF SERVICE AND AGREE TO BE BOUND BY THEM.  
    -
    27. Contact Us Please send your feedback, comments, requests for technical support by email: ngocanhthu20102002@gmail.com.
    These Terms of Service were created for yabe-online-mall.github.io by PolicyMaker.io on 2021-04-16. 
    -

    +

    From 528820571c4a2d7f28963b0f4026ed9e725e0fd0 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Wed, 19 May 2021 23:16:43 +0700 Subject: [PATCH 039/155] Fixed check featured products functions in check-featured-stores-products.php --- private/check-featured-stores-products.php | 60 ++++++---------------- 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index d4323aa4..4bacbc01 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -1,20 +1,17 @@ true if user input has TRUE value, + * @param array $products containing information of all products + * @return mixed + * array containing information of a product if it is + * featured on mall, * false otherwise. */ - function check_featured_mall_products($mall_product_id) { - $mall_products = read_csv("../../../../private/database/products.csv", true); - foreach ($mall_products as $p_mall) { - if (($p_mall['featured_in_mall'] == TRUE) && ($p_mall['id'] == $mall_product_id)) { + function check_featured_mall_products(array $products) { + foreach ($products as $p_mall) { + if ($p_mall['featured_in_mall'] === TRUE) { return $p_mall; } } @@ -22,46 +19,19 @@ function check_featured_mall_products($mall_product_id) { } /** - * Check if Check if featured products on the Store Home page(s) - * user input - * @param int $store_product_id - * id required for the input - * true if user input has TRUE value, + * Check if products are featured on Store Home page(s) + * @param array $products containing information of all products + * @return mixed + * array containing information of a product if it is + * featured on Store Home, * false otherwise. */ - function check_featured_store_products(int $store_product_id) { - $store_products = read_csv("../../../../private/database/products.csv", true); - foreach ($store_products as $p_store) { - if (($p_store['featured_in_store'] == TRUE) && ($p_store['id'] == $store_product_id)) { + function check_featured_store_products(array $products) { + foreach ($products as $p_store) { + if ($p_store['featured_in_store'] === "TRUE") { return $p_store; } } return false; } - - - /** - * Check if Check if featured stores on the Store Home page(s) - * user input - * @param int $store_stores_id - * id required for the input - * true if user input has TRUE value, - * false otherwise. - */ - function check_featured_store_stores(int $store_stores_id) { - $store_stores = read_csv("../../../../private/database/stores.csv", true); - foreach ($store_stores as $s_store) { - if (($s_store['featured_in_store'] == TRUE) && ($s_store['id'] == $store_stores_id)) { - return $s_store; - } - } - return false; - } - - - - - - - \ No newline at end of file From 769ee86eacfbb5c0ef4370ce42462c0024644f6d Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Wed, 19 May 2021 23:33:06 +0700 Subject: [PATCH 040/155] Removed unnecessary "require" line, added quotes --- private/check-featured-stores-products.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/private/check-featured-stores-products.php b/private/check-featured-stores-products.php index 4bacbc01..f8f082c0 100644 --- a/private/check-featured-stores-products.php +++ b/private/check-featured-stores-products.php @@ -1,6 +1,4 @@ Date: Wed, 19 May 2021 23:59:27 +0700 Subject: [PATCH 041/155] Implemented function to compare created time in created-time-function.php --- private/created-time-function.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/private/created-time-function.php b/private/created-time-function.php index b3d9bbc7..e0c3d975 100644 --- a/private/created-time-function.php +++ b/private/created-time-function.php @@ -1 +1,6 @@ Date: Thu, 20 May 2021 00:23:44 +0700 Subject: [PATCH 042/155] Changed name of function and parameters, fixed function so it sorts from newest to oldest --- private/created-time-function.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/private/created-time-function.php b/private/created-time-function.php index e0c3d975..f98a92b1 100644 --- a/private/created-time-function.php +++ b/private/created-time-function.php @@ -1,6 +1,6 @@ Date: Thu, 20 May 2021 00:33:11 +0700 Subject: [PATCH 043/155] Added docstring for time sort function in created-time-function.php --- private/created-time-function.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/private/created-time-function.php b/private/created-time-function.php index f98a92b1..32a90c92 100644 --- a/private/created-time-function.php +++ b/private/created-time-function.php @@ -1,6 +1,15 @@ Date: Thu, 20 May 2021 00:39:48 +0700 Subject: [PATCH 044/155] Renamed file to dynamic-display.php, moved sort_by_time function to this file --- private/created-time-function.php | 15 --------------- ...ed-stores-products.php => dynamic-display.php} | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 private/created-time-function.php rename private/{check-featured-stores-products.php => dynamic-display.php} (73%) diff --git a/private/created-time-function.php b/private/created-time-function.php deleted file mode 100644 index 32a90c92..00000000 --- a/private/created-time-function.php +++ /dev/null @@ -1,15 +0,0 @@ - Date: Thu, 20 May 2021 01:01:11 +0700 Subject: [PATCH 045/155] Finished implementing CMS logic --- private/shared/page-editor.php | 39 +++++++++++++++++-- public/admin/index.php | 1 + public/admin/legal_editor.php | 27 ++++++++++--- public/css/page-editor.css | 71 ++++++++++++++++++++++++++++++++++ public/js/page-editor.js | 33 ++++++++++++++++ 5 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 public/css/page-editor.css create mode 100644 public/js/page-editor.js diff --git a/private/shared/page-editor.php b/private/shared/page-editor.php index 7aa24d51..c66a2248 100644 --- a/private/shared/page-editor.php +++ b/private/shared/page-editor.php @@ -1,6 +1,39 @@ -
    -
    - + + +
    + +
    +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    + + " class="cms-editor-reset">Reset + + +
    This feature is not available on mobile devices
    diff --git a/public/admin/index.php b/public/admin/index.php index ffa513fd..ba801a85 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -44,6 +44,7 @@

    Welcome to Yabe CMS Administrator's Dashboard.

    +

    CMS stands for Content Management System. You can use the administrative tools provided here to modify website database, configure website settings, add/remove account manually, and more advanced operations... If you're new to CMS systems, please refer to the ">Administrator's Manual to learn how to operate Yabe CMS.

    diff --git a/public/admin/legal_editor.php b/public/admin/legal_editor.php index e1cbf847..4e78f4b2 100644 --- a/public/admin/legal_editor.php +++ b/public/admin/legal_editor.php @@ -5,10 +5,12 @@ $page_title = "Yabe CMS Administrator's Dashboard"; $style_sheets = [ "/css/common.css", - "/css/admin.css" + "/css/admin.css", + "/css/page-editor.css" ]; $scripts = [ "/js/common.js", + "/js/page-editor.js", ]; // Automatic redirect to Administrator Authentication page if user hasn't logged in @@ -17,23 +19,30 @@ } - // Legal page editor logic + // Legal page editor page selection logic $a_page_selected = $_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["page"]); + $filepath = null; if ($a_page_selected) { switch ($_GET["page"]) { case "copyright": - echo "copyright"; + $filepath = SHARED_PATH . "/legal/copyright.php"; break; case "tos": - echo "tos"; + $filepath = SHARED_PATH . "/legal/tos.php"; break; case "privacy_policy": - echo "privacy policy"; + $filepath = SHARED_PATH . "/legal/privacy-policy.php"; break; } } + if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["page_editor"])) { + file_put_contents(SHARED_PATH . $filepath, $_POST["edit"], LOCK_EX); + new_logs_entry("../../private/logs.txt", "CMS Page Editor | modified " . SHARED_PATH . $filepath); + } + + include(SHARED_PATH . "/top.php"); ?> @@ -69,6 +78,14 @@ + +
    diff --git a/public/css/page-editor.css b/public/css/page-editor.css new file mode 100644 index 00000000..c74287df --- /dev/null +++ b/public/css/page-editor.css @@ -0,0 +1,71 @@ +#page-editor { + margin: 30px 0 50px 0; +} + +.page-editor-tab { + width: 40%; +} + +.page-editor-tab label { + display: block; + width: 100%; + height: 100%; + padding: 10px 20px; + margin: 0; + color: #cdcdcd; + background: transparent; + border: 1px solid #ececec; + border-bottom: none; + border-radius: 30px 30px 0 0; + transition: 0.5s; +} + +.page-editor-tab label:hover { + cursor: pointer; +} + +.page-editor-tab input[type="radio"]:checked ~ label { + color: #252422; + background: #ececec; + font-weight: bolder; +} + +#page-editor-tab-header input[type="radio"] { + position: relative; + top: 0; + left: 0; + width: 0; + height: 0; +} + +#page-editor-textarea { + padding: 0; + margin: 0; + border: 1px solid #ececec; +} + +#page-editor-preview { + display: none; + border: 1px solid #ececec; + height: 750px; + padding: 20px; + -ms-overflow-y: scroll; + overflow-y: scroll; +} + +#page-editor-mobile-mode { + display: none; + margin: auto; +} + + +/* Page editor on mobile devices: Disabled */ +@media only screen and (max-width: 950px) { + #page-editor-form { + display: none; + } + + #page-editor-mobile-mode { + display: block; + } +} diff --git a/public/js/page-editor.js b/public/js/page-editor.js new file mode 100644 index 00000000..4b5605a4 --- /dev/null +++ b/public/js/page-editor.js @@ -0,0 +1,33 @@ +const EDIT_TAB_CONTROL = document.getElementById("page-editor-tab-edit"); +const EDIT_TAB_AREA = document.getElementById("page-editor-textarea"); +const PREVIEW_TAB_CONTROL = document.getElementById("page-editor-tab-preview"); +const PREVIEW_TAB_AREA = document.getElementById("page-editor-preview"); + + +// Toggling behavior between edit and preview tab +EDIT_TAB_CONTROL.addEventListener("change", function () { + if (EDIT_TAB_CONTROL.checked && !PREVIEW_TAB_CONTROL.checked) { + EDIT_TAB_AREA.setAttribute("style", "display: block;"); + PREVIEW_TAB_AREA.setAttribute("style", "display: none;"); + } else { + EDIT_TAB_AREA.setAttribute("style", "display: none;"); + PREVIEW_TAB_AREA.setAttribute("style", "display: block;"); + } +}); + +PREVIEW_TAB_CONTROL.addEventListener("change", function () { + if (PREVIEW_TAB_CONTROL.checked && !EDIT_TAB_CONTROL.checked) { + EDIT_TAB_AREA.setAttribute("style", "display: none;"); + PREVIEW_TAB_AREA.setAttribute("style", "display: block;"); + } else { + EDIT_TAB_AREA.setAttribute("style", "display: block;"); + PREVIEW_TAB_AREA.setAttribute("style", "display: none;"); + } +}); + + +// Render preview content from editor textarea HTML +PREVIEW_TAB_AREA.innerHTML = EDIT_TAB_AREA.value; +EDIT_TAB_AREA.addEventListener("input", function () { + PREVIEW_TAB_AREA.innerHTML = EDIT_TAB_AREA.value; +}); From 6e72df42a358ebabcfa8789f3e8f10efe9c8abd8 Mon Sep 17 00:00:00 2001 From: miketvo Date: Thu, 20 May 2021 01:19:02 +0700 Subject: [PATCH 046/155] Finalized implementing CMS logic --- private/logs.txt | 2 ++ private/shared/page-editor.php | 2 ++ public/admin/legal_editor.php | 24 ++++++++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/private/logs.txt b/private/logs.txt index e69de29b..3ba0cccb 100644 --- a/private/logs.txt +++ b/private/logs.txt @@ -0,0 +1,2 @@ +[2021-05-19T20:17:37+02:00sess_d17qs36m65lirduh4hijr9ickm] CMS Page Editor | modified C:\Users\vomin\Documents\GitHub\yabe-mall\private/shared +[2021-05-19T20:18:00+02:00sess_d17qs36m65lirduh4hijr9ickm] CMS Page Editor | modified C:\Users\vomin\Documents\GitHub\yabe-mall\private/shared diff --git a/private/shared/page-editor.php b/private/shared/page-editor.php index c66a2248..c9a2519f 100644 --- a/private/shared/page-editor.php +++ b/private/shared/page-editor.php @@ -30,6 +30,8 @@
    + + " class="cms-editor-reset">Reset diff --git a/public/admin/legal_editor.php b/public/admin/legal_editor.php index 4e78f4b2..95e1e5e7 100644 --- a/public/admin/legal_editor.php +++ b/public/admin/legal_editor.php @@ -1,4 +1,9 @@ - +
    + "; + echo "Content of " . $target_file . " updated."; + echo "
    "; + } + + ?> +
    + " ?> @@ -135,6 +139,7 @@ function next_page($list_length) { $stores_list = read_csv("../../../private/database/stores.csv", true); $expected_stores = []; // a table of matched stores $row = 0; // represent each row of $expected_store + if (isset($_GET["browse-option"])) { if ($_GET["by-store"] === "by-category") { if ($_GET["browse-option"] != "all-categories") { @@ -170,8 +175,7 @@ function next_page($list_length) { $row++; } } - } - } else if ($_GET["by-store"] === "by-name") { + } else if ($_GET["by-store"] === "by-name") { for ($i = 0; $i < count($stores_list); $i++) { $first_letter = substr($stores_list[$i]["name"], 0, 1); if ($_GET["browse-option"] === strtolower($first_letter) || $_GET["browse-option"] === strtoupper($first_letter) ) { @@ -188,7 +192,8 @@ function next_page($list_length) { } } } - } + } + } each_page($expected_stores, count($expected_stores)); ?> From b4ccc29b0ff4788c65470b81d96a91a87728ce4d Mon Sep 17 00:00:00 2001 From: miketvo Date: Thu, 20 May 2021 13:19:38 +0700 Subject: [PATCH 052/155] Added missing link to CMS Manual in public/admin/index.php --- public/admin/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/admin/index.php b/public/admin/index.php index ba801a85..91d35df6 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -45,7 +45,7 @@

    Welcome to Yabe CMS Administrator's Dashboard.

    -

    CMS stands for Content Management System. You can use the administrative tools provided here to modify website database, configure website settings, add/remove account manually, and more advanced operations... If you're new to CMS systems, please refer to the ">Administrator's Manual to learn how to operate Yabe CMS.

    +

    CMS stands for Content Management System. You can use the administrative tools provided here to modify website database, configure website settings, add/remove account manually, and more advanced operations... If you're new to CMS systems, please refer to the ">Administrator's Manual to learn how to operate Yabe CMS.

    From 123937fb9775f8e3f84cc7c4dfb4c0db5b8be019 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Thu, 20 May 2021 14:55:04 +0700 Subject: [PATCH 053/155] add styling for button (reuse most of the old pagination styling) --- public/css/pagination.css | 22 ++++++++++++++++++++++ public/mall/browse/index.php | 6 ++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/public/css/pagination.css b/public/css/pagination.css index 65e1914b..6f1d6e5d 100644 --- a/public/css/pagination.css +++ b/public/css/pagination.css @@ -32,3 +32,25 @@ .pagination .current-page:hover { background-color: #cd4813; } + +.pagination-wrapper { + padding: 20px 0; + text-align: right; + margin: 0 20px 20px 0; +} + +.prev-button, .next-button { + font-size: 14px; + text-align: right; + text-decoration: none; + color: black; + border: 1px black solid; + box-sizing: border-box; + padding: 3px 11px; + margin: 5px; + background-color: #dddddd; +} + +.prev-button:hover, .next-button:hover { + background-color: #ececec; +} \ No newline at end of file diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index dd8140a3..37977bbf 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -204,16 +204,18 @@ function next_page($list_length) { $prev = prev_page(); $next = next_page(count($expected_stores)); echo " +
    - - +
    "; ?> From 84dbdd14ed3719c3df0e20f8168d4746b80e33cd Mon Sep 17 00:00:00 2001 From: miketvo Date: Thu, 20 May 2021 14:55:05 +0700 Subject: [PATCH 054/155] Added docstring and make variable names more sensible --- private/dynamic-display.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index ebc368c6..e8d25cc2 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -10,14 +10,15 @@ * false otherwise. */ function check_featured_mall_products(array $products) { - foreach ($products as $p_mall) { - if ($p_mall['featured_in_mall'] === "TRUE") { - return $p_mall; + foreach ($products as $product) { + if ($product['featured_in_mall'] === "TRUE") { + return $product; } } return false; } + /** * Check if stores are featured on the Mall Home page * @param array $stores containing information of all stores @@ -27,9 +28,9 @@ function check_featured_mall_products(array $products) { * false otherwise. */ function check_featured_mall_stores(array $stores) { - foreach ($stores as $s_mall) { - if ($s_mall['featured'] === "TRUE") { - return $s_mall; + foreach ($stores as $store) { + if ($store['featured'] === "TRUE") { + return $store; } } return false; @@ -45,9 +46,9 @@ function check_featured_mall_stores(array $stores) { * false otherwise. */ function check_featured_store_products(array $products) { - foreach ($products as $p_store) { - if ($p_store['featured_in_store'] === "TRUE") { - return $p_store; + foreach ($products as $product) { + if ($product['featured_in_store'] === "TRUE") { + return $product; } } return false; @@ -55,12 +56,12 @@ function check_featured_store_products(array $products) { /** - * Compare and sort the dates created of two items (stores, products, etc.) from newest to oldest + * Compare the dates created of two items (stores, products, etc.). To be used as the handler function for usort() to sort a given group of database items from newest to oldest. * @param array $item1 first item for comparison * @param array $item2 second item for comparison * @return int */ - function sort_by_time(array $item1, array $item2): int { + function compare_by_time(array $item1, array $item2): int { return -(strtotime($item1["created_time"]) - strtotime($item2["created_time"])); } \ No newline at end of file From 3dc0e26f759e7272ed066f8e3017842320a5f5dc Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Thu, 20 May 2021 15:23:46 +0700 Subject: [PATCH 055/155] Modularize store header for Store pages --- private/shared/store/store-header.php | 57 ++++++++++++++++++ .../browse-product/by-category.php | 60 ------------------- .../store-template/browse-product/by-date.php | 59 ------------------ public/store/store-template/index.php | 58 ------------------ public/store/store-template/pages/bio.php | 59 ------------------ public/store/store-template/pages/contact.php | 59 ------------------ 6 files changed, 57 insertions(+), 295 deletions(-) create mode 100644 private/shared/store/store-header.php diff --git a/private/shared/store/store-header.php b/private/shared/store/store-header.php new file mode 100644 index 00000000..1690dd51 --- /dev/null +++ b/private/shared/store/store-header.php @@ -0,0 +1,57 @@ + + +
    +
    + image of a shop + image representation of a shop + +

    HSY Shop

    + + + +

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, aspernatur dolores magni, + aliquam perferendis debitis ipsa necessitatibus nisi quisquam velit ex dolorem, facilis + et rerum quod blanditiis ducimus voluptatem adipisci!

    + +
    + +
    PRODUCTS + +
    + ">CATEGORY +
    + ">DATE +
    +
    + + + +
    + +
    + + +
    + +
    +
    +
    \ No newline at end of file diff --git a/public/store/store-template/browse-product/by-category.php b/public/store/store-template/browse-product/by-category.php index d3564916..6559e998 100644 --- a/public/store/store-template/browse-product/by-category.php +++ b/public/store/store-template/browse-product/by-category.php @@ -20,66 +20,6 @@ ?>
    - - - -
    -
    - image of a shop - image representation of a shop - -

    HSY Shop

    - - - -

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, aspernatur dolores magni, - aliquam perferendis debitis ipsa necessitatibus nisi quisquam velit ex dolorem, facilis - et rerum quod blanditiis ducimus voluptatem adipisci!

    - -
    - -
    PRODUCTS - -
    - ">CATEGORY -
    - ">DATE -
    -
    - - - -
    - -
    - - -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    diff --git a/public/store/store-template/pages/bio.php b/public/store/store-template/pages/bio.php index a39a9d24..b9063e76 100644 --- a/public/store/store-template/pages/bio.php +++ b/public/store/store-template/pages/bio.php @@ -18,65 +18,6 @@ ?>
    - - -
    -
    - image of a shop - image representation of a shop - -

    HSY Shop

    - - - -

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, aspernatur dolores magni, - aliquam perferendis debitis ipsa necessitatibus nisi quisquam velit ex dolorem, facilis - et rerum quod blanditiis ducimus voluptatem adipisci!

    - -
    - -
    PRODUCTS - -
    - ">CATEGORY -
    - ">DATE -
    -
    - - - -
    - -
    - - -
    - -
    -
    -
    -

    BIO

    Our Goal

    diff --git a/public/store/store-template/pages/contact.php b/public/store/store-template/pages/contact.php index 8db0da35..c374573f 100644 --- a/public/store/store-template/pages/contact.php +++ b/public/store/store-template/pages/contact.php @@ -18,65 +18,6 @@ ?>
    - - -
    -
    - image of a shop - image representation of a shop - -

    HSY Shop

    - - - -

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, aspernatur dolores magni, - aliquam perferendis debitis ipsa necessitatibus nisi quisquam velit ex dolorem, facilis - et rerum quod blanditiis ducimus voluptatem adipisci!

    - -
    - -
    PRODUCTS - -
    - ">CATEGORY -
    - ">DATE -
    -
    - - - -
    - -
    - - -
    - -
    -
    -
    -

    CONTACT

    From b2fc7f9c12fd519ffe6897657f57d257a87a460d Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Thu, 20 May 2021 16:57:44 +0700 Subject: [PATCH 056/155] Modularize store footer for Store pages --- private/shared/store/store-footer.php | 20 ++++++++++++++++ .../browse-product/by-category.php | 24 +------------------ .../store-template/browse-product/by-date.php | 22 ----------------- public/store/store-template/index.php | 22 ----------------- public/store/store-template/pages/bio.php | 22 ----------------- public/store/store-template/pages/contact.php | 22 ----------------- 6 files changed, 21 insertions(+), 111 deletions(-) create mode 100644 private/shared/store/store-footer.php diff --git a/private/shared/store/store-footer.php b/private/shared/store/store-footer.php new file mode 100644 index 00000000..fce2d28c --- /dev/null +++ b/private/shared/store/store-footer.php @@ -0,0 +1,20 @@ + +
    diff --git a/public/store/store-template/browse-product/by-category.php b/public/store/store-template/browse-product/by-category.php index 6559e998..99ee6f92 100644 --- a/public/store/store-template/browse-product/by-category.php +++ b/public/store/store-template/browse-product/by-category.php @@ -173,28 +173,6 @@
    - - -
    - \ No newline at end of file + diff --git a/public/store/store-template/browse-product/by-date.php b/public/store/store-template/browse-product/by-date.php index b1e67235..627d1330 100644 --- a/public/store/store-template/browse-product/by-date.php +++ b/public/store/store-template/browse-product/by-date.php @@ -169,28 +169,6 @@
    - - -
    \ No newline at end of file diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index bffd213d..f8597959 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -174,28 +174,6 @@ - - -
    \ No newline at end of file diff --git a/public/store/store-template/pages/bio.php b/public/store/store-template/pages/bio.php index b9063e76..f49b5d92 100644 --- a/public/store/store-template/pages/bio.php +++ b/public/store/store-template/pages/bio.php @@ -69,28 +69,6 @@ - - - \ No newline at end of file diff --git a/public/store/store-template/pages/contact.php b/public/store/store-template/pages/contact.php index c374573f..ec4536a6 100644 --- a/public/store/store-template/pages/contact.php +++ b/public/store/store-template/pages/contact.php @@ -50,28 +50,6 @@

    +1 502 104 308

    - - - \ No newline at end of file From 08dc8437743996afcc49dffe5666bc263a18c827 Mon Sep 17 00:00:00 2001 From: miketvo Date: Thu, 20 May 2021 20:41:58 +0700 Subject: [PATCH 057/155] Initial front-end implementation --- private/shared/bottom.php | 1 + private/shared/top.php | 10 +++++----- public/js/search/common.js | 14 ++++++++++++++ public/search/index.php | 28 ++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 public/js/search/common.js create mode 100644 public/search/index.php diff --git a/private/shared/bottom.php b/private/shared/bottom.php index 03567108..ea0f5749 100644 --- a/private/shared/bottom.php +++ b/private/shared/bottom.php @@ -66,5 +66,6 @@ echo ""; } ?> + \ No newline at end of file diff --git a/private/shared/top.php b/private/shared/top.php index dabf636b..7bc1efcd 100644 --- a/private/shared/top.php +++ b/private/shared/top.php @@ -42,7 +42,7 @@
    @@ -56,12 +56,12 @@ - + diff --git a/public/js/search/common.js b/public/js/search/common.js new file mode 100644 index 00000000..59657674 --- /dev/null +++ b/public/js/search/common.js @@ -0,0 +1,14 @@ +const SEARCH_FORM = document.getElementById("nav-search-form"); +const SEARCH_BTTN = document.getElementById("nav-search-bttn"); +const SEARCH_FILTER = document.getElementById("nav-search-filter"); + +if (SEARCH_FORM !== undefined && SEARCH_BTTN !== undefined && NAV_SEARCH_FILTER !== undefined) { + SEARCH_BTTN.addEventListener("click", function () { + SEARCH_FORM.submit(); + }); + + SEARCH_FORM.addEventListener("submit", function () { + let regExPattern = /(^\s+)|(\s+$)|(?<=\s)\s/g; // Remove all unnecessary whitespaces + document.getElementById("nav-search-filter-input").value = SEARCH_FILTER.firstChild.textContent.replace(regExPattern, ""); + }); +} diff --git a/public/search/index.php b/public/search/index.php new file mode 100644 index 00000000..caa3c1e8 --- /dev/null +++ b/public/search/index.php @@ -0,0 +1,28 @@ + + + + +
    +
    +    
    +  
    +
    + + From 777ab7d7b53ddb51cfe507e5e66be09125a859da Mon Sep 17 00:00:00 2001 From: miketvo Date: Thu, 20 May 2021 21:00:44 +0700 Subject: [PATCH 058/155] Further front-end implementation: Navbar search filter: Removed all extra filters for Products; Added store categories. --- private/shared/top.php | 34 +++++++++++++++++++++++++--------- public/js/common.js | 4 +--- public/js/search/common.js | 5 +++-- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/private/shared/top.php b/private/shared/top.php index 7bc1efcd..b950c39d 100644 --- a/private/shared/top.php +++ b/private/shared/top.php @@ -38,19 +38,35 @@ diff --git a/public/js/common.js b/public/js/common.js index bb8fabe0..9e005d10 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -48,15 +48,13 @@ function previousPage() { const NAV_SEARCH_FILTER = document.getElementById("nav-search-filter"); const NAV_SEARCH_FILTER_OPTIONS = document.querySelectorAll(".nav-search-filter-option"); const NAV_SEARCH_FILTER_LEVEL_1 = document.getElementById("nav-search-filter-level-1"); -const NAV_SEARCH_FILTER_LEVEL_2_1 = document.getElementById("nav-search-filter-level-2-1"); const NAV_SEARCH_FILTER_LEVEL_2_2 = document.getElementById("nav-search-filter-level-2-2"); -let separator = " by "; +let separator = " - "; // Automatic display, width, and position on mouseover of Navbar Filter NAV_SEARCH_FILTER.addEventListener("mouseover", function () { let width = NAV_SEARCH_FILTER_LEVEL_1.offsetWidth; NAV_SEARCH_FILTER_LEVEL_1.setAttribute("style", "display: block; animation: expand-top 0.1s; transform-origin: top;"); - NAV_SEARCH_FILTER_LEVEL_2_1.setAttribute("style", `left: ${width}px;`); NAV_SEARCH_FILTER_LEVEL_2_2.setAttribute("style", `left: ${width}px;`); }); diff --git a/public/js/search/common.js b/public/js/search/common.js index 59657674..0351848f 100644 --- a/public/js/search/common.js +++ b/public/js/search/common.js @@ -1,14 +1,15 @@ const SEARCH_FORM = document.getElementById("nav-search-form"); const SEARCH_BTTN = document.getElementById("nav-search-bttn"); const SEARCH_FILTER = document.getElementById("nav-search-filter"); +const REGEX_UNNECESSARY_WHITESPACES = /(^\s+)|(\s+$)|(?<=\s)\s/g; // Regular expression pattern to find all unnecessary whitespaces if (SEARCH_FORM !== undefined && SEARCH_BTTN !== undefined && NAV_SEARCH_FILTER !== undefined) { SEARCH_BTTN.addEventListener("click", function () { + document.getElementById("nav-search-filter-input").value = SEARCH_FILTER.firstChild.textContent.replace(REGEX_UNNECESSARY_WHITESPACES, ""); SEARCH_FORM.submit(); }); SEARCH_FORM.addEventListener("submit", function () { - let regExPattern = /(^\s+)|(\s+$)|(?<=\s)\s/g; // Remove all unnecessary whitespaces - document.getElementById("nav-search-filter-input").value = SEARCH_FILTER.firstChild.textContent.replace(regExPattern, ""); + document.getElementById("nav-search-filter-input").value = SEARCH_FILTER.firstChild.textContent.replace(REGEX_UNNECESSARY_WHITESPACES, ""); }); } From cf60b7cae71a4f367dfb78aa1bbb0a94b28e3390 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Thu, 20 May 2021 21:56:25 +0700 Subject: [PATCH 059/155] Fixed store header's image sources --- private/shared/store/store-header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/private/shared/store/store-header.php b/private/shared/store/store-header.php index 1690dd51..d47ea364 100644 --- a/private/shared/store/store-header.php +++ b/private/shared/store/store-header.php @@ -7,9 +7,9 @@
    image of a shop + src="../../../public/media/image/placeholder_1920x1080.jpg"> image representation of a shop + src="../../../public/media/image/profile-placeholder_143x143.png">

    HSY Shop

    From e2b7654c5947cda4dd1b33b5bca16b8686dd9223 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Thu, 20 May 2021 21:58:09 +0700 Subject: [PATCH 060/155] Fixed store footer's image source --- private/shared/store/store-footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/shared/store/store-footer.php b/private/shared/store/store-footer.php index fce2d28c..2f9b1e32 100644 --- a/private/shared/store/store-footer.php +++ b/private/shared/store/store-footer.php @@ -1,6 +1,6 @@
    + + + + + + + + \ No newline at end of file From 27061240e4ccbaf0a6b1a4a364e91b2920b52cea Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Fri, 21 May 2021 13:01:29 +0700 Subject: [PATCH 075/155] restyled the created time for new store --- public/css/cards.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/css/cards.css b/public/css/cards.css index fc851e39..7e4f1bd7 100644 --- a/public/css/cards.css +++ b/public/css/cards.css @@ -65,6 +65,15 @@ font-size: 9pt; } +.store-card-sale-card { + float: right; + background: #fffcf2; + border: 1px solid #252422; + padding: 2px 5px; + margin: 20px 40px 20px; + font-size: 9pt; +} + .store-card { background: #fff; box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1); @@ -216,6 +225,10 @@ .product-card-sale-card { display: none; } + + .store-card-sale-card { + display: none; + } } @media only screen and (min-width: 1350px) { From 5fd916d3270a72dd26cbd0435fa54156b35fdfa1 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Fri, 21 May 2021 14:01:40 +0700 Subject: [PATCH 076/155] add a separate php file for functions, add docstrings, hasn't replaced nested if yet --- private/browse.php | 78 ++++++++++++++++++++++++++++++++++++ public/mall/browse/index.php | 55 +++---------------------- 2 files changed, 83 insertions(+), 50 deletions(-) create mode 100644 private/browse.php diff --git a/private/browse.php b/private/browse.php new file mode 100644 index 00000000..38f0d84e --- /dev/null +++ b/private/browse.php @@ -0,0 +1,78 @@ + + image representation of a shop + $store_name + + "; + } + +/** + * Retrieve a list of stores and the maximum number of cards that will be display + * Display store cards with a number of cards that is <= the maximum number of cards + * The cards will be order ascending based on its position in the list + * @param $stores + * @param $max_cards + */ + function each_page($stores, $max_cards) { + $min = 0; + $max = $max_cards - $min - 1; + $page = $_GET["page"]; + $list_length = count($stores); + $min += $max_cards * ($page-1); + $max += $max_cards * ($page-1); + if ($max > $list_length) { + $max = $list_length - 1; + } + for ($i = $min; $i <= $max; $i++) { + display_store($stores[$i]["store_name"],$stores[$i]["store_id"]); + } + + } + +/** + * Use the number of the current page to get the previous page + * @return int + */ + function prev_page() { + $prev = $_GET["page"] - 1; + // page number cannot be lower than 1 + if ($prev < 1) { + $prev = 1; + } + return $prev; + } + +/** + * Use the number of the current page to get the next page + * @return int + */ + function next_page($list_length, $max_cards) { + $next = $_GET["page"] + 1; + // calculate the required pages for each browse option + if ($list_length % $max_cards != 0) { + $max_page = floor($list_length / $max_cards) + 1; + } else { + $max_page = $list_length / $max_cards; + } + // page number cannot exceed the maximum number of pages + if ($next > $max_page) { + $next = $max_page; + } + return $next; + } \ No newline at end of file diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 37977bbf..8db7d19e 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -14,7 +14,8 @@ ]; include(SHARED_PATH . "/top.php"); -include("../../../private/csv.php"); +require_once("../../../private/csv.php"); +require_once("../../../private/browse.php"); // default browse option if (!isset($_GET["by-store"]) || $_GET["by-store"] === "") { @@ -29,55 +30,9 @@ $_GET["page"] = "1"; } -function display_store($s, $sid) { - $store_href = url_for("/store/store-template/?={$sid}"); - echo " -
    - image representation of a shop - $s -
    - "; -} - -$max_products = 10; // maximum number of products displayed on the page - -function each_page($stores, $list_length) { - global $max_products; - $min = 0; - $max = $max_products - $min - 1; - $page = $_GET["page"]; - $min += $max_products * ($page-1); - $max += $max_products * ($page-1); - if ($max > $list_length) { - $max = $list_length - 1; - } - for ($i = $min; $i <= $max; $i++) { - display_store($stores[$i]["store_name"],$stores[$i]["store_id"]); - } - -} -function prev_page() { - $prev = $_GET["page"] - 1; - if ($prev < 1) { - $prev = 1; - } - return $prev; -} +$max_stores = 10; // maximum number of stores displayed on the page -function next_page($list_length) { - global $max_products; - $next = $_GET["page"] + 1; - if ($list_length % $max_products != 0) { - $max_page = floor($list_length / $max_products) + 1; - } else { - $max_page = $list_length / $max_products; - } - if ($next > $max_page) { - $next = $max_page; - } - return $next; -} ?> @@ -194,7 +149,7 @@ function next_page($list_length) { } } } - each_page($expected_stores, count($expected_stores)); + each_page($expected_stores, $max_stores); ?> @@ -202,7 +157,7 @@ function next_page($list_length) {
    From 89e578a07d6f4bbfe22ed1be791815f62cd2215f Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Fri, 21 May 2021 14:08:48 +0700 Subject: [PATCH 077/155] Changed to more meaningful Variables, Sort stores by created time Added documentation --- public/mall/index.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index f079ff27..82f465aa 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -20,7 +20,7 @@ ]; - // Constants for display settings + // Constants for display at most 10 items define("NEW_PRODUCTS_DISPLAY_NUM", 10); define("FEATURED_PRODUCTS_DISPLAY_NUM", 10); define("NEW_STORES_DISPLAY_NUM", 10); @@ -30,13 +30,10 @@ // Dynamic loading of database $products = read_csv("../../private/database/products.csv", true); $stores = read_csv("../../private/database/stores.csv", true); + + // Sort products and stores from latest to oldest created time usort($products, "compare_by_time"); usort($stores, "compare_by_time"); - -// echo "
    ";
    -//    print_r($products);
    -//    print_r($stores);
    -//    echo "
    "; include(SHARED_PATH . "/top.php"); @@ -79,9 +76,8 @@
    image of a product @@ -107,8 +103,8 @@
    image representation of a shop @@ -132,11 +128,11 @@ image representation of a shop " . $stores[$display_count]["name"] . " -
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    +
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; $display_count++; } From 1d7a3473937e580b4bb5aa834af2b0cecbaded84 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Fri, 21 May 2021 15:07:04 +0700 Subject: [PATCH 078/155] limit the uses of nested if statements add comments fix a docstring --- private/browse.php | 2 +- public/mall/browse/index.php | 89 ++++++++++++++++++++---------------- 2 files changed, 50 insertions(+), 41 deletions(-) diff --git a/private/browse.php b/private/browse.php index 38f0d84e..3b73ae11 100644 --- a/private/browse.php +++ b/private/browse.php @@ -25,7 +25,7 @@ function display_store($store_name, $store_id) { /** * Retrieve a list of stores and the maximum number of cards that will be display * Display store cards with a number of cards that is <= the maximum number of cards - * The cards will be order ascending based on its position in the list + * The cards will be ordered ascending based on its position in the list * @param $stores * @param $max_cards */ diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 8db7d19e..5a9b5be6 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -92,51 +92,60 @@ "", - "store_name" => "", - ]); - $expected_stores[$row]["store_name"] = $store_name; - $expected_stores[$row]["store_id"] = $store_id; - $row++; - } + switch ($_GET['by-store']) { + case "by-category": + if ($_GET["browse-option"] != "all-categories") { + for ($i = 0; $i < count($category_list); $i++) { + if ($category_list[$i]["name"] == $_GET["browse-option"]) { + for ($k = 0; $k < count($stores_list); $k++) { + if ($category_list[$i]["id"] == $stores_list[$k]["category_id"]) { + $store_name = $stores_list[$k]["name"]; + $store_id = $stores_list[$k]["id"]; + } else { + continue; // prevent adding the unmatched to the table + // adding the unmatched will cause an error as their vars aren't set. + } + if (!in_array($store_id, $expected_stores)) { + array_push($expected_stores, [ + "store_id" => "", + "store_name" => "", + ]); + $expected_stores[$row]["store_name"] = $store_name; + $expected_stores[$row]["store_id"] = $store_id; + $row++; + } + } } } - } - } - } else { - for ($k = 0; $k< count($stores_list); $k++) { - $store_name = $stores_list[$k]["name"]; - $store_id = $stores_list[$k]["id"]; - array_push($expected_stores, [ + } else { + for ($k = 0; $k < count($stores_list); $k++) { + $store_name = $stores_list[$k]["name"]; + $store_id = $stores_list[$k]["id"]; + array_push($expected_stores, [ "store_id" => "", "store_name" => "", - ]); - $expected_stores[$row]["store_name"] = $store_name; - $expected_stores[$row]["store_id"] = $store_id; - $row++; - } - } - } else if ($_GET["by-store"] === "by-name") { - for ($i = 0; $i < count($stores_list); $i++) { - $first_letter = substr($stores_list[$i]["name"], 0, 1); - if ($_GET["browse-option"] === strtolower($first_letter) || $_GET["browse-option"] === strtoupper($first_letter) ) { - $store_name = $stores_list[$i]["name"]; - $store_id = $stores_list[$i]["id"]; - if (!in_array($store_id,$expected_stores)) { + ]); + $expected_stores[$row]["store_name"] = $store_name; + $expected_stores[$row]["store_id"] = $store_id; + $row++; + } + } + break; + case "by-name": + for ($i = 0; $i < count($stores_list); $i++) { + $first_letter = substr($stores_list[$i]["name"], 0, 1); + if ($_GET["browse-option"] === strtolower($first_letter) || $_GET["browse-option"] === strtoupper($first_letter)) { + $store_name = $stores_list[$i]["name"]; + $store_id = $stores_list[$i]["id"]; + } else { + continue; // prevent adding the unmatched to the table + // adding the unmatched will cause an error as their vars aren't set. + } + if (!in_array($store_id, $expected_stores)) { array_push($expected_stores, [ "store_id" => "", "store_name" => "", @@ -146,9 +155,9 @@ $row++; } } - } - } + break; } + } each_page($expected_stores, $max_stores); ?> From 245d7944972856a1e6e8b73b804561f8913a1177 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 17:05:11 +0700 Subject: [PATCH 079/155] Deleted all product cards, write functions to display product cards, added id to store link for testing --- public/mall/index.php | 2 +- public/store/store-template/index.php | 149 ++++---------------------- 2 files changed, 19 insertions(+), 132 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index 9c3d74da..c6614e82 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -104,7 +104,7 @@ ">image of a product diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index aab1e4eb..7172d3c3 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -1,4 +1,7 @@ - + "; + echo "image of a product"; + echo "
    "; + echo "Purple Hyacinth Comic"; + echo "

    Sophism & Ephemerys

    "; + echo "

    $16.95

    "; + echo "
    18/6/2018
    "; + echo "
    " . "\n" . "
    "; + } ?> @@ -30,71 +46,6 @@
    -
    - ">image of a product -
    - ">Purple Hyacinth Comic -

    Sophism & Ephemerys

    -

    $16.95

    -
    18/6/2018
    -
    -
    - -
    - ">image of a product -
    - ">Omniscient Reader's Viewpoint Novel -

    Sing Shong

    -

    $13.50

    -
    6/1/2018
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    @@ -107,71 +58,7 @@
    -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    - -
    - ">image of a product -
    - ">Product Title Goes Here -

    Short Description Goes Here

    -

    $16.95

    -
    1/4/2020
    -
    -
    +
    From e66442bf99b184695e73def5bdf8cccbaa0bb5c6 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 17:14:23 +0700 Subject: [PATCH 080/155] Added docstring & parameter for display product card function, changed image of cards to general placeholder --- public/store/store-template/index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index 7172d3c3..6fd2d936 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -20,10 +20,13 @@ include(SHARED_PATH . "/top.php"); - function display_product_cards() { + /** + * Display product card of each product + */ + function display_product_cards($product) { echo "
    "; echo "image of a product"; + src='../../media/image/placeholder_262x250.png'>"; echo "
    "; echo "Purple Hyacinth Comic"; echo "

    Sophism & Ephemerys

    "; @@ -46,6 +49,7 @@ function display_product_cards() {
    +
    From 211c65e9933fc49b78f8638ca1af6a9375b643cf Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 18:11:33 +0700 Subject: [PATCH 081/155] Fixed logic of check featured functions to return an array instead of 1 item --- private/dynamic-display.php | 18 ++++++++++++------ public/mall/index.php | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 983e3264..79e119c9 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -10,12 +10,14 @@ * false otherwise. */ function check_featured_mall_products(array $products) { + $featured_mall_products = []; + foreach ($products as $product) { if ($product['featured_in_mall'] === "TRUE") { - return $product; + $featured_mall_products[] = $product; } } - return false; + return $featured_mall_products; } @@ -28,12 +30,14 @@ function check_featured_mall_products(array $products) { * false otherwise. */ function check_featured_mall_stores(array $stores) { + $featured_mall_stores = []; + foreach ($stores as $store) { if ($store['featured'] === "TRUE") { - return $store; + $featured_mall_stores[] = $store; } } - return false; + return $featured_mall_stores; } @@ -46,12 +50,14 @@ function check_featured_mall_stores(array $stores) { * false otherwise. */ function check_featured_store_products(array $products) { + $featured_store_products = []; + foreach ($products as $product) { if ($product['featured_in_store'] === "TRUE") { - return $product; + $featured_store_products[] = $product; } } - return false; + return $featured_store_products; } diff --git a/public/mall/index.php b/public/mall/index.php index c6614e82..8a497c5f 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -104,7 +104,7 @@ ">image of a product From 3b25a309987ddef29a237f1c88a7faf5f45bc3c0 Mon Sep 17 00:00:00 2001 From: rider3458 Date: Fri, 21 May 2021 18:16:21 +0700 Subject: [PATCH 082/155] fix docstrings' indentation and rearrange code --- private/browse.php | 40 ++++++++++++++++++------------------ public/mall/browse/index.php | 14 ++++++++----- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/private/browse.php b/private/browse.php index 3b73ae11..d8f3f431 100644 --- a/private/browse.php +++ b/private/browse.php @@ -7,11 +7,11 @@ * */ -/** - * Retrieve store name and store, then insert them into the store card - * @param $store_name - * @param $store_id - */ + /** + * Retrieve store name and store, then insert them into the store card + * @param $store_name + * @param $store_id + */ function display_store($store_name, $store_id) { $store_href = url_for("/store/store-template/?={$store_id}"); echo " @@ -22,13 +22,13 @@ function display_store($store_name, $store_id) { "; } -/** - * Retrieve a list of stores and the maximum number of cards that will be display - * Display store cards with a number of cards that is <= the maximum number of cards - * The cards will be ordered ascending based on its position in the list - * @param $stores - * @param $max_cards - */ + /** + * Retrieve a list of stores and the maximum number of cards that will be display + * Display store cards with a number of cards that is <= the maximum number of cards + * The cards will be ordered ascending based on its position in the list + * @param $stores + * @param $max_cards + */ function each_page($stores, $max_cards) { $min = 0; $max = $max_cards - $min - 1; @@ -45,10 +45,10 @@ function each_page($stores, $max_cards) { } -/** - * Use the number of the current page to get the previous page - * @return int - */ + /** + * Use the number of the current page to get the previous page + * @return int + */ function prev_page() { $prev = $_GET["page"] - 1; // page number cannot be lower than 1 @@ -58,10 +58,10 @@ function prev_page() { return $prev; } -/** - * Use the number of the current page to get the next page - * @return int - */ + /** + * Use the number of the current page to get the next page + * @return int + */ function next_page($list_length, $max_cards) { $next = $_GET["page"] + 1; // calculate the required pages for each browse option diff --git a/public/mall/browse/index.php b/public/mall/browse/index.php index 5a9b5be6..b07a2aff 100644 --- a/public/mall/browse/index.php +++ b/public/mall/browse/index.php @@ -1,4 +1,10 @@ - + @@ -165,6 +168,7 @@
    Date: Fri, 21 May 2021 18:18:09 +0700 Subject: [PATCH 083/155] Added return type declaration and fixed docstring for check featured functions --- private/dynamic-display.php | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 79e119c9..6bfaa59e 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -1,15 +1,14 @@ array containing information of a product if it is - * featured on mall, - * false otherwise. + * @return array array containing information + * of all products featured on Mall Home */ - function check_featured_mall_products(array $products) { + function check_featured_mall_products(array $products): array { $featured_mall_products = []; foreach ($products as $product) { @@ -24,12 +23,10 @@ function check_featured_mall_products(array $products) { /** * Check if stores are featured on the Mall Home page * @param array $stores containing information of all stores - * @return mixed - * array containing information of a store if it is - * featured on mall, - * false otherwise. + * @return array array containing information + * of all stores featured on Mall Home */ - function check_featured_mall_stores(array $stores) { + function check_featured_mall_stores(array $stores): array { $featured_mall_stores = []; foreach ($stores as $store) { @@ -42,14 +39,12 @@ function check_featured_mall_stores(array $stores) { /** - * Check if products are featured on Store Home page(s) + * Check if products are featured on Store Home page * @param array $products containing information of all products - * @return mixed - * array containing information of a product if it is - * featured on Store Home, - * false otherwise. + * @return array array containing information + * of all products featured on Store Home */ - function check_featured_store_products(array $products) { + function check_featured_store_products(array $products): array { $featured_store_products = []; foreach ($products as $product) { From 30f6a6570e30268aa477ea5830be445fa15c601b Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 18:23:14 +0700 Subject: [PATCH 084/155] Remove extra blank line --- private/dynamic-display.php | 1 - 1 file changed, 1 deletion(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 6bfaa59e..c6c16884 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -1,7 +1,6 @@ Date: Fri, 21 May 2021 23:02:00 +0700 Subject: [PATCH 085/155] Added required files and blank lines --- private/shared/store/store-header.php | 2 ++ public/store/store-template/index.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/private/shared/store/store-header.php b/private/shared/store/store-header.php index 64d71198..a8fee5cb 100644 --- a/private/shared/store/store-header.php +++ b/private/shared/store/store-header.php @@ -1,4 +1,5 @@
    "; } + // get all stores and products data + $stores = read_csv(PRIVATE_PATH . "\database/stores.csv", true); + $products = read_csv(PRIVATE_PATH . "\database/products.csv", true); + + $store_data = get_store_data($stores); + $all_featured_products = check_featured_store_products($products); + ?>
    From e083d3d27d5e2555d6de44c54fce22ce87bcc5b1 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 23:23:36 +0700 Subject: [PATCH 087/155] Added docstring and changed name, variable name for get_specific_store_ft_products function --- private/dynamic-display.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index eddef8dd..ebabaa4a 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -104,14 +104,21 @@ function get_store_cat(string $store_category_id, array $categories) { } - function get_selected_store_ft_products(array $featured, array $store): array { - $selected_store_featured = []; + /** + * Get the featured products of a specific store + * @param array $featured containing data of all featured products of all stores + * @param array $store containing data of a specific store + * @return array + * array containing data of the featured products of the selected store + */ + function get_specific_store_ft_products(array $featured, array $store): array { + $specific_store_featured = []; foreach ($featured as $ft_product) { if ($ft_product["store_id"] === $store["id"]) { - $selected_store_featured[] = $ft_product; + $specific_store_featured[] = $ft_product; } } - return $selected_store_featured; + return $specific_store_featured; } \ No newline at end of file From 68b0df3c4135231d08bf8fa386fec45d3f6f2100 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 23:40:02 +0700 Subject: [PATCH 088/155] Changed docstring and make display_product_cards function dynamic --- private/dynamic-display.php | 2 +- public/store/store-template/index.php | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index ebabaa4a..00429f3f 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -67,7 +67,7 @@ function compare_by_time(array $item1, array $item2): int { /** - * Get all data of the selected store + * Get all data of a specific store * @param array $stores containing data of all stores * @return false|mixed * array containing data of the selected store, diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index 7195586a..b7f0a760 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -25,17 +25,19 @@ /** - * Display product card of each product + * Dynamic display of product cards + * @param $product + * to be displayed */ function display_product_cards($product) { echo "
    "; - echo "image of a product"; + echo " + image of a product"; echo "
    "; - echo ""; - echo "

    Sophism & Ephemerys

    "; - echo "

    $16.95

    "; - echo "
    18/6/2018
    "; + echo "" . $product["name"] . ""; + echo "

    Short description

    "; + echo "

    " . $product["price"] . "

    "; + echo "
    " . $product["created_time"] . "
    "; echo "
    " . "\n" . "
    "; } @@ -43,9 +45,11 @@ function display_product_cards($product) { $stores = read_csv(PRIVATE_PATH . "\database/stores.csv", true); $products = read_csv(PRIVATE_PATH . "\database/products.csv", true); - $store_data = get_store_data($stores); + $specific_store = get_store_data($stores); $all_featured_products = check_featured_store_products($products); + $specific_featured_products = get_specific_store_ft_products($all_featured_products, $specific_store); + ?>
    From 7fd2445edd9249fb16697cd966977ee7e615d9d8 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 23:49:53 +0700 Subject: [PATCH 089/155] Changed get_specific_store_products function to accommodate getting new products from a specific store --- private/dynamic-display.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 00429f3f..ea6d2c02 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -105,20 +105,20 @@ function get_store_cat(string $store_category_id, array $categories) { /** - * Get the featured products of a specific store - * @param array $featured containing data of all featured products of all stores + * Get all products from a specific store + * @param array $products containing products from database * @param array $store containing data of a specific store * @return array - * array containing data of the featured products of the selected store + * array containing data of all products of the selected store */ - function get_specific_store_ft_products(array $featured, array $store): array { - $specific_store_featured = []; + function get_specific_store_products(array $products, array $store): array { + $specific_store_products = []; - foreach ($featured as $ft_product) { - if ($ft_product["store_id"] === $store["id"]) { - $specific_store_featured[] = $ft_product; + foreach ($products as $product) { + if ($product["store_id"] === $store["id"]) { + $specific_store_products[] = $product; } } - return $specific_store_featured; + return $specific_store_products; } \ No newline at end of file From 3df40bc41bcaa9fb804fc936c40e8ccc39382baf Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Fri, 21 May 2021 23:58:48 +0700 Subject: [PATCH 090/155] Fixed docstring, get all necessary data to display new and featured products --- private/dynamic-display.php | 4 ++-- public/store/store-template/index.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index ea6d2c02..49d1292f 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -105,11 +105,11 @@ function get_store_cat(string $store_category_id, array $categories) { /** - * Get all products from a specific store + * Get products from a specific store * @param array $products containing products from database * @param array $store containing data of a specific store * @return array - * array containing data of all products of the selected store + * array containing data of products of the selected store */ function get_specific_store_products(array $products, array $store): array { $specific_store_products = []; diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index b7f0a760..0db9a3d3 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -48,7 +48,12 @@ function display_product_cards($product) { $specific_store = get_store_data($stores); $all_featured_products = check_featured_store_products($products); - $specific_featured_products = get_specific_store_ft_products($all_featured_products, $specific_store); + // get all products of a specific store and sort them by time created from newest to oldest + $specific_products = get_specific_store_products($products, $specific_store); + $sorted_products = usort($specific_products, "compare_by_time"); + + // get products that are featured on a specific store + $specific_featured_products = get_specific_store_products($all_featured_products, $specific_store); ?> From 9bbdc125b9e21566adf5a190c119a376920c085f Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 00:09:58 +0700 Subject: [PATCH 091/155] Implemented new products display --- public/store/store-template/index.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index 0db9a3d3..c19b0ad6 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -41,6 +41,7 @@ function display_product_cards($product) { echo "" . "\n" . ""; } + // get all stores and products data $stores = read_csv(PRIVATE_PATH . "\database/stores.csv", true); $products = read_csv(PRIVATE_PATH . "\database/products.csv", true); @@ -50,7 +51,7 @@ function display_product_cards($product) { // get all products of a specific store and sort them by time created from newest to oldest $specific_products = get_specific_store_products($products, $specific_store); - $sorted_products = usort($specific_products, "compare_by_time"); + usort($specific_products, "compare_by_time"); // get products that are featured on a specific store $specific_featured_products = get_specific_store_products($all_featured_products, $specific_store); @@ -69,7 +70,18 @@ function display_product_cards($product) {
    - +
    From 958ae2dba9434fbbfea91498b3d15507fbc3e977 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 00:18:50 +0700 Subject: [PATCH 092/155] Fixed link in product name, added dollar sign for price, changed created time to only display year, month, day --- public/store/store-template/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index c19b0ad6..bd8a70fb 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -34,10 +34,10 @@ function display_product_cards($product) { echo " image of a product"; echo "
    "; - echo "" . $product["name"] . ""; + echo "" . $product["name"] . ""; echo "

    Short description

    "; - echo "

    " . $product["price"] . "

    "; - echo "
    " . $product["created_time"] . "
    "; + echo "

    $" . $product["price"] . "

    "; + echo "
    " . substr($product["created_time"],0,10) . "
    "; echo "
    " . "\n" . ""; } From 080e1255e245e36bb36d9de96cc66665a31c4e0c Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 00:25:38 +0700 Subject: [PATCH 093/155] Implemented display featured products --- public/store/store-template/index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index bd8a70fb..bbb2fce7 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -71,6 +71,7 @@ function display_product_cards($product) {
    @@ -94,7 +96,13 @@ function display_product_cards($product) {
    - +
    From 8832b501b2e10badeca5a3761ab94d0612326dda Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 00:56:38 +0700 Subject: [PATCH 094/155] Fixed links, added required files and read database --- private/shared/store/store-header.php | 8 ++++---- public/mall/index.php | 2 +- public/store/store-template/index.php | 4 ++-- public/store/store-template/product-detail/index.php | 12 ++++++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/private/shared/store/store-header.php b/private/shared/store/store-header.php index a8fee5cb..37aea373 100644 --- a/private/shared/store/store-header.php +++ b/private/shared/store/store-header.php @@ -1,10 +1,10 @@ ">image of a product diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index bbb2fce7..4217c424 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -43,8 +43,8 @@ function display_product_cards($product) { // get all stores and products data - $stores = read_csv(PRIVATE_PATH . "\database/stores.csv", true); - $products = read_csv(PRIVATE_PATH . "\database/products.csv", true); + $stores = read_csv("../../../private/database/stores.csv", true); + $products = read_csv("../../../private/database/products.csv", true); $specific_store = get_store_data($stores); $all_featured_products = check_featured_store_products($products); diff --git a/public/store/store-template/product-detail/index.php b/public/store/store-template/product-detail/index.php index 47ce6696..a509984d 100644 --- a/public/store/store-template/product-detail/index.php +++ b/public/store/store-template/product-detail/index.php @@ -1,7 +1,15 @@ - - + Date: Sat, 22 May 2021 01:08:57 +0700 Subject: [PATCH 095/155] Fixed links and deleted product-detail-2 --- .../store-template/product-detail-2/index.php | 170 ------------------ .../store-template/product-detail/index.php | 4 +- 2 files changed, 2 insertions(+), 172 deletions(-) delete mode 100644 public/store/store-template/product-detail-2/index.php diff --git a/public/store/store-template/product-detail-2/index.php b/public/store/store-template/product-detail-2/index.php deleted file mode 100644 index cda142d8..00000000 --- a/public/store/store-template/product-detail-2/index.php +++ /dev/null @@ -1,170 +0,0 @@ - - - - -
    - - -
    - - another image of the
-                    product - another image of the
-                    product - another image of the
-                    product - another image of the
-                    product - - - - main image of the product - -
    -

    SING SHONG

    -

    Omniscient Reader's Viewpoint Novel

    -

    Add to Favorites

    -

    Lorem ipsum dolor sit amet consectetur adipisicing elit.

    -
    -

    $13.50

    -

    6/1/2018

    -
    -
    - - -
    -
    -
    - -
    -

    Product Description

    -

    Lorem, ipsum dolor sit amet consectetur adipisicing elit. Rem, aspernatur dolores magni, - aliquam perferendis debitis ipsa necessitatibus nisi quisquam velit ex dolorem, facilis - et rerum quod blanditiis ducimus voluptatem adipisci.

    - -

    More information

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    PublisherMunpia
    ID number030815020104
    LanguageEnglish
    No. pages551
    Dimension19 x 25 x 20 cm
    Special giftOmniscient Reader's Viewpoint Illustrated Postcards
    -
    - - -
    - - \ No newline at end of file diff --git a/public/store/store-template/product-detail/index.php b/public/store/store-template/product-detail/index.php index a509984d..380e6b28 100644 --- a/public/store/store-template/product-detail/index.php +++ b/public/store/store-template/product-detail/index.php @@ -7,8 +7,8 @@ Date: Sat, 22 May 2021 01:13:32 +0700 Subject: [PATCH 096/155] Implemented dynamic page title on Store Home --- public/store/store-template/index.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index 4217c424..2f311a49 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -8,8 +8,15 @@ ?> " . substr($product["created_time"],0,10) . ""; echo "" . "\n" . ""; } - - // get all stores and products data - $stores = read_csv("../../../private/database/stores.csv", true); - $products = read_csv("../../../private/database/products.csv", true); - $specific_store = get_store_data($stores); $all_featured_products = check_featured_store_products($products); // get all products of a specific store and sort them by time created from newest to oldest From fe547cb7b37210ebb40780a0bd0dcc361aac8306 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 01:20:13 +0700 Subject: [PATCH 097/155] Changed links & images on product detail page --- .../store-template/product-detail/index.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/public/store/store-template/product-detail/index.php b/public/store/store-template/product-detail/index.php index 380e6b28..e84bcfac 100644 --- a/public/store/store-template/product-detail/index.php +++ b/public/store/store-template/product-detail/index.php @@ -7,8 +7,8 @@ - another image of the
+        <img src= - another image of the
+        <img src= - another image of the
+        <img src= - another image of the
+        <img src= - main image of the product + main image of the product
    @@ -108,7 +108,7 @@
    + + \ No newline at end of file From 245290ed243370705930a5917f1e66f52fd0a283 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 08:01:41 +0700 Subject: [PATCH 100/155] rollback to the correct store home display --- private/dynamic-display.php | 248 +++++++++++++++++------------------- 1 file changed, 114 insertions(+), 134 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 8b27cd32..49d1292f 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -1,144 +1,124 @@ - -array containing information + * of all products featured on Mall Home + */ + function check_featured_mall_products(array $products): array { + $featured_mall_products = []; + + foreach ($products as $product) { + if ($product['featured_in_mall'] === "TRUE") { + $featured_mall_products[] = $product; + } + } + return $featured_mall_products; + } - // Constants for display at most 10 items - define("NEW_PRODUCTS_DISPLAY_NUM", 10); - define("FEATURED_PRODUCTS_DISPLAY_NUM", 10); - define("NEW_STORES_DISPLAY_NUM", 10); - define("FEATURED_STORES_DISPLAY_NUM", 10); - // Dynamic loading of database - $products = read_csv("../../private/database/products.csv", true); - $stores = read_csv("../../private/database/stores.csv", true); + /** + * Check if stores are featured on the Mall Home page + * @param array $stores containing information of all stores + * @return array array containing information + * of all stores featured on Mall Home + */ + function check_featured_mall_stores(array $stores): array { + $featured_mall_stores = []; + + foreach ($stores as $store) { + if ($store['featured'] === "TRUE") { + $featured_mall_stores[] = $store; + } + } + return $featured_mall_stores; + } - // Sort products and stores from latest to oldest created time - usort($products, "compare_by_time"); - usort($stores, "compare_by_time"); - include(SHARED_PATH . "/top.php"); - -?> + /** + * Check if products are featured on Store Home page + * @param array $products containing information of all products + * @return array array containing information + * of all products featured on Store Home + */ + function check_featured_store_products(array $products): array { + $featured_store_products = []; + + foreach ($products as $product) { + if ($product['featured_in_store'] === "TRUE") { + $featured_store_products[] = $product; + } + } + return $featured_store_products; + } -
    - Surprised person pointing at the Yabe logo -
    -
    - - - - - + /** + * Compare the dates created of two items (stores, products, etc.). To be used as the handler function for usort() to sort a given group of database items from newest to oldest. + * @param array $item1 first item for comparison + * @param array $item2 second item for comparison + * @return int + */ + function compare_by_time(array $item1, array $item2): int { + return -(strtotime($item1["created_time"]) - strtotime($item2["created_time"])); + } + + + /** + * Get all data of a specific store + * @param array $stores containing data of all stores + * @return false|mixed + * array containing data of the selected store, + * false otherwise. + */ + function get_store_data(array $stores) + { + if (isset($_GET["id"])) { + foreach ($stores as $store) { + if ($_GET["id"] === $store["id"]) { + return $store; + } + } + } + return false; + } + + + /** + * Get the category name from the category id of a store + * @param string $store_category_id + * @param array $categories containing data of all categories + * @return false|mixed + * category name of the selected store, + * false otherwise. + */ + function get_store_cat(string $store_category_id, array $categories) { + foreach ($categories as $category) { + if ($category["id"] === $store_category_id) { + return $category["name"]; + } + } + return false; + } + + + /** + * Get products from a specific store + * @param array $products containing products from database + * @param array $store containing data of a specific store + * @return array + * array containing data of products of the selected store + */ + function get_specific_store_products(array $products, array $store): array { + $specific_store_products = []; - -
    - - \ No newline at end of file + foreach ($products as $product) { + if ($product["store_id"] === $store["id"]) { + $specific_store_products[] = $product; + } + } + return $specific_store_products; + } + \ No newline at end of file From bd86e031e41e64dc964548b7aeb675500a1f1050 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 08:03:28 +0700 Subject: [PATCH 101/155] added function to Get the store name that correspond to the store id on products.csv --- private/dynamic-display.php | 59 ++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 871b86f1..2b3845ea 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -1,25 +1,6 @@ array containing name of the store if store_id on products.csv - * matches id on stores.csv, - * false otherwise. - */ - function get_store_name(int $id, array $stores): string { - foreach ($stores as $store) { - if ((int) $store["id"] === $id) { - return $store["name"]; - } - } - return false; - } - - /** * Check if products are featured on the Mall Home page * @param array $products containing information of all products @@ -86,7 +67,7 @@ function compare_by_time(array $item1, array $item2): int { /** - * Get all data of the selected store + * Get all data of a specific store * @param array $stores containing data of all stores * @return false|mixed * array containing data of the selected store, @@ -121,4 +102,42 @@ function get_store_cat(string $store_category_id, array $categories) { } return false; } + + + /** + * Get products from a specific store + * @param array $products containing products from database + * @param array $store containing data of a specific store + * @return array + * array containing data of products of the selected store + */ + function get_specific_store_products(array $products, array $store): array { + $specific_store_products = []; + + foreach ($products as $product) { + if ($product["store_id"] === $store["id"]) { + $specific_store_products[] = $product; + } + } + return $specific_store_products; + } + + + /** + * Get the store name that correspond to the store id on products.csv + * @param int $id + * @param array $stores + * @return string + * array containing name of the store if store_id on products.csv + * matches id on stores.csv, + * false otherwise. + */ + function get_store_name(int $id, array $stores): string { + foreach ($stores as $store) { + if ((int) $store["id"] === $id) { + return $store["name"]; + } + } + return false; + } \ No newline at end of file From 102fa7d196a7838fdf41ab92a36628ed031eb90d Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 08:04:57 +0700 Subject: [PATCH 102/155] successfully display featured products and stores on mall home --- public/mall/index.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index 82f465aa..20d4aed6 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -19,14 +19,12 @@ "/js/cards.js" ]; - // Constants for display at most 10 items define("NEW_PRODUCTS_DISPLAY_NUM", 10); define("FEATURED_PRODUCTS_DISPLAY_NUM", 10); define("NEW_STORES_DISPLAY_NUM", 10); define("FEATURED_STORES_DISPLAY_NUM", 10); - // Dynamic loading of database $products = read_csv("../../private/database/products.csv", true); $stores = read_csv("../../private/database/stores.csv", true); @@ -35,7 +33,6 @@ usort($products, "compare_by_time"); usort($stores, "compare_by_time"); - include(SHARED_PATH . "/top.php"); ?> @@ -77,15 +74,15 @@
    image of a product
    - " . $products[$display_count]["name"] . " - " . get_store_name((int) $products[$display_count]["store_id"], $stores) . " -

    $" . $products[$display_count]["price"] . "

    -
    " . date("Y年m月d日", strtotime($products[$display_count]["created_time"])) . "
    + " . $featured_mall_products[$display_count]["name"] . " + " . get_store_name((int) $featured_mall_products[$display_count]["store_id"], $stores) . " +

    $" . $featured_mall_products[$display_count]["price"] . "

    +
    " . date("Y年m月d日", strtotime($featured_mall_products[$display_count]["created_time"])) . "
    "; $display_count++; @@ -103,12 +100,12 @@ "; $display_count++; } From c79cde8e8b0e0a9b0d1c5828530c252a6deb8f0d Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 09:13:26 +0700 Subject: [PATCH 103/155] Added documentation --- public/mall/index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/mall/index.php b/public/mall/index.php index 20d4aed6..b9791605 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -49,6 +49,7 @@ "; @@ -73,6 +75,8 @@
    image representation of a shop " . $stores[$display_count]["name"] . " + // Convert a textual datetime into a Unix timestamp
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; $display_count++; From 5e48dd071c0749f1246a58adedce6621d5bd9a1f Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 10:31:23 +0700 Subject: [PATCH 104/155] put comment outside of the echo ""; statement --- public/mall/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index b9791605..d18f2eb8 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -50,6 +50,7 @@ @@ -58,7 +59,6 @@ " . $products[$display_count]["name"] . " " . get_store_name((int) $products[$display_count]["store_id"], $stores) . "

    $" . $products[$display_count]["price"] . "

    - // Convert a textual datetime into a Unix timestamp
    " . date("Y年m月d日", strtotime($products[$display_count]["created_time"])) . "
    "; @@ -130,12 +130,12 @@ image representation of a shop " . $stores[$display_count]["name"] . " - // Convert a textual datetime into a Unix timestamp
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; $display_count++; From cd82be6485ec5ffce716c74979d8f1f9ede6876a Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 11:48:21 +0700 Subject: [PATCH 105/155] Get a query containing the store's & product's ID for dynamic product detail & store home can work properly --- public/mall/index.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index d18f2eb8..e13d9b0d 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -51,13 +51,14 @@ // Loop counting the number of products until reaching 10 items // Convert a textual datetime into a Unix timestamp + // Get a query containing the product's ID and store's ID for dynamic product detail can work properly $display_count = 0; while ($display_count < NEW_PRODUCTS_DISPLAY_NUM) { echo ""; $display_count++; } @@ -131,11 +134,12 @@ // Loop counting the number of stores until reaching 10 items // Convert a textual datetime into a Unix timestamp + // Get a query containing the store's ID for dynamic store home can work properly $display_count = 0; while ($display_count < NEW_STORES_DISPLAY_NUM) { echo "
    image representation of a shop - " . $stores[$display_count]["name"] . " + " . $stores[$display_count]["name"] . "
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; $display_count++; From 2913ece35390a85ce4fd7eea1b0bf5bd05fda0fd Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 12:12:54 +0700 Subject: [PATCH 106/155] Get a query containing the store's & product's ID for dynamic product detail & store home can work properly --- public/mall/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index e13d9b0d..85752e49 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -83,10 +83,10 @@ $featured_mall_products = check_featured_mall_products($products); while ($display_count < FEATURED_PRODUCTS_DISPLAY_NUM) { echo "
    - image of a product + image of a product @@ -113,7 +113,7 @@ while ($display_count < FEATURED_STORES_DISPLAY_NUM) { echo ""; $display_count++; } @@ -139,7 +139,7 @@ while ($display_count < NEW_STORES_DISPLAY_NUM) { echo "
    image representation of a shop - " . $stores[$display_count]["name"] . " + " . $stores[$display_count]["name"] . "
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; $display_count++; From 3cd97fb6e0840065e9ec270775c67a617d603820 Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 12:16:16 +0700 Subject: [PATCH 107/155] Reposition get query containing the store's & product's ID --- public/mall/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index 85752e49..b8107d88 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -55,10 +55,10 @@ $display_count = 0; while ($display_count < NEW_PRODUCTS_DISPLAY_NUM) { echo "
    - image of a product + image of a product From 28f94215593b59c578a99a261fe474cdcb67fbdc Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 13:34:38 +0700 Subject: [PATCH 108/155] Reposition get query containing the store's ID --- public/mall/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index b8107d88..59efc5d2 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -112,7 +112,7 @@ $featured_mall_stores = check_featured_mall_stores($stores); while ($display_count < FEATURED_STORES_DISPLAY_NUM) { echo ""; $display_count++; @@ -138,7 +138,7 @@ $display_count = 0; while ($display_count < NEW_STORES_DISPLAY_NUM) { echo "
    - image representation of a shop + image representation of a shop " . $stores[$display_count]["name"] . "
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    "; From cef9877b5a993fb51e48b3b8fb9842f484965a2e Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 13:45:00 +0700 Subject: [PATCH 109/155] Changed get_item_data function's name & parameters to accommodate getting product's info --- private/dynamic-display.php | 15 +++++++-------- private/shared/store/store-header.php | 2 +- public/store/store-template/index.php | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/private/dynamic-display.php b/private/dynamic-display.php index 49d1292f..0a9d0af9 100644 --- a/private/dynamic-display.php +++ b/private/dynamic-display.php @@ -67,18 +67,17 @@ function compare_by_time(array $item1, array $item2): int { /** - * Get all data of a specific store - * @param array $stores containing data of all stores + * Get all data of a specific item + * @param array $items containing data of all items (stores, products, etc.) * @return false|mixed - * array containing data of the selected store, + * array containing data of the selected item, * false otherwise. */ - function get_store_data(array $stores) - { + function get_item_data(array $items) { if (isset($_GET["id"])) { - foreach ($stores as $store) { - if ($_GET["id"] === $store["id"]) { - return $store; + foreach ($items as $item) { + if ($_GET["id"] === $item["id"]) { + return $item; } } } diff --git a/private/shared/store/store-header.php b/private/shared/store/store-header.php index 37aea373..e31a1a21 100644 --- a/private/shared/store/store-header.php +++ b/private/shared/store/store-header.php @@ -6,7 +6,7 @@ $stores = read_csv( "../../../private/database/stores.csv", true); $categories = read_csv("../../../private/database/categories.csv", true); - $store = get_store_data($stores); + $store = get_item_data($stores); $store_cat_name = get_store_cat($store["category_id"], $categories); ?> diff --git a/public/store/store-template/index.php b/public/store/store-template/index.php index 2f311a49..be568869 100644 --- a/public/store/store-template/index.php +++ b/public/store/store-template/index.php @@ -13,7 +13,7 @@ $stores = read_csv("../../../private/database/stores.csv", true); $products = read_csv("../../../private/database/products.csv", true); - $specific_store = get_store_data($stores); + $specific_store = get_item_data($stores); $page_title = $specific_store["name"] . " | Home"; From 1ad7fb6daa174a53e1e1aeff32b221650d7ff25a Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 13:53:13 +0700 Subject: [PATCH 110/155] updated created time in standard display --- public/mall/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/mall/index.php b/public/mall/index.php index 59efc5d2..d4b52cdf 100644 --- a/public/mall/index.php +++ b/public/mall/index.php @@ -60,7 +60,7 @@ " . $products[$display_count]["name"] . " " . get_store_name((int) $products[$display_count]["store_id"], $stores) . "

    $" . $products[$display_count]["price"] . "

    -
    " . date("Y年m月d日", strtotime($products[$display_count]["created_time"])) . "
    +
    " . substr($products[$display_count]["created_time"],0,10) . "
    ;
    "; $display_count++; @@ -88,7 +88,7 @@ " . $featured_mall_products[$display_count]["name"] . " " . get_store_name((int) $featured_mall_products[$display_count]["store_id"], $stores) . "

    $" . $featured_mall_products[$display_count]["price"] . "

    -
    " . date("Y年m月d日", strtotime($featured_mall_products[$display_count]["created_time"])) . "
    +
    " . substr($featured_mall_products[$display_count]["created_time"],0,10) . "
    "; $display_count++; @@ -140,7 +140,7 @@ echo "
    image representation of a shop " . $stores[$display_count]["name"] . " -
    " . date("Y年m月d日", strtotime($stores[$display_count]["created_time"])) . "
    +
    " . substr($stores[$display_count]["created_time"],0,10) . "
    "; $display_count++; } From 650012653d5c3fae167fef8492605666141b7c7d Mon Sep 17 00:00:00 2001 From: tnathu-ai Date: Sat, 22 May 2021 13:58:56 +0700 Subject: [PATCH 111/155] styled created time display for new stores on mall home --- public/css/cards.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/css/cards.css b/public/css/cards.css index 7e4f1bd7..6bdd5b60 100644 --- a/public/css/cards.css +++ b/public/css/cards.css @@ -70,7 +70,7 @@ background: #fffcf2; border: 1px solid #252422; padding: 2px 5px; - margin: 20px 40px 20px; + margin: 20px 50px 0px; font-size: 9pt; } From 8aa5f8795f69d4a81c9afc94c667644662a0b368 Mon Sep 17 00:00:00 2001 From: doanyennhi Date: Sat, 22 May 2021 14:01:04 +0700 Subject: [PATCH 112/155] Wrote the correct function in store footer, deleted unnecessary info --- private/shared/store/store-footer.php | 2 +- public/mall/index.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/private/shared/store/store-footer.php b/private/shared/store/store-footer.php index 1d274ff2..52a59881 100644 --- a/private/shared/store/store-footer.php +++ b/private/shared/store/store-footer.php @@ -4,7 +4,7 @@ $stores = read_csv(PRIVATE_PATH . "\database/stores.csv", true); - $store = get_store_data($stores); + $store = get_item_data($stores); ?>