Professional Documents
Culture Documents
Lohesh - Documentation
Lohesh - Documentation
Lohesh - Documentation
PROBLEM DEFINITION:
Dairy products, derived from milk, encompass a wide range of nutritious
foods including milk, cheese, yogurt, and butter. These products are rich in
calcium, protein, and vitamins, making them indispensable for maintaining a
balanced diet. The dairy industry not only contributes to human nutrition but also
supports livelihoods within farming communities and the larger food processing
sector. Accessing quality dairy products is necessary in order to have a quality
lifestyle.
OBJECTIVE:
The main objective of this project is to bring in a facility of purchasing large
quantities of dairy products through franchises, in just a few clicks from your home
hassle-free. The user is provided with a wide variety of dairy products. All the
products are classified into groups such as milk, cheese, ice-cream, yogurt and
butter. Each category has more than 50 different varieties of products. This project
is for making ordering dairy products through franchises simpler and also user
friendly.
METHODOLOGY:
The interface consists of the following options:
1. Admin
2. Customer
3. Exit
1
1.Admin:
This module is for the administrators who have a specific username and
password to make sure that only they can access it. After a successful login, they
can perform the following actions:
- View franchises
- Add a new franchise
- Delete existing franchise
- Add new products
- Delete existing products
- View past order of customers
- Logout
Here the administrator has access to adding new products or delete existing
products by providing the required details about the products.
They can also view past orders of customers date wise i.e. most recent orders
or the oldest, orders made on a particular date or the orders of a particular
customer.
2.Customer:
This module provides the customers to either log in if the already have an
existing account or sign-up and create new one if they are new. The customers can
perform the following actions:
- Order products.
- View their past orders.
- Cancel their order.
- View details about adding their franchise.
- Change their password.
Here the customers can place new orders, view their past orders or even
delete any order if needed. If the customer is interested in adding their franchise,
they can view the details regarding that.
2
Tools/Platform used:
In this project we’ve used python programming language as the front end
and MySQL as the back and for implementing it.
3
SOURCE CODE
#--------------------------------------------------------------------------------------------------
-----------------
4
orders="create table if not exists orders(orderno int primary key not null
AUTO_INCREMENT,uname varchar(70) ,name varchar(70), qty int(10), price int,
date date)"
cursor.execute(orders)
abd="create table if not exists franchise(sno int primary key not null
AUTO_INCREMENT, name varchar(50), city varchar(50), address varchar(70),
email varchar(30), mobile varchar(15), jdate date, s_years int, fid int)"
cursor.execute(abd)
bd.commit()
#--------------------------------------------------------------------------------------------------
-----------------
#--------------------------------------------------------------------------------------------------
-----------------
cursor.execute("SELECT * FROM product")
result = cursor.fetchone()
if not result:
cursor.execute("insert into product values(1, 'Milk', 0901)")
cursor.execute("insert into product values(2, 'Cheese', 1603)")
cursor.execute("insert into product values(3, 'Ice Cream', 0908)")
cursor.execute("insert into product values(4, 'Yougurt', 2803)")
cursor.execute("insert into product values(5, 'Butter', 0710)")
#--------------------------------------------------------------------------------------------------
-----------------
5
cursor.execute("SELECT * FROM milk")
result = cursor.fetchone()
if not result:
cursor.execute("insert into milk values(1,'M0101', 'Skimmed Milk', '1 L', 50)")
cursor.execute("insert into milk values(2,'M0102', 'Low-Fat Milk', '1 L', 70)")
cursor.execute("insert into milk values(3,'M0103','Whole Milk', '1 L', 60)")
cursor.execute("insert into milk values(4, 'M0104', 'Raw Milk', '1 L', 80)")
cursor.execute("insert into milk values(5,'M0105', 'Pasteurized Milk', '1 L',50)")
cursor.execute("insert into milk values(6,'M0106', 'Ultra-High Temperature
milk', '1 L', 60)")
cursor.execute("insert into milk values(7,'M0107', 'Organic milk', '1 L', 70)")
cursor.execute("insert into milk values(8,'M0108', 'Homogenized milk', '1 L',
50)")
cursor.execute("insert into milk values(9, 'M0109', 'Condensed milk', '1 L', 80)")
cursor.execute("insert into milk values(10,'M0110', 'Evaporated milk', '1 L',
60)")
cursor.execute("insert into milk values(11,'M0111', 'Sweetened condensed milk',
'1 L', 80)")
cursor.execute("insert into milk values(12,'M0112', 'Powdered milk', '1 L',50)")
cursor.execute("insert into milk values(13,'M0113', 'Flavored milk', '1 L', 70)")
cursor.execute("insert into milk values(14,'M0114', 'Chocolate milk', '1 L', 80)")
cursor.execute("insert into milk values(15,'M0115', 'Strawberry milk', '1 L',50)")
cursor.execute("insert into milk values(16,'M0116', 'Banana milk', '1 L', 60)")
cursor.execute("insert into milk values(17,'M0117', 'Vanilla milk', '1 L', 60)")
cursor.execute("insert into milk values(18,'M0118', 'Coffee-flavored milk', '1 L',
60)")
cursor.execute("insert into milk values(19,'M0119', 'Buttermilk', '1 L',50)")
cursor.execute("insert into milk values(20,'M0120', 'Cultured buttermilk', '1 L',
70)")
cursor.execute("insert into milk values(21,'M0121', 'Acidophilus milk', '1 L',
80)")
cursor.execute("insert into milk values(22,'M0122', 'Lactose-free milk', '1 L',
70)")
cursor.execute("insert into milk values(23,'M0123', 'Goat milk', '1 L', 80)")
cursor.execute("insert into milk values(24,'M0124', 'Sheep milk', '1 L',50)")
6
cursor.execute("insert into milk values(25,'M0125', 'Buffalo milk', '1 L', 60)")
cursor.execute("insert into milk values(26,'M0126', 'Camel milk', '1 L', 60)")
cursor.execute("insert into milk values(27,'M0127', 'Donkey milk', '1 L', 80)")
cursor.execute("insert into milk values(28,'M0128', 'Horse milk', '1 L',50)")
cursor.execute("insert into milk values(29,'M0129', 'Soy milk', '1 L', 80)")
cursor.execute("insert into milk values(30,'M0130', 'Almond milk', '1 L', 80)")
cursor.execute("insert into milk values(31,'M0131', 'Coconut milk', '1 L', 60)")
cursor.execute("insert into milk values(32,'M0132', 'Rice milk', '1 L', 80)")
cursor.execute("insert into milk values(33,'M0133', 'Oat milk', '1 L',50)")
cursor.execute("insert into milk values(34,'M0134', 'Cashew milk', '1 L', 80)")
cursor.execute("insert into milk values(35,'M0135', 'Hazelnut milk', '1 L', 60)")
cursor.execute("insert into milk values(36,'M0136', 'Macadamia mik', '1 L', 80)")
cursor.execute("insert into milk values(37,'M0137', 'Quinoa milk', '1 L',50)")
cursor.execute("insert into milk values(38,'M0138', 'Hemp mik', '1 L', 80)")
cursor.execute("insert into milk values(39,'M0139', 'Pea milk', '1 L', 80)")
cursor.execute("insert into milk values(40,'M0140', 'Walnut milk', '1 L',50)")
cursor.execute("insert into milk values(41,'M0141', 'Pecan milk', '1 L', 80)")
cursor.execute("insert into milk values(42,'M0142', 'Pistachio milk', '1 L', 60)")
cursor.execute("insert into milk values(43,'M0143', 'Brazil nut milk', '1 L', 80)")
cursor.execute("insert into milk values(44,'M0144', 'Sunflower milk', '1 L', 60)")
cursor.execute("insert into milk values(45,'M0145', 'Flax milk', '1 L', 80)")
cursor.execute("insert into milk values(46,'M0146', 'Pumpkin seed milk', '1 L',
80)")
cursor.execute("insert into milk values(47,'M0147', 'Sesame milk', '1 L',50)")
cursor.execute("insert into milk values(48,'M0148', 'Tiger nut milk', '1 L', 80)")
cursor.execute("insert into milk values(49,'M0149', 'Watermelon seed milk', '1
L', 70)")
cursor.execute("insert into milk values(50,'M0150', 'Black sesame milk', '1 L',
70)")
cursor.execute("insert into milk values(51,'M0151', 'Chia seed milk', '1 L', 80)")
cursor.execute("insert into milk values(52,'M0152', 'Walnut-cashew milk', '1
L',50)")
cursor.execute("insert into milk values(53,'M0153', 'Rice-almond milk', '1 L',
80)")
cursor.execute("insert into milk values(54,'M0154', 'Barley milk', '1 L', 80)")
cursor.execute("insert into milk values(55,'M0155', 'Spelt milk', '1 L',50)")
7
cursor.execute("insert into milk values(56,'M0156', 'Corn milk', '1 L', 80)")
cursor.execute("insert into milk values(57,'M0157', 'Peanut milk', '1 L', 80)")
cursor.execute("insert into milk values(58,'M0158', 'Walnut-coconut milk', '1 L',
60)")
cursor.execute("insert into milk values(59,'M0159', 'Walnut-hazelnut milk', '1 L',
60)")
cursor.execute("insert into milk values(60,'M0160', 'Walnut-soy milk', '1 L',
80)")
cursor.execute("insert into milk values(61,'M0161','Cashew-oat mik', '1 L', 60)")
cursor.execute("insert into milk values(62,'M0162', 'Cashew-coconut milk', '1 L',
70)")
cursor.execute("insert into milk values(63,'M0163', 'Cashew-hazelnut milk', '1
L', 80)")
cursor.execute("insert into milk values(64,'M0164', 'Cashew-rice milk', '1 L',
60)")
cursor.execute("insert into milk values(65,'M0165', 'Cashew-quinoa milk', '1 L',
80)")
cursor.execute("insert into milk values(66,'M0166', 'Cashew-pea milk', '1 L',
80)")
cursor.execute("insert into milk values(67,'M0167', 'Cashew-walnut milk', '1 L',
60)")
cursor.execute("insert into milk values(68,'M0168', 'Cashew-pecan milk', '1 L',
60)")
cursor.execute("insert into milk values(69,'M0169', 'Cashew-pistachio milk', '1
L', 80)")
cursor.execute("insert into milk values(70,'M0170', 'Cashew-brazil nut milk', '1
L', 80)")
cursor.execute("insert into milk values(71,'M0171', 'Cashew-sunflower milk', '1
L', 60)")
cursor.execute("insert into milk values(72,'M0172', 'Cashew-flax milk', '1 L',
80)")
cursor.execute("insert into milk values(73,'M0173', 'Cashew-pumpkin seed
milk', '1 L',50)")
cursor.execute("insert into milk values(74,'M0174', 'Cashew-seasame milk', '1
L',50)")
cursor.execute("insert into milk values(75,'M0175', 'Cashew-tiger nut milk', '1
L',50)")
8
cursor.execute("insert into milk values(76,'M0176', 'Cashew-black sesame milk',
'1 L', 70)")
cursor.execute("insert into milk values(77,'M0177', 'Cashew-chia seed milk', '1
L', 70)")
cursor.execute("insert into milk values(78,'M0178', 'Cashew-corn milk', '1 L',
80)")
cursor.execute("insert into milk values(79,'M0179', 'Cashew-peanut milk', '1
L',50)")
bd.commit()
9
cursor.execute("insert into cheese values(23,'C0123','Munster',' 500 g',450)")
cursor.execute("insert into cheese values(24,'C0124','Edam',' 500 g',390)")
cursor.execute("insert into cheese values(25,'C0125','Cottage cheese',' 500
g',560)")
cursor.execute("insert into cheese values(26,'C0126','Queso fresco',' 500
g',450)")
cursor.execute("insert into cheese values(27,'C0127','Queso blanco',' 500
g',390)")
cursor.execute("insert into cheese values(28,'C0128','Edam cheese',' 500
g',450)")
cursor.execute("insert into cheese values(29,'C0129','Gouda cheese',' 500
g',620)")
cursor.execute("insert into cheese values(30,'C0130','Parmesan cheese',' 500
g',450)")
cursor.execute("insert into cheese values(31,'C0131','Cheddar cheese',' 500
g',620)")
cursor.execute("insert into cheese values(32,'C0132','Mozzarella cheese',' 500
g',390)")
cursor.execute("insert into cheese values(33,'C0133','Swiss cheese',' 500
g',450)")
cursor.execute("insert into cheese values(34,'C0134','Provolone cheese',' 500
g',450)")
cursor.execute("insert into cheese values(35,'C0135','Monterey Jack cheese','
500 g',450)")
cursor.execute("insert into cheese values(36,'C0136','Brie cheese',' 500 g',560)")
cursor.execute("insert into cheese values(37,'C0137','Blue cheese',' 500 g',390)")
cursor.execute("insert into cheese values(38,'C0138','Feta cheese',' 500 g',450)")
cursor.execute("insert into cheese values(39,'C0139','Colby cheese',' 500
g',620)")
cursor.execute("insert into cheese values(40,'C0140','Camembert cheese',' 500
g',550)")
cursor.execute("insert into cheese values(41,'C0141','Ricotta cheese',' 500
g',620)")
cursor.execute("insert into cheese values(42,'C0142','Havarti cheese',' 500
g',560)")
cursor.execute("insert into cheese values(43,'C0143','Fontina cheese',' 500
g',620)")
10
cursor.execute("insert into cheese values(44,'C0144','Limburger cheese',' 500
g',390)")
cursor.execute("insert into cheese values(45,'C0145','Stilton cheese',' 500
g',450)")
cursor.execute("insert into cheese values(46,'C0146','Emmental cheese',' 500
g',620)")
cursor.execute("insert into cheese values(47,'C0147','Muenster cheese',' 500
g',450)")
cursor.execute("insert into cheese values(48,'C0148','Munster cheese',' 500
g',390)")
cursor.execute("insert into cheese values(49,'C0149','Cottage cheese',' 500
g',560)")
cursor.execute("insert into cheese values(50,'C0150','Queso fresco cheese',' 500
g',390)")
bd.commit()
12
cursor.execute("insert into icream values(34,'I0134','Cherry Vanilla', '500
g',570)")
cursor.execute("insert into icream values(35,'I0135','Blueberry Cheesecake', '500
g',570)")
cursor.execute("insert into icream values(36,'I0136','Tiramisu', '500 g',570)")
cursor.execute("insert into icream values(37,'I0137','Key Lime Pie', '500
g',570)")
cursor.execute("insert into icream values(38,'I0138','Banana Split', '500 g',380)")
cursor.execute("insert into icream values(39,'I0139','Pistachio Almond', '500
g',430)")
cursor.execute("insert into icream values(40,'I0140','Butterfinger', '500 g',570)")
cursor.execute("insert into icream values(41,'I0141','Oreo', '500 g',430)")
cursor.execute("insert into icream values(42,'I0142','Red Velvet', '500 g',430)")
cursor.execute("insert into icream values(43,'I0143','Almond Joy', '500 g',570)")
cursor.execute("insert into icream values(44,'I0144','Rocky Mountain Road',
'500 g',440)")
cursor.execute("insert into icream values(45,'I0145','Smores', '500 g',430)")
cursor.execute("insert into icream values(46,'I0146','Caramel Macchiato', '500
g',570)")
cursor.execute("insert into icream values(47,'I0147','Pralines and Cream', '500
g',430)")
cursor.execute("insert into icream values(48,'I0148','Chocolate Hazelnut', '500
g',570)")
cursor.execute("insert into icream values(49,'I0149','Chocolate Mousse', '500
g',570)")
cursor.execute("insert into icream values(50,'I0150','Irish Coffee', '500 g',430)")
cursor.execute("insert into icream values(51,'I0151','Nutella Swirl', '500
g',380)")
cursor.execute("insert into icream values(52,'I0152','White Chocolate
Raspberry', '500 g',570)")
cursor.execute("insert into icream values(53,'I0153','Lemon Sorbet', '500
g',430)")
cursor.execute("insert into icream values(54,'I0154','Mango', '500 g',570)")
cursor.execute("insert into icream values(55,'I0155','Pineapple Coconut', '500
g',430)")
cursor.execute("insert into icream values(56,'I0156','Green Tea', '500 g',380)")
13
cursor.execute("insert into icream values(57,'I0157','Pistachio Cardamom', '500
g',440)")
cursor.execute("insert into icream values(58,'I0158','Strawberry Cheesecake',
'500 g',570)")
cursor.execute("insert into icream values(59,'I0159','Blueberry', '500 g',570)")
cursor.execute("insert into icream values(60,'I0160','Coconut Almond', '500
g',570)")
cursor.execute("insert into icream values(61,'I0161','Black Raspberry', '500
g',430)")
cursor.execute("insert into icream values(62,'I0162','Espresso', '500 g',570)")
cursor.execute("insert into icream values(63,'I0163','Peppermint', '500 g',570)")
cursor.execute("insert into icream values(64,'I0164','Chocolate Coconut', '500
g',440)")
cursor.execute("insert into icream values(65,'I0165','Chocolate Mint', '500
g',430)")
cursor.execute("insert into icream values(66,'I0166','Orange Sherbet', '500
g',380)")
cursor.execute("insert into icream values(67,'I0167','Butter Pecan Praline', '500
g',570)")
cursor.execute("insert into icream values(68,'I0168','Banana Cream Pie', '500
g',570)")
cursor.execute("insert into icream values(69,'I0169','Gingerbread', '500 g',570)")
cursor.execute("insert into icream values(70,'I0170','Lavender Honey', '500
g',570)")
cursor.execute("insert into icream values(71,'I0171','Raspberry Sorbet', '500
g',380)")
cursor.execute("insert into icream values(72,'I0172','Black Forest', '500 g',440)")
cursor.execute("insert into icream values(73,'I0173','Hazelnut Praline', '500
g',570)")
cursor.execute("insert into icream values(74,'I0174','Cinnamon', '500 g',430)")
cursor.execute("insert into icream values(75,'I0175','Cheesecake Brownie', '500
g',570)")
cursor.execute("insert into icream values(76,'I0176','Pina Colada', '500 g',430)")
cursor.execute("insert into icream values(77,'I0177','Cotton Candy Swirl', '500
g',570)")
cursor.execute("insert into icream values(78,'I0178','Mango Passionfruit', '500
g',570)")
14
cursor.execute("insert into icream values(79,'I0179','Pistachio Almond Fudge',
'500 g',570)")
cursor.execute("insert into icream values(80,'I0180','Bubblegum', '500 g',430)")
cursor.execute("insert into icream values(81,'I0181','White Chocolate
Macadamia Nut', '500 g',570)")
cursor.execute("insert into icream values(82,'I0182','Lemon Poppy Seed', '500
g',430)")
cursor.execute("insert into icream values(83,'I0183','Maple Bacon', '500
g',570)")
cursor.execute("insert into icream values(84,'I0184','Chocolate Peanut Butter
Swirl', '500 g',570)")
cursor.execute("insert into icream values(85,'I0185','Caramel Apple', '500
g',570)")
cursor.execute("insert into icream values(86,'I0186','Raspberry Truffle', '500
g',430)")
cursor.execute("insert into icream values(87,'I0187','Peach', '500 g',570)")
cursor.execute("insert into icream values(88,'I0188','Pistachio Cardamom Rose',
'500 g',570)")
cursor.execute("insert into icream values(89,'I0189','Vanilla Bean', '500 g',430)")
cursor.execute("insert into icream values(90,'I0190','Honey Lavender', '500
g',440)")
cursor.execute("insert into icream values(91,'I0191','Mocha Chip', '500 g',570)")
cursor.execute("insert into icream values(92,'I0192','Cookies and Cream
Cheesecake', '500 g',570)")
cursor.execute("insert into icream values(93,'I0193','Blackberry', '500 g',430)")
cursor.execute("insert into icream values(94,'I0194','White Chocolate
Peppermint', '500 g',570)")
cursor.execute("insert into icream values(95,'I0195','Lemon Custard', '500
g',430)")
cursor.execute("insert into icream values(96,'I0196','Chai Latte', '500 g',380)")
cursor.execute("insert into icream values(97,'I0197','Caramel Pretzel', '500
g',570)")
cursor.execute("insert into icream values(98,'I0198','Maple Cinnamon', '500
g',430)")
cursor.execute("insert into icream values(99,'I0199','Toffee Crunch', '500
g',430)")
15
cursor.execute("insert into icream values(100,'I0100','Cherry Amaretto', '500
g',440)")
bd.commit()
16
cursor.execute("insert into yougur values(16,'Y0116','The Greek Gods
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(17,'Y0117','Chobani Flip Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(18,'Y0118','Icelandic Provisions
Skyr','200 ml',80)")
cursor.execute("insert into yougur values(19,'Y0119','Dannon Light & Fit
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(20,'Y0120','Two Good Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(21,'Y0121','Oikos Triple Zero Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(22,'Y0122','Brown Cow Cream Top
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(23,'Y0123','Yoplait Plenti Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(24,'Y0124','Fage Total 2% Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(25,'Y0125','Noosa Greek Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(26,'Y0126','Chobani Less Sugar Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(27,'Y0127','Dannon Activia Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(28,'Y0128','Siggis Simple Sides
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(29,'Y0129','Green Valley Creamery
Lactose-Free Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(30,'Y0130','Nancys Organic Whole
Milk Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(31,'Y0131','Fage TruBlend Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(32,'Y0132','Yoplait Greek 100 Protein
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(33,'Y0133','The Coconut Cult
Probiotic Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(34,'Y0134','So Delicious Dairy Free
Yogurt','200 ml',80)")
17
cursor.execute("insert into yougur values(35,'Y0135','Forager Project Dairy-Free
Cashewgurt','200 ml',80)")
cursor.execute("insert into yougur values(36,'Y0136','Silk Dairy-Free Yogurt
Alternative','200 ml',80)")
cursor.execute("insert into yougur values(37,'Y0137','Good Karma Dairy-Free
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(38,'Y0138','Kite Hill Almond Milk
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(39,'Y0139','Daiya Greek Yogurt
Alternative','200 ml',80)")
cursor.execute("insert into yougur values(40,'Y0140','Anitas Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(41,'Y0141','Dream Blends Almond
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(42,'Y0142','Nancys Organic Probiotic
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(43,'Y0143','Alpro Soy Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(44,'Y0144','Tillamook Farmstyle
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(45,'Y0145','Wallaby Organic Aussie
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(46,'Y0146','Karoun Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(47,'Y0147','Chobani Complete Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(48,'Y0148','Alpina Greek Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(49,'Y0149','The Coconut
Collaborative Coconut Milk Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(50,'Y0150','Alove Aloe Vera
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(51,'Y0151','La Fermière Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(52,'Y0152','Maple Hill Creamery
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(53,'Y0153','Anderson Erickson Greek
Yogurt','200 ml',80)")
18
cursor.execute("insert into yougur values(54,'Y0154','Emmi Swiss Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(55,'Y0155','Voskos Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(56,'Y0156','Almond Dream Almond
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(57,'Y0157','The Icelandic Milk and
Skyr Corporation Skyr','200 ml',80)")
cursor.execute("insert into yougur values(58,'Y0158','YoCrunch Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(59,'Y0159','Yami Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(60,'Y0160','Clover Greek Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(61,'Y0161','Redwood Hill Farm Goat
Milk Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(62,'Y0162','Lala Greek Yogurt
Smoothie','200 ml',80)")
cursor.execute("insert into yougur values(63,'Y0163','Wallaby Organic
Kefir','200 ml',80)")
cursor.execute("insert into yougur values(64,'Y0164','R.W. Knudsen Family
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(65,'Y0165','Fruyo High Protein
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(66,'Y0166','Lactaid Lactose-Free
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(67,'Y0167','Cascade Fresh
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(68,'Y0168','GoodBelly Probiotic
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(69,'Y0169','Windy Ridge Farm
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(70,'Y0170','Greek Gods Seriously
Indulgent Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(71,'Y0171','Brown Cow Non-GMO
Project Verified Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(72,'Y0172','Annies Organic
Yogurt','200 ml',80)")
19
cursor.execute("insert into yougur values(73,'Y0173','EVOLVE Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(74,'Y0174','Glenisk Organic
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(75,'Y0175','Karoun Greek Style
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(76,'Y0176','WhiteWave Foods Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(77,'Y0177','Mountain High
Yoghurt','200 ml',80)")
cursor.execute("insert into yougur values(78,'Y0178','Natural Valley Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(79,'Y0179','Sweet Cow Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(80,'Y0180','Wallaby Organic Nonfat
Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(81,'Y0181','Yoplait Lactose-Free
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(82,'Y0182','Ellenos Greek
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(83,'Y0183','Alpenrose Dairy
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(84,'Y0184','Lifeway Greek Style
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(85,'Y0185','Oykos Greek Style
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(86,'Y0186','St. Benoit Creamery
Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(87,'Y0187','Blue Hill Yogurt','200
ml',80)")
cursor.execute("insert into yougur values(88,'Y0188','Chobani Less Sugar
Crunch Greek Yogurt','200 ml',80)")
cursor.execute("insert into yougur values(89,'Y0189','Yulu ','200 ml',80)")
cursor.execute("insert into yougur values(90,'Y0190','Powerful ','200 ml',80)")
bd.commit()
20
result = cursor.fetchone()
if not result:
cursor.execute("insert into butter values(1,'B0101','Salted', '100g', 80)")
cursor.execute("insert into butter values(2,'B0102','Unsalted ','100g',85)")
cursor.execute("insert into butter values(3,'B0103','Organic ','100g',80)")
cursor.execute("insert into butter values(4,'B0104','Grass-fed ','100g',90)")
cursor.execute("insert into butter values(5,'B0105','Cultured ','100g',80)")
cursor.execute("insert into butter values(6,'B0106','European-style ','100g',100)")
cursor.execute("insert into butter values(7,'B0107','Clarified
(Ghee)','100g',80)")
cursor.execute("insert into butter values(8,'B0108','Light ','100g',95)")
cursor.execute("insert into butter values(9,'B0109','Whipped ','100g',90)")
cursor.execute("insert into butter values(10,'B0110','Flavored ','100g',120)")
cursor.execute("insert into butter values(11,'B0111','Garlic ','100g',80)")
cursor.execute("insert into butter values(12,'B0112','Herb ','100g',100)")
cursor.execute("insert into butter values(13,'B0113','Truffle ','100g',90)")
cursor.execute("insert into butter values(14,'B0114','Lemon ','100g',85)")
cursor.execute("insert into butter values(15,'B0115','Cinnamon ','100g',95)")
cursor.execute("insert into butter values(16,'B0116','Honey ','100g',150)")
cursor.execute("insert into butter values(17,'B0117','Maple ','100g',90)")
cursor.execute("insert into butter values(18,'B0118','Pumpkin ','100g',100)")
cursor.execute("insert into butter values(19,'B0119','Chocolate ','100g',100)")
cursor.execute("insert into butter values(20,'B0120','Vanilla ','100g',120)")
cursor.execute("insert into butter values(21,'B0121','Berry ','100g',150)")
cursor.execute("insert into butter values(22,'B0122','Almond ','100g',80)")
cursor.execute("insert into butter values(23,'B0123','Pistachio ','100g',100)")
cursor.execute("insert into butter values(24,'B0124','Cashew ','100g',85)")
cursor.execute("insert into butter values(25,'B0125','Hazelnut ','100g',95)")
cursor.execute("insert into butter values(26,'B0126','Walnut ','100g',90)")
cursor.execute("insert into butter values(27,'B0127','Peanut ','100g',80)")
cursor.execute("insert into butter values(28,'B0128','Macadamia ','100g',85)")
cursor.execute("insert into butter values(29,'B0129','Sunflower ','100g',100)")
cursor.execute("insert into butter values(30,'B0130','Sesame ','100g',90)")
bd.commit()
21
#--------------------------------------------------------------------------------------------------
---------------
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" LOGIN
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#Login Process
print()
uname=input("Enter username : ")
print()
pwd=input("Enter password : ")
print()
login=False
sql="select * from login"
cursor.execute(sql)
for i in cursor:
if i[1]==uname and i[2]==pwd:
print("Hi",i[1],", you've successfully logged into our Creamery Farm")
print()
login=True
continue
if login==True:
homepage(uname)
elif login==False:
print("Invalid Credentials")
#--------------------------------------------------------------------------------------------------
---------------
22
#SIGN-UP FOR CUSTOMERS
uname=''
na=''
adres=''
def signup():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" SIGN-UP
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
global na
print()
na=input('Enter you name : ')
print()
uname=input("Enter your username : ")
signup=True
if len(uname)>20:
print("Your username can only contain 20 characters!")
signup=False
else:
sql="select * from login"
cursor.execute(sql)
for i in cursor:
if i[0]==uname:
print("Username already exists")
signup=False
continue
if signup:
print()
bd.commit()
while True:
23
pwd=input("Enter your password : ")
print()
repwd=input("Re-enter your password : ")
if pwd==repwd:
print()
break
else:
print("Password doesn't match")
continue
while True:
mobile=input("Enter your mobile number : ")
print()
if len(mobile)!=10:
while True:
email=input("Enter the Email Address : ")
if '@' and '.com' not in email:
print("Invalid Email id!")
print()
continue
else:
break
global adres
print()
adres=input("Enter your Address : ")
today =datetime.today()
todayform = today.strftime("%d/%m/%y")
24
doj=todayform
sql1="insert into
login(name,username,password,email,mobile,date_of_join,address)values('{}','{}','
{}','{}','{}','{}','{}')".format(na,uname,pwd,email,mobile,doj,adres)
cursor.execute(sql1)
bd.commit()
print()
print("Account created successfully!")
print()
login()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
bd.commit()
#--------------------------------------------------------------------------------------------------
---------------
#VIEW PRODUCTS
def all_products():
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DAIRY PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1 - Milk")
print()
print("2 - Cheese")
25
print()
print("3 - Ice-Cream")
print()
print("4 - Yogurt")
print()
print("5 - Butter")
print()
print("6 - Exit")
print()
choice=input("Enter choice : ")
print()
if choice=='1':
milk()
elif choice=='2':
cheese()
elif choice=='3':
ice_cream()
elif choice=='4':
yougurt()
elif choice=='5':
butter()
elif choice=='6':
print()
print("~ EXITED ~")
print()
break
else:
break
def milk():
26
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" MILK
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("PID","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from milk")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
def cheese():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" CHEESE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("PID","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from cheese")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
27
def ice_cream():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ICE-CREAM
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from icream")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
def yougurt():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" YOGURT
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("PID","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from yougur")
l=cursor.fetchall()
for i in l:
28
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
def butter():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" BUTTER
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:20}\t".format("PID","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from butter")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:20s}\t{:20}\t".format(i[1],i[2],i[3],i[4]).center(140))
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#--------------------------------------------------------------------------------------------------
---------------
#CHANGE PASSWORD
def changepassword(uname):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(' CHANGE PASSWORD
')
29
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
pwd=input("Enter new password : ")
print()
if len(pwd)>20:
print("Your password can only contain 20 characters!")
else:
repwd=input("Re-enter new password : ")
print()
if pwd==repwd:
sql2="update login set password='"+pwd+"' where username='"+uname+"'"
cursor.execute(sql2)
bd.commit()
print("Password changed successfully")
else:
print("Invalid credentials")
#--------------------------------------------------------------------------------------------------
---------------
#HOMEPAGE
def homepage(uname):
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" HOMEPAGE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1 - View All Products")
print()
30
print("2 - Order")
print()
print("3 - Cancel Order")
print()
print("4 - View Past Orders")
print()
print("5 - View Franchise Details")
print()
print("6 - Change Password")
print()
print('7 - Exit')
print()
choice=input("Enter choice : ")
print()
if choice=='1':
all_products()
elif choice=='2':
order(uname)
elif choice=='3':
cancel_order(uname)
elif choice=='4':
view_order(uname)
elif choice=='5':
fra()
elif choice=='6':
changepassword(uname)
elif choice=='7':
break
else:
31
continue
#--------------------------------------------------------------------------------------------------
---------------
def fra():
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW FRANCHISE DETAILS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('''The following are the amount to paid for adding the franchise:
1. Rs. 1,90,000 - 1 year
2. Rs. 3,80,000 - 2 years
3. Rs. 5,70,000 - 3 years
For any further queries and information please contact the Admin.''')
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#--------------------------------------------------------------------------------------------------
---------------
#ORDER
def order(uname):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DAIRY PRODUCTS
")
32
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
while True:
print()
print("1 - Milk")
print()
print("2 - Cheese")
print()
print("3 - Ice-Cream")
print()
print("4 - Yogurt")
print()
print("5 - Butter")
print()
print("6 - Exit")
print()
if choice=='1':
milks()
elif choice=='2':
cheeses()
elif choice=='3':
ice_creams()
elif choice=='4':
yougurts()
elif choice=='5':
butters()
33
elif choice=='6':
payment(uname)
print("~ EXITED ~")
break
else:
break
def milks():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" MILK
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from milk")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('Choose a product from the above:')
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
34
hj=lmn[:5]+lmn[6:8]+lmn[9:]
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
n="select name from milk where pid='{}'".format(pn)
cursor.execute(n)
for i in cursor:
prn=i[0]
u="select username from login "
cursor.execute(u)
for i in cursor:
j=i[0]
sql1="insert into orders(uname,name,qty,price,date)values('{}','{}',{},
{},'{}')".format( j,prn,qt,b,hj)
cursor.execute(sql1)
bd.commit()
def cheeses():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
35
print(" CHEESE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from cheese")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('Choose a product from the above:')
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
hj=lmn[:5]+lmn[6:8]+lmn[9:]
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
n="select name from cheese where pid='{}'".format(pn)
cursor.execute(n)
for i in cursor:
prn=i[0]
u="select username from login "
cursor.execute(u)
for i in cursor:
j=i[0]
sql1="insert into orders(uname,name,qty,price,date)values('{}','{}',{},
{},'{}')".format( j,prn,qt,b,hj)
cursor.execute(sql1)
bd.commit()
def ice_creams():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ICE-CREAM
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from icream")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:50s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
37
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('Choose a product from the above:')
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
hj=lmn[:5]+lmn[6:8]+lmn[9:]
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
n="select name from icream where pid='{}'".format(pn)
cursor.execute(n)
for i in cursor:
prn=i[0]
u="select username from login "
38
cursor.execute(u)
for i in cursor:
j=i[0]
sql1="insert into orders(uname,name,qty,price,date)values('{}','{}',{},
{},'{}')".format( j,prn,qt,b,hj)
cursor.execute(sql1)
bd.commit()
def yougurts():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" YOGURT
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:60s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from yougur")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:60s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('Choose a products from the above:')
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
hj=lmn[:5]+lmn[6:8]+lmn[9:]
39
n=int(input('How many products do you want to purchase?: '))
print()
for i in range(n):
pn=input('Enter product id: ')
print()
qt=int(input('How many packets do you want purchase? : '))
print()
a="select price from yougur where pid='{}'".format(pn)
cursor.execute(a)
for i in cursor:
cost=i[0]
b=cost*qt
print('Total cost: ',b)
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
n="select name from yougur where pid='{}'".format(pn)
cursor.execute(n)
for i in cursor:
prn=i[0]
u="select username from login "
cursor.execute(u)
for i in cursor:
j=i[0]
sql1="insert into orders(uname,name,qty,price,date)values('{}','{}',{},
{},'{}')".format( j,prn,qt,b,hj)
cursor.execute(sql1)
bd.commit()
def butters():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
40
print(" BUTTER
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:15s}\t{:60s}\t{:10s}\t{:15}\t".format("P_id","Product
name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from butter")
l=cursor.fetchall()
for i in l:
print("{:15s}\t{:60s}\t{:10s}\t{:15}\t".format(i[1],i[2],i[3],i[4]).center(140))
#print(' '*44,"-"*59,' '*37)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('Choose a products from the above:')
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
hj=lmn[:5]+lmn[6:8]+lmn[9:]
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
n="select name from butter where pid='{}'".format(pn)
cursor.execute(n)
for i in cursor:
prn=i[0]
u="select username from login "
cursor.execute(u)
for i in cursor:
j=i[0]
sql1="insert into orders(uname,name,qty,price,date)values('{}','{}',{},
{},'{}')".format( j,prn,qt,b,hj)
cursor.execute(sql1)
bd.commit()
#--------------------------------------------------------------------------------------------------
---------------
#VIEW ORDER
def view_order(uname):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW ORDER
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\t".format("Order no.","Customer User-
Name","Product name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
sql="select * from orders where uname='"+uname+"'"
cursor.execute(sql)
42
l=cursor.fetchall()
for i in l:
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\
t".format(i[0],i[1],i[2],i[3],i[4]).center(140))
#--------------------------------------------------------------------------------------------------
---------------
#CANCEL ORDER
def cancel_order(uname):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" CANCEL ORDER
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
table_name = "orders"
print("Your past orders:")
print()
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\t".format("Order no.","Customer User-
Name","Product name","Quantity","Price").center(140))
sql="select * from orders where uname='"+uname+"'"
cursor.execute(sql)
l=cursor.fetchall()
for i in l:
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\
t".format(i[0],i[1],i[2],i[3],i[4]).center(140))
print('-'*189)
print()
row_id_to_delete = int(input('Enter Order No. to be deleted: '))
print()
delete_query = f"DELETE FROM {table_name} WHERE orderno =
{row_id_to_delete}"
43
cursor.execute(delete_query)
bd.commit()
print("Order cancelled successfully! The Admin will contact you soon about the
refund of your cancelled order.")
print()
print('-'*189)
print("Your orders now:")
print()
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\t".format("Order no.","Customer User-
Name","Product name","Quantity","Price").center(140))
sql="select * from orders where uname='"+uname+"'"
cursor.execute(sql)
l=cursor.fetchall()
for i in l:
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\
t".format(i[0],i[1],i[2],i[3],i[4]).center(140))
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#--------------------------------------------------------------------------------------------------
--------------
#PAYMENT
def payment(uname):
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" PAYMENT
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("Your orders:")
print()
44
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\t".format("Order no.","Customer User-
Name","Product name","Quantity","Price").center(140))
#print(' '*44,"-"*59,' '*37)
cursor.execute("select * from orders where uname='{}'".format(uname))
l=cursor.fetchall()
for i in l:
print("{:5}\t{:50s}\t{:50s}\t{:10}\t{:15}\
t".format(i[0],i[1],i[2],i[3],i[4]).center(140))
print()
if pm==1:
cn=int(input('Enter last 5 digits of your card: '))
print()
print('Total cost : ',tc)
print()
ps=input('Enter your password: ')
print()
print('Payment done successfully!')
print()
elif pm==2:
cn=int(input('Enter your pin : '))
print()
print('Total cost : ',tc)
print()
ps=input('Enter your password: ')
print()
print('Payment done successfully!')
print()
elif pm==3:
cn=int(input('Enter your pin : '))
print()
print('Total cost : ',tc)
print()
ps=input('Enter your password: ')
print()
print('Payment done successfully!')
print()
elif pm==4:
cn=int(input('Enter your UPI pin : '))
print()
print('Total cost : ',tc)
print()
46
ps=input('Enter your password: ')
print()
print('Payment done successfully!')
print()
else:
print('Invalid Choice!')
print()
continue
print('Your items will be delivered soon.')
print()
break
else:
print()
print('Thank you, visit again!')
cursor.execute("delete from orders where uname='{}'".format(uname))
bd.commit()
break
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#--------------------------------------------------------------------------------------------------
--------------
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" CUSTOMER
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
47
print()
print("1 - Login")
print()
print("2 - Signup")
print()
print("3 - Exit")
print()
ch=int(input("Enter your choice : "))
print()
if ch==1:
login()
elif ch==2:
signup()
elif ch==3:
print("~ EXITED ~")
break
#--------------------------------------------------------------------------------------------------
--------------------------------------------------------
def admin():
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADMIN LOGIN
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
48
print()
login=False
uname=input("Enter username : ")
print()
pwd=input("Enter password : ")
print()
if uname=="cfarm" and pwd=="lsd":
print("Logged in Successfully!\n")
login=True
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" HOMEPAGE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1 - Franchise")
print()
print("2 - View Products")
print()
print("3 - Add Products")
print()
print("4 - Delete Products")
print()
print("5 - View Orders")
print()
print("6 - Exit")
print()
ch=int(input("Enter your choice : "))
if ch==1:
franchise()
49
if ch==2:
all_products()
if ch==3:
add_products()
if ch==4:
delete_products()
if ch==5:
v_order()
if ch==6:
print()
print("Successfully Logged Out")
print()
break
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
#--------------------------------------------------------------------------------------------------
-----------------------------------
def add_products():
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD PRODUCTS
")
50
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1 - Milk")
print()
print("2 - Cheese")
print()
print("3 - Ice Cream")
print()
print("4 - Yougurt")
print()
print("5 - Butter")
print()
print("6 - Exit")
print()
if ch==1:
milk()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD MILK PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=int(input("How many products you want to add : "))
print()
for i in range(n):
pid=input("Enter the id : ")
print()
name=input("Enter the product name : ")
51
print()
qty=input("Enter quantity : ")
print()
price=int(input("Enter the price : "))
print()
print('Your product is added successfully: ')
print()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
aa="insert into milk(pid, name, qty, price)values('{}','{}','{}',
{})".format(pid, name, qty, price)
cursor.execute(aa)
bd.commit()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==2:
cheese()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD CHEESE
PRODUCTS ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
52
n=int(input("How many products you want to add : "))
print()
for i in range(n):
pid=input("Enter the id : ")
print()
name=input("Enter the product name : ")
print()
qty=input("Enter quantity : ")
print()
price=int(input("Enter the price : "))
print()
print('Your product is added successfully: ')
print()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
aa="insert into cheese(name, qty, price)values('{}','{}','{}',
{})".format(pid, name, qty, price)
cursor.execute(aa)
bd.commit()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==3:
ice_cream()
print()
53
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD ICE-CREAM
PRODUCTS ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=int(input("How many products you want to add : "))
print()
for i in range(n):
pid=input("Enter the id : ")
print()
name=input("Enter the product name : ")
print()
qty=input("Enter quantity : ")
print()
price=int(input("Enter the price : "))
print()
print('Your product is added successfully: ')
print()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
aa="insert into icream(name, qty, price)values('{}','{}','{}',
{})".format(pid, name, qty, price)
cursor.execute(aa)
bd.commit()
print()
cursor.execute("select * from icream")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
54
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==4:
yougurt()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD YOGURT
PRODUCTS ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=int(input("How many products you want to add : "))
print()
for i in range(n):
pid=input("Enter the id : ")
print()
name=input("Enter the product name : ")
print()
qty=input("Enter quantity : ")
print()
price=int(input("Enter the price : "))
print()
print('Your product is added successfully: ')
print()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
aa="insert into yougur(name, qty, price)values('{}','{}','{}',
{})".format(pid, name, qty, price)
cursor.execute(aa)
bd.commit()
print()
55
cursor.execute("select * from yougur")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==5:
butter()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD BUTTER
PRODUCTS ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=int(input("How many products you want to add : "))
print()
for i in range(n):
pid=input("Enter the id : ")
print()
name=input("Enter the product name : ")
print()
qty=input("Enter quantity : ")
print()
price=int(input("Enter the price : "))
print()
print('Your product is added successfully: ')
print()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
56
aa="insert into butter(name, qty, price)values('{}','{}','{}',
{})".format(pid, name, qty, price)
cursor.execute(aa)
bd.commit()
print()
cursor.execute("select * from butter")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==6:
print()
print('~ EXITED ~')
print()
break
#--------------------------------------------------------------------------------------------------
-----------------------------------
def delete_products():
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
57
print()
print("1 - Milk")
print()
print("2 - Cheese")
print()
print("3 - Ice Cream")
print()
print("4 - Yougurt")
print()
print("5 - Butter")
print()
print("6 - Exit")
print()
if ch==1:
milk()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE MILK PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=input("Enter product ID : ")
print()
n="'"+n+"'"
a="delete from milk where pid={}".format(n)
cursor.execute(a)
print()
print("Your product has been successfully deleted")
print()
58
bd.commit()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
cursor.execute("select * from milk")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==2:
cheese()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE CHEESE PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=input("Enter product ID : ")
print()
n="'"+n+"'"
a="delete from cheese where pid={}".format(n)
cursor.execute(a)
print("Your product has been successfully deleted")
print()
bd.commit()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
cursor.execute("select * from cheese")
l=cursor.fetchall()
59
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==3:
ice_cream()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE ICE-CREAM
PRODUCTS ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=input("Enter product ID : ")
print()
n="'"+n+"'"
a="delete from icream where pid={}".format(n)
cursor.execute(a)
print("Your product has been successfully deleted")
print()
bd.commit()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
cursor.execute("select * from icream")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
60
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==4:
yougurt()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE YOGURT PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=input("Enter product ID : ")
print()
n="'"+n+"'"
a="delete from yougur where pid={}".format(n)
cursor.execute(a)
print("Your product has been successfully deleted")
print()
bd.commit()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
cursor.execute("select * from yougur")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==5:
61
butter()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE BUTTER PRODUCTS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
n=input("Enter product ID : ")
print()
n="'"+n+"'"
a="delete from butter where pid={}".format(n)
cursor.execute(a)
print("Your product has been successfully deleted")
print()
bd.commit()
print("{:20}\t{:50s}\t{:10}\t{:10}\t".format("PID","Product
name","Quantity","Price").center(140))
cursor.execute("select * from butter")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:10}\t{:10}\
t".format(i[1],i[2],i[3],i[4]).center(140))
bd.commit()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if ch==6:
print()
print('~ EXITED ~')
print()
break
62
#--------------------------------------------------------------------------------------------------
-----------------------------------
def franchise():
while True:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" FRANCHISE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("1- Details")
print()
print("2- View")
print()
print("3 - Add")
print()
print("4 - Delete")
print()
print("5 - Exit")
print()
c=int(input("Enter your choice : "))
if c==1:
print()
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DETAILS
")
63
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print('''The following are the amount to paid for adding the franchise:
1. Rs. 1,90,000 - 1 year
2. Rs. 3,80,000 - 2 years
3. Rs. 5,70,000 - 3 years ''')
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
if c==2:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW FRANCHISE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:5}\t{:30s}\t{:30s}\t{:50s}\t{:30}\t{:10s}\t{:10}\t{:10}\
t".format("S.no","Name", "City", "Address", "Mobile", "Date", "Years",
"Code").center(140))
cursor.execute("select * from franchise")
l=cursor.fetchall()
for i in l:
print("{:5}\t{:30s}\t{:30s}\t{:30s}\t{:25}\t{}\t{:5}\t{:5}\
t".format(i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8]).center(140))
if c==3:
print()
64
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" ADD FRANCHISE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:50s}\t{:10}\t".format("S.no","Franchise name",
"Franchise City", "Franchise code", "Date").center(140))
cursor.execute("select * from franchise")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:50s}\t{:10}\t{}\t".format(i[0],i[1],i[2],i[8],
i[6]).center(140))
print()
cursor.execute("select curdate()")
k=cursor.fetchone()
k=str(k)
x=(k[15:-3])
lmn=(x.replace(',','-'))
hj=lmn[:5]+lmn[6:8]+lmn[9:]
name=input('Enter franchise name : ')
print()
city=input('Enter the city : ')
print()
print('''The following are the amount to paid for adding the franchise:
1 - Rs. 1,90,000 - 1 year
2 - Rs. 3,80,000 - 2 years
3 - Rs. 5,70,000 - 3 years ''')
print()
plan=int(input('Enter the plan no. choosen: '))
print()
import random
fid=random.randint(100, 999)
65
add=input("Enter the address : ")
print()
while True:
mobile=input("Enter your mobile number : ")
print()
if len(mobile)!=10:
print("Invalid mobile number!")
print()
continue
else:
break
while True:
email=input("Enter the Email Address : ")
print()
adno=int(input('Enter your Aadhar number: '))
print()
if '@' and '.com' not in email:
print("Invalid Email id!")
print()
continue
else:
break
66
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:50s}\t{:10}\t{}\t".format(i[0],i[1],i[2],i[8],
i[6]).center(140))
bd.commit()
if c==4:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" DELETE FRANCHISE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:50s}\t{:10}\t".format("S.no","Franchise name",
"Franchise City", "Franchise code", "Date").center(140))
cursor.execute("select * from franchise")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:50s}\t{:10}\t{}\t".format(i[0],i[1],i[2],i[8],
i[6]).center(140))
print()
n=input("Enter the franchise code : ")
print()
a="delete from franchise where fid={}".format(n)
cursor.execute(a)
print("Your franchise has been successfully deleted")
print()
bd.commit()
print("{:20}\t{:50s}\t{:50s}\t{:10}\t".format("S.no","Franchise name",
"Franchise City", "Franchise code", "Date").center(140))
cursor.execute("select * from franchise")
67
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:50s}\t{:10}\t{}\t".format(i[0],i[1],i[2],i[8],
i[6]).center(140))
bd.commit()
if c==5:
print ()
print("~ EXITED ~")
print()
break
#--------------------------------------------------------------------------------------------------
-----------------------------------
def v_order():
while True:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW ORDERS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1- All Orders")
print()
print("2 - Date Wise")
print()
print("3 - Particular Date")
print()
print("4 - Name Wise")
68
print()
print("5 - Exit")
print()
ch=int(input("Enter your choice : "))
if ch==1:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW ALL ORDERS
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
cursor.execute("select * from orders")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
bd.commit()
if ch==2:
while True:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW ORDERS DATE
WISE ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
69
print()
print("1- Ascending")
print()
print("2 - Descending")
print()
print("3 - Exit")
print()
c=int(input("Enter your choice : "))
if c==1:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("
ASCENDING ")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
cursor.execute("select * from orders order by date")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
bd.commit()
if c==2:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print("
DESCENDING ")
70
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
cursor.execute("select * from orders order by date desc")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
bd.commit()
if c==3:
break
if ch==3:
n=input("Enter the date(YYYY-MM-DD) : ")
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" PARTICULAR DATE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
aa="select * from orders where date='{}'".format(n)
cursor.execute(aa)
l=cursor.fetchall()
for i in l:
71
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
bd.commit()
if ch==4:
print()
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" VIEW NAME WISE
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
cursor.execute("select * from orders")
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
bd.commit()
print()
n=input("Enter the customer u-name : ")
print()
print("{:20}\t{:50s}\t{:20s}\t{:20s}\t{:20s}\
t{:20s}".format("S.no","Customer u-name","Product
name","Quantity","Price","Date").center(140))
cursor.execute("select * from orders where uname = '{}'".format(n))
l=cursor.fetchall()
for i in l:
print("{:20}\t{:50s}\t{:20s}\t{:20}\t{:20}\t{}\
t".format(i[0],i[1],i[2],i[3],i[4],i[5]).center(140))
72
bd.commit()
if ch==5:
print()
print('~ EXITED ~')
print()
break
#--------------------------------------------------------------------------------------------------
-------------------------------------------------
def Adcust():
while True:
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print(" CREAMERY FARM
")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
print("1 - Customer")
print()
print("2 - Admin ")
print()
print("3 - Exit ")
print()
ch=int(input("Enter your choice : "))
print()
if ch==1:
vk()
if ch==2:
73
admin()
if ch==3:
print("~ EXITED ~")
break
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~")
print()
Adcust()
74
OUTPUT
USER INTERFACE
CUSTOMER
CUSTOMER - SIGNUP
75
LOGIN
HOMEPAGE
76
MILK
77
CHEESE
78
ICE-CREAM
79
80
YOGURT
81
BUTTER
82
EXIT
ORDER
83
84
85
86
PAYMENT
87
CANCEL ORDER
88
VIEW FRANCHISE DETAILS
CHANGE PASSWORD
89
EXIT FROM CUSTOMER
90
ADMIN LOGIN
HOMEPAGE
FRANCHISE
91
FRANCHISE – DETAILS
FRANCHISE – VIEW
FRANCHISE – ADD
92
FRANCHISE – DELETE
93
FRANCHISE – EXIT
VIEW PRODUCTS
94
MILK
95
CHEESE
96
ICE-CREAM
97
YOGURT
98
99
BUTTER
100
EXIT
ADD PRODUCTS
101
102
103
EXIT FROM ADD PRODUCTS
DELETE PRODUCTS
104
105
EXIT FROM DELETE PRODUCTS
106
VIEW ORDERS
107
VIEW ORDERS – DATE WISE
108
VIEW ORDERS – DATE WISE (DESCENDING)
109
VIEW ORDERS – NAME WISE
110
EXIT FROM ADMIN
111