You are on page 1of 126

PROJECT SUBMITTED TO THE UNIVERSITY OF MUMBAI

IN PARTIAL FULFULMENT TO THE DEGREE OF


BACHELOR OF SCIENCE

SMT. CHANDIBAI HIMATHMAL


MANSUKHANI COLLEGE
ULHASNAGAR-421003

T.Y.B.Sc. (COMPUTER SCIENCE)


ACADEMIC YEAR 2016-2017

PROJECT ON
SWISH – ART AND CRAFT ONLINE STORE

BY
MR. ASHUTOSH MAZUMDAR

PROJECT INCHARGE
MS. PIYALI MAGHI

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 1


SWISH
ART AND CRAFT
ONLINE
STORE

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 2


Contents
A. System Documentation.................................................................................................4

1. Certificate..........................................................................................................................

1. Acknowledgement...........................................................................................................6

2. Organizational Overview................................................................................................7

3. Description of Present System........................................................................................8

4. Limitations of Present System........................................................................................9

5. Proposed System and Its Advantages...........................................................................10

6. Gantt Chart....................................................................................................................11

7. Event List......................................................................................................................12

8. Entity Relationship Diagram (ER-Diagram).................................................................13

9. Use Case Diagram.........................................................................................................15

10. Activity Diagram.......................................................................................................18

11. Class Diagram...........................................................................................................20

12. Sequence/Collaboration Diagram..............................................................................22

13. State Diagram............................................................................................................24

14. Form Listing..............................................................................................................26

15. Database and List of Tables with descriptions..........................................................27

B. Project Documentation...............................................................................................31

1. Program Source Code...................................................................................................32

2. Data Entry Screens......................................................................................................113

C. Validations.................................................................................................................117

1. Test Cases....................................................................................................................118

2. Test Data.....................................................................................................................119

3. Test Results.................................................................................................................120

D. Report Layout............................................................................................................122

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 3


E. References And Bibliography..................................................................................124

A. System Documentation

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 4


1. Certificate

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 5


1. Acknowledgement
It gives me great pleasure in presenting this project report. Its justification
will never sound good if I do not express my vote of thanks to our C.H.M.
College and respective Principal. I would also like to thank our HOD Mrs.
Ritika Sachdev for her timely support in this completion of this project.
I thank our internal project guide Ms. Piyali Maghi, who has done a lot
to keep this project systematically and on schedule. I am thankful for their
valuable guidance to every stage of the project. Finally, I would thank to all
others, who give there extended support to complete this project.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 6


2. Organizational Overview

Swish is associated with selling art and craft supplies. It lets you shop thousands
of one of a kind art supplies for your every need. Whether it's for moments big
or small—there’s something for everyone. There’s no creative marketplace
quite like it.
You can browse curated collections of your favorite art supplies. You can even
avail to huge  discounts.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 7


3. Description of Present System

Online shopping is a form of Electronic Commerce . E-commerce or Electronic


commerce, is a subset of E-Business (a company that does all or most of its
transactions through the Internet), is the purchasing, selling, and exchanging of
goods and services over computer networks (such as the Internet) through
which transactions or terms of sale are performed electronically.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 8


4. Limitations of Present System

 Event Management offers many a venues and it was not possible


to cover all of them.
 There was an inability to collect detailed data in terms of one-to-
one meeting with people concerned with entertainment industry.
However a little bit could b done.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 9


5. Proposed System and Its Advantages
1. This system provides a graphical user interface to add or delete
the information.
2. This system can be implemented in hotels, clubs for booking
events.
3. The system can also be used to promote the entire event booking
places.
4. The user gets all the resources at a single place instead of
wandering around for these.

ADVANTAGES

5. This system is effective and save time and cost of the user.
 Improved processing speed.
 Improved arrangement for events coordination.
 The system useful as it calculates an exact cost for all the
resources required during the event.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 10


6.Gantt Chart
Sr. Phase Duration Start Date Finish Date Actual Signature
No Finish Date
I Planning Phase 17 23-Oct-15 8-Nov-15 8-Nov-15
1.1 Defining Problem 8 23-Oct-15 30-Oct-15 30-Oct-15
1.2 Confirm Project 4 31-Oct-15 3-Nov-15 3-Nov-15
Feasibility
1.3 Project Schedule 3 4-Nov-15 6-Nov-15 6-Nov-15
1.4 Staffing Project 1 7-Nov-15 7-Nov-15 7-Nov-15
1.5 Launching Project 1 8-Nov-15 8-Nov-15 8-Nov-15

II Analysis Phase 22 9-Nov-15 30-Nov-15 30-Nov-15


2.1 Gathering 10 9-Nov-15 18-Nov-15 18-Nov-15
Information
2.2 Defining System 6 19-Nov-15 24-Nov-15 24-Nov-15
Requirement
2.3 Prioritize 3 25-Nov-15 27-Nov-15 27-Nov-15
Requirements
2.4 Generate and 2 28-Nov-15 29-Nov-15 29-Nov-15
evaluate
alternatives

2.5 Review 1 30-Nov-15 30-Nov-15 30-Nov-15


Recommendation

III Design Phase 40 1-Dec-15 9-Jan-16 9-Jan-16


3.1 Design User 20 1-Dec-15 20-Dec-15 20-Dec-15
Interface
3.2 Design Application 10 21-Dec-15 30-Dec-15 30-Dec-15
Architecture
3.3 Design And 8 31-Dec-15 7-Jan-16 7-Jan-16
Interact Database
3.4 Design And 2 8-Jan-16 9-Jan-16 9-Jan-16
Integrate System
Controls

IV Implementation 48 10-Jan-16 26-Feb-16 26-Feb-16


Phase
4.1 Construct The 30 10-Jan-16 8-Feb-16 8-Feb-16
Software
Components
4.2 Verify An Test The 14 9-Feb-16 22-Feb-16 22-Feb-16
Components
4.3 Training And 3 23-Feb-16 25-Feb-16 25-Feb-16
Documentation
4.4 Install Software 1 26-Feb-16 26-Feb-16 26-Feb-16
V Support Phase - 27-Feb-16 Till Date

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 11


7. Event List
 Admin log into the system.
 Admin add/update/delete details of events.
 Admin view the booking status.
 Admin generates the receipt.
 Admin view reports of event.
 New customers register into the system.
 Register customer log into the system.
 Customers browse through the store.
 Customers add the desired product to cart.
 Customers pay the payment.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 12


8. Entity Relationship Diagram (ER-Diagram)
 1. Entity relationship diagram can express overall logical
structure of database logically.
 2. ER Diagrams are simple and clear.
 3. ER Diagrams represents entities and tables and their
relationship with one another.

Components of ER diagram:
Sr. Shape Description
No.
1 Rectangle Represents entity set.

2 Ellipse Represents attributes.

3 Diamond Represents relationship.

4 Flow lines Represents link between 2


entities set.
5 Double ellipse Represents multivalve
attributes.

6 Dashed ellipse Denotes derived attributes.

7 Double Represents weak entity set.


Rectangle

8 Double Diamond Represents relationship set for


weak entity set.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 13


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 14
9. Use Case Diagram

USE CASE DESCRIPTION


Admin Subsystem:
 Admin log into the system.
 Admin add/update/delete details of events.
 Admin view the booking status.
 Admin generates the receipt.
 Admin view reports of event.

Customer Subsystem:
 New customers register into the system.
 Register customer log into the system.
 Customers view their own details.
 Customer book an event.
 Customers pay the payment.
 Customers receive email regarding bookings.
 Customers give the feedback.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 15


USE CASE DIAGRAM

A use case diagram is a set of scenarios that describing an


interaction between user and system. A use case diagram displays the
relationship among actors & use cases. The 2 main components of use
case diagram are use case and actor.

Actor Use Case


An actor represents a user or another system will interact with
the system that you are modelling. A use case is an external view of
the system that represents some action that might perform in order to
complete a task.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 16


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 17
10. Activity Diagram
 Activity diagram describes the workflow behavior of the system.
 2. Activity diagram are similar to state diagram because activities are the
state of doing something.
 The diagram describes the state of activities by showing the sequence of
activities performed.
 Activity diagram can resolve activities that are conditional or parallel.
 Activity diagram should be used in conjunction with other modeling
techniques such as interaction diagram and state diagram.
 Main reason to use the activity diagram is to model workflow behind the
system being designed.

Components of Activity Diagram:-


1 Represents the activity.

2 Merge

3 Fork

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 18


Customer Admin

Login Login No
No

Yes

New Register Book an Event


Add New Event

View Own Details


Update Records

View Venue
Delete Records

Payment Verification Add Venue

View Booking

Receive Email Cancel Booking


Generate Receipt

Send Email

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 19


11. Class Diagram
Class diagrams are widely used to describe the types of objects
used in system and their relationship. Class diagram models class
structure and contents using design elements such as classes and
packages and objects.
Class diagram describes 3 different perspectives when designing a
system. These perspectives become evident as the diagram is
created and help solidify the design.
Classes are composed of 3 things:
1. Class name.
2. Attributes and
3. Operations.

For Example Diagram:

Student
Class Name
+Name:text
+Address:text Attribute
+Add_Student()
Operations

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 20


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 21
12. Sequence/Collaboration Diagram
Sequence diagram demonstrates the behavior of the objects in a use- case by
describing the objects and the messages they pass. The diagrams are read left
to right & descending.
Components of Sequence Diagram:-
1 Represent object
activation.

2 Represents the objects of


case study.

3 Represents life of
objects.

4 Represents end of
objects.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 22


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 23
13. State Diagram
 State diagram are used to describe the behavior of the
system.
 State diagram describe all of the possible state of an
object as an event occurs.
 Each diagram usually represents objects of single class
and track the different state of its object through the
system.
 We use the state diagram to demonstrate the behavior
of an object through many use cases of the system.
 We use the state diagram for classes where it is
necessary to understand the behavior of the object
through the entire system.
Diagram:

State Diagram Activity

Transitions

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 24


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 25
14. Form Listing
1. Action.php
2. Cart.php
3. Body.php
4. Checkout_process.php
5. Checkout.php
6. Config.php
7. Db.php
8. Error.php
9. Footer.php
10. Header.php
11. Homeaction.php
12. Index.php
13. Login_form.php
14. Login.php
15. Logout.php
16. Newsletter.php
17. Offersmail.php
18. Paymen_success.php
19. Produc.php
20. Register_form.php
21. Register.php
22. Store.php

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 26


15. Database and List of Tables with descriptions
Database Table Name- admin_info

Database Table Name- brands

Database Table Name- cart

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 27


Database Table Name- categories

Database Table Name- email_info

Database Table Name- logs

Database Table Name- orders

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 28


Database Table Name- orders_info

Database Table Name- order_products

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 29


Database Table Name- products

Database Table Name- user_info

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 30


B. Project Documentation

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 31


1. Program Source Code

Source Code:
File Name: action.php

<?php
session_start();
$ip_add = getenv("REMOTE_ADDR");
include "db.php";
if(isset($_POST["category"])){
    $category_query = "SELECT * FROM categories";
  
    $run_query = mysqli_query($con,$category_query) or
die(mysqli_error($con));
    echo "
    
      
            <div class='aside'>
                            <h3 class='aside-title'>Categories</h3>
                            <div class='btn-group-vertical'>
    ";
    if(mysqli_num_rows($run_query) > 0){
        $i=1;
        while($row = mysqli_fetch_array($run_query)){
      
            $cid = $row["cat_id"];
            $cat_name = $row["cat_title"];
            $sql = "SELECT COUNT(*) AS count_items FROM products WHERE
product_cat=$i";
            $query = mysqli_query($con,$sql);
            $row = mysqli_fetch_array($query);
            $count=$row["count_items"];
ASHUTOSH MAZUMDAR|ROLL NO: 40Page 32
            $i++;
      
      
            echo "
          
                    <div type='button' class='btn navbar-btn category' cid='$cid'>
                  
                                    <a href='#'>
                                        <span  ></span>
                                        $cat_name
                                        <small class='qty'>($count)</small>
                                    </a>
                                </div>
          
            ";
      
    }
    
    
        echo "</div>";
  }
}
if(isset($_POST["brand"])){
    $brand_query = "SELECT * FROM brands";
    $run_query = mysqli_query($con,$brand_query);
    echo "
        <div class='aside'>
                            <h3 class='aside-title'>Brand</h3>
                            <div class='btn-group-vertical'>
    ";
    if(mysqli_num_rows($run_query) > 0){
        $i=1;
        while($row = mysqli_fetch_array($run_query)){
      
            $bid = $row["brand_id"];
            $brand_name = $row["brand_title"];
            $sql = "SELECT COUNT(*) AS count_items FROM products WHERE
product_brand=$i";
            $query = mysqli_query($con,$sql);
            $row = mysqli_fetch_array($query);
            $count=$row["count_items"];
            $i++;

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 33


            echo "
          
          
                    <div type='button' class='btn navbar-btn selectBrand' bid='$bid'>
                  
                                    <a href='#'>
                                        <span ></span>
                                        $brand_name
                                        <small >($count)</small>
                                    </a>
                                </div>
            ";
    }
        echo "</div>";
  }
}
if(isset($_POST["page"])){
    $sql = "SELECT * FROM products";
    $run_query = mysqli_query($con,$sql);
    $count = mysqli_num_rows($run_query);
    $pageno = ceil($count/9);
    for($i=1;$i<=$pageno;$i++){
        echo "
            <li><a href='#product-row' page='$i' id='page'
class='active'>$i</a></li>
      
      
        ";
  }
}
if(isset($_POST["getProduct"])){
    $limit = 9;
    if(isset($_POST["setPage"])){
        $pageno = $_POST["pageNumber"];
        $start = ($pageno * $limit) - $limit;
    }else{
        $start = 0;
  }
    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id LIMIT $start,$limit";
    $run_query = mysqli_query($con,$product_query);
    if(mysqli_num_rows($run_query) > 0){

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 34


        while($row = mysqli_fetch_array($run_query)){
            $pro_id    = $row['product_id'];
            $pro_cat   = $row['product_cat'];
            $pro_brand = $row['product_brand'];
            $pro_title = $row['product_title'];
            $pro_price = $row['product_price'];
            $pro_image = $row['product_image'];
      
            $cat_name = $row["cat_title"];
            echo "
        
            
                        <div class='col-md-4 col-xs-6' >
                                <a href='product.php?p=$pro_id'><div class='product'>
                                    <div class='product-img'>
                                        <img src='product_images/$pro_image' style='max-
height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name header-cart-item-name'><a
href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-item-
info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-wishlist'><i class='fa fa-heart-
o'></i><span class='tooltipp'>add to wishlist</span></button>
                                            <button class='add-to-compare'><i class='fa fa-
exchange'></i><span class='tooltipp'>add to compare</span></button>
                                            <button class='quick-view'><i class='fa
fa-eye'></i><span class='tooltipp'>quick view</span></button>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 35


                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product' class='add-to-cart-
btn block2-btn-towishlist' href='#'><i class='fa fa-shopping-cart'></i> add to
cart</button>
                                    </div>
                                </div>
                            </div>
            
            ";
    }
  }
}

if(isset($_POST["get_seleted_Category"]) || isset($_POST["selectBrand"]) ||
isset($_POST["search"])){
    if(isset($_POST["get_seleted_Category"])){
        $id = $_POST["cat_id"];
        $sql = "SELECT * FROM products,categories WHERE product_cat = '$id'
AND product_cat=cat_id";
    
    }else if(isset($_POST["selectBrand"])){
        $id = $_POST["brand_id"];
        $sql = "SELECT * FROM products,categories WHERE product_brand =
'$id' AND product_cat=cat_id";
    }else {
    
        $keyword = $_POST["keyword"];
        header('Location:store.php');
        $sql = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_keywords LIKE '%$keyword%'";
    
  }
  
    $run_query = mysqli_query($con,$sql);
    while($row=mysqli_fetch_array($run_query)){
            $pro_id    = $row['product_id'];
            $pro_cat   = $row['product_cat'];
            $pro_brand = $row['product_brand'];
            $pro_title = $row['product_title'];
            $pro_price = $row['product_price'];

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 36


            $pro_image = $row['product_image'];
            $cat_name = $row["cat_title"];
            echo "
          
            
                        <div class='col-md-4 col-xs-6'>
                                <a href='product.php?p=$pro_id'><div class='product'>
                                    <div class='product-img'>
                                        <img  src='product_images/$pro_image'  style='max-
height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name header-cart-item-name'><a
href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-item-
info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-wishlist' tabindex='0'><i
class='fa fa-heart-o'></i><span class='tooltipp'>add to
wishlist</span></button>
                                            <button class='add-to-compare'><i class='fa fa-
exchange'></i><span class='tooltipp'>add to compare</span></button>
                                            <button class='quick-view' ><i class='fa
fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product' href='#' tabindex='0'
class='add-to-cart-btn'><i class='fa fa-shopping-cart'></i> add to cart</button>
                                    </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 37


                                </div>
                            </div>
            ";
    }
  }
  

    if(isset($_POST["addToCart"])){
    

        $p_id = $_POST["proId"];
    

        if(isset($_SESSION["uid"])){

        $user_id = $_SESSION["uid"];

        $sql = "SELECT * FROM cart WHERE p_id = '$p_id' AND user_id =


'$user_id'";
        $run_query = mysqli_query($con,$sql);
        $count = mysqli_num_rows($run_query);
        if($count > 0){
            echo "
                <div class='alert alert-warning'>
                        <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                        <b>Product is already added into the cart Continue Shopping..!
</b>
                </div>
            ";//not in video
        } else {
            $sql = "INSERT INTO `cart`
            (`p_id`, `ip_add`, `user_id`, `qty`)
            VALUES ('$p_id','$ip_add','$user_id','1')";
            if(mysqli_query($con,$sql)){
                echo "
                    <div class='alert alert-success'>
                        <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                        <b>Product is Added..!</b>
                    </div>
                ";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 38


      }
    }
        }else{
            $sql = "SELECT id FROM cart WHERE ip_add = '$ip_add' AND p_id
= '$p_id' AND user_id = -1";
            $query = mysqli_query($con,$sql);
            if (mysqli_num_rows($query) > 0) {
                echo "
                    <div class='alert alert-warning'>
                            <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                            <b>Product is already added into the cart Continue
Shopping..!</b>
                    </div>";
                    exit();
      }
            $sql = "INSERT INTO `cart`
            (`p_id`, `ip_add`, `user_id`, `qty`)
            VALUES ('$p_id','$ip_add','-1','1')";
            if (mysqli_query($con,$sql)) {
                echo "
                    <div class='alert alert-success'>
                        <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                        <b>Your product is Added Successfully..!</b>
                    </div>
                ";
                exit();
      }
      
    }
    
    
    
    
  }

//Count User cart item


if (isset($_POST["count_item"])) {
    //When user is logged in then we will count number of item in cart by using
user session id
    if (isset($_SESSION["uid"])) {

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 39


        $sql = "SELECT COUNT(*) AS count_item FROM cart WHERE user_id
= $_SESSION[uid]";
    }else{
        //When user is not logged in then we will count number of item in cart by
using users unique ip address
        $sql = "SELECT COUNT(*) AS count_item FROM cart WHERE ip_add
= '$ip_add' AND user_id < 0";
  }
  
    $query = mysqli_query($con,$sql);
    $row = mysqli_fetch_array($query);
    echo $row["count_item"];
    exit();
}
//Count User cart item

//Get Cart Item From Database to Dropdown menu


if (isset($_POST["Common"])) {

    if (isset($_SESSION["uid"])) {
        //When user is logged in this query will execute
        $sql = "SELECT
a.product_id,a.product_title,a.product_price,a.product_image,b.id,b.qty FROM
products a,cart b WHERE a.product_id=b.p_id AND
b.user_id='$_SESSION[uid]'";
    }else{
        //When user is not logged in this query will execute
        $sql = "SELECT
a.product_id,a.product_title,a.product_price,a.product_image,b.id,b.qty FROM
products a,cart b WHERE a.product_id=b.p_id AND b.ip_add='$ip_add' AND
b.user_id < 0";
  }
    $query = mysqli_query($con,$sql);
    if (isset($_POST["getCartItem"])) {
    
        if (mysqli_num_rows($query) > 0) {
            $n=0;
            $total_price=0;
            while ($row=mysqli_fetch_array($query)) {
        
                $n++;
                $product_id = $row["product_id"];

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 40


                $product_title = $row["product_title"];
                $product_price = $row["product_price"];
                $product_image = $row["product_image"];
                $cart_item_id = $row["id"];
                $qty = $row["qty"];
                $total_price=$total_price+$product_price;
                echo '
          
          
                    <div class="product-widget">
                                                <div class="product-img">
                                                    <img src="product_images/'.$product_image.'"
alt="">
                                                </div>
                                                <div class="product-body">
                                                    <h3 class="product-name"><a href="#">'.
$product_title.'</a></h3>
                                                    <h4 class="product-price"><span
class="qty">'.$n.'</span>$'.$product_price.'</h4>
                                                </div>
                        
                                            </div>'
          
          
          ;
        
      }
      
            echo '<div class="cart-summary">
                    <small class="qty">'.$n.' Item(s) selected</small>
                    <h5>$'.$total_price.'</h5>
                </div>'
            ?>
        
        
            <?php
      
            exit();
    }
  }
  
  

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 41


  
    if (isset($_POST["checkOutDetails"])) {
        if (mysqli_num_rows($query) > 0) {
      
            echo '<div class="main ">
            <div class="table-responsive">
            <form method="post" action="login_form.php">
      
                   <table id="cart" class="table table-hover table-condensed" id="">
                    <thead>
                        <tr>
                            <th style="width:50%">Product</th>
                            <th style="width:10%">Price</th>
                            <th style="width:8%">Quantity</th>
                            <th style="width:7%" class="text-center">Subtotal</th>
                            <th style="width:10%"></th>
                        </tr>
                    </thead>
                    <tbody>
                    ';
                $n=0;
                while ($row=mysqli_fetch_array($query)) {
                    $n++;
                    $product_id = $row["product_id"];
                    $product_title = $row["product_title"];
                    $product_price = $row["product_price"];
                    $product_image = $row["product_image"];
                    $cart_item_id = $row["id"];
                    $qty = $row["qty"];

                    echo
            '
               
                        <tr>
                            <td data-th="Product" >
                                <div class="row">
                
                                    <div class="col-sm-4 "><img src="product_images/'.
$product_image.'" style="height: 70px;width:75px;"/>
                                    <h4 class="nomargin product-name header-cart-item-
name"><a href="product.php?p='.$product_id.'">'.$product_title.'</a></h4>
                                    </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 42


                                    <div class="col-sm-6">
                                        <div style="max-width=50px;">
                                        <p>Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam,</p>
                                        </div>
                                    </div>
                  
                  
                                </div>
                            </td>
                            <input type="hidden" name="product_id[]" value="'.
$product_id.'"/>
                            <input type="hidden" name="" value="'.$cart_item_id.'"/>
                            <td data-th="Price"><input type="text" class="form-control
price" value="'.$product_price.'" readonly="readonly"></td>
                            <td data-th="Quantity">
                                <input type="text" class="form-control qty" value="'.$qty.'"
>
                            </td>
                            <td data-th="Subtotal" class="text-center"><input type="text"
class="form-control total" value="'.$product_price.'"
readonly="readonly"></td>
                            <td class="actions" data-th="">
                            <div class="btn-group">
                                <a href="#" class="btn btn-info btn-sm update"
update_id="'.$product_id.'"><i class="fa fa-refresh"></i></a>
                
                                <a href="#" class="btn btn-danger btn-sm remove"
remove_id="'.$product_id.'"><i class="fa fa-trash-o"></i></a>      
                            </div>                          
                            </td>
                        </tr>
          
              
                            ';
        }
        
                echo '</tbody>
                <tfoot>
          
                    <tr>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 43


                        <td><a href="store.php" class="btn btn-warning"><i class="fa
fa-angle-left"></i> Continue Shopping</a></td>
                        <td colspan="2" class="hidden-xs"></td>
                        <td class="hidden-xs text-center"><b class="net_total"
></b></td>
                        <div id="issessionset"></div>
                        <td>
              
                            ';
                if (!isset($_SESSION["uid"])) {
                    echo '
          
                            <a href="" data-toggle="modal" data-
target="#Modal_register" class="btn btn-success">Ready to
Checkout</a></td>
                                </tr>
                            </tfoot>
        
                            </table></div></div>';
                }else if(isset($_SESSION["uid"])){
          
                    echo '
                    </form>
          
                        <form action="checkout.php" method="post">
                            <input type="hidden" name="cmd" value="_cart">
                            <input type="hidden" name="business"
value="shoppingcart@puneeth.com">
                            <input type="hidden" name="upload" value="1">';
               
                            $x=0;
                            $sql = "SELECT
a.product_id,a.product_title,a.product_price,a.product_image,b.id,b.qty FROM
products a,cart b WHERE a.product_id=b.p_id AND
b.user_id='$_SESSION[uid]'";
                            $query = mysqli_query($con,$sql);
                            while($row=mysqli_fetch_array($query)){
                                $x++;
                                echo    

                                    '<input type="hidden" name="total_count" value="'.


$x.'">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 44


                                    <input type="hidden" name="item_name_'.$x.'" value="'.
$row["product_title"].'">
                                     <input type="hidden" name="item_number_'.$x.'"
value="'.$x.'">
                                     <input type="hidden" name="amount_'.$x.'" value="'.
$row["product_price"].'">
                                     <input type="hidden" name="quantity_'.$x.'" value="'.
$row["qty"].'">';
                }
               
                            echo  
                                '<input type="hidden" name="return"
value="http://localhost/myfiles/public_html/payment_success.php"/>
                                    <input type="hidden" name="notify_url"
value="http://localhost/myfiles/public_html/payment_success.php">
                                    <input type="hidden" name="cancel_return"
value="http://localhost/myfiles/public_html/cancel.php"/>
                                    <input type="hidden" name="currency_code"
value="USD"/>
                                    <input type="hidden" name="custom" value="'.
$_SESSION["uid"].'"/>
                                    <input type="submit" id="submit"
name="login_user_with_product" name="submit" class="btn btn-success"
value="Ready to Checkout">
                                    </form></td>
                  
                                    </tr>
                  
                                    </tfoot>
                  
                            </table></div></div>    
                                ';
        }
      }
  }
  
  
}

if (isset($_POST["removeItemFromCart"])) {
    $remove_id = $_POST["rid"];
    if (isset($_SESSION["uid"])) {

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 45


        $sql = "DELETE FROM cart WHERE p_id = '$remove_id' AND user_id =
'$_SESSION[uid]'";
    }else{
        $sql = "DELETE FROM cart WHERE p_id = '$remove_id' AND ip_add =
'$ip_add'";
  }
    if(mysqli_query($con,$sql)){
        echo "<div class='alert alert-danger'>
                        <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                        <b>Product is removed from cart</b>
                </div>";
        exit();
  }
}

if (isset($_POST["updateCartItem"])) {
    $update_id = $_POST["update_id"];
    $qty = $_POST["qty"];
    if (isset($_SESSION["uid"])) {
        $sql = "UPDATE cart SET qty='$qty' WHERE p_id = '$update_id' AND
user_id = '$_SESSION[uid]'";
    }else{
        $sql = "UPDATE cart SET qty='$qty' WHERE p_id = '$update_id' AND
ip_add = '$ip_add'";
  }
    if(mysqli_query($con,$sql)){
        echo "<div class='alert alert-info'>
                        <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                        <b>Product is updated</b>
                </div>";
        exit();
  }
}

?>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 46


Filename: body.php

   <div class="main main-raised">


        <div class="container mainn-raised" style="width:100%;">
 
  <div id="myCarousel" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
   

    <!-- Wrapper for slides -->


    <div class="carousel-inner">

      <div class="item active">


        <img src="img/Banner 01.jpg" alt="Los Angeles" style="width:100%;">
       
      </div>

      <div class="item">
        <img src="img/banner 02.jpg" style="width:100%;">
       
      </div>

      <div class="item">
        <img src="img/banner 03.jpg" style="width:100%;">
       
      </div>
 
    </div>

    <!-- Left and right controls -->


    <a class="left carousel-control _26sdfg" href="#myCarousel" data-
slide="prev">
      <span class="glyphicon glyphicon-chevron-left"></span>
      <span class="sr-only" >Previous</span>
    </a>
    <a class="right carousel-control _26sdfg" href="#myCarousel" data-
slide="next">
      <span class="glyphicon glyphicon-chevron-right"></span>
      <span class="sr-only">Next</span>
    </a>
  </div>
</div>
     

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 47


        <!-- SECTION -->
        <div class="section mainn mainn-raised">
       
       
            <!-- container -->
            <div class="container">
           
                <!-- row -->
                <div class="row">
                    <!-- shop -->
                    <div class="col-md-4 col-xs-6">
                        <a href="product.php?p=1"><div class="shop">
                            <div class="shop-img">
                                <img src="./img/shop 01.png" alt="">
                            </div>
                            <div class="shop-body">
                                <h3>Brushes<br>Collection</h3>
                                <a href="product.php?p=1" class="cta-
btn">Shop now <i class="fa fa-arrow-circle-right"></i></a>
                            </div>
                        </div></a>
                    </div>
                    <!-- /shop -->

                    <!-- shop -->


                    <div class="col-md-4 col-xs-6">
                        <a href="product.php?p=5"><div class="shop">
                            <div class="shop-img">
                                <img src="./img/shop 02.png" alt="">
                            </div>
                            <div class="shop-body">
                                <h3>Canvas Boards<br>Collection</h3>
                                <a href="product.php?p=4" class="cta-
btn">Shop now <i class="fa fa-arrow-circle-right"></i></a>
                            </div>
                        </div></a>
                    </div>
                    <!-- /shop -->

                    <!-- shop -->


                    <div class="col-md-4 col-xs-6">
                        <a href="product.php?p=23"><div class="shop">
                            <div class="shop-img">
                                <img src="./img/shop 03.png" alt="">
                            </div>
                            <div class="shop-body">
                                <h3>Craft<br>Supplies</h3>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 48


                                <a href="product.php?p=23" class="cta-
btn">Shop now <i class="fa fa-arrow-circle-right"></i></a>
                            </div>
                            </div></a>
                    </div>
                    <!-- /shop -->
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->
        </div>
        <!-- /SECTION -->
         
       

        <!-- SECTION -->


        <div class="section">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">

                    <!-- section title -->


                    <div class="col-md-12">
                        <div class="section-title">
                            <h3 class="title">New Products</h3>
                            <div class="section-nav">
                                <ul class="section-tab-nav tab-nav">
                                    <li class="active"><a data-toggle="tab"
href="store.php">Craft Supplies</a></li>
                                    <li><a data-toggle="tab"
href="store.php">Spray Paints</a></li>
                                    <li><a data-toggle="tab"
href="store.php">Embroidery kit</a></li>
                                    <li><a data-toggle="tab"
href="store.php">Painting</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!-- /section title -->

                    <!-- Products tab & slick -->


                    <div class="col-md-12 mainn mainn-raised">
                        <div class="row">
                            <div class="products-tabs">
                                <!-- tab -->
                                <div id="tab1" class="tab-pane active">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 49


                                    <div class="products-slick" data-
nav="#slick-nav-1" >
                                   
                                    <?php
                    include 'db.php';
                               
                   
                    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_id BETWEEN 11 AND 25";
                $run_query = mysqli_query($con,$product_query);
                if(mysqli_num_rows($run_query) > 0){

                    while($row = mysqli_fetch_array($run_query)){
                        $pro_id    = $row['product_id'];
                        $pro_cat   = $row['product_cat'];
                        $pro_brand = $row['product_brand'];
                        $pro_title = $row['product_title'];
                        $pro_price = $row['product_price'];
                        $pro_image = $row['product_image'];

                        $cat_name = $row["cat_title"];

                        echo "
               
                       
                               
                                <div class='product'>
                                    <a href='product.php?p=$pro_id'><div
class='product-img'>
                                        <img src='product_images/$pro_image'
style='max-height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-
category'>$cat_name</p>
                                        <h3 class='product-name header-cart-
item-name'><a href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-
item-info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 50


                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-
wishlist'><i class='fa fa-heart-o'></i><span class='tooltipp'>add to
wishlist</span></button>
                                            <button class='add-to-compare'><i
class='fa fa-exchange'></i><span class='tooltipp'>add to
compare</span></button>
                                            <button class='quick-view'><i
class='fa fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product'
class='add-to-cart-btn block2-btn-towishlist' href='#'><i class='fa fa-
shopping-cart'></i> add to cart</button>
                                    </div>
                                </div>
                               
                           
                       
            ";
        }
        ;
     
}
?>
                                        <!-- product -->
                                       
   
                                        <!-- /product -->
                                       
                                       
                                        <!-- /product -->
                                    </div>
                                    <div id="slick-nav-1" class="products-
slick-nav"></div>
                                </div>
                                <!-- /tab -->
                            </div>
                        </div>
                    </div>
                    <!-- Products tab & slick -->
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 51


        </div>
        <!-- /SECTION -->
       

        <!-- SECTION -->


        <div class="section">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">

                    <!-- section title -->


                    <div class="col-md-12">
                        <div class="section-title">
                            <h3 class="title">Top selling</h3>
                            <div class="section-nav">
                               
                            </div>
                        </div>
                    </div>
                    <!-- /section title -->

                    <!-- Products tab & slick -->


                    <div class="col-md-12 mainn mainn-raised">
                        <div class="row">
                            <div class="products-tabs">
                                <!-- tab -->
                                <div id="tab2" class="tab-pane fade in
active">
                                    <div class="products-slick" data-
nav="#slick-nav-2">
                                        <!-- product -->
                                        <?php
                    include 'db.php';
                               
                   
                    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_id BETWEEN 1 AND 10";
                $run_query = mysqli_query($con,$product_query);
                if(mysqli_num_rows($run_query) > 0){

                    while($row = mysqli_fetch_array($run_query)){
                        $pro_id    = $row['product_id'];
                        $pro_cat   = $row['product_cat'];
                        $pro_brand = $row['product_brand'];
                        $pro_title = $row['product_title'];
                        $pro_price = $row['product_price'];
                        $pro_image = $row['product_image'];

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 52


                        $cat_name = $row["cat_title"];

                        echo "
               
                       
                               
                                <div class='product'>
                                    <a href='product.php?p=$pro_id'><div
class='product-img'>
                                        <img src='product_images/$pro_image'
style='max-height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-
category'>$cat_name</p>
                                        <h3 class='product-name header-cart-
item-name'><a href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-
item-info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-
wishlist'><i class='fa fa-heart-o'></i><span class='tooltipp'>add to
wishlist</span></button>
                                            <button class='add-to-compare'><i
class='fa fa-exchange'></i><span class='tooltipp'>add to
compare</span></button>
                                            <button class='quick-view'><i
class='fa fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product'
class='add-to-cart-btn block2-btn-towishlist' href='#'><i class='fa fa-
shopping-cart'></i> add to cart</button>
                                    </div>
                                </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 53


                               
                           
                       
            ";
        }
        ;
     
}
?>
                                       
                                        <!-- /product -->
                                    </div>
                                    <div id="slick-nav-2" class="products-
slick-nav"></div>
                                </div>
                                <!-- /tab -->
                            </div>
                        </div>
                    </div>
                    <!-- /Products tab & slick -->
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->
        </div>
                            </div>
                        </div>
                    </div>

                </div>
               
            </div>
           
        </div>
       
</div>
       

Filename: cart.php

<?php
include "header.php";
?>

<section class="section">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 54


<div class="container-fluid">  
    <div id="cart_checkout">
    </div>
</div>
</section>  
<?php
include "newslettter.php";
include "footer.php";
?>

Filename: checkout_process.php

<?php
session_start();
include "db.php";
if (isset($_SESSION["uid"])) {

    $f_name = $_POST["firstname"];
    $email = $_POST['email'];
    $address = $_POST['address'];
    $city = $_POST['city'];
    $state = $_POST['state'];
    $zip= $_POST['zip'];
    $cardname= $_POST['cardname'];
    $cardnumber= $_POST['cardNumber'];
    $expdate= $_POST['expdate'];
    $cvv= $_POST['cvv'];
    $user_id=$_SESSION["uid"];
    $cardnumberstr=(string)$cardnumber;
    $total_count=$_POST['total_count'];
    $prod_total = $_POST['total_price'];
  
  
    $sql0="SELECT order_id from `orders_info`";
    $runquery=mysqli_query($con,$sql0);
    if (mysqli_num_rows($runquery) == 0) {
        echo( mysqli_error($con));
        $order_id=1;
    }else if (mysqli_num_rows($runquery) > 0) {
        $sql2="SELECT MAX(order_id) AS max_val from `orders_info`";
        $runquery1=mysqli_query($con,$sql2);
        $row = mysqli_fetch_array($runquery1);

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 55


        $order_id= $row["max_val"];
        $order_id=$order_id+1;
        echo( mysqli_error($con));
  }

    $sql = "INSERT INTO `orders_info`


    (`order_id`,`user_id`,`f_name`, `email`,`address`,
    `city`, `state`, `zip`,
`cardname`,`cardnumber`,`expdate`,`prod_count`,`total_amt`,`cvv`)
    VALUES ($order_id, '$user_id','$f_name','$email',
    '$address', '$city', '$state',
'$zip','$cardname','$cardnumberstr','$expdate','$total_count','$prod_total','$cvv')
";

    if(mysqli_query($con,$sql)){
        $i=1;
        $prod_id_=0;
        $prod_price_=0;
        $prod_qty_=0;
        while($i<=$total_count){
            $str=(string)$i;
            $prod_id_+$str = $_POST['prod_id_'.$i];
            $prod_id=$prod_id_+$str;        
            $prod_price_+$str = $_POST['prod_price_'.$i];
            $prod_price=$prod_price_+$str;
            $prod_qty_+$str = $_POST['prod_qty_'.$i];
            $prod_qty=$prod_qty_+$str;
            $sub_total=(int)$prod_price*(int)$prod_qty;
            $sql1="INSERT INTO `order_products`
            (`order_pro_id`,`order_id`,`product_id`,`qty`,`amt`)
            VALUES (NULL, '$order_id','$prod_id','$prod_qty','$sub_total')";
            if(mysqli_query($con,$sql1)){
                $del_sql="DELETE from cart where user_id=$user_id";
                if(mysqli_query($con,$del_sql)){
                    echo"<script>window.location.href='store.php'</script>";
                }else{
                    echo(mysqli_error($con));
        }

            }else{
                echo(mysqli_error($con));
      }

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 56


            $i++;

    }
    }else{

        echo(mysqli_error($con));
    
  }
  
}else{
    echo"<script>window.location.href='index.php'</script>";
}
  

?>

Filename: checkout_php
<?php
include "db.php";

include "header.php";

             
?>

<style>

.row-checkout {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 0 -16px;
}

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 57


.col-25 {
  -ms-flex: 25%;
  flex: 25%;
}

.col-50 {
  -ms-flex: 50%;
  flex: 50%;
}

.col-75 {
  -ms-flex: 75%;
  flex: 75%;
}

.col-25,
.col-50,
.col-75 {
  padding: 0 16px;
}

.container-checkout {
  background-color: #f2f2f2;
  padding: 5px 20px 15px 20px;
  border: 1px solid lightgrey;
  border-radius: 3px;
}

input[type=text] {
  width: 100%;
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

label {
  margin-bottom: 10px;
  display: block;
}

.icon-container {

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 58


  margin-bottom: 20px;
  padding: 7px 0;
  font-size: 24px;
}

.checkout-btn {
  background-color: #4CAF50;
  color: white;
  padding: 12px;
  margin: 10px 0;
  border: none;
  width: 100%;
  border-radius: 3px;
  cursor: pointer;
  font-size: 17px;
}

.checkout-btn:hover {
  background-color: #45a049;
}

hr {
  border: 1px solid lightgrey;
}

span.price {
  float: right;
  color: grey;
}

@media (max-width: 800px) {


  .row-checkout {
    flex-direction: column-reverse;
 }
  .col-25 {
    margin-bottom: 20px;
 }
}
</style>

          

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 59


<section class="section">      
    <div class="container-fluid">
        <div class="row-checkout">
        <?php
        if(isset($_SESSION["uid"])){
            $sql = "SELECT * FROM user_info WHERE
user_id='$_SESSION[uid]'";
            $query = mysqli_query($con,$sql);
            $row=mysqli_fetch_array($query);
    
        echo'
            <div class="col-75">
                <div class="container-checkout">
                <form id="checkout_form" action="checkout_process.php"
method="POST" class="was-validated">

                    <div class="row-checkout">
          
                    <div class="col-50">
                        <h3>Billing Address</h3>
                        <label for="fname"><i class="fa fa-user" ></i> Full
Name</label>
                        <input type="text" id="fname" class="form-control"
name="firstname" pattern="^[a-zA-Z ]+$"  value="'.$row["first_name"].' '.
$row["last_name"].'">
                        <label for="email"><i class="fa fa-envelope"></i>
Email</label>
                        <input type="text" id="email" name="email" class="form-
control" pattern="^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9]+(\.[a-z]{2,4})$"
value="'.$row["email"].'" required>
                        <label for="adr"><i class="fa fa-address-card-o"></i>
Address</label>
                        <input type="text" id="adr" name="address" class="form-
control" value="'.$row["address1"].'" required>
                        <label for="city"><i class="fa fa-institution"></i> City</label>
                        <input type="text" id="city" name="city" class="form-control"
value="'.$row["address2"].'" pattern="^[a-zA-Z ]+$" required>

                        <div class="row">
                        <div class="col-50">
                            <label for="state">State</label>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 60


                            <input type="text" id="state" name="state" class="form-
control" pattern="^[a-zA-Z ]+$" required>
                        </div>
                        <div class="col-50">
                            <label for="zip">Zip</label>
                            <input type="text" id="zip" name="zip" class="form-control"
pattern="^[0-9]{6}(?:-[0-9]{4})?$" required>
                        </div>
                        </div>
                    </div>
          
          
                    <div class="col-50">
                        <h3>Payment</h3>
                        <label for="fname">Accepted Cards</label>
                        <div class="icon-container">
                        <i class="fa fa-cc-visa" style="color:navy;"></i>
                        <i class="fa fa-cc-mastercard" style="color:red;"></i>
                        <i class="fa fa-cc-discover" style="color:orange;"></i>
                        </div>
            
            
                        <label for="cname">Name on Card</label>
                        <input type="text" id="cname" name="cardname" class="form-
control" pattern="^[a-zA-Z ]+$" required>
            
                        <div class="form-group" id="card-number-field">
                        <label for="cardNumber">Card Number</label>
                        <input type="text" class="form-control" id="cardNumber"
name="cardNumber" required>
                    </div>
                        <label for="expdate">Exp Date</label>
                        <input type="text" id="expdate" name="expdate" class="form-
control" pattern="^((0[1-9])|(1[0-2]))\/(\d{2})$" placeholder="12/22"required>
            

                        <div class="row">
            
                        <div class="col-50">
                            <div class="form-group CVV">
                                <label for="cvv">CVV</label>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 61


                                <input type="text" class="form-control" name="cvv"
id="cvv" required>
                        </div>
                        </div>
                    </div>
                    </div>
                    </div>
                    <label><input type="CHECKBOX" name="q" class="roomselect"
value="conform" required> Shipping address same as billing
                    </label>';
                    $i=1;
                    $total=0;
                    $total_count=$_POST['total_count'];
                    while($i<=$total_count){
                        $item_name_ = $_POST['item_name_'.$i];
                        $amount_ = $_POST['amount_'.$i];
                        $quantity_ = $_POST['quantity_'.$i];
                        $total=$total+$amount_ ;
                        $sql = "SELECT product_id FROM products WHERE
product_title='$item_name_'";
                        $query = mysqli_query($con,$sql);
                        $row=mysqli_fetch_array($query);
                        $product_id=$row["product_id"];
                        echo "  
                        <input type='hidden' name='prod_id_$i' value='$product_id'>
                        <input type='hidden' name='prod_price_$i' value='$amount_'>
                        <input type='hidden' name='prod_qty_$i' value='$quantity_'>
                        ";
                        $i++;
          }
          
                echo'  
                <input type="hidden" name="total_count" value="'.$total_count.'">
                    <input type="hidden" name="total_price" value="'.$total.'">
          
                    <input type="submit" id="submit" value="Continue to checkout"
class="checkout-btn" >
          
                </form>
                </div>
            </div>
            ';

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 62


        }else{
            echo"<script>window.location.href = 'cart.php'</script>";
    }
        ?>

            <div class="col-25">
                <div class="container-checkout">
        
                <?php
                if (isset($_POST["cmd"])) {
        
                    $user_id = $_POST['custom'];
          
          
                    $i=1;
                    echo
          "
                    <h4>Cart
                    <span class='price' style='color:black'>
                    <i class='fa fa-shopping-cart'></i>
                    <b>$total_count</b>
                    </span>
                </h4>

                    <table class='table table-condensed'>


                    <thead><tr>
                    <th >No.</th>
                    <th >Product</th>
                    <th >Qty    </th>
                    <th >Amount</th></tr>
                    </thead>
                    <tbody>
                    ";
                    $total=0;
                    while($i<=$total_count){
                        $item_name_ = $_POST['item_name_'.$i];
            
                        $item_number_ = $_POST['item_number_'.$i];
            
                        $amount_ = $_POST['amount_'.$i];
            
                        $quantity_ = $_POST['quantity_'.$i];

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 63


                        $total=$total+$amount_ ;
                        $sql = "SELECT product_id FROM products WHERE
product_title='$item_name_'";
                        $query = mysqli_query($con,$sql);
                        $row=mysqli_fetch_array($query);
                        $product_id=$row["product_id"];
          
                        echo "  

            
<tr><td><p>$item_number_</p></td><td><p>$item_name_</p></td><td
><p>$quantity_</p></td><td ><p>$amount_</p></td></tr>";
            
                        $i++;
          }

                echo"

                </tbody>
                </table>
                <hr>
        
                <h3>total<span class='price' style='color:black'><b>$
$total</b></span></h3>";
          
        }
                ?>
                </div>
            </div>
        </div>
    </div>
</section>
        <div id="newsletter" class="section">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">
                    <div class="col-md-12">
                        <div class="newsletter">
                            <p>Sign Up for the <strong>NEWSLETTER</strong></p>
                            <form >

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 64


                                <input class="input" type="email" placeholder="Enter Your
Email">
                                <button class="newsletter-btn"><i class="fa fa-
envelope"></i> Subscribe</button>
                            </form>
                            <ul class="newsletter-follow">
                                <li>
                                    <a href="#"><i class="fa fa-facebook"></i></a>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-twitter"></i></a>
                                </li>
                                <li>
                                    <a href="#"><i class="fa fa-instagram"></i></a>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->
        </div>
    
<?php
include "footer.php";
?>

Filename: config.php

<?php
session_start();

$username = "";
$email    = "";
$errors = array();

define('DB_SERVER', 'localhost');
   define('DB_USERNAME', 'PuneethReddy');
   define('DB_PASSWORD', '');

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 65


   define('DB_DATABASE', 'ecommerece');
   $db =
mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DAT
ABASE);
if (!$db) {
    die("Connection failed: " . mysqli_connect_error());
}

if (isset($_POST['reg_user'])) {
 
  $username = mysqli_real_escape_string($db, $_POST['username']);
  $email = mysqli_real_escape_string($db, $_POST['email']);
  $password_1 = mysqli_real_escape_string($db, $_POST['password_1']);
  $password_2 = mysqli_real_escape_string($db, $_POST['password_2']);

 
  if (empty($username)) { array_push($errors, "Username is required"); }
  if (empty($email)) { array_push($errors, "Email is required"); }
  if (empty($password_1)) { array_push($errors, "Password is required"); }
  if ($password_1 != $password_2) {
  array_push($errors, "The two passwords do not match");
 }

 
  $user_check_query = "SELECT * FROM register WHERE Name='$username'
OR email='$email' LIMIT 1";
  $result = mysqli_query($db, $user_check_query);
  $user = mysqli_fetch_assoc($result);
 
  if ($user) {
    if ($user['Name'] === $username) {
      array_push($errors, "Username already exists");
  }

    if ($user['email'] === $email) {


      array_push($errors, "email already exists");
  }
 }

 
  if (count($errors) == 0) {
    $password = md5($password_1);

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 66


    $query = "INSERT INTO register (Name, email, password)
          VALUES('$username', '$email', '$password')";
    mysqli_query($db, $query);
    $_SESSION['Name'] = $username;
    $_SESSION['success'] = "You are now logged in";
    header('location: index.php');
 }
}
if (isset($_POST['login_user'])) {
  $username = mysqli_real_escape_string($db, $_POST['email']);
  $password = mysqli_real_escape_string($db, $_POST['password']);

  if (empty($username)) {
    array_push($errors, "email is required");
 }
  if (empty($password)) {
    array_push($errors, "Password is required");
 }

  if (count($errors) == 0) {
    $password = md5($password);
    $query = "SELECT * FROM register WHERE email='$username' AND
password='$password'";
    $results = mysqli_query($db, $query);
    if (mysqli_num_rows($results) == 1) {
      $_SESSION['email'] = $username;
      $_SESSION['success'] = "You are now logged in";
      header('location: index.php');
    }else {
      array_push($errors, "Wrong username/password combination");
  }
 }
}

?>

Filename: db.php
<?php

$servername = "localhost";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 67


$username = "root";
$password = "";
$db = "ecommerce";

$con = mysqli_connect($servername, $username, $password,$db);

if (!$con) {
    die("Connection failed: " . mysqli_connect_error());
}

?>

Filename: header.php
<?php
session_start();

?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
     <!-- The above 3 meta tags *must* come first in the head; any other head
content must come *after* these tags -->

    <title>Swish - Art and Craft Store</title>

    <!-- Google font -->


    <link href="https://fonts.googleapis.com/css?
family=Montserrat:400,500,700" rel="stylesheet">

    <!-- Bootstrap -->


    <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css"/>

    <!-- Slick -->


    <link type="text/css" rel="stylesheet" href="css/slick.css"/>
    <link type="text/css" rel="stylesheet" href="css/slick-theme.css"/>

    <!-- nouislider -->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 68


    <link type="text/css" rel="stylesheet" href="css/nouislider.min.css"/>

    <!-- Font Awesome Icon -->


    <link rel="stylesheet" href="css/font-awesome.min.css">

    <!-- Custom stlylesheet -->


    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <link type="text/css" rel="stylesheet" href="css/accountbtn.css"/>
  
  
  
    <style>
        #navigation {
          background: #F4FCD9;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #F4FCD9, #C5D8A4);  /*
Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #F4FCD9, #C5D8A4); /* W3C, IE
10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

     
    }
        #header {
 
            background: #cc6f6a;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #F6E6CB, #cc6f6a);  /*
Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #F6E6CB, #cc6f6a); /* W3C, IE
10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

 
    }
        #top-header {
       
 
            background: #cc6f6a;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #EEC373, #e97f84);  /*
Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #EEC373, #e97f84); /* W3C, IE
10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

    }
        #footer {

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 69


            background: #CA965C;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #EEC373, #CA965C);  /*
Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #EEC373, #CA965C); /* W3C, IE
10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */

          color: #1E1F29;
    }
        #bottom-footer {
            background: #7474BF;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #EEC373, #CA965C);  /*
Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #EEC373, #CA965C); /* W3C, IE
10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
     

    }
        .footer-links li a {
          color: #1E1F29;
    }
        .mainn-raised {
      
            margin: -7px 0px 0px;
            border-radius: 6px;
            box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px
rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2);

    }
    
        .glyphicon{
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
    .glyphicon-chevron-left:before{
        content:"\f053"
  }
    .glyphicon-chevron-right:before{
        content:"\f054"

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 70


  }
    

    
    
        </style>

    </head>
  <body>
    <!-- HEADER -->
    <header>
      <!-- TOP HEADER -->
      <div id="top-header">
        <div class="container">
     
          <ul class="header-links pull-right">
      
            <li><?php
                             include "db.php";
                            if(isset($_SESSION["uid"])){
                                $sql = "SELECT first_name FROM user_info WHERE
user_id='$_SESSION[uid]'";
                                $query = mysqli_query($con,$sql);
                                $row=mysqli_fetch_array($query);
                
                                echo '
                               <div class="dropdownn">
                                  <a href="#" class="dropdownn" data-toggle="modal"
data-target="#myModal" ><i class="fa fa-user-o"></i> HI '.
$row["first_name"].'</a>
                                  <div class="dropdownn-content">
                                    <a href="" data-toggle="modal" data-
target="#profile"><i class="fa fa-user-circle" aria-hidden="true" ></i>My
Profile</a>
                                    <a href="logout.php"  ><i class="fa fa-sign-in" aria-
hidden="true"></i>Log out</a>
                  
                                  </div>
                                </div>';

                            }else{
                                echo '

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 71


                                <div class="dropdownn">
                                  <a href="#" class="dropdownn" data-toggle="modal"
data-target="#myModal" ><i class="fa fa-user-o"></i> My Account</a>
                                  <div class="dropdownn-content">
                                    <a href="" data-toggle="modal" data-
target="#Modal_login"><i class="fa fa-sign-in" aria-hidden="true"
></i>Login</a>
                                    <a href="" data-toggle="modal" data-
target="#Modal_register"><i class="fa fa-user-plus"
aria-hidden="true"></i>Register</a>
                  
                                  </div>
                                </div>';
                
              }
                                             ?>
                
                                </li>      
          </ul>
     
        </div>
      </div>
      <!-- /TOP HEADER -->
   
   

      <!-- MAIN HEADER -->


      <div id="header">
        <!-- container -->
        <div class="container">
          <!-- row -->
          <div class="row">
            <!-- LOGO -->
            <div class="col-md-3">
              <div class="header-logo">
                <a href="index.php" class="logo">
                  <img src="img/Swish Logo-01.jpg" style="width: 200px;
height:80px">
         
                </a>
              </div>
            </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 72


            <!-- /LOGO -->

            <!-- SEARCH BAR -->


            <div class="col-md-6">
              <div class="header-search">
                <form>
                  <select class="input-select">
                    <option value="0">All Categories</option>
                    <option value="1">Art Supplies</option>
                    <option value="1">Craft Supplies</option>
                  </select>
                  <input class="input" id="search" type="text" placeholder="Search
here">
                  <button type="submit" id="search_btn" class="search-
btn">Search</button>
                </form>
              </div>
            </div>
            <!-- /SEARCH BAR -->

            <!-- ACCOUNT -->


            <div class="col-md-3 clearfix">
              <div class="header-ctn">
        
                <!-- Cart -->
                <div class="dropdown">
                  <a class="dropdown-toggle" data-toggle="dropdown" aria-
expanded="true">
                    <i class="fa fa-shopping-cart"></i>
                    <span>Your Cart</span>
                    <div class="badge qty">0</div>
                  </a>
                  <div class="cart-dropdown"  >
                    <div class="cart-list" id="cart_product">
          
           
                    </div>
          
                    <div class="cart-btns">
                        <a href="cart.php" style="width:100%;"><i class="fa fa-
edit"></i>  edit cart</a>
           

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 73


                    </div>
                  </div>
          
                  </div>
                <!-- /Cart -->

                <!-- Menu Toogle -->


                <div class="menu-toggle">
                  <a href="#">
                    <i class="fa fa-bars"></i>
                    <span>Menu</span>
                  </a>
                </div>
                <!-- /Menu Toogle -->
              </div>
            </div>
            <!-- /ACCOUNT -->
          </div>
          <!-- row -->
        </div>
        <!-- container -->
      </div>
      <!-- /MAIN HEADER -->
    </header>
    <!-- /HEADER -->
    <nav id='navigation'>
      <!-- container -->
            <div class="container" id="get_category_home">
        
            </div>
        <!-- responsive-nav -->
    
      <!-- /container -->
    </nav>
      

    <!-- NAVIGATION -->


  
    <div class="modal fade" id="Modal_login" role="dialog">
                        <div class="modal-dialog">
             
                          <!-- Modal content-->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 74


                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-
dismiss="modal">&times;</button>
               
                            </div>
                            <div class="modal-body">
                            <?php
                                include "login_form.php";
  
                            ?>
     
                            </div>
              
                          </div>
             
                        </div>
                      </div>
                <div class="modal fade" id="Modal_register" role="dialog">
                        <div class="modal-dialog" style="">

                          <!-- Modal content-->


                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-
dismiss="modal">&times;</button>
               
                            </div>
                            <div class="modal-body">
                            <?php
                                include "register_form.php";
  
                            ?>
     
                            </div>
              
                          </div>

                        </div>
                      </div>
  
Filename: homeaction.php

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 75


<?php
session_start();
$ip_add = getenv("REMOTE_ADDR");
include "db.php";

if(isset($_POST["categoryhome"])){
    $category_query = "SELECT * FROM categories WHERE cat_id!=1";
  
    $run_query = mysqli_query($con,$category_query) or
die(mysqli_error($con));
    echo "
    
      
      
                <!-- responsive-nav -->
                <div id='responsive-nav'>
                    <!-- NAV -->
                    <ul class='main-nav nav navbar-nav'>
                    <li class='active'><a href='index.php'>Home</a></li>
                    <li><a href='store.php'>Art Supplies</a></li>
                    <li><a href='store.php'>Craft Supplies</a></li>
    ";
    if(mysqli_num_rows($run_query) > 0){
        while($row = mysqli_fetch_array($run_query)){
            $cid = $row["cat_id"];
            $cat_name = $row["cat_title"];
      
            $sql = "SELECT COUNT(*) AS count_items FROM
products,categories WHERE product_cat=cat_id";
            $query = mysqli_query($con,$sql);
            $row = mysqli_fetch_array($query);
            $count=$row["count_items"];
      
      
      
      
    }
    
        echo "</ul>
                    <!-- /NAV -->
                </div>
                <!-- /responsive-nav -->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 76


        
            ";
  }
}

if(isset($_POST["page"])){
    $sql = "SELECT * FROM products";
    $run_query = mysqli_query($con,$sql);
    $count = mysqli_num_rows($run_query);
    $pageno = ceil($count/2);
    for($i=1;$i<=$pageno;$i++){
        echo "
            <li><a href='#product-row' page='$i' id='page'>$i</a></li>
      
      
        ";
  }
}
if(isset($_POST["getProducthome"])){
    $limit = 3;
    if(isset($_POST["setPage"])){
        $pageno = $_POST["pageNumber"];
        $start = ($pageno * $limit) - $limit;
    }else{
        $start = 0;
  }
    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id LIMIT $start,$limit";
    $run_query = mysqli_query($con,$product_query);
    if(mysqli_num_rows($run_query) > 0){
        while($row = mysqli_fetch_array($run_query)){
            $pro_id    = $row['product_id'];
            $pro_cat   = $row['product_cat'];
            $pro_brand = $row['product_brand'];
            $pro_title = $row['product_title'];
            $pro_price = $row['product_price'];
            $pro_image = $row['product_image'];
      
            $cat_name = $row["cat_title"];
            echo "
        
                       <div class='product-widget'>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 77


                                <a href='product.php?p=$pro_id'>
                                    <div class='product-img'>
                                        <img src='product_images/$pro_image' alt=''>
                                    </div>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name'><a href='product.php?
p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price'>$pro_price<del
class='product-old-price'>Rs. 999</del></h4>
                                    </div></a>
                                </div>
            
            ";
    }
  }
}

if(isset($_POST["gethomeProduct"])){
    $limit = 9;
    if(isset($_POST["setPage"])){
        $pageno = $_POST["pageNumber"];
        $start = ($pageno * $limit) - $limit;
    }else{
        $start = 0;
  }
  
    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_id BETWEEN 71 AND 74";
    $run_query = mysqli_query($con,$product_query);
    if(mysqli_num_rows($run_query) > 0){
    
        while($row = mysqli_fetch_array($run_query)){
            $pro_id    = $row['product_id'];
            $pro_cat   = $row['product_cat'];
            $pro_brand = $row['product_brand'];
            $pro_title = $row['product_title'];
            $pro_price = $row['product_price'];
            $pro_image = $row['product_image'];
      
            $cat_name = $row["cat_title"];
      

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 78


            echo "
        
            
                                <div class='col-md-3 col-xs-6'>
                                <a href='product.php?p=$pro_id'><div class='product'>
                                    <div class='product-img'>
                                        <img src='product_images/$pro_image' style='max-
height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name header-cart-item-name'><a
href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-item-
info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-wishlist'><i class='fa fa-heart-
o'></i><span class='tooltipp'>add to wishlist</span></button>
                                            <button class='add-to-compare'><i class='fa fa-
exchange'></i><span class='tooltipp'>add to compare</span></button>
                                            <button class='quick-view'><i class='fa
fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product' class='add-to-cart-
btn block2-btn-towishlist' href='#'><i class='fa fa-shopping-cart'></i> add to
cart</button>
                                    </div>
                                </div>
                                </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 79


              
            
            ";
    }
    ;
   
}
  
  }
  
if(isset($_POST["get_seleted_Category"]) ||  isset($_POST["search"])){
    if(isset($_POST["get_seleted_Category"])){
        $id = $_POST["cat_id"];
        $sql = "SELECT * FROM products,categories WHERE product_cat = '$id'
AND product_cat=cat_id";
    }else {
        $keyword = $_POST["keyword"];
        $sql = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_keywords LIKE '%$keyword%'";
  }
  
    $run_query = mysqli_query($con,$sql);
    while($row=mysqli_fetch_array($run_query)){
            $pro_id    = $row['product_id'];
            $pro_cat   = $row['product_cat'];
            $pro_brand = $row['product_brand'];
            $pro_title = $row['product_title'];
            $pro_price = $row['product_price'];
            $pro_image = $row['product_image'];
            $cat_name = $row["cat_title"];
            echo "
          
            
                        <div class='col-md-4 col-xs-6'>
                                <a href='product.php?p=$pro_id'><div class='product'>
                                    <div class='product-img'>
                                        <img  src='product_images/$pro_image' style='max-
height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 80


                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name header-cart-item-name'><a
href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-item-
info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-wishlist' tabindex='0'><i
class='fa fa-heart-o'></i><span class='tooltipp'>add to
wishlist</span></button>
                                            <button class='add-to-compare'><i class='fa fa-
exchange'></i><span class='tooltipp'>add to compare</span></button>
                                            <button class='quick-view' ><i class='fa
fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product' href='#' tabindex='0'
class='add-to-cart-btn'><i class='fa fa-shopping-cart'></i> add to cart</button>
                                    </div>
                                </div>
                            </div>
            ";
    }
  }

Filename: index.php
<?php

include "header.php";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 81


include "body.php";
include "newslettter.php";
include "footer.php";
?>

Filename: login_form.php

<?php
if (isset($_POST["login_user_with_product"])) {
  
    $product_list = $_POST["product_id"];
  
    $json_e = json_encode($product_list);
  
    setcookie("product_list",$json_e,strtotime("+1 day"),"/","","",TRUE);

}
?>

    <div class="wait overlay">


        <div class="loader"></div>
    </div>
    <div class="container-fluid">
<div class="login-marg">
            
            
                                <form onsubmit="return false" id="login" class="login100-
form ">
                                    <div class="billing-details jumbotron">
                                    <div class="section-title">
                                        <h2 class="login100-form-title p-b-49" >Login
Here</h2>
                                    </div>
                  
                  
                                    <div class="form-group">
                                       <label for="email">Email</label>
                                        <input class="input input-borders" type="email"
name="email" placeholder="Email" id="password" required>
                                    </div>
                  

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 82


                                    <div class="form-group">
                                       <label for="email">Password</label>
                                        <input class="input input-borders" type="password"
name="password" placeholder="password" id="password" required>
                                    </div>
                  
                                    <div class="text-pad" >
                                       <a href="#">
                                           forget password ?
                                       </a>
                    
                                    </div>
                  
                                        <input class="primary-btn btn-block"   type="submit"
Value="Login">
                    
                                        <div class="panel-footer"><div class="alert alert-
danger"><h4 id="e_msg"></h4></div></div>
                  
                    
                    
                  

                                </div>
                
                                </form>
              
            
                    </div>
        
        
            </div>

Filename: login.php

<?php
include "db.php";

session_start();

#Login script
 

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 83


if(isset($_POST["email"]) && isset($_POST["password"])){
    $email = mysqli_real_escape_string($con,$_POST["email"]);
    $password = $_POST["password"];
    $sql = "SELECT * FROM user_info WHERE email = '$email' AND
password = '$password'";
    $run_query = mysqli_query($con,$sql);
    $count = mysqli_num_rows($run_query);
    $row = mysqli_fetch_array($run_query);
        $_SESSION["uid"] = $row["user_id"];
        $_SESSION["name"] = $row["first_name"];
        $ip_add = getenv("REMOTE_ADDR");
    
    
  
    if($count == 1){
      
            if (isset($_COOKIE["product_list"])) {
                $p_list = stripcslashes($_COOKIE["product_list"]);
        
                $product_list = json_decode($p_list,true);
                for ($i=0; $i < count($product_list); $i++) {
          
                    $verify_cart = "SELECT id FROM cart WHERE user_id =
$_SESSION[uid] AND p_id = ".$product_list[$i];
                    $result  = mysqli_query($con,$verify_cart);
                    if(mysqli_num_rows($result) < 1){
            
                        $update_cart = "UPDATE cart SET user_id = '$_SESSION[uid]'
WHERE ip_add = '$ip_add' AND user_id = -1";
                        mysqli_query($con,$update_cart);
                    }else{
            
                        $delete_existing_product = "DELETE FROM cart WHERE
user_id = -1 AND ip_add = '$ip_add' AND p_id = ".$product_list[$i];
                        mysqli_query($con,$delete_existing_product);
          }
        }
        
                setcookie("product_list","",strtotime("-1 day"),"/");
        
                echo "cart_login";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 84


        
        
                exit();
        
      }
            //if user is login from page we will send login_success
            echo "login_success";
            $BackToMyPage = $_SERVER['HTTP_REFERER'];
                if(!isset($BackToMyPage)) {
                    header('Location: '.$BackToMyPage);
                    echo"<script type='text/javascript'>
          
                    </script>";
                } else {
                    header('Location: index.php'); // default page
        }
        
      
            exit;

        }else{
                $email = mysqli_real_escape_string($con,$_POST["email"]);
                $password =md5($_POST["password"]) ;
                $sql = "SELECT * FROM admin_info WHERE admin_email =
'$email' AND admin_password = '$password'";
                $run_query = mysqli_query($con,$sql);
                $count = mysqli_num_rows($run_query);

            //if user record is available in database then $count will be equal to 1


            if($count == 1){
                $row = mysqli_fetch_array($run_query);
                $_SESSION["uid"] = $row["admin_id"];
                $_SESSION["name"] = $row["admin_name"];
                $ip_add = getenv("REMOTE_ADDR");
                //we have created a cookie in login_form.php page so if that cookie is
available means user is not login

                    //if user is login from page we will send login_success


                    echo "login_success";

                    echo "<script> location.href='admin/addproduct.php'; </script>";


                    exit;

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 85


                }else{
                    echo "<span style='color:red;'>Please register before
login..!</span>";
                    exit();
        }
  
  
}
  
  
}

?>

Filename: logout.php

<?php

session_start();

unset($_SESSION["uid"]);

unset($_SESSION["name"]);

$BackToMyPage = $_SERVER['HTTP_REFERER'];
if(isset($BackToMyPage)) {
    header('Location: '.$BackToMyPage);
} else {
    header('Location: index.php'); // default page
}
  

?>

Filename: payment_success.php
<?php

session_start();
if(!isset($_SESSION["uid"])){
    header("location:index.php");
ASHUTOSH MAZUMDAR|ROLL NO: 40Page 86
}

if (isset($_GET["st"])) {

    # code...
    $trx_id = $_GET["tx"];
        $p_st = $_GET["st"];
        $amt = $_GET["amt"];
        $cc = $_GET["cc"];
        $cm_user_id = $_GET["cm"];
        $c_amt = $_COOKIE["ta"];
    if ($p_st == "Completed") {

    

        include_once("db.php");
        $sql = "SELECT p_id,qty FROM cart WHERE user_id = '$cm_user_id'";
        $query = mysqli_query($con,$sql);
        if (mysqli_num_rows($query) > 0) {
            # code...
            while ($row=mysqli_fetch_array($query)) {
            $product_id[] = $row["p_id"];
            $qty[] = $row["qty"];
      }

            for ($i=0; $i < count($product_id); $i++) {


                $sql = "INSERT INTO orders (user_id,product_id,qty,trx_id,p_status)
VALUES ('$cm_user_id','".$product_id[$i]."','".$qty[$i]."','$trx_id','$p_st')";
                mysqli_query($con,$sql);
      }

            $sql = "DELETE FROM cart WHERE user_id = '$cm_user_id'";


            if (mysqli_query($con,$sql)) {
                ?>
                    <!DOCTYPE html>
                    <html>
                        <head>
                            <meta charset="UTF-8">
                            <title>Khan Store</title>
                            <link rel="stylesheet" href="css/bootstrap.min.css"/>
                            <script src="js/jquery2.js"></script>
                            <script src="js/bootstrap.min.js"></script>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 87


                            <script src="main.js"></script>
                            <style>
                                table tr td {padding:10px;}
                            </style>
                        </head>
                    <body>
                        <div class="navbar navbar-inverse navbar-fixed-top">
                            <div class="container-fluid">  
                                <div class="navbar-header">
                                    <a href="#" class="navbar-brand">Khan Store</a>
                                </div>
                                <ul class="nav navbar-nav">
                                    <li><a href="index.php"><span class="glyphicon
glyphicon-home"></span>Home</a></li>
                                    <li><a href="profile.php"><span class="glyphicon
glyphicon-modal-window"></span>Product</a></li>
                                </ul>
                            </div>
                        </div>
                        <p><br/></p>
                        <p><br/></p>
                        <p><br/></p>
                        <div class="container-fluid">
            
                            <div class="row">
                                <div class="col-md-2"></div>
                                <div class="col-md-8">
                                    <div class="panel panel-default">
                                        <div class="panel-heading"></div>
                                        <div class="panel-body">
                                            <h1>Thankyou </h1>
                                            <hr/>
                                            <p>Hello <?php echo "<b>".
$_SESSION["name"]."</b>"; ?>,Your payment process is
                                            successfully completed and your Transaction id is
<b><?php echo $trx_id; ?></b><br/>
                                            you can continue your Shopping <br/></p>
                                            <a href="index.php" class="btn btn-success btn-
lg">Continue Shopping</a>
                                        </div>
                                        <div class="panel-footer"></div>
                                    </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 88


                                </div>
                                <div class="col-md-2"></div>
                            </div>
                        </div>
                    </body>
                    </html>

                <?php
      }
        }else{
            header("location:index.php");
    }
    
  }
}

?>

Filename: product.php

<?php
include "header.php";
?>
        <!-- /BREADCRUMB -->
        <script type="text/javascript">
            jQuery(document).ready(function($) {
                $(".scroll").click(function(event){    
                    event.preventDefault();
                    $('html,body').animate({scrollTop:$(this.hash).offset().top},900);
                });
            });
</script>
        <script>
  
    (function (global) {
    if(typeof (global) === "undefined")
  {
        throw new Error("window is undefined");
  }
    var _hash = "!";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 89


    var noBackPlease = function () {
        global.location.href += "#";
        // making sure we have the fruit available for juice....
        // 50 milliseconds for just once do not cost much (^__^)
        global.setTimeout(function () {
            global.location.href += "!";
        }, 50);
    };  
    // Earlier we had setInerval here....
    global.onhashchange = function () {
        if (global.location.hash !== _hash) {
            global.location.hash = _hash;
    }
    };
    global.onload = function () {        
        noBackPlease();
        // disables backspace on page except on input fields and textarea..
        document.body.onkeydown = function (e) {
            var elm = e.target.nodeName.toLowerCase();
            if (e.which === 8 && (elm !== 'input' && elm  !== 'textarea')) {
                e.preventDefault();
      }
            // stopping event bubbling up the DOM tree..
            e.stopPropagation();
        };      
    };
})(window);
</script>

        <!-- SECTION -->


        <div class="section main main-raised">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">
                    <!-- Product main img -->
          
                    <?php
                                include 'db.php';
                                $product_id = $_GET['p'];
                
                                $sql = " SELECT * FROM products ";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 90


                                $sql = " SELECT * FROM products WHERE product_id =
$product_id";
                                if (!$con) {
                                    die("Connection failed: " . mysqli_connect_error());
                }
                                $result = mysqli_query($con, $sql);
                                if (mysqli_num_rows($result) > 0)
                {
                                    while($row = mysqli_fetch_assoc($result))
                  {
                                    echo '
                  
                  
                
                                <div class="col-md-5 col-md-push-2">
                                <div id="product-main-img">
                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>
                                </div>
                            </div>
                
                                <div class="col-md-2  col-md-pull-5">
                                <div id="product-imgs">
                                    <div class="product-preview">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 91


                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'g"
alt="">
                                    </div>

                                    <div class="product-preview">
                                        <img src="product_images/'.$row['product_image'].'"
alt="">
                                    </div>
                                </div>
                            </div>

                 
                                    ';
                  
                                    ?>
                                    <!-- FlexSlider -->
                  
                                    <?php
                                    echo '
                  
                  
                  
                    <div class="col-md-5">
                        <div class="product-details">
                            <h2 class="product-name">'.$row['product_title'].'</h2>
                            <div>
                                <div class="product-rating">
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star"></i>
                                    <i class="fa fa-star-o"></i>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 92


                                </div>
                                <a class="review-link" href="#review-form">10 Review(s)
| Add your review</a>
                            </div>
                            <div>
                                <h3 class="product-price">$'.$row['product_price'].'<del
class="product-old-price">Rs. 999</del></h3>
                                <span class="product-available">In Stock</span>
                            </div>
                            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat.</p>

                            <div class="product-options">
                                <label>
                                    Size
                                    <select class="input-select">
                                        <option value="0">X</option>
                                    </select>
                                </label>
                                <label>
                                    Color
                                    <select class="input-select">
                                        <option value="0">Red</option>
                                    </select>
                                </label>
                            </div>

                            <div class="add-to-cart">
                                <div class="qty-label">
                                    Qty
                                    <div class="input-number">
                    
                                        <span class="qty-up">+</span>
                                        <span class="qty-down">-</span>
                                    </div>
                                </div>
                                <div class="btn-group" style="margin-left: 25px; margin-
top: 15px">
                                <button class="add-to-cart-btn" pid="'.$row['product_id'].'"
id="product" ><i class="fa fa-shopping-cart"></i> add to cart</button>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 93


                                </div>
                
                
                            </div>

                            <ul class="product-btns">
                                <li><a href="#"><i class="fa fa-heart-o"></i> add to
wishlist</a></li>
                                <li><a href="#"><i class="fa fa-exchange"></i> add to
compare</a></li>
                            </ul>

                            <ul class="product-links">
                                <li>Share:</li>
                                <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                                <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                                <li><a href="#"><i class="fa
fa-google-plus"></i></a></li>
                                <li><a href="#"><i class="fa fa-envelope"></i></a></li>
                            </ul>

                        </div>
                    </div>
                  
          
                    <!-- /Product main img -->

                    <!-- Product thumb imgs -->


          
          
          
                    <!-- /Product thumb imgs -->

                    <!-- Product details -->


          
                    <!-- /Product details -->

                    <!-- Product tab -->


                    <div class="col-md-12">
                        <div id="product-tab">
                            <!-- product tab nav -->
                            <ul class="tab-nav">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 94


                                <li class="active"><a data-toggle="tab"
href="#tab1">Description</a></li>
                                <li><a data-toggle="tab" href="#tab2">Details</a></li>
                                <li><a data-toggle="tab" href="#tab3">Reviews
(3)</a></li>
                            </ul>
                            <!-- /product tab nav -->

                            <!-- product tab content -->


                            <div class="tab-content">
                                <!-- tab1  -->
                                <div id="tab1" class="tab-pane fade in active">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <p>Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
id est laborum.</p>
                                        </div>
                                    </div>
                                </div>
                                <!-- /tab1  -->

                                <!-- tab2  -->


                                <div id="tab2" class="tab-pane fade in">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <p>Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
id est laborum.</p>
                                        </div>
                                    </div>
                                </div>
                                <!-- /tab2  -->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 95


                                <!-- tab3  -->
                                <div id="tab3" class="tab-pane fade in">
                                    <div class="row">
                                        <!-- Rating -->
                                        <div class="col-md-3">
                                            <div id="rating">
                                                <div class="rating-avg">
                                                    <span>4.5</span>
                                                    <div class="rating-stars">
                                                        <i class="fa fa-star"></i>
                                                        <i class="fa fa-star"></i>
                                                        <i class="fa fa-star"></i>
                                                        <i class="fa fa-star"></i>
                                                        <i class="fa fa-star-o"></i>
                                                    </div>
                                                </div>
                                                <ul class="rating">
                                                    <li>
                                                        <div class="rating-stars">
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                        </div>
                                                        <div class="rating-progress">
                                                            <div style="width: 80%;"></div>
                                                        </div>
                                                        <span class="sum">3</span>
                                                    </li>
                                                    <li>
                                                        <div class="rating-stars">
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star-o"></i>
                                                        </div>
                                                        <div class="rating-progress">
                                                            <div style="width: 60%;"></div>
                                                        </div>
                                                        <span class="sum">2</span>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 96


                                                    </li>
                                                    <li>
                                                        <div class="rating-stars">
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                        </div>
                                                        <div class="rating-progress">
                                                            <div></div>
                                                        </div>
                                                        <span class="sum">0</span>
                                                    </li>
                                                    <li>
                                                        <div class="rating-stars">
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                        </div>
                                                        <div class="rating-progress">
                                                            <div></div>
                                                        </div>
                                                        <span class="sum">0</span>
                                                    </li>
                                                    <li>
                                                        <div class="rating-stars">
                                                            <i class="fa fa-star"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                            <i class="fa fa-star-o"></i>
                                                        </div>
                                                        <div class="rating-progress">
                                                            <div></div>
                                                        </div>
                                                        <span class="sum">0</span>
                                                    </li>
                                                </ul>
                                            </div>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 97


                                        </div>
                                        <!-- /Rating -->

                                        <!-- Reviews -->


                                        <div class="col-md-6">
                                            <div id="reviews">
                                                <ul class="reviews">
                                                    <li>
                                                        <div class="review-heading">
                                                            <h5 class="name">John</h5>
                                                            <p class="date">27 DEC 2018, 8:0
PM</p>
                                                            <div class="review-rating">
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star-o empty"></i>
                                                            </div>
                                                        </div>
                                                        <div class="review-body">
                                                            <p>Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua</p>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="review-heading">
                                                            <h5 class="name">John</h5>
                                                            <p class="date">27 DEC 2018, 8:0
PM</p>
                                                            <div class="review-rating">
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star-o empty"></i>
                                                            </div>
                                                        </div>
                                                        <div class="review-body">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 98


                                                            <p>Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua</p>
                                                        </div>
                                                    </li>
                                                    <li>
                                                        <div class="review-heading">
                                                            <h5 class="name">John</h5>
                                                            <p class="date">27 DEC 2018, 8:0
PM</p>
                                                            <div class="review-rating">
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star"></i>
                                                                <i class="fa fa-star-o empty"></i>
                                                            </div>
                                                        </div>
                                                        <div class="review-body">
                                                            <p>Lorem ipsum dolor sit amet,
consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua</p>
                                                        </div>
                                                    </li>
                                                </ul>
                                                <ul class="reviews-pagination">
                                                    <li class="active">1</li>
                                                    <li><a href="#">2</a></li>
                                                    <li><a href="#">3</a></li>
                                                    <li><a href="#">4</a></li>
                                                    <li><a href="#"><i class="fa fa-angle-
right"></i></a></li>
                                                </ul>
                                            </div>
                                        </div>
                                        <!-- /Reviews -->

                                        <!-- Review Form -->


                                        <div class="col-md-3 mainn">
                                            <div id="review-form">
                                                <form class="review-form">

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 99


                                                    <input class="input" type="text"
placeholder="Your Name">
                                                    <input class="input" type="email"
placeholder="Your Email">
                                                    <textarea class="input" placeholder="Your
Review"></textarea>
                                                    <div class="input-rating">
                                                        <span>Your Rating: </span>
                                                        <div class="stars">
                                                            <input id="star5" name="rating"
value="5" type="radio"><label for="star5"></label>
                                                            <input id="star4" name="rating"
value="4" type="radio"><label for="star4"></label>
                                                            <input id="star3" name="rating"
value="3" type="radio"><label for="star3"></label>
                                                            <input id="star2" name="rating"
value="2" type="radio"><label for="star2"></label>
                                                            <input id="star1" name="rating"
value="1" type="radio"><label for="star1"></label>
                                                        </div>
                                                    </div>
                                                    <button class="primary-btn">Submit</button>
                                                </form>
                                            </div>
                                        </div>
                                        <!-- /Review Form -->
                                    </div>
                                </div>
                                <!-- /tab3  -->
                            </div>
                            <!-- /product tab content  -->
                        </div>
                    </div>
                    <!-- /product tab -->
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->
        </div>
        <!-- /SECTION -->

        <!-- Section -->

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 100


        <div class="section main main-raised">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">
          
                    <div class="col-md-12">
                        <div class="section-title text-center">
                            <h3 class="title">Related Products</h3>
              
                        </div>
                    </div>
                    ';
                                    $_SESSION['product_id'] = $row['product_id'];
                  }
                }
                                ?>  
                                <?php
                    include 'db.php';
                                $product_id = $_GET['p'];
          
                    $product_query = "SELECT * FROM products,categories WHERE
product_cat=cat_id AND product_id BETWEEN $product_id AND
$product_id+3";
                $run_query = mysqli_query($con,$product_query);
                if(mysqli_num_rows($run_query) > 0){

                    while($row = mysqli_fetch_array($run_query)){
                        $pro_id    = $row['product_id'];
                        $pro_cat   = $row['product_cat'];
                        $pro_brand = $row['product_brand'];
                        $pro_title = $row['product_title'];
                        $pro_price = $row['product_price'];
                        $pro_image = $row['product_image'];

                        $cat_name = $row["cat_title"];

                        echo "
        
            
                                <div class='col-md-3 col-xs-6'>
                                <a href='product.php?p=$pro_id'><div class='product'>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 101


                                    <div class='product-img'>
                                        <img src='product_images/$pro_image' style='max-
height: 170px;' alt=''>
                                        <div class='product-label'>
                                            <span class='sale'>-30%</span>
                                            <span class='new'>NEW</span>
                                        </div>
                                    </div></a>
                                    <div class='product-body'>
                                        <p class='product-category'>$cat_name</p>
                                        <h3 class='product-name header-cart-item-name'><a
href='product.php?p=$pro_id'>$pro_title</a></h3>
                                        <h4 class='product-price header-cart-item-
info'>$pro_price<del class='product-old-price'>Rs. 999</del></h4>
                                        <div class='product-rating'>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                            <i class='fa fa-star'></i>
                                        </div>
                                        <div class='product-btns'>
                                            <button class='add-to-wishlist'><i class='fa fa-heart-
o'></i><span class='tooltipp'>add to wishlist</span></button>
                                            <button class='add-to-compare'><i class='fa fa-
exchange'></i><span class='tooltipp'>add to compare</span></button>
                                            <button class='quick-view'><i class='fa
fa-eye'></i><span class='tooltipp'>quick view</span></button>
                                        </div>
                                    </div>
                                    <div class='add-to-cart'>
                                        <button pid='$pro_id' id='product' class='add-to-cart-
btn block2-btn-towishlist' href='#'><i class='fa fa-shopping-cart'></i> add to
cart</button>
                                    </div>
                                </div>
                                </div>
              
            
            ";
    }
    ;

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 102


   
}
?>

                </div>
        
            </div>
        </div>
    
<?php
include "newslettter.php";
include "footer.php";

?>

Filename: register_form.php

    <div class="wait overlay">


        <div class="loader"></div>
    </div>
    <style>
    .input-borders{
        border-radius:30px;
  }
    </style>
                <!-- row -->
        
                <div class="container-fluid">
          
            
            
                        <!-- /Billing Details -->
            
                                <form id="signup_form" onsubmit="return false"
class="login100-form">
                                    <div class="billing-details jumbotron">
                                    <div class="section-title">
                                        <h2 class="login100-form-title p-b-49" >Register
Here</h2>
                                    </div>
                                    <div class="form-group ">
                  

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 103


                                        <input class="input form-control input-borders"
type="text" name="f_name" id="f_name" placeholder="First Name">
                                    </div>
                                    <div class="form-group">
                  
                                        <input class="input form-control input-borders"
type="text" name="l_name" id="l_name" placeholder="Last Name">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="email" name="email"  placeholder="Email">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="password" name="password" id="password" placeholder="password">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="password" name="repassword" id="repassword" placeholder="confirm
password">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="text" name="mobile" id="mobile" placeholder="mobile">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="text" name="address1" id="address1" placeholder="Address">
                                    </div>
                                    <div class="form-group">
                                        <input class="input form-control input-borders"
type="text" name="address2" id="address2" placeholder="City">
                                    </div>
                  
                  
                                    <div style="form-group">
                                       <input class="primary-btn btn-block"  value="Sign Up"
type="submit" name="signup_button">
                                    </div>
                                    <div class="text-pad">
                                    <a href="" data-toggle="modal" data-
target="#Modal_login">Already have an Account ? then login</a>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 104


                    
                                    </div>
                  
                
                                </form>
                                <div class="login-marg">
                        <!-- Billing Details -->
                        <div class="row">
                            <div class="col-md-2"></div>
                            <div class="col-md-8" id="signup_msg">
                  

                                </div>
                                <!--Alert from signup form-->
                            </div>
                            <div class="col-md-2"></div>
                        </div>

            
                    </div>
                    </div>

                   
Filename: register.php
<?php
session_start();
include "db.php";
if (isset($_POST["f_name"])) {

    $f_name = $_POST["f_name"];
    $l_name = $_POST["l_name"];
    $email = $_POST['email'];
    $password = $_POST['password'];
    $repassword = $_POST['repassword'];
    $mobile = $_POST['mobile'];
    $address1 = $_POST['address1'];
    $address2 = $_POST['address2'];
    $name = "/^[a-zA-Z ]+$/";
    $emailValidation = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9]+(\.[a-z]{2,4})
$/";
    $number = "/^[0-9]+$/";

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 105


if(empty($f_name) || empty($l_name) || empty($email) || empty($password) ||
empty($repassword) ||
    empty($mobile) || empty($address1) || empty($address2)){
    
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a><b>PLease Fill all fields..!</b>
            </div>
        ";
        exit();
    } else {
        if(!preg_match($name,$f_name)){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>this $f_name is not valid..!</b>
            </div>
        ";
        exit();
  }
    if(!preg_match($name,$l_name)){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>this $l_name is not valid..!</b>
            </div>
        ";
        exit();
  }
    if(!preg_match($emailValidation,$email)){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>this $email is not valid..!</b>
            </div>
        ";
        exit();
  }

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 106


    if(strlen($password) < 9 ){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>Password is weak</b>
            </div>
        ";
        exit();
  }
    if(strlen($repassword) < 9 ){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>Password is weak</b>
            </div>
        ";
        exit();
  }
    if($password != $repassword){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>password is not same</b>
            </div>
        ";
  }
    if(!preg_match($number,$mobile)){
        echo "
            <div class='alert alert-warning'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>Mobile number $mobile is not valid</b>
            </div>
        ";
        exit();
  }
    if(!(strlen($mobile) == 10)){
        echo "
            <div class='alert alert-warning'>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 107


                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>Mobile number must be 10 digit</b>
            </div>
        ";
        exit();
  }
    //existing email address in our database
    $sql = "SELECT user_id FROM user_info WHERE email = '$email' LIMIT
1" ;
    $check_query = mysqli_query($con,$sql);
    $count_email = mysqli_num_rows($check_query);
    if($count_email > 0){
        echo "
            <div class='alert alert-danger'>
                <a href='#' class='close' data-dismiss='alert' aria-
label='close'>&times;</a>
                <b>Email Address is already available Try Another email
address</b>
            </div>
        ";
        exit();
    } else {
    
        $sql = "INSERT INTO `user_info`
        (`user_id`, `first_name`, `last_name`, `email`,
        `password`, `mobile`, `address1`, `address2`)
        VALUES (NULL, '$f_name', '$l_name', '$email',
        '$password', '$mobile', '$address1', '$address2')";
        $run_query = mysqli_query($con,$sql);
        $_SESSION["uid"] = mysqli_insert_id($con);
        $_SESSION["name"] = $f_name;
        $ip_add = getenv("REMOTE_ADDR");
        $sql = "UPDATE cart SET user_id = '$_SESSION[uid]' WHERE
ip_add='$ip_add' AND user_id = -1";
        if(mysqli_query($con,$sql)){
            echo "register_success";
            echo "<script> location.href='store.php'; </script>";
            exit;
    }
  }
  }

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 108


  
}

?>

Filename: store.php

<?php
include 'header.php';
?>
     <script id="jsbin-javascript">
(function (global) {
    if(typeof (global) === "undefined")
  {
        throw new Error("window is undefined");
  }
    var _hash = "!";
    var noBackPlease = function () {
        global.location.href += "#";
    
        global.setTimeout(function () {
            global.location.href += "!";
        }, 50);
    };  
  
    global.onhashchange = function () {
        if (global.location.hash !== _hash) {
            global.location.hash = _hash;
    }
    };
    global.onload = function () {        
        noBackPlease();
    
        document.body.onkeydown = function (e) {
            var elm = e.target.nodeName.toLowerCase();
            if (e.which === 8 && (elm !== 'input' && elm  !== 'textarea')) {
                e.preventDefault();
      }
      
            e.stopPropagation();

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 109


        };      
    };
})(window);
</script>
      <div class="main main-raised">
    
        <div class="section">
            <!-- container -->
            <div class="container">
                <!-- row -->
                <div class="row">
                    <!-- ASIDE -->
                    <div id="aside" class="col-md-3">
                        <!-- aside Widget -->
                        <div id="get_category">
                        </div>
                        <!-- /aside Widget -->

                        <!-- aside Widget -->


                        <div class="aside">
                            <h3 class="aside-title">Price</h3>
                            <div class="price-filter">
                                <div id="price-slider" class="noUi-target noUi-ltr noUi-
horizontal"><div class="noUi-base"><div class="noUi-origin" style="left:
0%;"><div class="noUi-handle noUi-handle-lower" data-handle="0"
tabindex="0" role="slider" aria-orientation="horizontal" aria-valuemin="0.0"
aria-valuemax="100.0" aria-valuenow="0.0" aria-valuetext="1.00" style="z-
index: 5;"></div></div><div class="noUi-connect" style="left: 0%; right:
0%;"></div><div class="noUi-origin" style="left: 100%;"><div class="noUi-
handle noUi-handle-upper" data-handle="1" tabindex="0" role="slider" aria-
orientation="horizontal" aria-valuemin="0.0" aria-valuemax="100.0" aria-
valuenow="100.0" aria-valuetext="999.00" style="z-index:
4;"></div></div></div></div>
                                <div class="input-number price-min">
                                    <input id="price-min" type="number">
                                    <span class="qty-up">+</span>
                                    <span class="qty-down">-</span>
                                </div>
                                <span>-</span>
                                <div class="input-number price-max">
                                    <input id="price-max" type="number">
                                    <span class="qty-up">+</span>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 110


                                    <span class="qty-down">-</span>
                                </div>
                            </div>
                        </div>
                        <!-- /aside Widget -->

                        <!-- aside Widget -->


                        <div id="get_brand">
                        </div>
                        <!-- /aside Widget -->

                        <!-- aside Widget -->


                        <div class="aside">
                            <h3 class="aside-title">Top selling</h3>
                            <div id="get_product_home">
                                <!-- product widget -->
                
                                <!-- product widget -->
                            </div>
                        </div>
                        <!-- /aside Widget -->
                    </div>
                    <!-- /ASIDE -->

                    <!-- STORE -->


                    <div id="store" class="col-md-9">
                        <!-- store top filter -->
                        <div class="store-filter clearfix">
                            <div class="store-sort">
                                <label>
                                    Sort By:
                                    <select class="input-select">
                                        <option value="0">Popular</option>
                                        <option value="1">Position</option>
                                    </select>
                                </label>

                                <label>
                                    Show:
                                    <select class="input-select">
                                        <option value="0">20</option>
                                        <option value="1">50</option>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 111


                                    </select>
                                </label>
                            </div>
                            <ul class="store-grid">
                                <li class="active"><i class="fa fa-th"></i></li>
                                <li><a href="#"><i class="fa fa-th-list"></i></a></li>
                            </ul>
                        </div>
                        <!-- /store top filter -->

                        <!-- store products -->


                        <div class="row" id="product-row">
                        <div class="col-md-12 col-xs-12" id="product_msg">
                    </div>
                            <!-- product -->
                            <div id="get_product">
                            <!--Here we get product jquery Ajax Request-->
                        </div>
              
                            <!-- /product -->
                        </div>
                        <!-- /store products -->

                        <!-- store bottom filter -->


                        <div class="store-filter clearfix">
                            <span class="store-qty">Showing 20-100 products</span>
                            <ul class="store-pagination" id="pageno">
                                <li ><a class="active" href="#aside">1</a></li>
                
                                <li><a href="#"><i class="fa fa-angle-right"></i></a></li>
                            </ul>
                        </div>
                        <!-- /store bottom filter -->
                    </div>
                    <!-- /STORE -->
                </div>
                <!-- /row -->
            </div>
            <!-- /container -->
        </div>
</div>
<?php

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 112


include "newslettter.php";
include "footer.php";
?>

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 113


2. Data Entry Screens

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 114


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 115
ASHUTOSH MAZUMDAR|ROLL NO: 40Page 116
ASHUTOSH MAZUMDAR|ROLL NO: 40Page 117
C. Validations

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 118


1. Test Cases
What is Test Case? “A Test Case has a component that describes an
input, action or event expected response, to determine if a feature of an
application is working correctly.” Software testing can be stated as the process
of validating and verifying that a computer program/application/product: 
Meets the requirements that guided its design and development.  Works as
expected  Can be implemented with the same characters.  And satisfies the
needs of Stakeholders.
Why we Write Test Case? A Test Case in Software Engineering is a set
of conditions or variables under which a tester will determine whether an
application , software system or one of its feature is working as it was
originally established for it to do. The basic objective to write test case is to
vali=date te testing coverage for the application. Test Cases bring some sort of
standardization and minimize the ad-hoc approach in testing.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 119


2. Test Data
List of variables and possible values used in the test case. You can list
specific values or describe value ranges. The test case should be performed once
for each combination Of values. These values written in set notation one per
line. E.g.; Login ID {Valid login, invalid login, login empty}
1) Username {Valid login, invalid login, login empty}
2) Name {Name cannot be blank, Name should be a string}
3) Email {Invalid email id, Email id is a compulsory attribute}
4) Validation Summary-Show pop ups at the top of the page
Steps to carry out the test.
See step formatting rules below:
1. Visit Login page
2. Enter User Name
3. Enter Password Click Login
Actual Results:
….Empty username and empty password Here you have to paste your empty
user name and password field.. along with message box in alert type message
box………. After than invalid username and password image along with
msgbox….
Comments:
If username and password are correctly entered only then you will be taken to
next page.

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 120


3. Test Results

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 121


ASHUTOSH MAZUMDAR|ROLL NO: 40Page 122
D. Report Layout

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 123


File Name: rptReceipt.rpt

File Name: rptBookingList.rpt

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 124


E. References And Bibliography

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 125


References
1. R. Pressman, “Software Engineering [A Practitioner’s Approach].
2. 6th Edition, Tata McGraw Hill.
3. Murach’s Visual Basic 2008 by Anne Boehm.
4. Beginning ASP.NET 3.5 in VB 2008, Second edition, Mathew
McDonald.
5. Building Web Applications with UML – 2nd Edition by Jim
Conallen.
6. http://www.dotnetspder.com
7. http://www.wikipedia.com
8. http://www.developer.com

ASHUTOSH MAZUMDAR|ROLL NO: 40Page 126

You might also like