You are on page 1of 23

A Mini Project Report

on
“Online Health Shopping Portal with Product
Recommendation”

Third Year of Engineering


In
Computer Engineering

By

Deepak Suthar 37 COMP B


Janhavi Tawde 38 COMP B
Anurag Tiwari 39 COMP B
Ayush Tiwari 40 COMP B
Pratik Tiwari 41 COMP B

Computer Engineering
Thakur College of Engineering and Technology, Kandivali
2019-20
CERTIFICATE

This is to certify that the students of Third Year “Computer”

Engineering at Thakur College of Engineering and Technology,

have satisfactorily completed the requirements of the PROJECT

under Employability Skills Development Programme - 2020

while working on “ Online Health Shopping Portal with

Product Recommendation”

Mr.Nitin Mr. Amol Dapkekar Dr. Zahir Aalam Dr.B.K


Harane Mishra
Training Coordinator Professor (TPO)
T&P Principal
Coordinator

Internal Examiner: External Examiner:


Signature with Date: …………….. Signature with Date: …………..
Name: ……………………………..
Name: ………………………….

PLACE: Mumbai
DATE: 03 August 2020
INDEX

Sr No Title
1. Executive Summary

2. Problem Statement

3. Description

4. Finding

Implementation
5.

Result & Discussion


6.
Impact Study
7.
Conclusion
8.

9. References
EXECUTIVE SUMMARY:

The project title aims at building an online health shopping portal along with the
additional feature of product recommendation. The objectives of the project included
building personalized user sessions and accounts, displaying a catalog of products,
recommending products and using a cart to keep a track of user’s purchases. A total
of 5 major categories have been utilized to classify a variety of healthcare products.
These range from Medicines, Ayurveda, Supplements, and Medical devices to
Personal Hygiene. To enhance the security measures, the cart option is only made
available to registered users who have logged in. In case of guest browsing, the
functionality has been restricted towards displaying the product catalog only. A
separate product page for every product is an added advantage as it provides the
complete picture to a buyer before he makes up his mind for the purchase. This
information clubbed with product recommendations ensure that the sales of products
in a long-term period escalate.

PROBLEM STATEMENT:

The project aims to develop an online health store for customers with the goal to
make shopping of health products easy and at one click. The objectives needed to be
attained for the completion of the project were:
• Creating user accounts and sessions
• Displaying a catalog of products
• Searching for specific healthcare issues and displaying products
• Displaying product information
• Recommending similar products
• Creating user cart to keep track of purchases

The overall objective was to keep in mind the feasibility of selling healthcare
products while considering prescriptive medicinal tags to facilitate the user’s
experience about browsing and purchasing healthcare products.
DESCRIPTION:
The outbreak of Coronavirus pandemic has compelled people to stay confined at
their homes. The panic-stricken society has changed its way of shopping leading to
people favoring more towards online shopping. This has created a huge audience for
online shopping portals to flourish their businesses. Essential commodities, like
healthcare products and food items, need to be available to the customers with
convenience, at the topmost priority. So, an online health store like ours, is a very
promising project which solves problems of the society along with gaining profits.
Remote areas do not have access to all products usually. People in the area can order
products online from our website and get it delivered at their doorstep. A significant
change in the lifestyle of people residing in the city areas has also been observed,
wherein most of the people are found to be extremely busy and they prefer to order
things online and get it delivered at their houses. Some people are not comfortable
with going to medical shops as they find it invading their privacy. So, they opt to
order medicines and other healthcare products online which assures their privacy as
well. Many medical stores charge products at MRP but the same products can be
found at a discounted rate online. Therefore, people also view the monetary aspect
while buying the healthcare products, and consider online stores to be a boon in such
cases. All these reasons make online healthcare portal like ours a blooming business.

FINDING:
The findings in the project majorly included projects, and other shopping portals
which have been previously developed. A former project of ours, titles E-Mart,
which was an electronics shopping portal was the baseline foundation for creating
our healthcare portal for it provided the necessary structure and attributes required
to build our project. Additionally, the sources from the references were utilized
which incorporated concepts learned from YouTube videos and W3schools. A
thorough literature survey was conducted wherein we also referred a project titled
Online Shopping Portal. The project included different ideas for the implementation
of our own project.
IMPLEMENTATION:

Software:
1. Web technologies (HTML, CSS, JAVASCRIPT, PHP)
2. Database (MySql)
3. XAMPP Control Panel
Hardware:
1. OS: Windows 7 and above.
2. Minimum 2gb ram.

Flow chart:
Database connectivity:

Code for database connection


<?php

$databaseHost = 'localhost';
$databaseName = 'health1';
$databaseUsername = 'root';
$databasePassword = '';

$mysqli = mysqli_connect($databaseHost,
$databaseUsername, $databasePassword, $databaseName);

?>

Here we connect our project to the database ‘health1’ that has been created and we
include the host as well the username. We are using the mysqli_connect function in
order to connect to the database.
Code for login

$query = "Select * from customer WHERE User_id='$email'";


$result = mysqli_query($con,$query) or die(mysqli_error($con));
$row = $result->fetch_assoc();
$count = mysqli_num_rows($result);
if ($count<=0)
{
echo '<h2><center>Sorry, you have not registered.<br>To Register <a href="signup.
html">Click Here</a></center></h2>';
}
else if(($row["User_id"] == $email) and ($row["Password"] == $pswd)){
session_start();
$_SESSION["id"] = $row["User_id"];
$_SESSION["name"] = $row["Name"];
$_SESSION["valid"] = true;
echo '<div><h1 style="font-family:sans-
serif;color:coral"><center><br><br><br>Login Successful<br>Welcome '.$_SESSION["n
ame"].'!<br>Go to <br><br><a style="color:white" href="dashboard.html"><button cl
ass="button" ><span>
<i class="fa fa-home"></i> Home</span></button></a></center></h1></div>';
}
else {
echo "<script>alert('username or password incorrect')</script>";
echo "<script>location.href='signin.html'</script>";
}
}

Here, as we can see that after fetching the email from the database, if the password
matches then the user is logged in and a session is created, which is valid until the
user logs out. In case, the email is not fetched then the user is shown the registration
page to login again. Also, if the password entered is incorrect then the alert is shown
where the user is notified about the wrong password and redirected to login again.

Code for registration

if(isset($_POST['Submit'])) {
#echo "test2";d
$name = mysqli_real_escape_string($mysqli, $_POST['name']);
$pswd = mysqli_real_escape_string($mysqli, $_POST['psw']);
$email = mysqli_real_escape_string($mysqli, $_POST['email']);
$add = mysqli_real_escape_string($mysqli, $_POST['address']);
$phone = mysqli_real_escape_string($mysqli, $_POST['phone']);
$result = mysqli_query($mysqli,"INSERT INTO customer(User_id,Name,Password,Addres
s,Phone) VALUES('$email','$name','$pswd','$add','$phone')");
}
Once the user has entered the details, the post method is used to gather all the data
that has been submitted in the form and then it is checked whether any field was
empty. If everything is correct, then the user’s details are added to the database.

Code for displaying product catalog

$query = "SELECT * FROM product where category = 'Medicines'";


if ($result = $mysqli->query($query)) {
while ($row = $result->fetch_assoc()) {
$field1name = $row["Name"];
$field3name = $row["Units"];
$field2name = $row["Product_id"];
echo '<tr>
<td><b>'.$field1name.'</b></td>
<td class="w3-center">'.$field3name.'</td>
<td class="w3-
center"><img src = "./images/'.$row['Product_id'].'.jpg" alt="Photo of '.$row['Na
me'].'" width =350 height= 350></td>
<td><form action="productdetails2.php" method="post">
<input type="hidden" value="'.$field2name.'" name = "Product_id">
<input class="w3-button w3-
green" type="submit" value="View Product Details">
</form></td>
</tr>';
}

The code above highlights the query which has been utilized to fetch the products
from the database according to the category of the page currently being used.
Thereafter, the results are displayed in a tabular format where the image is fetched
from a folder as the image image’s name corresponds to the product’s id. Upon
clicking to view the products, the website redirects to the individual product’s
page.
Code for individual product details
$id = '';
if( isset( $_POST["Product_id"])) {
$id = $_POST["Product_id"];
}
$sql = "SELECT * FROM product where Product_id = '$id'";

$Product_id = $id;
$directory = "./images/";
if ($result = $mysqli->query($sql)) {
while($row = $result->fetch_assoc()){
$field1name = $row["Name"];
$field2name = $row["Cost"];
$field3name = $row["Units"];
$field4name = $row["Description"];
$tag1 = $row['tag1'];
// echo "$tag1";
$tag2 = $row['tag2'];
$tag3 = $row['tag3'];
$tag4 = $row['tag4'];
//$result->free();
}
}

echo '<img src = "./images/stars.png" class="d-block w-


100" height = 125 width = 10>';
?>
<p class ='price'> Price<br>Rs. <?php echo $field2name; ?></p>
<p><b>Availability:</b> In Stock</p>
<p>Description<br><?php echo $field4name; ?></p>
<?php
echo '<iframe name="hiddenFrame" class="hide"></iframe>
<div>
<form action="addtocart.php" method="post">
<input type="hidden" value="'.$Product_id.'" name = "Product_id">
<br><input class = "button-a" value="Add to Cart" type="submit">
</form></div>';

The above code is used to display individual product details where the query
fetches the product’s data from the database based on the product’s id that is
submitted from the previous page using the post method. The details that are
displayed include the product’s image, name, price, and description.
Code for search functionality
$query = "Select * from product WHERE tag1 LIKE '%$search%' OR tag2 LIKE '%$searc
h%' OR tag3 LIKE '%$search%' ";
$result = mysqli_query($con,$query) or die(mysqli_error($con));
$count = mysqli_num_rows($result);
if ($count<=0)
{
echo "<h1>Sorry, no results found related to your health problem</h1>";

}
else {
while($row = mysqli_fetch_assoc($sldt))
{
$field1name = $row["Name"];
$field3name = $row["Units"];
$field2name = $row["Product_id"];
echo '<tr>
<td><b>'.$field1name.'</b></td>
<td class="w3-center">'.$field3name.'</td>
<td class="w3-
center"><img src = "./images/'.$row['Product_id'].'.jpg" alt="Photo of '.$row['Na
me'].'" width =350 height= 350></td>
<td><form action="productdetails2.php" method="post">
<input type="hidden" value="'.$field2name.'" name = "Product_id">
<input class="w3-button w3-
green" type="submit" value="View Product Details">
</form></td>
</tr>';
}

The code above takes the input from the search bar on the page and uses tags to
find out which product matches the tags from the database. It then goes on to fetch
those products and display them in the tabular format.
Code for product recommendation
<table id="recommendation_table" style="border: 2px solid black">
<tr>

<!-- or tag3 = '$tag3' or tag4 = '$tag4' -->


<?php
$space = '';
$query_recommend = "select Product_id, Name, cost, Description fr
om product WHERE tag1 = '$tag1' or tag2 = '$tag2' or tag3 = '$tag3' or tag4 = '$t
ag4' and tag3 <> '$space' and tag4 <> '$space'";
$recommend_limit = 0;
if ($result = $mysqli->query($query_recommend)) {
while($row = $result-
>fetch_assoc() and $recommend_limit < 5){
if ($Product_id == $row["Product_id"]) {
continue;
}
$recommend_limit += 1;

// echo "<pre>";
// print_r($row);
echo "<td style='width: 20%;'>";
echo '<img src = "'.$directory.$row["Product_id"].'.jpg"
height="200px" width="200px"><hr>';
echo $row["Name"]."<br>";
echo "<div id='recommendation_rs'>Rs. ".$row["cost"]."</d
iv><br><hr>";
echo $row["Description"]."<br>";
echo "<td>";
}
}

The product recommendation is used to suggest similar products to the one being
viewed. The product recommendation works upon tagging similar products with
the same tags in the database. While displaying, a simple query is used to fetch the
products with the same tags as that one of the products on the page being viewed
currently. This data is represented in the same tabular format as that of the
product’s catalog
Code for Cart
$id = '';
if( isset( $_POST["Product_id"])) {
$id = $_POST["Product_id"];
}
else{
//echo "No";
}

$uid = $_SESSION["id"];
$sql1 = "SELECT * FROM product where Product_id = '$id'";
if ($result3 = $con->query($sql1)) {
while($row = $result3->fetch_assoc()){
$pname = $row["Name"];
$price = $row["Cost"];
//$result->free();
}

$sql = "INSERT INTO orders (`User_id`, `Product_id`, `Name`, `Cost`)


VALUES ('$uid', '$id','$pname','$price')";
$result2 = mysqli_query($con, $sql);
if($result2){
//echo "yes";
}else{
echo "The record was not inserted successfully----
>" . mysqli_error($con);
}

echo '<center><table class="w3-table-all w3-large" style="width:70%;">


<tr class="w3-green">
<th class="w3-center" style="width:200px">Product_id</th>
<th class="w3-center">Name</th>
<th class="w3-center">Cost</th>
<th class="w3-center"> </th>
</tr>';

$sql2 = "SELECT * from orders where User_id = '$uid'";


$directory = "./images/";
$sum = 0;
if ($result1 = $con->query($sql2)) {
while ($row = $result1->fetch_assoc()) {
$field1name = $row["Product_id"];
$field2name = $row["Name"];
$field3name = $row["Cost"];
$field4name = $row["Order_id"];
$sum = $sum + $field3name;
echo '<tr>
<td>'.$field1name.'</td>
<td>'.$field2name.'</td>
<td>'.$field3name.'</td>
<td>
<form action="delete.php" method="post">
<input type="hidden" value="'.$field4name.'" name = "Order_id">
<input class="w3-button w3-
green" type="submit" value="Delete Product">
</form>
</td>
</tr>';
}
$result1->free();
}
echo '<tr>
<td>Total</td>
<td>'.$sum.'</td>
</tr>';
The code for cart uses the product’s id that has been passed previously to fetch
product details from the product’s table. These details are then inserted into the
orders table where the current user’s session id is also stored. Upon displaying the
cart, only the current user’s details and products ordered are fetched from the
orders table and displayed in a tabular format.
Code for deleting from cart
$id = '';
if( isset( $_POST["Order_id"])) {
$id = $_POST["Order_id"];
}
else{
//echo "No";
}

$uid = $_SESSION["id"];
$sql = "DELETE FROM orders where Order_id = '$id'";
if ($con->query($sql) === TRUE) {
echo "<script>alert('Record Deleted Successfully')</script>";
} else {
echo "Error deleting record: " . $con->error;
}

The above code used the current user’s session id and the product’s id and deletes
the record from the orders table in the database by running a SQL query for
deleting a record.
Code for logging out
unset($_SESSION["id"]);
unset($_SESSION["name"]);
unset($_SESSION["valid"]);
session_destroy();
header("location:index.html");

For logging out, all the session variables which were previously set are now unset,
meaning destroyed and the session is destroyed.
RESULT & DISCUSSION:
The outputs of the healthcare portal developed are as follows:
1. Homepage
2. Product Categories available

3. Login Page

4. Successful login
5. Registration Page

6. Successful Registration

7. Medical Devices Category


8. Ayurveda Category

9. Supplements Category
10.Medicines Category

11.Personal Hygiene Category


12.Using search functionality to find products for “Cough”

13.Product Details
14.User’s Cart

Our website helps the users to view a wide range of healthcare products and add
them to their respective carts. The additional improvement over conventional
projects have been the incorporation of product recommendations for every product.
This was not easily available in previous systems but the inclusion of it in our project
has made it a well-defined and overall, fully implemented end to end shopping
website for healthcare products.

As of now, we have not built a payment gateway page. We have not linked the
checkout and payment page to it. Also, the product recommendation system is quite
basic and naive. We would like to add user reviews on our website for all products
and build a strong product recommendation system. We plan to see which product
is purchased more by customers and review their satisfaction rate for that product.
This will ensure we construct a substantial recommending system. The use of
Machine Learning algorithms becomes inevitable for this part of the project.
IMPACT STUDY:

The whole experience of learning turned out to be enriching and conducive. The
division of groups enabled us to work in a team that is necessary for the corporate
world. Every member of the team sincerely learned and practiced PHP language that
helped us in constructing our website. It gave us an insight into server-side scripting
and broadened the spectrum of practical knowledge. Apart from technical skills,
values like team spirit, coordination, and punctuality were inculcated in us.
Continuous evaluation every day kept us on our toes and compelled us to go the
extra mile in enhancing our knowledge base.

Our project was developed in an interactive and user-friendly manner that will be
able to compete with the other beasts in the market. It was built to make the process
of buying medicines easy. With the help of this website, people can purchase
medicines and healthcare products from the ease of their homes. The whole e-
commerce system changes the perception of buyers and compels them to purchase
or view a wide range of products from their house. People can avail of different
products and get them delivered at their doorstep. In our project, people can view,
browse, and add products in their cart along with product recommendations. This
can enable users to buy more products according to their needs. In remote areas,
where people cannot access specific medicines can buy them on our site and get it
delivered to their house. Some people are not comfortable with physically buying
some medicines as it supposedly invades their privacy. While some people are busy
with their work that they don't find it convenient to purchase physically. This
audience or set of customers are our targets and our site has a huge impact on them.
In the future, we plan to add Machine Learning models that can analyze and predict
the sale of different healthcare products on our site. This analysis of data will help
the companies to manufacture products accordingly that will help them to increase
their profit. Also, we can examine the health of population area-wise and the data
can be provided to the ministry of health to pass policies and laws which will benefit
the citizens.
CONCLUSION:

Our team was successful to build a full working website which was Online
Healthcare Portal. The primary goals were product catalog, cart, product
recommendation system and product search functionality which were achieved
successfully. A complete overview of 90 products were conveyed as well. A user-
friendly interface was developed wherein a user can view products, login, register
and use his personalized cart to keep track of all the purchases he or she has done.

In future, we plan to add more categories and subcategories. This will help the user
to search the products more easily. Also, we intend to expand the products database
incorporating additional security features in it to protect sensitive user data.
Scanning and searching for products after user uploads a prescription is one of the
features we wish to add as well. Storing and updating medical history for the users
could give a very personalized touch to the entire portal as it will allow them to
maintain their privacy. With the use of artificial intelligence and machine learning
models, statistics of different products can be studied. We believe that with constant
modifications and upgradations, we will be able to deploy a website that will provide
100% customer satisfaction and also prove beneficial for the companies.

REFERENCES:

1. https://www.w3schools.com/php/
2. https://www.w3schools.com/w3css/defaulT.asp
3. https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css
4. https://code.jquery.com/jquery-3.5.1.slim.min.js
5. https://stackoverflow.com/questions/12747650/creating-a-search-form-in-
php-to-search-a-database
6. https://phpgurukul.com/shopping-portal-free-download/

You might also like