diff --git a/Dockerfile b/Dockerfile index 89ccbdd15a898962a2d72616099eb60ed7ea16f7..9ef737b105279fa8e77508b757ee207b3de5286d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM php:8.0-apache WORKDIR /var/www/html -COPY src/App/. /var/www/html -RUN docker-php-ext-install mysqli pdo pdo_mysql +COPY src/. /var/www/html +RUN docker-php-ext-install mysqli RUN a2enmod rewrite -RUN apt-get -y update && apt-get -y upgrade && apt-get install -y ffmpeg +RUN apt-get -y update && apt-get -y upgrade EXPOSE 8080 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5fd9ca08725c4bd982084e15e13235c1efc6d52f..0054d0bc93e872955c74a753380b41a7db3c578e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: dockerfile: Dockerfile env_file: .env volumes: - - ./src/App:/var/www/html + - ./src:/var/www/html mysql: image: mysql:latest diff --git a/src/components/cart/Cart.php b/src/components/cart/Cart.php index 811bd29559286d119793edf7285f791ac574ab43..445572302e99a112c5d4d5d58868407bfc622a3d 100644 --- a/src/components/cart/Cart.php +++ b/src/components/cart/Cart.php @@ -4,10 +4,10 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/Global.css"> - <link rel="stylesheet" href="../../public/styles/cart/Cart.css"> + <link rel="stylesheet" href="../../styles/Global.css"> + <link rel="stylesheet" href="../../styles/cart/Cart.css"> <title>Shopping Cart</title> - <script src="../../public/scripts/Cart/cart.js"></script> + <script src="../../scripts/cart/cart.js"></script> </head> <body> @@ -30,7 +30,7 @@ $itemDetail = $this->data['cartItems'][$item['product_id']]; $productFile = $this->data['productFileModel']->getProductFile($itemDetail['id'])->fetch_assoc(); $total = $itemDetail['price'] * $item['quantity']; - $imagePath = '../../public/storage/image/'. $productFile['file_name']; + $imagePath = '../../storage/image/'. $productFile['file_name']; $cartTable .= " <tr> diff --git a/src/components/category/Category.php b/src/components/category/Category.php index 0cb4bad59babed65e16172323d636a369bc34c9e..313439dd212486a973bb0bfd1d440fe2bc61bf8f 100644 --- a/src/components/category/Category.php +++ b/src/components/category/Category.php @@ -3,10 +3,10 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/Global.css"> - <link rel="stylesheet" href="../../public/styles/category/category.css"> - <link rel="stylesheet" href="../../public/styles/category/addCategory.css"> - <script src="../../public/scripts/Category/category.js"></script> + <link rel="stylesheet" href="../../styles/Global.css"> + <link rel="stylesheet" href="../../styles/category/Category.css"> + <link rel="stylesheet" href="../../styles/category/AddCategory.css"> + <script src="../../scripts/category/category.js"></script> <title>Kategori</title> </head> <body> diff --git a/src/components/home/Home.php b/src/components/home/Home.php index b156231f298f437c8e94002f09746924064a2051..fc80fee39d4e0c53a2f246b92cf2d4c81c8f85e1 100644 --- a/src/components/home/Home.php +++ b/src/components/home/Home.php @@ -5,10 +5,10 @@ <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- global CSS --> - <link rel="stylesheet" href="../../public/styles/product/ProductCard.css"> - <link rel="stylesheet" href="../../public/styles/home/Home.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> - <script src="../../public/scripts/functions/debounce.js"></script> + <link rel="stylesheet" href="../../styles/product/ProductCard.css"> + <link rel="stylesheet" href="../../styles/home/Home.css"> + <link rel="stylesheet" href="../../styles/Global.css"> + <script src="../../scripts/functions/debounce.js"></script> <title>Home Page</title> </head> @@ -85,7 +85,7 @@ foreach($this->data['product'] as $product){ foreach($this->data['productFile'] as $productFile){ if($product[0] == $productFile[1]){ - $path = '../../public/storage/image/'. $productFile[2]; + $path = '../../storage/image/'. $productFile[2]; product_card_template( $path, $product[2], @@ -108,5 +108,5 @@ </body> </html> -<script src="../../public/scripts/home/paginateForm.js"></script> -<script src="../../public/scripts/home/search.js"></script> \ No newline at end of file +<script src="../../scripts/home/paginateForm.js"></script> +<script src="../../scripts/home/search.js"></script> \ No newline at end of file diff --git a/src/components/home/NotFound.php b/src/components/home/NotFound.php index 8342c036631d39786973f592d666ad4218432e16..13dc244d0f691b18e3dd68d75f2422aa2dfdf330 100644 --- a/src/components/home/NotFound.php +++ b/src/components/home/NotFound.php @@ -3,8 +3,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/home/Home.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/home/Home.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>404 Not Found</title> </head> diff --git a/src/components/login/Login.php b/src/components/login/Login.php index 1c30a98e9aa2d154b1b6b1fd93cc171656a32703..b9f37f56164a31ef4104d1ca3b2715f03849a4d7 100644 --- a/src/components/login/Login.php +++ b/src/components/login/Login.php @@ -9,8 +9,8 @@ if (isset($_SESSION["user_id"])) { <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/login/Login.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/login/Login.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>Login</title> </head> diff --git a/src/components/login/Register.php b/src/components/login/Register.php index e35f79b8214cc80f29e74cd5aca4050d4bbeafc3..e52d4d9b14049508fdf2a0904d2e15456a62c2e6 100644 --- a/src/components/login/Register.php +++ b/src/components/login/Register.php @@ -9,8 +9,8 @@ if (isset($_SESSION["user_id"])) { <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/login/Login.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/login/Login.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>register</title> </head> diff --git a/src/components/product/AddProduct.php b/src/components/product/AddProduct.php index aa4f1a81e307d3eafdfb7a85ac70d4a5f6d42cf7..e3bb4bfce63bebd85eb4703153a6505b7eb96610 100644 --- a/src/components/product/AddProduct.php +++ b/src/components/product/AddProduct.php @@ -3,8 +3,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/product/addProduct.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/product/AddProduct.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>Tambah Produk</title> </head> <body> diff --git a/src/components/product/EditProduct.php b/src/components/product/EditProduct.php index 202587e6465dc1207e19d1de9f492c29d2c1b7f9..9856d3ec4e997f0ea019c5081a3520727b22243d 100644 --- a/src/components/product/EditProduct.php +++ b/src/components/product/EditProduct.php @@ -3,9 +3,9 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/product/addProduct.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> - <script src="../../public/scripts/popup.js"></script> + <link rel="stylesheet" href="../../styles/product/AddProduct.css"> + <link rel="stylesheet" href="../../styles/Global.css"> + <script src="../../scripts/popup.js"></script> <title>Edit Produk</title> </head> <body> @@ -44,14 +44,14 @@ <label for="product_image">Gambar Produk:</label> <div class="product-image"> - <img src= <?php echo "../../public/storage/image/". $this->data['productFile'][0][2] ?> alt="Product Image"> + <img src= <?php echo "../../storage/image/". $this->data['productFile'][0][2] ?> alt="Product Image"> </div> <input type="file" id="product_image" name="product_image" accept="image/*" title="Ganti Produk"> <label for="product_video">Video Produk:</label> <?php if(sizeof($this->data['productFile'])>1){ - $src = '../../public/storage/video/'.$this->data['productFile'][1][2]; + $src = '../../storage/video/'.$this->data['productFile'][1][2]; echo " <video width='320' height='240' controls> <source src=$src type='video/mp4'> diff --git a/src/components/product/Product.php b/src/components/product/Product.php index 418aa833beb47eb86329c6f327987ea70a01158d..66843eb1c1af8e7dfd721e117a2045d835cabad4 100644 --- a/src/components/product/Product.php +++ b/src/components/product/Product.php @@ -3,8 +3,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/product/product.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/product/Product.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title><?php echo $this->data['product']['name']; ?></title> </head> <body> @@ -14,10 +14,10 @@ <div class="product-container"> <div class="product-image"> - <img src= <?php echo "../../public/storage/image/". $this->data['productFile'][0][2] ?> alt="Product Image"> + <img src= <?php echo "../../storage/image/". $this->data['productFile'][0][2] ?> alt="Product Image"> <?php if(sizeof($this->data['productFile']) > 1){ - $src = '../../public/storage/video/'.$this->data['productFile'][1][2]; + $src = '../../storage/video/'.$this->data['productFile'][1][2]; echo " <video controls> <source src=$src type='video/mp4'> diff --git a/src/components/profile/EditProfile.php b/src/components/profile/EditProfile.php index 263508f21f4fd12a1e506667dd57d7bf70b86f8d..f9a45cab9e37caa68ce7d8ab292ef5cc228310b7 100644 --- a/src/components/profile/EditProfile.php +++ b/src/components/profile/EditProfile.php @@ -4,8 +4,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/profile/Profile.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/profile/Profile.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>Profile</title> </head> diff --git a/src/components/profile/Profile.php b/src/components/profile/Profile.php index e8ea4307fa8f38fe45faf3cc80f2138bbb0303cb..7ad277b83406df1f1c0ce9db2e2d1578be601f4c 100644 --- a/src/components/profile/Profile.php +++ b/src/components/profile/Profile.php @@ -4,8 +4,8 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="../../public/styles/profile/Profile.css"> - <link rel="stylesheet" href="../../public/styles/Global.css"> + <link rel="stylesheet" href="../../styles/profile/Profile.css"> + <link rel="stylesheet" href="../../styles/Global.css"> <title>Profile</title> </head> diff --git a/src/components/template/Navbar.php b/src/components/template/Navbar.php index 100ecfca7a64edc4fcd360ecc369707c517a92e3..93e3767e96ba52e103dccfbd0db106118feffb62 100644 --- a/src/components/template/Navbar.php +++ b/src/components/template/Navbar.php @@ -3,7 +3,7 @@ $title = basename($_SERVER['PHP_SELF']); $title = str_replace('.php', '', $title); ?> -<link rel="stylesheet" href="../../public/styles/template/Navbar.css"> +<link rel="stylesheet" href="../../styles/template/Navbar.css"> <header> <nav id="site-menu"> <ul> diff --git a/src/controller/product/AddProductController.php b/src/controller/product/AddProductController.php index 9fdbede3530c066ec4b86c088dd733b13cec245f..baed08c8c5fb5c8456d7828afa46cbefebcef691 100644 --- a/src/controller/product/AddProductController.php +++ b/src/controller/product/AddProductController.php @@ -63,9 +63,9 @@ class AddProductController extends Controller{ } if (in_array($pict_extension, $allowed_extensions) ) { if ($pict_error === 0) { - $uploadPict_directory = __DIR__ . "/../../public/storage/image/"; + $uploadPict_directory = __DIR__ . "/../../storage/image/"; - $uploadVid_directory = __DIR__ . "/../../public/storage/video/"; + $uploadVid_directory = __DIR__ . "/../../storage/video/"; if (!is_dir($uploadPict_directory)) { mkdir($uploadPict_directory, 0755, true); @@ -118,7 +118,7 @@ class AddProductController extends Controller{ } if($pict_error === 4){ - $uploadVid_directory = __DIR__ . "/../../public/storage/video/"; + $uploadVid_directory = __DIR__ . "/../../storage/video/"; if (!is_dir($uploadVid_directory)) { mkdir($uploadVid_directory, 0755, true); diff --git a/src/controller/product/EditProductController.php b/src/controller/product/EditProductController.php index 1626fb32b101a543914e53975d798212eadcbc9a..ef81937321eda5aedeccb406072dfe84965cdca9 100644 --- a/src/controller/product/EditProductController.php +++ b/src/controller/product/EditProductController.php @@ -67,7 +67,7 @@ class EditProductController extends Controller{ if($pict_error === 0){ $pict_extension = strtolower(pathinfo($pict_name, PATHINFO_EXTENSION)); if(in_array($pict_extension, $allowed_extensions)){ - $uploadPict_directory = __DIR__ . "/../../public/storage/image/"; + $uploadPict_directory = __DIR__ . "/../../storage/image/"; if (!is_dir($uploadPict_directory)) { mkdir($uploadPict_directory, 0755, true); @@ -97,7 +97,7 @@ class EditProductController extends Controller{ if($vid_error === 0){ $vid_extension = strtolower(pathinfo($vid_name, PATHINFO_EXTENSION)); if(in_array($vid_extension, $allowed_extensions)){ - $uploadVid_directory = __DIR__ . "/../../public/storage/video/"; + $uploadVid_directory = __DIR__ . "/../../storage/video/"; if (!is_dir($uploadVid_directory)) { mkdir($uploadVid_directory, 0755, true);