0% found this document useful (0 votes)
31 views19 pages

Dharsan Bharani

y

Uploaded by

vithyamithun892
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views19 pages

Dharsan Bharani

y

Uploaded by

vithyamithun892
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 19

INTRODUCTION

Online mobile shopping is the process whereby consumers directly buy goods,
services, etc. from a seller interactively in real-time without an intermediary service over
the internet. Online shopping is the process of buying goods and services from merchants
who sell on the internet. Since the emergence of the world wide web, merchants have
sought to sell their products to people who surf the internet. Shoppers can visit web stores
from the comfort of their homes and shop as they sit in front of the computer. Consumers
buy a variety of items from online stores.
In fact, people can purchase just about anything from companies that provide their
products online. Mobiles and laptops are among the hundreds of product consumers can
buy from an online store. Many people choose to conduct shopping online because of the
convenience.
Online shopping allows you to browse through endless possibilities and even offers
merchandise that’s unavailable in stores. If you’re searching for a nice product that may
not be distributed locally, you’re sure to find what you’re looking for on the internet.
What’s even more useful is the ability to compare items, similar or not, online. You can
search through multiple stores at the same time, comparing material quality, sizes and
pricing simultaneously.
The Online Mobile Store Management System has 2 sides of the user interface
which are the Admin Panel and Client/Public-Side. The Admin Panel can be accessed only
by the management or the system admin user while the clients or possible client can freely
create their system account in order to use the important features of the system such as
shopping cart and placing orders. All of the data/information that can be found on the
client/public side can be configure or modified through the admin panel. This system also
generates a printable date-wise sales report.

1
FRONT END: PYTHON
BACK END :MYSQL

PYTHON:
Python is an interpreted, object-oriented, high-level programming language with
dynamic semantics developed by Guido van Rossum. It was originally released in
1991. Designed to be easy as well as fun, the name "Python" is a nod to the British
comedy group Monty Python. Python has a reputation as a beginner-friendly
language, replacing Java as the most widely used introductory language because it
handles much of the complexity for the user, allowing beginners to focus on fully
grasping programming concepts rather than minute details.

Python is used for server-side web development, software development,


mathematics, and system scripting, and is popular for Rapid Application
Development and as a scripting or glue language to tie existing components
because of its high-level, built-in data structures, dynamic typing, and dynamic
binding. Program maintenance costs are reduced with Python due to the easily
learned syntax and emphasis on readability. Additionally, Python's support of
modules and packages facilitates modular programs and reuse of code. Python is
an open source community language, so numerous independent programmers are
continually building libraries and functionality for it.

2
MYSQL:
MySQL is a SQL-based relational database management system for web databases.
Use MySQL for various applications, including data cleansing, data warehousing,
online shopping, logging software, and portals. MySQL can store everything from
a single record to a complete product inventory. The application of MySQL varies
based on the need. It can associate with any scripting language like PHP or Perl
and create websites.

3
Source Code:
import mysql.connector
con=mysql.connector.connect(host="localhost",user="root",password="admin",database="
mobile_shopping")
cur=con.cursor()
cur.execute("create table products(id int,name varchar(20),price int,original_price int);")
cur.execute("insert into products values(1001,'Acer',50000,54000);")
cur.execute("insert into products values(1002,'vivo',30000,34000);")
cur.execute("insert into products values(1003,'oppo',20000,21000);")
cur.execute("insert into products values(1004,'Apple',33000,34000);")
cur.execute("insert into products values(1005,'Dell',13000,14000);")
cur.execute("insert into products values(1006,'Hp',20000,24000);")
con.commit()

def adminLoginWindow():
print("=====================")
print("1.Display Menu")
print("2.Add Product")
print("3.Remove Product")
print("4.Products goods available")
print("5.Logout")
print("=========================================")

def adminDisplayMenuWindow():
cur.execute("select * from products;")

4
data=cur.fetchall()
for i in data:
print(i)
def addproducts():
L=[]
id=int(input("Enter the id: "))
L.append(id)
name=input("Enter the Name : ")
L.append(name)
price=int(input("Enter price: "))
L.append(price)
original_price=int(input("Enter original price: "))
L.append(original_price)
cont=(L)
sql="insert into products(id,name,price,original_price) values (%s,%s,%s,%s)"
cur.execute(sql,cont)
con.commit()

def removeproducts():
id = int(input("Enter the id need to be deleted : "))
r=(id,)
sql="delete from products where id=%s"
cur.execute(sql,r)
con.commit()
print("Deleting item....")
print("deleted successfully")
5
adminDisplayMenuWindow()

def availableproducts():
print("\n")
cur.execute("select * from products;")
data=cur.fetchall()
Total=cur.rowcount
print("\nTotal available goods is : ", Total)

def logoutwindow():
login()
print("1. Admin Login Window")
print("2. User Login Window")
choice = int(input("Please enter user choice : "))
if choice==1:
adminLoginWindow()
elif choice==2:
userLoginWindow()

def adminOptions():
choice = int(input("Please enter user choice : "))
if choice == 1:
adminDisplayMenuWindow()
print("\n===================================================\n")
adminLoginWindow()

6
print("\n===================================================\n")
adminOptions()
elif choice == 2:
adminDisplayMenuWindow()
print("\n===================================================\n")
addproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 3:
adminDisplayMenuWindow()
print("\n===================================================\n")
removeproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 4:
availableproducts()
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()
elif choice == 5:

7
logoutwindow()
else:
print("\nInvalid Choice. Please enter valid choice")
print("\n===================================================\n")
adminLoginWindow()
print("\n===================================================\n")
adminOptions()

def userLoginWindow():
print("=====================\n")
print("1.Display Menu")
print("2.Place order")
print("3.Logout")
print("\n======================")
def userDisplayMenuWindow():
cur.execute("select * from products;")
data=cur.fetchall()
for i in data:
print(i)
def user_id():
userDisplayMenuWindow()
p_id = int(input("\nEnter the id : "))
def placeOrder():
order_number = 10
userDisplayMenuWindow()

8
p_id = int(input("\nEnter the id : "))
conform = input("\nDo you want to place an order on the above shown product : Y/N ")
if conform == 'Y' or conform == 'y':
print("\nSuccessfully placed the order on the product")
order_number += 1
print("Your order number is : ", order_number)
cur.execute("delete from products where id=%s" %(p_id,))
#d["Available"] -= 1

elif conform == 'N' or conform == 'n':


print("The order is not placed. You can carry on with you purchase. Happy
shopping!!!!")

else:
print("\nYou have entered wrong option. Please enter again\n")
conform = input("\nDo you want to place an order on the above shown product :
Y/N ")

print("\nAvailable products : \n")


userDisplayMenuWindow()
def userChoiceOptions():
choice = int(input("Please enter user choice : "))
if choice == 1:
userDisplayMenuWindow()
print("\n===================================================\n")
userLoginWindow()

9
print("\n===================================================\n")
userChoiceOptions()
elif choice == 2:
placeOrder()
print("\n===================================================\n")
userLoginWindow()
print("\n===================================================\n")
userChoiceOptions()
elif choice == 3:
logoutwindow()
else:
print("Invalid Choice. Please enter valid choice")
def login():
tp = input("Enter As an Admin/Enter As User [Type A for Admin/ Type U for User] : ")
if tp == 'A' or tp == 'a':
adminLoginWindow()
adminOptions()
elif tp == 'U' or tp == 'u':
userLoginWindow()
userChoiceOptions()
else:
print("Invalid Option. Enter valid type")
login()

10
Python output:

11
12
13
14
15
16
17
MYSQL Output:

18
19

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy