diff --git a/.env b/.env deleted file mode 100644 index 34f90628790824edf85c0da6845b37ce3bc897ff..0000000000000000000000000000000000000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -DB_PASSWORD=kelompokD \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b2f593e0a0fb2297d851f8e30bbca35c6513f630..67f37f2bfe959c2e4e8c549d52d0f71c7b5a9cad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM php:latest -WORKDIR /app +WORKDIR /app/nutricraft-app RUN apt-get update @@ -12,4 +12,4 @@ COPY . . EXPOSE 3000 -CMD [ "php", "-S", "0.0.0.0:3000" ] \ No newline at end of file +CMD [ "php", "-S", "0.0.0.0:3001" ] \ No newline at end of file diff --git a/server/controller/auth/Fact.php b/server/controller/auth/Fact.php index df8fd225814ad6f58c48f5cda96fdbb25e490e3f..049fa6652d48d51d9017af7774f6d2b5e5e6fe8b 100644 --- a/server/controller/auth/Fact.php +++ b/server/controller/auth/Fact.php @@ -10,7 +10,7 @@ $content = new Content(); if(isset($_GET['select'])){ $select = $_GET['select']; $page = $_GET['page']; - $page = ($page-1)*2; + $page = ($page-1)*10; if(isset($_GET['search'])){ $search = $_GET['search']; $result = $content->FindByTitle($search, $select, $page); diff --git a/server/controller/auth/Meals.php b/server/controller/auth/Meals.php index 6b11d1c518a31d976b1bc0e998c777c9274e82b4..b3e1db7d25482a39295447cbf72d978df01d627f 100644 --- a/server/controller/auth/Meals.php +++ b/server/controller/auth/Meals.php @@ -13,7 +13,7 @@ $kiri = $_GET['lowRange']; $kanan = $_GET['highRange']; $sort = $_GET['sort']; $page = $_GET['page']; -$page = ($page-1)*2; +$page = ($page-1)*10; $show = $_GET['show']; diff --git a/server/handler/data/Content.php b/server/handler/data/Content.php index d9258f36f7a74f52d5c7a414425fc944ea1874b1..61c1163bd66562a215920e777b76953db88a5182 100644 --- a/server/handler/data/Content.php +++ b/server/handler/data/Content.php @@ -160,7 +160,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c ORDER BY c.title ASC - LIMIT 2 OFFSET $page"); + limit 10 OFFSET $page"); }else if($select){ $exec = pg_query($conn, "SELECT c.id id,c.title title,c.highlight highlight,c.body body, (SELECT p.path FROM file p WHERE c.id_photo_highlight = p.id) as path_photo, @@ -169,7 +169,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c ORDER BY c.created_at DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT c.id id,c.title title,c.highlight highlight,c.body body, (SELECT p.path FROM file p WHERE c.id_photo_highlight = p.id) as path_photo, @@ -178,7 +178,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c ORDER BY c.created_at ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); } // $exec = pg_query($conn, "SELECT * FROM content ORDER BY created_at"); @@ -252,7 +252,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c WHERE c.title ILIKE '%$title%' ORDER BY c.title ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else if($select == 'Newest'){ $exec = pg_query($conn, "SELECT c.id id,c.title title,c.highlight highlight,c.body body, (SELECT p.path FROM file p WHERE c.id_photo_highlight = p.id) as path_photo, @@ -261,7 +261,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c WHERE c.title ILIKE '%$title%' ORDER BY c.created_at DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT c.id id,c.title title,c.highlight highlight,c.body body, (SELECT p.path FROM file p WHERE c.id_photo_highlight = p.id) as path_photo, @@ -270,7 +270,7 @@ class Content c.created_at as created_at, c.updated_at as updated_at FROM content c WHERE c.title ILIKE '%$title%' ORDER BY c.created_at ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); } $result = array(); diff --git a/server/handler/data/Meal.php b/server/handler/data/Meal.php index 7763d4ff874b329627f3eb8a0a9777d8ece2e9f7..c77099b7758d6ab8e6717ddacf02644f3977c40d 100644 --- a/server/handler/data/Meal.php +++ b/server/handler/data/Meal.php @@ -118,18 +118,18 @@ class Meal (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.title ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else if($sort == "Calories: low to high"){ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.calorie ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.calorie DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); } $result = array(); @@ -214,19 +214,19 @@ class Meal (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE (m.title ILIKE '%$title%' OR m.highlight ILIKE '%$title%') AND m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.title ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else if($sort == "Calories: low to high"){ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE (m.title ILIKE '%$title%' OR m.highlight ILIKE '%$title%') AND m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.calorie ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE (m.title ILIKE '%$title%' OR m.highlight ILIKE '%$title%') AND m.calorie <= '$right' AND m.calorie >= '$left' ORDER BY m.calorie DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); } $result = array(); @@ -319,19 +319,19 @@ class Meal (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.title ILIKE '%$title%' AND m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.title ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else if($sort == "Calories: low to high"){ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.title ILIKE '%$title%' AND m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.calorie ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.title ILIKE '%$title%' AND m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.calorie DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); } $result = array(); @@ -407,19 +407,19 @@ class Meal (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.title ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else if($sort == "Calories: low to high"){ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.calorie ASC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }else{ $exec = pg_query($conn, "SELECT m.id id, m.title title, m.highlight highlight, m.description description, m.type type, m.calorie calorie, (SELECT path FROM file f WHERE f.id = m.id_file) as path_photo, m.created_at created_at, m.updated_at updated_at FROM meals m WHERE m.calorie <= '$right' AND m.calorie >= '$left' AND m.type = '$type' ORDER BY m.calorie DESC - LIMIT 2 OFFSET $page"); + LIMIT 10 OFFSET $page"); }