diff --git a/.github/images/00-Landing-page.png b/.github/images/00-Landing-page.png new file mode 100644 index 0000000..33c5bac Binary files /dev/null and b/.github/images/00-Landing-page.png differ diff --git a/.github/images/01-Customer-registration.png b/.github/images/01-Customer-registration.png new file mode 100644 index 0000000..96bf576 Binary files /dev/null and b/.github/images/01-Customer-registration.png differ diff --git a/.github/images/02-Customer-login.png b/.github/images/02-Customer-login.png new file mode 100644 index 0000000..cb8fd6a Binary files /dev/null and b/.github/images/02-Customer-login.png differ diff --git a/.github/images/03-Order-details.png b/.github/images/03-Order-details.png new file mode 100644 index 0000000..6373bcb Binary files /dev/null and b/.github/images/03-Order-details.png differ diff --git a/.github/images/04-Shopping-cart.png b/.github/images/04-Shopping-cart.png new file mode 100644 index 0000000..4fe0272 Binary files /dev/null and b/.github/images/04-Shopping-cart.png differ diff --git a/.github/images/05-Order-list-and-cancellation.png b/.github/images/05-Order-list-and-cancellation.png new file mode 100644 index 0000000..2abe613 Binary files /dev/null and b/.github/images/05-Order-list-and-cancellation.png differ diff --git a/.github/images/06-Order-successful.png b/.github/images/06-Order-successful.png new file mode 100644 index 0000000..9e52b7c Binary files /dev/null and b/.github/images/06-Order-successful.png differ diff --git a/.github/images/07-Admin-registration.png b/.github/images/07-Admin-registration.png new file mode 100644 index 0000000..c9fd3ea Binary files /dev/null and b/.github/images/07-Admin-registration.png differ diff --git a/.github/images/08-Admin-login.png b/.github/images/08-Admin-login.png new file mode 100644 index 0000000..e5e0dd8 Binary files /dev/null and b/.github/images/08-Admin-login.png differ diff --git a/.github/images/09-Product-list.png b/.github/images/09-Product-list.png new file mode 100644 index 0000000..f3cfb0c Binary files /dev/null and b/.github/images/09-Product-list.png differ diff --git a/.github/images/10-Adding-product-details.png b/.github/images/10-Adding-product-details.png new file mode 100644 index 0000000..384b878 Binary files /dev/null and b/.github/images/10-Adding-product-details.png differ diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..5cdc45e --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..7f523a9 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,27 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '36 8 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue message' + stale-pr-message: 'Stale pull request message' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/.github/workflows/webhost.yml b/.github/workflows/webhost.yml index 6bd4308..3f8c06c 100644 --- a/.github/workflows/webhost.yml +++ b/.github/workflows/webhost.yml @@ -1,4 +1,4 @@ -name: Deploy to the Web +name: Continuous Deployment on: push: branches: diff --git a/.github/workflows/webhost_pr.yml b/.github/workflows/webhost_pr.yml index 504ca55..2ec2f5d 100644 --- a/.github/workflows/webhost_pr.yml +++ b/.github/workflows/webhost_pr.yml @@ -24,5 +24,5 @@ jobs: - name: Comment on Pull request uses: thollander/actions-comment-pull-request@v1 with: - message: "Hooray 🚀🎉 The preview version can now be seen on https://shoponline-web.000webhostapp.com/pull_request/" + message: "### Hooray 🚀🎉 Your changes are now live and can now be seen in the preview version on https://shoponline-web.000webhostapp.com/pull_request/" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/404.html b/404.html index e50dfb9..36b23b2 100644 --- a/404.html +++ b/404.html @@ -7,7 +7,11 @@ - 404! Page not found + 404! Page not found + + + + diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e69de29..0000000 diff --git a/README.md b/README.md index 0344336..68e9cec 100644 --- a/README.md +++ b/README.md @@ -9,53 +9,87 @@ -- We're hosted at [here](https://shoponline-web.000webhostapp.com/) (We are currently facing some issues with registration/login , will be fixed soon) +- We're **hosted** at [ShopOnline](https://shoponline-web.000webhostapp.com/) (We are currently facing some issues with registration/login, this will be fixed soon). -### An E-commerce platform in form of a Web Application incorporating concepts of DBMS along with PHP, HTML, CSS. +### An E-commerce platform in the form of a Web Application incorporating concepts of DBMS along with PHP, HTML, CSS. -The ShopOnline Web Application was developed using HTML, CSS, Javascript, PHP, phpMyAdmin, MySQL and XAMPP as a result of implementation of key concepts of DBMS such as normalization for an efficient database design. +The ShopOnline Web Application was developed using HTML, CSS, JavaScript, PHP, phpMyAdmin, MySQL and XAMPP as a result of implementation of key concepts of DBMS such as normalization for an efficient database design. Project maintainers: - Sudhay Senthilkumar ([@sudhay23](https://github.com/sudhay23)) - Sandeep Rajakrishnan ([@san-coding](https://github.com/san-coding)) - Raswanth R -- Tarun K B - - > (Screenshots are not in order of workflow, please visit the hosted live website to check out the project) - > - > LANDING PAGE - > Screenshot 2021-09-17 at 8 57 38 PM - > - > CUSTOMER REGISTERATION - > Screenshot 2021-09-17 at 8 57 38 PM - > - > CUSTOMER LOGIN - > Screenshot 2021-09-17 at 8 57 38 PM - > - > DETAILS OF ORDER - > Screenshot 2021-09-17 at 8 57 38 PM - > - > CART - > Screenshot 2021-09-17 at 8 56 30 PM - > - > ORDER DETAILS AND CANCELLATIONS - > Screenshot 2021-09-17 at 8 57 05 PM - > - > ORDER SUCCESSFUL - > Screenshot 2021-09-17 at 8 56 47 PM - > - > ADMIN REGISTERATION - > Screenshot 2021-09-17 at 8 57 38 PM - > - > ADMIN LOGIN - > Screenshot 2021-09-17 at 8 57 38 PM - > - > PRODUCTS LIST - > Screenshot 2021-09-17 at 8 51 29 PM - > - > ADDING PRODUCT DETAILS - > Screenshot 2021-09-17 at 8 51 56 PM +- Tarun.K.B + + +## Screenshots + +Screenshots are not in the order of the workflow, please visit the hosted live website to check out the project. + +### Landing page +![](.github/images/00-Landing-page.png) + +### Customer registration +![](.github/images/01-Customer-registration.png) + +### Customer login +![](.github/images/02-Customer-login.png) + +### Order details +![](.github/images/03-Order-details.png) + +### Shopping cart +![](.github/images/04-Shopping-cart.png) + +### Order list and cancellation +![](.github/images/05-Order-list-and-cancellation.png) + +### Order successful +![](.github/images/06-Order-successful.png) + +### Admin registration +![](.github/images/07-Admin-registration.png) + +### Admin login +![](.github/images/08-Admin-login.png) + +### Product list +![](.github/images/09-Product-list.png) + +### Adding product details +![](.github/images/10-Adding-product-details.png) + + +## Videos + +https://user-images.githubusercontent.com/51874681/136643130-71e34b48-5424-479f-b4ca-3d3e9e53ec84.mp4 + +https://user-images.githubusercontent.com/51874681/136643163-2b43e203-d855-442e-9328-1845e450f8cf.mp4 + +https://user-images.githubusercontent.com/51874681/136643169-b416bdff-e701-4fe9-aae1-910fc62389d7.mp4 + +https://user-images.githubusercontent.com/51874681/136643171-5b18b160-e46d-4bf8-8328-f56b4015f630.mp4 + +https://user-images.githubusercontent.com/51874681/136643176-3a8e1962-a08f-4f6a-895e-5d50a4c08993.mp4 + +https://user-images.githubusercontent.com/51874681/136643183-44488e43-40e4-4c73-8703-64454bb30dba.mp4 + +https://user-images.githubusercontent.com/51874681/136703386-48a1931b-e582-48c0-916a-1080f7c16e95.mp4 + +https://user-images.githubusercontent.com/51874681/136703395-dabba0f4-3f61-4d40-8a94-5f51d9f2b32f.mp4 + +https://user-images.githubusercontent.com/51874681/136703400-cac2e3d7-edd4-4ea3-a0b7-7662990bdcfe.mp4 + +https://user-images.githubusercontent.com/51874681/136703403-197f3f78-7445-45fb-999d-f41734b4a58a.mp4 + +https://user-images.githubusercontent.com/51874681/136703411-5ef185d4-b12f-455d-b707-539f573694ec.mp4 + +https://user-images.githubusercontent.com/51874681/136703422-b82d0dcb-d00c-4091-89fa-ca3d0d1644f7.mp4 + + + + ## Contact Us diff --git a/With PHP/backend/databaseConnect.php b/With PHP/backend/databaseConnect.php index 5479b61..144275b 100644 --- a/With PHP/backend/databaseConnect.php +++ b/With PHP/backend/databaseConnect.php @@ -1,6 +1,6 @@ load(); diff --git a/With PHP/backend/failedValidation.html b/With PHP/backend/failedValidation.html new file mode 100644 index 0000000..f3564eb --- /dev/null +++ b/With PHP/backend/failedValidation.html @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/With PHP/backend/registerCustomer.php b/With PHP/backend/registerCustomer.php index 16d333a..89de0cb 100644 --- a/With PHP/backend/registerCustomer.php +++ b/With PHP/backend/registerCustomer.php @@ -1,58 +1,94 @@ format('Y-m-d') === $date; +} + +function valid_email($mail) { + $exp = "/[a-z0-9_-]+@[a-z0-9_-]+\.[a-z]{2,4}$/i"; + return preg_match($exp, $mail); +} + +if ( + $fname === '' || + $lname === '' || + $dob === '' || + $phoneno === '' || + $email === '' || + $address === '' || + $paymentpreference === '' || + $accountpassword === '' || + !valid_password($accountpassword) || + !valid_phoneno($phoneno) || + !valid_dob($dob) || + !valid_email($email) +) { + exit(require "failedValidation.html"); +} include 'databaseConnect.php'; - //create connection - $conn = new mysqli($host, $dbUsername, $dbPassword, $dbname); - if (mysqli_connect_error()) { - die('Connection Error('. mysqli_connect_errno().')'. mysqli_connect_error()); - } else { - $SELECT_ONE = "SELECT email from persons where email = ? limit 1"; - $INSERT_ONE = "INSERT into persons (fname, lname, accesslevel, accountpassword, dob, phoneno, email, address) values(?, ?, ?, ?, ?, ?, ?, ?)"; - $SELECT_TWO = "SELECT personid from persons where email = ? limit 1"; - $INSERT_TWO = "INSERT into customer (personid, paymentPreference) values(?, ?)"; - - //Prepare statement - $stmt = $conn->prepare($SELECT_ONE); - $stmt->bind_param("s",$email); - $stmt->execute(); - $stmt->bind_result($email); - $stmt->store_result(); - $stmt->fetch(); - $rnum = $stmt->num_rows; - if ($rnum==0) { - $stmt->close(); - $stmt = $conn->prepare($INSERT_ONE); - $stmt->bind_param("sssssiss", $fname, $lname, $accesslevel, $accountpassword, $dob, $phoneno, $email, $address ); - $stmt->execute(); - $stmt->close(); - - $stmt = $conn->prepare($SELECT_TWO); - $stmt->bind_param("s",$email); - $stmt->execute(); - $stmt->bind_result($PERSON_ID); - $stmt->store_result(); - $stmt->fetch(); - $stmt->close(); - - $stmt = $conn->prepare($INSERT_TWO); - $stmt->bind_param("is", $PERSON_ID, $paymentpreference); - $stmt->execute(); - require "successRegisterCustomer.html"; - } else { - require 'failedRegisterCustomer.html'; - } - $stmt->close(); - $conn->close(); - } -?> +//create connection +$conn = new mysqli($host, $dbUsername, $dbPassword, $dbname); +if (mysqli_connect_error()) { + die('Connection Error(' . mysqli_connect_errno() . ')' . mysqli_connect_error()); +} else { + $SELECT_ONE = "SELECT email from persons where email = ? limit 1"; + $INSERT_ONE = "INSERT into persons (fname, lname, accesslevel, accountpassword, dob, phoneno, email, address) values(?, ?, ?, ?, ?, ?, ?, ?)"; + $SELECT_TWO = "SELECT personid from persons where email = ? limit 1"; + $INSERT_TWO = "INSERT into customer (personid, paymentPreference) values(?, ?)"; + + //Prepare statement + $stmt = $conn->prepare($SELECT_ONE); + $stmt->bind_param("s", $email); + $stmt->execute(); + $stmt->bind_result($email); + $stmt->store_result(); + $stmt->fetch(); + $rnum = $stmt->num_rows; + if ($rnum == 0) { + $stmt->close(); + $stmt = $conn->prepare($INSERT_ONE); + $stmt->bind_param("sssssiss", $fname, $lname, $accesslevel, $accountpassword, $dob, $phoneno, $email, $address); + $stmt->execute(); + $stmt->close(); + + $stmt = $conn->prepare($SELECT_TWO); + $stmt->bind_param("s", $email); + $stmt->execute(); + $stmt->bind_result($PERSON_ID); + $stmt->store_result(); + $stmt->fetch(); + $stmt->close(); + + $stmt = $conn->prepare($INSERT_TWO); + $stmt->bind_param("is", $PERSON_ID, $paymentpreference); + $stmt->execute(); + require "successRegisterCustomer.html"; + } else { + require 'failedRegisterCustomer.html'; + } + $stmt->close(); + $conn->close(); +} diff --git a/admin.html b/admin.html index 0f76abb..abf49bf 100644 --- a/admin.html +++ b/admin.html @@ -3,7 +3,9 @@ Admin Area | ShopOnline + +