diff --git a/scripts/build-image.sh b/scripts/build-image.sh deleted file mode 100644 index ce096bac1ad2e7c6eec731197a2b126c245fa237..0000000000000000000000000000000000000000 --- a/scripts/build-image.sh +++ /dev/null @@ -1 +0,0 @@ -docker build -t tubes-1:latest . \ No newline at end of file diff --git a/scripts/client/pages/home/index.php b/scripts/client/pages/home/index.php index 5e5fc7672f1d92a73549d1cc64efb0a5f0269db1..4b3def1862b6d05fe2e1296ba4766d16454e7c34 100644 --- a/scripts/client/pages/home/index.php +++ b/scripts/client/pages/home/index.php @@ -14,7 +14,7 @@ </div> <div class="dropdown2"> <input class="filter-price" id="prilast" type="text" placeholder="Select filter price" readonly> - <div class="options" id="categoryFilter"> + <div class="options"> <div onclick="showFilterPrice('< 5K')">< 5K</div> <div onclick="showFilterPrice('5K - 30K')">5K - 30K</div> <div onclick="showFilterPrice('30K - 100K')">30K - 100K</div> @@ -52,7 +52,7 @@ // Function to populate the category dropdown function populateCategoryDropdown() { $.ajax({ - url: 'http://localhost:8000/server/api/categorycontroller/showAllcategories', + url: 'http://localhost:8000/api/CategoryController/showAllcategories', method: 'GET', dataType: 'json', success: function (data) { diff --git a/scripts/client/public/css/globals.css b/scripts/client/public/css/globals.css index 034f2b53daf7d5e010e416ffd291a10cb7a7d64f..b2900c358f427fa537e4ac3c7b523d8862baedfb 100644 --- a/scripts/client/public/css/globals.css +++ b/scripts/client/public/css/globals.css @@ -29,26 +29,33 @@ a:hover { /* Navbar */ .indexCt { - background-color: var(--black); - min-height: 100vh; + background-color: #33383a; + height: 100vh; + width: 100vw; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center; justify-content: center; - row-gap: 30px; margin: auto; } .bigText img { - width: 5vw; + width: 15vw; } /* Redirection */ .redirect { + text-align: center; color: white; - font-family: "Arial"; - font-size: 16px; + font-size: 1rem; +} + +.main-title-spl { + text-align: center; + padding-bottom: 1rem; + color: white; + font-size: 4rem; } /* Responsive design */ diff --git a/scripts/client/index.html b/scripts/index.html similarity index 53% rename from scripts/client/index.html rename to scripts/index.html index 18e02a7ed55ac8251fbf06be345e092b9aef6d99..f28166d930278f4cbdaeef864ee09926a438d2de 100644 --- a/scripts/client/index.html +++ b/scripts/index.html @@ -4,17 +4,15 @@ <link rel="icon" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta http-equiv="refresh" content="3;url=http://localhost:8000/pages/home" /> - <link rel="stylesheet" href="css/globals.css"> + <link rel="stylesheet" href="http://localhost:8000/public/css/globals.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <title>KBL</title> </head> - <body> - <div class="indexCt"> - <a href="http://localhost:8000/pages/home" class="bigText"> - <img src="./assets/logo.png" /> - </a> - <div class="redirect">Redirecting you to Home Page...</div> - </div> - </body> + <body class="indexCt"> + <a href="http://localhost:8000/pages/home" class="bigText"> + <img src="http://localhost:8000/public/images/logo.png" /> + </a> + <div class="main-title-spl">- KBL -</div> + <div class="redirect">Redirecting you to Home Page...</div> </body> </html> \ No newline at end of file diff --git a/scripts/server/app/constants/response.php b/scripts/server/app/constants/response.php index f5712039d8872df08fb45b2137722d046498b043..c51c1faccfa245b6d9da7f7aa0a3f7ecf44bf27c 100644 --- a/scripts/server/app/constants/response.php +++ b/scripts/server/app/constants/response.php @@ -19,6 +19,9 @@ define('USERNAME_REGISTERED','username_registered'); // PRODUCT API RESPONSE define('PRODUCT_NOT_FOUND','product_not_found'); +// CATEGORY API RESPONSE +define('CATEGORY_NOT_FOUND','category_not_found'); + // TOPUP API RESPONSE define('TOPUP_REQ_NOT_FOUND','topup_req_not_found'); define('TOPUP_HIST_NOT_FOUND','topup_hist_not_found'); diff --git a/scripts/server/app/controllers/CategoryController.php b/scripts/server/app/controllers/CategoryController.php index 4f70354dc1b0a79a3ce186df4e5e4638f581b77d..5fbc4f59d4b2191de3e53b0a4672d489fb63f4df 100644 --- a/scripts/server/app/controllers/CategoryController.php +++ b/scripts/server/app/controllers/CategoryController.php @@ -20,7 +20,7 @@ class CategoryController extends Controller { if ($res) { json_response_success($res); } else { - json_response_fail(PRODUCT_NOT_FOUND); + json_response_fail(CATEGORY_NOT_FOUND); } } } \ No newline at end of file diff --git a/scripts/server/app/models/CategoryModel.php b/scripts/server/app/models/CategoryModel.php index 9c49e6a244ad32d6a35482992215bdb58903ae89..6662acf5543f4c53dad545d34b6da2b562b2c4bb 100644 --- a/scripts/server/app/models/CategoryModel.php +++ b/scripts/server/app/models/CategoryModel.php @@ -11,6 +11,8 @@ class CategoryModel { $this->db->query('SELECT * FROM category ORDER BY id'); try { + $this->db->execute(); + // Fetch and return results. return $this->db->resultSet(); } catch (PDOException $e) { return false;